@devicechain/widgets 1.5.0-rc.1 → 1.6.0-rc.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/README.md +14 -1
- package/dist/access-strings.d.ts +1 -1
- package/dist/aggregate-strings.d.ts +3 -1
- package/dist/alarm-strings.d.ts +4 -1
- package/dist/chunks/{aggregate-feed-HCF5FYIJ.js → aggregate-feed-QJRO7Y4V.js} +7 -4
- package/dist/chunks/aggregate-feed-QJRO7Y4V.js.map +7 -0
- package/dist/chunks/{aggregate-widgets-IFZUFYXV.js → aggregate-widgets-SHPHUHNL.js} +39 -62
- package/dist/chunks/aggregate-widgets-SHPHUHNL.js.map +7 -0
- package/dist/chunks/{alarm-widgets-TTQYBKMZ.js → alarm-widgets-DQEITFVN.js} +2 -2
- package/dist/chunks/alarm-widgets-DQEITFVN.js.map +7 -0
- package/dist/chunks/{chunk-FM7OI5TQ.js → chunk-2GMBZTQD.js} +44 -5
- package/dist/chunks/chunk-2GMBZTQD.js.map +7 -0
- package/dist/chunks/{chunk-AF4M5OXQ.js → chunk-4BEFYYM3.js} +3 -3
- package/dist/chunks/chunk-5UDZ5R5F.js +60 -0
- package/dist/chunks/chunk-5UDZ5R5F.js.map +7 -0
- package/dist/chunks/{chunk-VTGKDO44.js → chunk-7TEFJ64H.js} +19 -5
- package/dist/chunks/chunk-7TEFJ64H.js.map +7 -0
- package/dist/chunks/{chunk-GUCEPNGM.js → chunk-EFTUK5YX.js} +1 -1
- package/dist/chunks/chunk-EFTUK5YX.js.map +7 -0
- package/dist/chunks/{chunk-EQOWBDS7.js → chunk-G5UBMPMX.js} +2 -2
- package/dist/chunks/{chunk-EQOWBDS7.js.map → chunk-G5UBMPMX.js.map} +2 -2
- package/dist/chunks/{chunk-RG2AYYKO.js → chunk-GWH5AHG3.js} +6 -4
- package/dist/chunks/chunk-GWH5AHG3.js.map +7 -0
- package/dist/chunks/{chunk-XJ7UF2CP.js → chunk-O763YMOG.js} +1 -1
- package/dist/chunks/chunk-O763YMOG.js.map +7 -0
- package/dist/chunks/{chunk-ZX4K3GT5.js → chunk-R2XEYQEJ.js} +45 -24
- package/dist/chunks/chunk-R2XEYQEJ.js.map +7 -0
- package/dist/chunks/{chunk-JVC6JYUR.js → chunk-RLVZXNPJ.js} +1 -1
- package/dist/chunks/{chunk-JVC6JYUR.js.map → chunk-RLVZXNPJ.js.map} +1 -1
- package/dist/chunks/{chunk-QHTO5ZEM.js → chunk-UDQVBVXJ.js} +1 -1
- package/dist/chunks/chunk-UDQVBVXJ.js.map +7 -0
- package/dist/chunks/chunk-UVLEBGAC.js +17 -0
- package/dist/chunks/chunk-UVLEBGAC.js.map +7 -0
- package/dist/chunks/chunk-VR6643C7.js +119 -0
- package/dist/chunks/chunk-VR6643C7.js.map +7 -0
- package/dist/chunks/{chunk-ZR74ORIT.js → chunk-XDHKONWK.js} +1 -1
- package/dist/chunks/chunk-XDHKONWK.js.map +7 -0
- package/dist/chunks/{chunk-3FSXS67N.js → chunk-ZKR5WDF5.js} +68 -18
- package/dist/chunks/chunk-ZKR5WDF5.js.map +7 -0
- package/dist/chunks/{compare-feed-MLHG7YFN.js → compare-feed-K46QVE5D.js} +28 -16
- package/dist/chunks/compare-feed-K46QVE5D.js.map +7 -0
- package/dist/chunks/{control-widgets-KTH6BWMH.js → control-widgets-VMWBTRC6.js} +70 -34
- package/dist/chunks/control-widgets-VMWBTRC6.js.map +7 -0
- package/dist/chunks/entity-selector-IRUFUDQ6.js +7 -0
- package/dist/chunks/{event-markers-feed-BQO4T367.js → event-markers-feed-TOAQ53YC.js} +29 -11
- package/dist/chunks/event-markers-feed-TOAQ53YC.js.map +7 -0
- package/dist/chunks/{export-rows-OEWIBIUY.js → export-rows-XKIVLOM3.js} +3 -3
- package/dist/chunks/{fleet-feed-AKJ7QIMP.js → fleet-feed-AYNL3CC2.js} +6 -6
- package/dist/chunks/{history-widgets-7GNKTE5X.js → history-widgets-WJ4KRTG7.js} +55 -20
- package/dist/chunks/history-widgets-WJ4KRTG7.js.map +7 -0
- package/dist/chunks/{level-widgets-DKCQT2XF.js → level-widgets-3SRESJYW.js} +46 -14
- package/dist/chunks/level-widgets-3SRESJYW.js.map +7 -0
- package/dist/chunks/{natural-earth-data-VMKQ6LY3.js → natural-earth-data-R7NPQARR.js} +1 -1
- package/dist/chunks/natural-earth-data-R7NPQARR.js.map +7 -0
- package/dist/chunks/{no-reading-B4MPXAS2.js → no-reading-CTQCMNYA.js} +4 -4
- package/dist/chunks/{presence-widgets-7OGANOLB.js → presence-widgets-P2H3A2SD.js} +34 -16
- package/dist/chunks/presence-widgets-P2H3A2SD.js.map +7 -0
- package/dist/chunks/table-HAKFOUMS.js +8 -0
- package/dist/command-control-strings.d.ts +1 -1
- package/dist/compare-strings.d.ts +1 -1
- package/dist/event-markers-strings.d.ts +1 -1
- package/dist/fleet-strings.d.ts +1 -1
- package/dist/history-strings.d.ts +1 -1
- package/dist/host-context.js +1 -1
- package/dist/index.d.ts +112 -4
- package/dist/index.js +338 -131
- package/dist/index.js.map +4 -4
- package/dist/level-strings.d.ts +1 -1
- package/dist/presence-strings.d.ts +1 -1
- package/dist/registry.d.ts +2 -0
- package/dist/scada-strings.d.ts +1 -1
- package/dist/selection-strings.d.ts +10 -0
- package/dist/shared-strings.d.ts +38 -0
- package/dist/state-timeline-strings.d.ts +1 -1
- package/dist/status-grid-strings.d.ts +1 -1
- package/dist/table-strings.d.ts +1 -1
- package/dist/time-range-bar.d.ts +1 -2
- package/dist/time-range-strings.d.ts +8 -0
- package/dist/vite.js.map +1 -1
- package/dist/widgets/command-status.d.ts +1 -0
- package/dist/widgets/map-geometry.d.ts +2 -0
- package/package.json +8 -8
- package/dist/chunks/aggregate-feed-HCF5FYIJ.js.map +0 -7
- package/dist/chunks/aggregate-widgets-IFZUFYXV.js.map +0 -7
- package/dist/chunks/alarm-widgets-TTQYBKMZ.js.map +0 -7
- package/dist/chunks/chunk-3FSXS67N.js.map +0 -7
- package/dist/chunks/chunk-BRH66T5F.js +0 -15
- package/dist/chunks/chunk-BRH66T5F.js.map +0 -7
- package/dist/chunks/chunk-FM7OI5TQ.js.map +0 -7
- package/dist/chunks/chunk-GUCEPNGM.js.map +0 -7
- package/dist/chunks/chunk-QHTO5ZEM.js.map +0 -7
- package/dist/chunks/chunk-QMGKB6J3.js +0 -84
- package/dist/chunks/chunk-QMGKB6J3.js.map +0 -7
- package/dist/chunks/chunk-RG2AYYKO.js.map +0 -7
- package/dist/chunks/chunk-VTGKDO44.js.map +0 -7
- package/dist/chunks/chunk-XJ7UF2CP.js.map +0 -7
- package/dist/chunks/chunk-ZR74ORIT.js.map +0 -7
- package/dist/chunks/chunk-ZX4K3GT5.js.map +0 -7
- package/dist/chunks/compare-feed-MLHG7YFN.js.map +0 -7
- package/dist/chunks/control-widgets-KTH6BWMH.js.map +0 -7
- package/dist/chunks/entity-selector-3JJFI4DT.js +0 -7
- package/dist/chunks/event-markers-feed-BQO4T367.js.map +0 -7
- package/dist/chunks/history-widgets-7GNKTE5X.js.map +0 -7
- package/dist/chunks/level-widgets-DKCQT2XF.js.map +0 -7
- package/dist/chunks/natural-earth-data-VMKQ6LY3.js.map +0 -7
- package/dist/chunks/presence-widgets-7OGANOLB.js.map +0 -7
- package/dist/chunks/table-2UGM2Q4H.js +0 -8
- /package/dist/chunks/{chunk-AF4M5OXQ.js.map → chunk-4BEFYYM3.js.map} +0 -0
- /package/dist/chunks/{entity-selector-3JJFI4DT.js.map → entity-selector-IRUFUDQ6.js.map} +0 -0
- /package/dist/chunks/{export-rows-OEWIBIUY.js.map → export-rows-XKIVLOM3.js.map} +0 -0
- /package/dist/chunks/{fleet-feed-AKJ7QIMP.js.map → fleet-feed-AYNL3CC2.js.map} +0 -0
- /package/dist/chunks/{no-reading-B4MPXAS2.js.map → no-reading-CTQCMNYA.js.map} +0 -0
- /package/dist/chunks/{table-2UGM2Q4H.js.map → table-HAKFOUMS.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunks/chunk-XNEBAY4J.js";
|
|
4
4
|
import {
|
|
5
5
|
EntitySelector
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-2GMBZTQD.js";
|
|
7
7
|
import {
|
|
8
8
|
readRange
|
|
9
|
-
} from "./chunks/chunk-
|
|
9
|
+
} from "./chunks/chunk-XDHKONWK.js";
|
|
10
10
|
import {
|
|
11
11
|
Table
|
|
12
|
-
} from "./chunks/chunk-
|
|
12
|
+
} from "./chunks/chunk-GWH5AHG3.js";
|
|
13
13
|
import {
|
|
14
14
|
ChunkLoadingFrame,
|
|
15
15
|
lazyChunk
|
|
@@ -26,20 +26,20 @@ import {
|
|
|
26
26
|
presenceMode,
|
|
27
27
|
takesHistorySeed,
|
|
28
28
|
wantsEventMarkers
|
|
29
|
-
} from "./chunks/chunk-
|
|
29
|
+
} from "./chunks/chunk-EFTUK5YX.js";
|
|
30
30
|
import {
|
|
31
31
|
MapRuntimeProvider,
|
|
32
32
|
TenantBasemapProvider,
|
|
33
33
|
useMapRuntime,
|
|
34
34
|
useTenantBasemap
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-UDQVBVXJ.js";
|
|
36
36
|
import {
|
|
37
37
|
accessStrings
|
|
38
|
-
} from "./chunks/chunk-
|
|
39
|
-
import "./chunks/chunk-
|
|
38
|
+
} from "./chunks/chunk-UVLEBGAC.js";
|
|
39
|
+
import "./chunks/chunk-RLVZXNPJ.js";
|
|
40
40
|
import {
|
|
41
41
|
LevelReadout
|
|
42
|
-
} from "./chunks/chunk-
|
|
42
|
+
} from "./chunks/chunk-G5UBMPMX.js";
|
|
43
43
|
import {
|
|
44
44
|
AlarmCount,
|
|
45
45
|
AlarmSeverity,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
severityColor,
|
|
49
49
|
severityLabel,
|
|
50
50
|
severityRank
|
|
51
|
-
} from "./chunks/chunk-
|
|
51
|
+
} from "./chunks/chunk-ZKR5WDF5.js";
|
|
52
52
|
import {
|
|
53
53
|
CommandButton,
|
|
54
54
|
buildPayload,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
isTerminalStatus,
|
|
60
60
|
parseParameterSchema,
|
|
61
61
|
validateParams
|
|
62
|
-
} from "./chunks/chunk-
|
|
62
|
+
} from "./chunks/chunk-R2XEYQEJ.js";
|
|
63
63
|
|
|
64
64
|
// src/dashboard-renderer.tsx
|
|
65
65
|
import {
|
|
@@ -88,6 +88,129 @@ import {
|
|
|
88
88
|
} from "@devicechain/widget-sdk";
|
|
89
89
|
import { Fragment, useCallback as useCallback3, useEffect as useEffect4, useLayoutEffect, useMemo as useMemo5, useRef as useRef2, useState as useState5 } from "react";
|
|
90
90
|
|
|
91
|
+
// src/shared-strings.ts
|
|
92
|
+
import { viewerLocale } from "@devicechain/widget-sdk";
|
|
93
|
+
var SHARED_STRINGS = {
|
|
94
|
+
en: {
|
|
95
|
+
renderFailed: "This widget failed to render",
|
|
96
|
+
reset: "Reset widget",
|
|
97
|
+
dismiss: "Dismiss",
|
|
98
|
+
newerViewer: "This widget needs a newer viewer",
|
|
99
|
+
cannotShow: "This widget cannot be shown here",
|
|
100
|
+
widgetType: (type) => `Widget type: ${type}`,
|
|
101
|
+
deviceUnavailable: "Device unavailable",
|
|
102
|
+
deviceGone: "The bound device no longer exists.",
|
|
103
|
+
notForCustomers: "Not available for customer users",
|
|
104
|
+
customerBinding: "This widget is bound to something customer users cannot view.",
|
|
105
|
+
dataUnavailable: "Data unavailable",
|
|
106
|
+
loading: "Loading…",
|
|
107
|
+
noImage: "No image URL",
|
|
108
|
+
naturalEarth: "Made with Natural Earth",
|
|
109
|
+
locationDenied: "Location not permitted",
|
|
110
|
+
locationPermission: "You do not have permission to view device locations.",
|
|
111
|
+
noMapRuntime: "Map runtime not configured",
|
|
112
|
+
mapRuntimeHint: "This host must install MapRuntimeProvider with its bundler's MapLibre worker URL.",
|
|
113
|
+
noDevices: "No devices selected",
|
|
114
|
+
noPositions: "No positions reported",
|
|
115
|
+
bindLocation: "Bind this widget to a device or anchor and select its location series.",
|
|
116
|
+
positionsEmpty: "None of the selected devices has reported a position yet.",
|
|
117
|
+
mapUnavailable: "Map renderer unavailable — positions are shown without a basemap.",
|
|
118
|
+
now: "Now",
|
|
119
|
+
currentState: "Shows the current state: the fixed time window does not apply to this widget.",
|
|
120
|
+
undeclared: (capability) => `this widget did not declare the ${capability} interaction`,
|
|
121
|
+
versions: (authored, installed) => `Saved version: ${authored}; installed version: ${installed}.`,
|
|
122
|
+
unresolved: {
|
|
123
|
+
unregistered: "This widget is not installed in this viewer.",
|
|
124
|
+
unversioned: "This widget was saved without version information.",
|
|
125
|
+
"invalid-metadata": "This widget has invalid version information.",
|
|
126
|
+
"options-version": "The saved settings version does not match the installed widget.",
|
|
127
|
+
"sdk-incompatible": "The saved widget SDK version does not match the installed widget."
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
es: {
|
|
131
|
+
renderFailed: "No se pudo mostrar este widget",
|
|
132
|
+
reset: "Restablecer widget",
|
|
133
|
+
dismiss: "Cerrar",
|
|
134
|
+
newerViewer: "Este widget necesita un visor más reciente",
|
|
135
|
+
cannotShow: "Este widget no se puede mostrar aquí",
|
|
136
|
+
widgetType: (type) => `Tipo de widget: ${type}`,
|
|
137
|
+
deviceUnavailable: "Dispositivo no disponible",
|
|
138
|
+
deviceGone: "El dispositivo vinculado ya no existe.",
|
|
139
|
+
notForCustomers: "No disponible para usuarios de clientes",
|
|
140
|
+
customerBinding: "Este widget está vinculado a un recurso que los usuarios de clientes no pueden ver.",
|
|
141
|
+
dataUnavailable: "Datos no disponibles",
|
|
142
|
+
loading: "Cargando…",
|
|
143
|
+
noImage: "No se ha indicado la URL de la imagen",
|
|
144
|
+
naturalEarth: "Con datos de Natural Earth",
|
|
145
|
+
locationDenied: "Ubicación no permitida",
|
|
146
|
+
locationPermission: "No tiene permiso para ver las ubicaciones de los dispositivos.",
|
|
147
|
+
noMapRuntime: "El motor del mapa no está configurado",
|
|
148
|
+
mapRuntimeHint: "Esta aplicación debe configurar MapRuntimeProvider con la URL del worker de MapLibre de su empaquetador.",
|
|
149
|
+
noDevices: "No hay dispositivos seleccionados",
|
|
150
|
+
noPositions: "No se han comunicado posiciones",
|
|
151
|
+
bindLocation: "Vincule este widget a un dispositivo o ancla y seleccione su serie de ubicación.",
|
|
152
|
+
positionsEmpty: "Ninguno de los dispositivos seleccionados ha comunicado una posición todavía.",
|
|
153
|
+
mapUnavailable: "El motor del mapa no está disponible; las posiciones se muestran sin mapa base.",
|
|
154
|
+
now: "Ahora",
|
|
155
|
+
currentState: "Muestra el estado actual: la ventana de tiempo fija no se aplica a este widget.",
|
|
156
|
+
undeclared: (capability) => `Este widget no declaró la interacción ${capability}`,
|
|
157
|
+
versions: (authored, installed) => `Versión guardada: ${authored}; versión instalada: ${installed}.`,
|
|
158
|
+
unresolved: {
|
|
159
|
+
unregistered: "Este widget no está instalado en este visor.",
|
|
160
|
+
unversioned: "Este widget se guardó sin información de versión.",
|
|
161
|
+
"invalid-metadata": "Este widget tiene información de versión no válida.",
|
|
162
|
+
"options-version": "La versión de la configuración guardada no coincide con la del widget instalado.",
|
|
163
|
+
"sdk-incompatible": "La versión del SDK del widget guardado no coincide con la del widget instalado."
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"zh-CN": {
|
|
167
|
+
renderFailed: "无法显示此组件",
|
|
168
|
+
reset: "重置组件",
|
|
169
|
+
dismiss: "关闭",
|
|
170
|
+
newerViewer: "此组件需要更新版本的查看器",
|
|
171
|
+
cannotShow: "此处无法显示此组件",
|
|
172
|
+
widgetType: (type) => `组件类型:${type}`,
|
|
173
|
+
deviceUnavailable: "设备不可用",
|
|
174
|
+
deviceGone: "绑定的设备已不存在。",
|
|
175
|
+
notForCustomers: "客户用户无法使用",
|
|
176
|
+
customerBinding: "此组件绑定的资源不支持客户用户查看。",
|
|
177
|
+
dataUnavailable: "数据不可用",
|
|
178
|
+
loading: "正在加载…",
|
|
179
|
+
noImage: "尚未设置图片 URL",
|
|
180
|
+
naturalEarth: "采用 Natural Earth 数据",
|
|
181
|
+
locationDenied: "无权查看位置",
|
|
182
|
+
locationPermission: "您没有查看设备位置的权限。",
|
|
183
|
+
noMapRuntime: "尚未配置地图运行环境",
|
|
184
|
+
mapRuntimeHint: "此应用必须配置 MapRuntimeProvider,并提供打包工具生成的 MapLibre worker URL。",
|
|
185
|
+
noDevices: "尚未选择设备",
|
|
186
|
+
noPositions: "尚未报告位置",
|
|
187
|
+
bindLocation: "请将此组件绑定到设备或锚点,并选择其位置序列。",
|
|
188
|
+
positionsEmpty: "所选设备均尚未报告位置。",
|
|
189
|
+
mapUnavailable: "地图渲染器不可用,位置将不带底图显示。",
|
|
190
|
+
now: "当前",
|
|
191
|
+
currentState: "显示当前状态:固定时间窗口不适用于此组件。",
|
|
192
|
+
undeclared: (capability) => `此组件未声明 ${capability} 交互`,
|
|
193
|
+
versions: (authored, installed) => `保存的版本:${authored};已安装的版本:${installed}。`,
|
|
194
|
+
unresolved: {
|
|
195
|
+
unregistered: "此查看器尚未安装此组件。",
|
|
196
|
+
unversioned: "此组件保存时未包含版本信息。",
|
|
197
|
+
"invalid-metadata": "此组件的版本信息无效。",
|
|
198
|
+
"options-version": "已保存的设置版本与已安装的组件不匹配。",
|
|
199
|
+
"sdk-incompatible": "已保存的组件 SDK 版本与已安装的组件不匹配。"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
function sharedStrings(locale = viewerLocale()) {
|
|
204
|
+
const language = locale?.toLowerCase().split("-")[0];
|
|
205
|
+
return language === "es" ? SHARED_STRINGS.es : language === "zh" ? SHARED_STRINGS["zh-CN"] : SHARED_STRINGS.en;
|
|
206
|
+
}
|
|
207
|
+
function unresolvedWidgetDetail(reason, locale = viewerLocale()) {
|
|
208
|
+
const language = locale?.toLowerCase().split("-")[0];
|
|
209
|
+
if (language !== "es" && language !== "zh") return reason.message;
|
|
210
|
+
const words = sharedStrings(locale);
|
|
211
|
+
return [words.unresolved[reason.code], reason.versions && words.versions(reason.versions.authored, reason.versions.installed)].filter(Boolean).join(" ");
|
|
212
|
+
}
|
|
213
|
+
|
|
91
214
|
// src/connected-widget.tsx
|
|
92
215
|
import {
|
|
93
216
|
UNKNOWN_WIDGET_TYPE
|
|
@@ -1378,7 +1501,7 @@ var builtinWidgetDescriptors = {
|
|
|
1378
1501
|
var builtinWidgetCatalog = createWidgetCatalog(Object.values(builtinWidgetDescriptors));
|
|
1379
1502
|
|
|
1380
1503
|
// src/widgets/aggregate-lazy.tsx
|
|
1381
|
-
var chunk = lazyChunk(() => import("./chunks/aggregate-widgets-
|
|
1504
|
+
var chunk = lazyChunk(() => import("./chunks/aggregate-widgets-SHPHUHNL.js"));
|
|
1382
1505
|
var loadAggregateWidgets = chunk.load;
|
|
1383
1506
|
var statCardWidget = defineWidget({
|
|
1384
1507
|
descriptor: builtinWidgetDescriptors["stat-card"],
|
|
@@ -1407,7 +1530,7 @@ var statusGridWidget = defineWidget({
|
|
|
1407
1530
|
|
|
1408
1531
|
// src/widgets/alarm-lazy.tsx
|
|
1409
1532
|
import { defineWidget as defineWidget2 } from "@devicechain/widget-sdk";
|
|
1410
|
-
var chunk2 = lazyChunk(() => import("./chunks/alarm-widgets-
|
|
1533
|
+
var chunk2 = lazyChunk(() => import("./chunks/alarm-widgets-DQEITFVN.js"));
|
|
1411
1534
|
var loadAlarmWidgets = chunk2.load;
|
|
1412
1535
|
var alarmTableWidget = defineWidget2({
|
|
1413
1536
|
descriptor: builtinWidgetDescriptors["alarm-table"],
|
|
@@ -1424,7 +1547,7 @@ var alarmCountWidget = defineWidget2({
|
|
|
1424
1547
|
|
|
1425
1548
|
// src/widgets/control-lazy.tsx
|
|
1426
1549
|
import { defineWidget as defineWidget3 } from "@devicechain/widget-sdk";
|
|
1427
|
-
var chunk3 = lazyChunk(() => import("./chunks/control-widgets-
|
|
1550
|
+
var chunk3 = lazyChunk(() => import("./chunks/control-widgets-VMWBTRC6.js"));
|
|
1428
1551
|
var loadControlWidgets = chunk3.load;
|
|
1429
1552
|
var commandSliderWidget = defineWidget3({
|
|
1430
1553
|
descriptor: builtinWidgetDescriptors["command-slider"],
|
|
@@ -1441,7 +1564,7 @@ var commandButtonWidget = defineWidget3({
|
|
|
1441
1564
|
|
|
1442
1565
|
// src/widgets/history-lazy.tsx
|
|
1443
1566
|
import { defineWidget as defineWidget4 } from "@devicechain/widget-sdk";
|
|
1444
|
-
var chunk4 = lazyChunk(() => import("./chunks/history-widgets-
|
|
1567
|
+
var chunk4 = lazyChunk(() => import("./chunks/history-widgets-WJ4KRTG7.js"));
|
|
1445
1568
|
var loadHistoryWidgets = chunk4.load;
|
|
1446
1569
|
var historyTableWidget = defineWidget4({
|
|
1447
1570
|
descriptor: builtinWidgetDescriptors["history-table"],
|
|
@@ -1454,7 +1577,7 @@ var stateTimelineWidget = defineWidget4({
|
|
|
1454
1577
|
|
|
1455
1578
|
// src/widgets/presence-lazy.tsx
|
|
1456
1579
|
import { defineWidget as defineWidget5 } from "@devicechain/widget-sdk";
|
|
1457
|
-
var chunk5 = lazyChunk(() => import("./chunks/presence-widgets-
|
|
1580
|
+
var chunk5 = lazyChunk(() => import("./chunks/presence-widgets-P2H3A2SD.js"));
|
|
1458
1581
|
var loadPresenceWidgets = chunk5.load;
|
|
1459
1582
|
var deviceStatusWidget = defineWidget5({
|
|
1460
1583
|
descriptor: builtinWidgetDescriptors["device-status"],
|
|
@@ -1467,7 +1590,7 @@ var onlineDoughnutWidget = defineWidget5({
|
|
|
1467
1590
|
|
|
1468
1591
|
// src/widgets/selection-lazy.tsx
|
|
1469
1592
|
import { defineWidget as defineWidget6 } from "@devicechain/widget-sdk";
|
|
1470
|
-
var chunk6 = lazyChunk(() => import("./chunks/entity-selector-
|
|
1593
|
+
var chunk6 = lazyChunk(() => import("./chunks/entity-selector-IRUFUDQ6.js"));
|
|
1471
1594
|
var loadSelectionWidgets = chunk6.load;
|
|
1472
1595
|
var entitySelectorWidget = defineWidget6({
|
|
1473
1596
|
descriptor: builtinWidgetDescriptors["entity-selector"],
|
|
@@ -1494,7 +1617,7 @@ import { buildGaugeOption, EChart, gaugeReadoutBox, loadChartEngine, useChartThe
|
|
|
1494
1617
|
|
|
1495
1618
|
// src/widgets/no-reading-lazy.tsx
|
|
1496
1619
|
import { useEffect, useState } from "react";
|
|
1497
|
-
var NoReading = lazyChunk(() => import("./chunks/no-reading-
|
|
1620
|
+
var NoReading = lazyChunk(() => import("./chunks/no-reading-CTQCMNYA.js")).component("NoReading");
|
|
1498
1621
|
function useSettledEmpty(empty, ms = 1500) {
|
|
1499
1622
|
const [settled, setSettled] = useState(false);
|
|
1500
1623
|
useEffect(() => {
|
|
@@ -1609,7 +1732,7 @@ function Image({ widget }) {
|
|
|
1609
1732
|
color: css("muted-foreground"),
|
|
1610
1733
|
fontSize: fontVar("md")
|
|
1611
1734
|
},
|
|
1612
|
-
children:
|
|
1735
|
+
children: sharedStrings().noImage
|
|
1613
1736
|
}
|
|
1614
1737
|
) });
|
|
1615
1738
|
}
|
|
@@ -1787,7 +1910,7 @@ var latestCardWidget = defineWidget10({
|
|
|
1787
1910
|
// src/widgets/level-lazy.tsx
|
|
1788
1911
|
import { defineWidget as defineWidget11 } from "@devicechain/widget-sdk";
|
|
1789
1912
|
import { loadChartEngine as loadChartEngine2 } from "@devicechain/widget-sdk/echarts";
|
|
1790
|
-
var chunk7 = lazyChunk(() => import("./chunks/level-widgets-
|
|
1913
|
+
var chunk7 = lazyChunk(() => import("./chunks/level-widgets-3SRESJYW.js"));
|
|
1791
1914
|
var loadLevelWidgets = chunk7.load;
|
|
1792
1915
|
var lazyComponent = chunk7.component;
|
|
1793
1916
|
var linearGaugeWidget = defineWidget11({
|
|
@@ -1872,10 +1995,10 @@ function describePosition(sample) {
|
|
|
1872
1995
|
`${formatDegrees(sample.latitude)}, ${formatDegrees(sample.longitude)}`
|
|
1873
1996
|
];
|
|
1874
1997
|
if (sample.elevation != null) parts.push(`${sample.elevation} m`);
|
|
1875
|
-
if (sample.accuracy != null) parts.push(
|
|
1998
|
+
if (sample.accuracy != null) parts.push(`±${sample.accuracy} m`);
|
|
1876
1999
|
if (sample.speed != null) parts.push(`${sample.speed} m/s`);
|
|
1877
|
-
if (sample.heading != null) parts.push(`${sample.heading}
|
|
1878
|
-
return parts.join("
|
|
2000
|
+
if (sample.heading != null) parts.push(`${sample.heading}°`);
|
|
2001
|
+
return parts.join(" · ");
|
|
1879
2002
|
}
|
|
1880
2003
|
function rasterStyleFor(tileUrl, attribution) {
|
|
1881
2004
|
return {
|
|
@@ -1897,12 +2020,12 @@ var BUNDLED_BASEMAP_ATTRIBUTION = "Made with Natural Earth";
|
|
|
1897
2020
|
var OCEAN = "#0b1220";
|
|
1898
2021
|
var LAND = "#1e293b";
|
|
1899
2022
|
var BOUNDARY = "#475569";
|
|
1900
|
-
function landStyleFrom(land, boundaries) {
|
|
2023
|
+
function landStyleFrom(land, boundaries, attribution = BUNDLED_BASEMAP_ATTRIBUTION) {
|
|
1901
2024
|
return {
|
|
1902
2025
|
version: 8,
|
|
1903
2026
|
projection: PROJECTION,
|
|
1904
2027
|
sources: {
|
|
1905
|
-
land: { type: "geojson", data: land, attribution
|
|
2028
|
+
land: { type: "geojson", data: land, attribution },
|
|
1906
2029
|
boundaries: { type: "geojson", data: boundaries }
|
|
1907
2030
|
},
|
|
1908
2031
|
layers: [
|
|
@@ -1917,14 +2040,16 @@ function landStyleFrom(land, boundaries) {
|
|
|
1917
2040
|
]
|
|
1918
2041
|
};
|
|
1919
2042
|
}
|
|
1920
|
-
var
|
|
1921
|
-
function loadLandStyle() {
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
2043
|
+
var landStylePromises = /* @__PURE__ */ new Map();
|
|
2044
|
+
function loadLandStyle(attribution = BUNDLED_BASEMAP_ATTRIBUTION) {
|
|
2045
|
+
let pending = landStylePromises.get(attribution);
|
|
2046
|
+
if (!pending) {
|
|
2047
|
+
pending = import("./chunks/natural-earth-data-R7NPQARR.js").then(
|
|
2048
|
+
(mod) => landStyleFrom(mod.NATURAL_EARTH.land, mod.NATURAL_EARTH.boundaries, attribution)
|
|
1925
2049
|
);
|
|
2050
|
+
landStylePromises.set(attribution, pending);
|
|
1926
2051
|
}
|
|
1927
|
-
return
|
|
2052
|
+
return pending;
|
|
1928
2053
|
}
|
|
1929
2054
|
|
|
1930
2055
|
// src/widgets/map.tsx
|
|
@@ -1933,7 +2058,8 @@ var mapLibrePromise;
|
|
|
1933
2058
|
function loadMapLibre(runtime) {
|
|
1934
2059
|
if (!mapLibrePromise) {
|
|
1935
2060
|
mapLibrePromise = Promise.all([
|
|
1936
|
-
|
|
2061
|
+
// Name the exports we use so the bundler can drop unused controls and helpers.
|
|
2062
|
+
import("maplibre-gl").then(({ Map: Map2, Marker: Marker2, LngLatBounds, setWorkerUrl }) => ({ Map: Map2, Marker: Marker2, LngLatBounds, setWorkerUrl })),
|
|
1937
2063
|
Promise.resolve().then(() => runtime.loadStyles?.())
|
|
1938
2064
|
]).then(([mod]) => {
|
|
1939
2065
|
mod.setWorkerUrl(runtime.workerUrl);
|
|
@@ -1963,9 +2089,9 @@ function MapWidget({ widget, data }) {
|
|
|
1963
2089
|
return /* @__PURE__ */ jsx5(WidgetFrame5, { title, children: /* @__PURE__ */ jsx5(
|
|
1964
2090
|
MapNotice,
|
|
1965
2091
|
{
|
|
1966
|
-
glyph: "
|
|
1967
|
-
heading:
|
|
1968
|
-
detail:
|
|
2092
|
+
glyph: "🔒",
|
|
2093
|
+
heading: sharedStrings().locationDenied,
|
|
2094
|
+
detail: sharedStrings().locationPermission
|
|
1969
2095
|
}
|
|
1970
2096
|
) });
|
|
1971
2097
|
}
|
|
@@ -1973,21 +2099,21 @@ function MapWidget({ widget, data }) {
|
|
|
1973
2099
|
return /* @__PURE__ */ jsx5(WidgetFrame5, { title, children: /* @__PURE__ */ jsx5(
|
|
1974
2100
|
MapNotice,
|
|
1975
2101
|
{
|
|
1976
|
-
glyph: "
|
|
1977
|
-
heading:
|
|
1978
|
-
detail:
|
|
2102
|
+
glyph: "🧩",
|
|
2103
|
+
heading: sharedStrings().noMapRuntime,
|
|
2104
|
+
detail: sharedStrings().mapRuntimeHint
|
|
1979
2105
|
}
|
|
1980
2106
|
) });
|
|
1981
2107
|
}
|
|
1982
2108
|
if (data.loading && positions.length === 0) {
|
|
1983
|
-
return /* @__PURE__ */ jsx5(WidgetFrame5, { title, children: /* @__PURE__ */ jsx5(MapNotice, { heading:
|
|
2109
|
+
return /* @__PURE__ */ jsx5(WidgetFrame5, { title, children: /* @__PURE__ */ jsx5(MapNotice, { heading: sharedStrings().loading }) });
|
|
1984
2110
|
}
|
|
1985
2111
|
if (positions.length === 0) {
|
|
1986
2112
|
return /* @__PURE__ */ jsx5(WidgetFrame5, { title, children: /* @__PURE__ */ jsx5(
|
|
1987
2113
|
MapNotice,
|
|
1988
2114
|
{
|
|
1989
|
-
heading: data.deviceTokens.length === 0 ?
|
|
1990
|
-
detail: data.deviceTokens.length === 0 ?
|
|
2115
|
+
heading: data.deviceTokens.length === 0 ? sharedStrings().noDevices : sharedStrings().noPositions,
|
|
2116
|
+
detail: data.deviceTokens.length === 0 ? sharedStrings().bindLocation : sharedStrings().positionsEmpty
|
|
1991
2117
|
}
|
|
1992
2118
|
) });
|
|
1993
2119
|
}
|
|
@@ -2064,12 +2190,13 @@ function LiveMap({
|
|
|
2064
2190
|
const selectable = pick !== void 0;
|
|
2065
2191
|
const tileUrl = basemap?.tileUrl ?? null;
|
|
2066
2192
|
const attribution = basemap?.attribution ?? null;
|
|
2193
|
+
const landAttribution = sharedStrings().naturalEarth;
|
|
2067
2194
|
useEffect2(() => {
|
|
2068
2195
|
let cancelled = false;
|
|
2069
2196
|
setStatus("loading");
|
|
2070
2197
|
Promise.all([
|
|
2071
2198
|
loadMapLibre(runtime),
|
|
2072
|
-
tileUrl ? rasterStyleFor(tileUrl, attribution ?? void 0) : loadLandStyle()
|
|
2199
|
+
tileUrl ? rasterStyleFor(tileUrl, attribution ?? void 0) : loadLandStyle(landAttribution)
|
|
2073
2200
|
]).then(([maplibre, style]) => {
|
|
2074
2201
|
const el = containerRef.current;
|
|
2075
2202
|
if (cancelled || !el) return;
|
|
@@ -2091,7 +2218,7 @@ function LiveMap({
|
|
|
2091
2218
|
mapRef.current?.remove();
|
|
2092
2219
|
mapRef.current = null;
|
|
2093
2220
|
};
|
|
2094
|
-
}, [tileUrl, attribution, runtime.workerUrl]);
|
|
2221
|
+
}, [tileUrl, attribution, landAttribution, runtime.workerUrl]);
|
|
2095
2222
|
useEffect2(() => {
|
|
2096
2223
|
const map = mapRef.current;
|
|
2097
2224
|
if (status !== "ready" || !map) return;
|
|
@@ -2142,7 +2269,7 @@ function LiveMap({
|
|
|
2142
2269
|
PlainPanel,
|
|
2143
2270
|
{
|
|
2144
2271
|
positions,
|
|
2145
|
-
note:
|
|
2272
|
+
note: sharedStrings().mapUnavailable,
|
|
2146
2273
|
pick
|
|
2147
2274
|
}
|
|
2148
2275
|
);
|
|
@@ -2233,7 +2360,7 @@ var mapWidget = defineWidget12({
|
|
|
2233
2360
|
|
|
2234
2361
|
// src/widgets/table-lazy.tsx
|
|
2235
2362
|
import { defineWidget as defineWidget13 } from "@devicechain/widget-sdk";
|
|
2236
|
-
var chunk8 = lazyChunk(() => import("./chunks/table-
|
|
2363
|
+
var chunk8 = lazyChunk(() => import("./chunks/table-HAKFOUMS.js"));
|
|
2237
2364
|
var loadTableWidget = chunk8.load;
|
|
2238
2365
|
var tableWidget = defineWidget13({
|
|
2239
2366
|
descriptor: builtinWidgetDescriptors["table"],
|
|
@@ -2258,7 +2385,7 @@ import {
|
|
|
2258
2385
|
useWidgetScale as useWidgetScale2,
|
|
2259
2386
|
useWidgetTimeRange,
|
|
2260
2387
|
useWidgetTimeZone as useWidgetTimeZone2,
|
|
2261
|
-
viewerLocale,
|
|
2388
|
+
viewerLocale as viewerLocale2,
|
|
2262
2389
|
WidgetFrame as WidgetFrame6
|
|
2263
2390
|
} from "@devicechain/widget-sdk";
|
|
2264
2391
|
import { buildLineOption, EChart as EChart2, loadChartEngine as loadChartEngine3, useChartTheme as useChartTheme2 } from "@devicechain/widget-sdk/echarts";
|
|
@@ -2269,7 +2396,7 @@ function TimeSeriesChart({ widget, data, markers }) {
|
|
|
2269
2396
|
const spanSeconds = isValidSpanSeconds(pinned) ? pinned : range?.spanSeconds;
|
|
2270
2397
|
const exportRows = () => {
|
|
2271
2398
|
const device = widget.datasource?.kind === "device" ? widget.datasource.deviceToken : void 0;
|
|
2272
|
-
return import("./chunks/export-rows-
|
|
2399
|
+
return import("./chunks/export-rows-XKIVLOM3.js").then(
|
|
2273
2400
|
(m) => m.samplesExport({
|
|
2274
2401
|
subject: optString6(widget.options, "title") ?? device ?? "chart",
|
|
2275
2402
|
samples: data.samples,
|
|
@@ -2328,8 +2455,13 @@ var SPAN_STRINGS = {
|
|
|
2328
2455
|
},
|
|
2329
2456
|
es: {
|
|
2330
2457
|
from: (time) => `desde ${time}`,
|
|
2331
|
-
pinned: (span) => `Fijado a ${span}: el intervalo de tiempo del panel no se aplica a este
|
|
2332
|
-
cut: (time, span) => `Se muestra desde ${time}, no todo el intervalo de ${span}: se descartaron las muestras
|
|
2458
|
+
pinned: (span) => `Fijado a ${span}: el intervalo de tiempo del panel no se aplica a este gráfico.`,
|
|
2459
|
+
cut: (time, span) => `Se muestra desde ${time}, no todo el intervalo de ${span}: se descartaron las muestras más antiguas para acotar la memoria.`
|
|
2460
|
+
},
|
|
2461
|
+
"zh-CN": {
|
|
2462
|
+
from: (time) => `从 ${time} 起`,
|
|
2463
|
+
pinned: (span) => `固定为 ${span}:仪表板的时间范围不适用于此图。`,
|
|
2464
|
+
cut: (time, span) => `仅显示 ${time} 以来的数据,未覆盖整个 ${span}:为限制内存,较早的样本已丢弃。`
|
|
2333
2465
|
}
|
|
2334
2466
|
};
|
|
2335
2467
|
var DAY_MS = 864e5;
|
|
@@ -2341,11 +2473,12 @@ function SpanBadge({ widget, data }) {
|
|
|
2341
2473
|
const showSpan = range !== void 0 && span !== range.spanSeconds;
|
|
2342
2474
|
const cutAt = data.truncatedBefore;
|
|
2343
2475
|
if (!showSpan && !cutAt) return null;
|
|
2344
|
-
const
|
|
2476
|
+
const language = viewerLocale2()?.toLowerCase().split("-")[0];
|
|
2477
|
+
const words = language === "es" ? SPAN_STRINGS.es : language === "zh" ? SPAN_STRINGS["zh-CN"] : SPAN_STRINGS.en;
|
|
2345
2478
|
const label = span === void 0 ? "" : spanLabel(span);
|
|
2346
2479
|
const end = range?.paused && range.pausedAt !== void 0 ? range.pausedAt : Date.now();
|
|
2347
2480
|
const time = cutAt ? end - Date.parse(cutAt) > DAY_MS ? formatDateTime(cutAt, timeZone) : formatTimestamp2(cutAt, timeZone) : "";
|
|
2348
|
-
const text = [showSpan ? label : "", cutAt ? words.from(time) : ""].filter(Boolean).join("
|
|
2481
|
+
const text = [showSpan ? label : "", cutAt ? words.from(time) : ""].filter(Boolean).join(" · ");
|
|
2349
2482
|
const title = [showSpan ? words.pinned(label) : "", cutAt ? words.cut(time, label) : ""].filter(Boolean).join(" ");
|
|
2350
2483
|
return /* @__PURE__ */ jsx6(
|
|
2351
2484
|
"span",
|
|
@@ -2427,7 +2560,6 @@ import {
|
|
|
2427
2560
|
fontVar as fontVar6,
|
|
2428
2561
|
optString as optString7,
|
|
2429
2562
|
spaceVar as spaceVar4,
|
|
2430
|
-
viewerLocale as viewerLocale2,
|
|
2431
2563
|
useAlarmStream,
|
|
2432
2564
|
useCommandStream,
|
|
2433
2565
|
useDatasourceAvailability,
|
|
@@ -2466,7 +2598,7 @@ var ALARM_AUTHORITY = "alarm:write";
|
|
|
2466
2598
|
var COMMAND_AUTHORITY = "command:write";
|
|
2467
2599
|
function undeclared(capability, report) {
|
|
2468
2600
|
return guardAsync(
|
|
2469
|
-
() => Promise.reject(new Error(
|
|
2601
|
+
() => Promise.reject(new Error(sharedStrings().undeclared(capability))),
|
|
2470
2602
|
report
|
|
2471
2603
|
);
|
|
2472
2604
|
}
|
|
@@ -2543,10 +2675,10 @@ var WidgetErrorBoundary = class extends Component {
|
|
|
2543
2675
|
const { error } = this.state;
|
|
2544
2676
|
if (!error) return this.props.children;
|
|
2545
2677
|
return /* @__PURE__ */ jsx7(WidgetFrame7, { title: this.props.title, children: /* @__PURE__ */ jsxs5("div", { style: MESSAGE_STYLE, role: "alert", children: [
|
|
2546
|
-
/* @__PURE__ */ jsx7("div", { style: { fontSize: 20, lineHeight: 1 }, "aria-hidden": "true", children: "
|
|
2547
|
-
/* @__PURE__ */ jsx7("div", { style: { fontSize: 13, fontWeight: 600 }, children:
|
|
2678
|
+
/* @__PURE__ */ jsx7("div", { style: { fontSize: 20, lineHeight: 1 }, "aria-hidden": "true", children: "⚠" }),
|
|
2679
|
+
/* @__PURE__ */ jsx7("div", { style: { fontSize: 13, fontWeight: 600 }, children: sharedStrings().renderFailed }),
|
|
2548
2680
|
/* @__PURE__ */ jsx7("div", { style: { fontSize: 11, opacity: 0.8, wordBreak: "break-word" }, children: error.message }),
|
|
2549
|
-
/* @__PURE__ */ jsx7("button", { type: "button", style: BUTTON_STYLE, onClick: this.reset, children:
|
|
2681
|
+
/* @__PURE__ */ jsx7("button", { type: "button", style: BUTTON_STYLE, onClick: this.reset, children: sharedStrings().reset })
|
|
2550
2682
|
] }) });
|
|
2551
2683
|
}
|
|
2552
2684
|
};
|
|
@@ -2577,8 +2709,8 @@ function WidgetContainment({ title, resetKey, children }) {
|
|
|
2577
2709
|
alignItems: "center"
|
|
2578
2710
|
},
|
|
2579
2711
|
children: [
|
|
2580
|
-
/* @__PURE__ */ jsx7("span", { style: { flex: 1, wordBreak: "break-word" }, children: messages.join("
|
|
2581
|
-
/* @__PURE__ */ jsx7("button", { type: "button", "aria-label":
|
|
2712
|
+
/* @__PURE__ */ jsx7("span", { style: { flex: 1, wordBreak: "break-word" }, children: messages.join(" · ") }),
|
|
2713
|
+
/* @__PURE__ */ jsx7("button", { type: "button", "aria-label": sharedStrings().dismiss, onClick: clear, style: { cursor: "pointer" }, children: "×" })
|
|
2582
2714
|
]
|
|
2583
2715
|
}
|
|
2584
2716
|
)
|
|
@@ -2637,12 +2769,8 @@ function ConnectedWidgetBody({ widget, hub, registry, actions, initialSamples, i
|
|
|
2637
2769
|
function showsCurrentStateOnly(descriptor) {
|
|
2638
2770
|
return descriptor.channel === "alarm" || descriptor.channel === "location" || presenceMode(descriptor);
|
|
2639
2771
|
}
|
|
2640
|
-
var CURRENT_STATE_STRINGS = {
|
|
2641
|
-
en: { label: "Now", title: "Shows the current state: the fixed time window does not apply to this widget." },
|
|
2642
|
-
es: { label: "Ahora", title: "Muestra el estado actual: la ventana de tiempo fija no se aplica a este widget." }
|
|
2643
|
-
};
|
|
2644
2772
|
function CurrentStateBadge({ children }) {
|
|
2645
|
-
const words =
|
|
2773
|
+
const words = sharedStrings();
|
|
2646
2774
|
return /* @__PURE__ */ jsxs6("div", { "data-current-state": "", style: { position: "relative", width: "100%", height: "100%", minWidth: 0, minHeight: 0 }, children: [
|
|
2647
2775
|
children,
|
|
2648
2776
|
/* @__PURE__ */ jsx8(
|
|
@@ -2650,8 +2778,8 @@ function CurrentStateBadge({ children }) {
|
|
|
2650
2778
|
{
|
|
2651
2779
|
"data-current-state-badge": "",
|
|
2652
2780
|
role: "note",
|
|
2653
|
-
title: words.
|
|
2654
|
-
"aria-label": words.
|
|
2781
|
+
title: words.currentState,
|
|
2782
|
+
"aria-label": words.currentState,
|
|
2655
2783
|
style: {
|
|
2656
2784
|
position: "absolute",
|
|
2657
2785
|
// Bottom LEFT: a map keeps its attribution bottom right, and a chart its span badge top right.
|
|
@@ -2666,7 +2794,7 @@ function CurrentStateBadge({ children }) {
|
|
|
2666
2794
|
borderRadius: 4,
|
|
2667
2795
|
zIndex: 1
|
|
2668
2796
|
},
|
|
2669
|
-
children: words.
|
|
2797
|
+
children: words.now
|
|
2670
2798
|
}
|
|
2671
2799
|
)
|
|
2672
2800
|
] });
|
|
@@ -2747,9 +2875,9 @@ function ChannelBody(props) {
|
|
|
2747
2875
|
function StaticConnectedWidget({ widget, Component: Component2, actions }) {
|
|
2748
2876
|
return /* @__PURE__ */ jsx8(Component2, { widget, data: null, actions });
|
|
2749
2877
|
}
|
|
2750
|
-
var FleetFeed = lazyChunk(() => import("./chunks/fleet-feed-
|
|
2751
|
-
var PresenceFeed = lazyChunk(() => import("./chunks/presence-widgets-
|
|
2752
|
-
var HistoryFeed = lazyChunk(() => import("./chunks/history-widgets-
|
|
2878
|
+
var FleetFeed = lazyChunk(() => import("./chunks/fleet-feed-AYNL3CC2.js")).component("default", void 0, ChunkLoadingFrame);
|
|
2879
|
+
var PresenceFeed = lazyChunk(() => import("./chunks/presence-widgets-P2H3A2SD.js")).component("PresenceFeed");
|
|
2880
|
+
var HistoryFeed = lazyChunk(() => import("./chunks/history-widgets-WJ4KRTG7.js")).component("HistoryFeed");
|
|
2753
2881
|
function MeasurementConnectedWidget(props) {
|
|
2754
2882
|
if (presenceMode(props.descriptor)) {
|
|
2755
2883
|
return /* @__PURE__ */ jsx8(PresenceFeed, { hub: props.hub, widget: props.widget, descriptor: props.descriptor, Component: props.Component, actions: props.actions, ErrorFrame: WidgetErrorFrame });
|
|
@@ -2788,13 +2916,13 @@ function StreamConnectedWidget({ widget, hub, descriptor, Component: Component2,
|
|
|
2788
2916
|
if (data.error) return /* @__PURE__ */ jsx8(WidgetErrorFrame, { widget, error: data.error });
|
|
2789
2917
|
return /* @__PURE__ */ jsx8(WidgetFreshnessProvider, { freshness, children: wantsEventMarkers(descriptor, widget) ? /* @__PURE__ */ jsx8(EventMarkersFeed, { hub, widget, descriptor, data, Component: Component2, actions }) : /* @__PURE__ */ jsx8(Component2, { widget, data, actions }) });
|
|
2790
2918
|
}
|
|
2791
|
-
var EventMarkersFeed = lazyChunk(() => import("./chunks/event-markers-feed-
|
|
2792
|
-
var AggregateFeed = lazyChunk(() => import("./chunks/aggregate-feed-
|
|
2919
|
+
var EventMarkersFeed = lazyChunk(() => import("./chunks/event-markers-feed-TOAQ53YC.js")).component("default");
|
|
2920
|
+
var AggregateFeed = lazyChunk(() => import("./chunks/aggregate-feed-QJRO7Y4V.js")).component("default");
|
|
2793
2921
|
function AggregateConnectedWidget(channel) {
|
|
2794
2922
|
const props = { ...channel, ErrorFrame: WidgetErrorFrame };
|
|
2795
2923
|
return channel.widget.datasource?.kind === "anchor" ? /* @__PURE__ */ jsx8(FleetFeed, { ...props, refuse: true }) : /* @__PURE__ */ jsx8(AggregateFeed, { ...props });
|
|
2796
2924
|
}
|
|
2797
|
-
var GroupedAlarm = lazyChunk(() => import("./chunks/alarm-widgets-
|
|
2925
|
+
var GroupedAlarm = lazyChunk(() => import("./chunks/alarm-widgets-DQEITFVN.js")).component("GroupedAlarm");
|
|
2798
2926
|
function AlarmConnectedWidget(props) {
|
|
2799
2927
|
return groupsAlarmsByDeviceType(props.descriptor, props.widget) ? /* @__PURE__ */ jsx8(
|
|
2800
2928
|
GroupedAlarm,
|
|
@@ -2849,18 +2977,16 @@ function UnresolvedWidgetFrame({
|
|
|
2849
2977
|
reason
|
|
2850
2978
|
}) {
|
|
2851
2979
|
const storedType = typeof stored === "string" ? stored : "";
|
|
2852
|
-
const
|
|
2980
|
+
const detail = reason ? unresolvedWidgetDetail(reason) : void 0;
|
|
2981
|
+
const heading = (reason?.code ?? "unregistered") === "unregistered" ? sharedStrings().newerViewer : sharedStrings().cannotShow;
|
|
2853
2982
|
return /* @__PURE__ */ jsx8(WidgetFrame8, { children: /* @__PURE__ */ jsxs6(
|
|
2854
2983
|
"div",
|
|
2855
2984
|
{
|
|
2856
2985
|
style: STATE_STYLE,
|
|
2857
2986
|
children: [
|
|
2858
2987
|
/* @__PURE__ */ jsx8("div", { style: { fontSize: 13, fontWeight: 600 }, children: heading }),
|
|
2859
|
-
storedType && !
|
|
2860
|
-
|
|
2861
|
-
storedType
|
|
2862
|
-
] }),
|
|
2863
|
-
reason && /* @__PURE__ */ jsx8("div", { style: { fontSize: 11, opacity: 0.8, wordBreak: "break-word" }, children: reason.message })
|
|
2988
|
+
storedType && !detail?.includes(storedType) && /* @__PURE__ */ jsx8("div", { style: { fontSize: 11, opacity: 0.8 }, children: sharedStrings().widgetType(storedType) }),
|
|
2989
|
+
detail && /* @__PURE__ */ jsx8("div", { style: { fontSize: 11, opacity: 0.8, wordBreak: "break-word" }, children: detail })
|
|
2864
2990
|
]
|
|
2865
2991
|
}
|
|
2866
2992
|
) });
|
|
@@ -2884,10 +3010,10 @@ function StateBody({ kind, glyph, title, detail }) {
|
|
|
2884
3010
|
] });
|
|
2885
3011
|
}
|
|
2886
3012
|
function WidgetForbiddenFrame({ widget }) {
|
|
2887
|
-
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "forbidden", glyph: "
|
|
3013
|
+
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "forbidden", glyph: "⊘", title: accessStrings().forbidden });
|
|
2888
3014
|
}
|
|
2889
3015
|
function WidgetUnavailableFrame({ widget }) {
|
|
2890
|
-
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "gone", glyph: "
|
|
3016
|
+
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "gone", glyph: "⊘", title: sharedStrings().deviceUnavailable, detail: sharedStrings().deviceGone });
|
|
2891
3017
|
}
|
|
2892
3018
|
function WidgetNotForCustomerUsersFrame({ widget }) {
|
|
2893
3019
|
return /* @__PURE__ */ jsx8(
|
|
@@ -2895,15 +3021,15 @@ function WidgetNotForCustomerUsersFrame({ widget }) {
|
|
|
2895
3021
|
{
|
|
2896
3022
|
widget,
|
|
2897
3023
|
kind: "unsupported",
|
|
2898
|
-
glyph: "
|
|
2899
|
-
title:
|
|
2900
|
-
detail:
|
|
3024
|
+
glyph: "⊘",
|
|
3025
|
+
title: sharedStrings().notForCustomers,
|
|
3026
|
+
detail: sharedStrings().customerBinding
|
|
2901
3027
|
}
|
|
2902
3028
|
);
|
|
2903
3029
|
}
|
|
2904
3030
|
function WidgetErrorFrame({ widget, error }) {
|
|
2905
3031
|
if (isForbiddenError(error)) return /* @__PURE__ */ jsx8(WidgetForbiddenFrame, { widget });
|
|
2906
|
-
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "error", glyph: "
|
|
3032
|
+
return /* @__PURE__ */ jsx8(StatePane, { widget, kind: "error", glyph: "…", title: sharedStrings().dataUnavailable, detail: String(error) });
|
|
2907
3033
|
}
|
|
2908
3034
|
|
|
2909
3035
|
// src/dashboard-renderer.tsx
|
|
@@ -3235,32 +3361,9 @@ import {
|
|
|
3235
3361
|
withSpan
|
|
3236
3362
|
} from "@devicechain/dashboards";
|
|
3237
3363
|
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3, useState as useState6 } from "react";
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
const lastDefault = useRef3(defaultSeconds);
|
|
3242
|
-
useEffect5(() => {
|
|
3243
|
-
if (lastDefault.current === defaultSeconds) return;
|
|
3244
|
-
lastDefault.current = defaultSeconds;
|
|
3245
|
-
setState((s) => withSpan(s, isValidSpanSeconds2(defaultSeconds) ? defaultSeconds : DEFAULT_TIME_RANGE_SECONDS2));
|
|
3246
|
-
}, [defaultSeconds]);
|
|
3247
|
-
const controls = useMemo6(
|
|
3248
|
-
() => ({
|
|
3249
|
-
// A preset click while a fixed window is showing leaves it: back to live at that span.
|
|
3250
|
-
setSpan: (spanSeconds) => setState((s) => withSpan(leaveAbsolute(s), spanSeconds)),
|
|
3251
|
-
pause: () => setState((s) => pauseRange(s, Date.now())),
|
|
3252
|
-
resume: () => setState((s) => resumeRange(s)),
|
|
3253
|
-
setAbsolute: (fromMs, toMs) => {
|
|
3254
|
-
const made = absoluteRange(fromMs, toMs);
|
|
3255
|
-
if ("problem" in made) return made.problem;
|
|
3256
|
-
setState(made.state);
|
|
3257
|
-
return void 0;
|
|
3258
|
-
}
|
|
3259
|
-
}),
|
|
3260
|
-
[]
|
|
3261
|
-
);
|
|
3262
|
-
return [state, controls];
|
|
3263
|
-
}
|
|
3364
|
+
|
|
3365
|
+
// src/time-range-strings.ts
|
|
3366
|
+
import { viewerLocale as viewerLocale3 } from "@devicechain/widget-sdk";
|
|
3264
3367
|
var DEFAULT_ABSOLUTE_LABELS = {
|
|
3265
3368
|
custom: "Custom range",
|
|
3266
3369
|
from: "From",
|
|
@@ -3294,8 +3397,109 @@ var DEFAULT_TIME_RANGE_LABELS = {
|
|
|
3294
3397
|
pausedAt: (time) => `Paused at ${time}`,
|
|
3295
3398
|
actionsLive: "commands still send"
|
|
3296
3399
|
};
|
|
3297
|
-
var
|
|
3298
|
-
|
|
3400
|
+
var TIME_RANGE_STRINGS = {
|
|
3401
|
+
en: { ...DEFAULT_TIME_RANGE_LABELS, absolute: DEFAULT_ABSOLUTE_LABELS },
|
|
3402
|
+
"es": {
|
|
3403
|
+
range: "Intervalo de tiempo",
|
|
3404
|
+
pause: "Pausar",
|
|
3405
|
+
resume: "Reanudar",
|
|
3406
|
+
paused: "En pausa",
|
|
3407
|
+
pausedAt: (time) => `En pausa desde las ${time}`,
|
|
3408
|
+
actionsLive: "los comandos se siguen enviando",
|
|
3409
|
+
absolute: {
|
|
3410
|
+
custom: "Intervalo personalizado",
|
|
3411
|
+
from: "Desde",
|
|
3412
|
+
to: "Hasta",
|
|
3413
|
+
apply: "Aplicar",
|
|
3414
|
+
cancel: "Cancelar",
|
|
3415
|
+
zone: (zone, offset) => `Las horas están en ${zone} (${offset}). Los enlaces compartidos usan UTC.`,
|
|
3416
|
+
fixed: "Intervalo fijo",
|
|
3417
|
+
backToLive: "Volver a en vivo",
|
|
3418
|
+
copyLink: "Copiar enlace",
|
|
3419
|
+
linkCopied: "Enlace copiado",
|
|
3420
|
+
loadFailed: "No se pudo cargar el selector de intervalo. Inténtalo de nuevo.",
|
|
3421
|
+
dismiss: "Descartar",
|
|
3422
|
+
ignored: (reason, raw) => `Se ignoró el intervalo de tiempo del enlace: ${reason} (${raw}). Se muestra el panel en vivo.`,
|
|
3423
|
+
incomplete: "se requieren tanto from como to",
|
|
3424
|
+
unzoned: "las horas deben ser ISO 8601 con zona horaria, por ejemplo 2026-10-22T02:00:00Z o +02:00",
|
|
3425
|
+
problem: {
|
|
3426
|
+
unparseable: "Introduce un inicio y un fin.",
|
|
3427
|
+
order: "El inicio debe ser anterior al fin.",
|
|
3428
|
+
tooShort: "El intervalo debe durar al menos un minuto.",
|
|
3429
|
+
tooLong: "El intervalo puede durar como máximo 31 días.",
|
|
3430
|
+
future: "El fin no puede estar en el futuro.",
|
|
3431
|
+
tooEarly: "El inicio queda demasiado lejos en el pasado."
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
},
|
|
3435
|
+
"zh-CN": {
|
|
3436
|
+
range: "时间范围",
|
|
3437
|
+
pause: "暂停",
|
|
3438
|
+
resume: "继续",
|
|
3439
|
+
paused: "已暂停",
|
|
3440
|
+
pausedAt: (time) => `暂停于 ${time}`,
|
|
3441
|
+
actionsLive: "命令仍会发送",
|
|
3442
|
+
absolute: {
|
|
3443
|
+
custom: "自定义范围",
|
|
3444
|
+
from: "开始",
|
|
3445
|
+
to: "结束",
|
|
3446
|
+
apply: "应用",
|
|
3447
|
+
cancel: "取消",
|
|
3448
|
+
zone: (zone, offset) => `时间以 ${zone}(${offset})显示。共享链接使用 UTC。`,
|
|
3449
|
+
fixed: "固定时间窗口",
|
|
3450
|
+
backToLive: "返回实时视图",
|
|
3451
|
+
copyLink: "复制链接",
|
|
3452
|
+
linkCopied: "链接已复制",
|
|
3453
|
+
loadFailed: "无法加载时间范围选择器,请重试。",
|
|
3454
|
+
dismiss: "关闭",
|
|
3455
|
+
ignored: (reason, raw) => `已忽略链接的时间窗口:${reason}(${raw})。当前显示实时仪表板。`,
|
|
3456
|
+
incomplete: "必须同时提供 from 和 to",
|
|
3457
|
+
unzoned: "时间必须使用带时区的 ISO 8601 格式,例如 2026-10-22T02:00:00Z 或 +02:00",
|
|
3458
|
+
problem: {
|
|
3459
|
+
unparseable: "请输入开始和结束时间。",
|
|
3460
|
+
order: "开始时间必须早于结束时间。",
|
|
3461
|
+
tooShort: "时间窗口至少为一分钟。",
|
|
3462
|
+
tooLong: "时间窗口最多为 31 天。",
|
|
3463
|
+
future: "结束时间不能在未来。",
|
|
3464
|
+
tooEarly: "开始时间过早。"
|
|
3465
|
+
}
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
};
|
|
3469
|
+
function timeRangeStrings(locale = viewerLocale3()) {
|
|
3470
|
+
const language = locale?.toLowerCase().split("-")[0];
|
|
3471
|
+
return language === "es" ? TIME_RANGE_STRINGS.es : language === "zh" ? TIME_RANGE_STRINGS["zh-CN"] : TIME_RANGE_STRINGS.en;
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
// src/time-range-bar.tsx
|
|
3475
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3476
|
+
function useBoardTimeRange(defaultSeconds, link = {}) {
|
|
3477
|
+
const [state, setState] = useState6(() => initialTimeRange2(defaultSeconds, link));
|
|
3478
|
+
const lastDefault = useRef3(defaultSeconds);
|
|
3479
|
+
useEffect5(() => {
|
|
3480
|
+
if (lastDefault.current === defaultSeconds) return;
|
|
3481
|
+
lastDefault.current = defaultSeconds;
|
|
3482
|
+
setState((s) => withSpan(s, isValidSpanSeconds2(defaultSeconds) ? defaultSeconds : DEFAULT_TIME_RANGE_SECONDS2));
|
|
3483
|
+
}, [defaultSeconds]);
|
|
3484
|
+
const controls = useMemo6(
|
|
3485
|
+
() => ({
|
|
3486
|
+
// A preset click while a fixed window is showing leaves it: back to live at that span.
|
|
3487
|
+
setSpan: (spanSeconds) => setState((s) => withSpan(leaveAbsolute(s), spanSeconds)),
|
|
3488
|
+
pause: () => setState((s) => pauseRange(s, Date.now())),
|
|
3489
|
+
resume: () => setState((s) => resumeRange(s)),
|
|
3490
|
+
setAbsolute: (fromMs, toMs) => {
|
|
3491
|
+
const made = absoluteRange(fromMs, toMs);
|
|
3492
|
+
if ("problem" in made) return made.problem;
|
|
3493
|
+
setState(made.state);
|
|
3494
|
+
return void 0;
|
|
3495
|
+
}
|
|
3496
|
+
}),
|
|
3497
|
+
[]
|
|
3498
|
+
);
|
|
3499
|
+
return [state, controls];
|
|
3500
|
+
}
|
|
3501
|
+
var absoluteLabels = (labels) => ({ ...timeRangeStrings().absolute, ...labels.absolute });
|
|
3502
|
+
function rejectedLinkNote(rejected, labels = timeRangeStrings()) {
|
|
3299
3503
|
const l = absoluteLabels(labels);
|
|
3300
3504
|
const raw = `from=${rejected.from || "-"} to=${rejected.to || "-"}`;
|
|
3301
3505
|
const reason = rejected.reason === "incomplete" ? l.incomplete : rejected.reason === "unparseable" ? l.unzoned : l.problem[rejected.reason];
|
|
@@ -3313,7 +3517,7 @@ var button = (active) => ({
|
|
|
3313
3517
|
});
|
|
3314
3518
|
function PausedIndicator({
|
|
3315
3519
|
pausedAt,
|
|
3316
|
-
labels =
|
|
3520
|
+
labels = timeRangeStrings()
|
|
3317
3521
|
}) {
|
|
3318
3522
|
const time = pausedAt === void 0 ? void 0 : new Date(pausedAt).toLocaleTimeString();
|
|
3319
3523
|
return /* @__PURE__ */ jsxs8(
|
|
@@ -3337,21 +3541,21 @@ function PausedIndicator({
|
|
|
3337
3541
|
borderRadius: 4
|
|
3338
3542
|
},
|
|
3339
3543
|
children: [
|
|
3340
|
-
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "
|
|
3544
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "⏸" }),
|
|
3341
3545
|
labels.paused,
|
|
3342
3546
|
time ? /* @__PURE__ */ jsx10("span", { style: { fontWeight: 400, textTransform: "none" }, children: ` ${time}` }) : null,
|
|
3343
|
-
/* @__PURE__ */ jsx10("span", { "data-time-range-actions-live": "", style: { fontWeight: 400, textTransform: "none" }, children:
|
|
3547
|
+
/* @__PURE__ */ jsx10("span", { "data-time-range-actions-live": "", style: { fontWeight: 400, textTransform: "none" }, children: `· ${labels.actionsLive}` })
|
|
3344
3548
|
]
|
|
3345
3549
|
}
|
|
3346
3550
|
);
|
|
3347
3551
|
}
|
|
3348
3552
|
function formatAbsoluteRange(a) {
|
|
3349
3553
|
const f = new Intl.DateTimeFormat(void 0, { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", timeZoneName: "short" });
|
|
3350
|
-
return `${f.format(a.fromMs)}
|
|
3554
|
+
return `${f.format(a.fromMs)} – ${f.format(a.toMs)}`;
|
|
3351
3555
|
}
|
|
3352
3556
|
function AbsoluteIndicator({
|
|
3353
3557
|
absolute,
|
|
3354
|
-
labels =
|
|
3558
|
+
labels = timeRangeStrings()
|
|
3355
3559
|
}) {
|
|
3356
3560
|
const l = absoluteLabels(labels);
|
|
3357
3561
|
const utc = absoluteToParams(absolute);
|
|
@@ -3360,7 +3564,7 @@ function AbsoluteIndicator({
|
|
|
3360
3564
|
{
|
|
3361
3565
|
role: "status",
|
|
3362
3566
|
"data-time-range-absolute": "",
|
|
3363
|
-
title: `${utc.from}
|
|
3567
|
+
title: `${utc.from} – ${utc.to} (UTC)`,
|
|
3364
3568
|
style: {
|
|
3365
3569
|
display: "inline-flex",
|
|
3366
3570
|
alignItems: "center",
|
|
@@ -3377,7 +3581,7 @@ function AbsoluteIndicator({
|
|
|
3377
3581
|
children: [
|
|
3378
3582
|
/* @__PURE__ */ jsx10("span", { style: { letterSpacing: 0.4, textTransform: "uppercase" }, children: l.fixed }),
|
|
3379
3583
|
/* @__PURE__ */ jsx10("span", { "data-time-range-window": "", style: { fontWeight: 400 }, children: formatAbsoluteRange(absolute) }),
|
|
3380
|
-
/* @__PURE__ */ jsx10("span", { "data-time-range-actions-live": "", style: { fontWeight: 400 }, children:
|
|
3584
|
+
/* @__PURE__ */ jsx10("span", { "data-time-range-actions-live": "", style: { fontWeight: 400 }, children: `· ${labels.actionsLive}` })
|
|
3381
3585
|
]
|
|
3382
3586
|
}
|
|
3383
3587
|
);
|
|
@@ -3394,7 +3598,7 @@ function absoluteLinkFor(href, a) {
|
|
|
3394
3598
|
function TimeRangeBar({
|
|
3395
3599
|
state,
|
|
3396
3600
|
controls,
|
|
3397
|
-
labels =
|
|
3601
|
+
labels = timeRangeStrings(),
|
|
3398
3602
|
notice
|
|
3399
3603
|
}) {
|
|
3400
3604
|
const abs = state.absolute;
|
|
@@ -3651,7 +3855,7 @@ function BoundDevicesNotice({ title, lines, dismissLabel, onDismiss, retryLabel,
|
|
|
3651
3855
|
);
|
|
3652
3856
|
}
|
|
3653
3857
|
var ECHO_MAX = 48;
|
|
3654
|
-
var echo = (s) => s.length > ECHO_MAX ? `${s.slice(0, ECHO_MAX)}
|
|
3858
|
+
var echo = (s) => s.length > ECHO_MAX ? `${s.slice(0, ECHO_MAX)}…` : s;
|
|
3655
3859
|
function describeBoundDevicesProblems(problems, w) {
|
|
3656
3860
|
const out = [];
|
|
3657
3861
|
for (const i of problems.issues) {
|
|
@@ -3685,13 +3889,13 @@ var OPTION_DOCS = {
|
|
|
3685
3889
|
"thresholds.level": "The severity of this band. The theme decides the colour; normal has none.",
|
|
3686
3890
|
"thresholds.label": "Text shown on the chart line for this threshold. Defaults to its value.",
|
|
3687
3891
|
staleAfterSeconds: "Seconds after which the newest sample is called stale: the value is greyed out and badged. Unset shows the sample age only and never marks the widget stale.",
|
|
3688
|
-
windowSeconds: "Seconds of history the widget covers, back from now. Leave unset to follow the board
|
|
3892
|
+
windowSeconds: "Seconds of history the widget covers, back from now. Leave unset to follow the board’s time range; set it to pin this widget to a fixed span that the viewer’s range picker does not change. 60 to 604800.",
|
|
3689
3893
|
measurement: "Which measurement to display. Defaults to the first the datasource selects.",
|
|
3690
3894
|
flashOnChange: "Briefly tint a value green on a rise and red on a fall when it changes.",
|
|
3691
3895
|
window: "Samples retained across ALL of the widget's measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.",
|
|
3692
3896
|
min: "Value at the empty end of the scale. Required: the widget does not guess a range.",
|
|
3693
3897
|
max: "Value at the full end of the scale. Required, and above min.",
|
|
3694
|
-
text: "The text to show. Rendered as plain text
|
|
3898
|
+
text: "The text to show. Rendered as plain text — markup is never interpreted.",
|
|
3695
3899
|
align: "Horizontal alignment of the text. Default center.",
|
|
3696
3900
|
fontSize: "Text size in pixels at the comfortable density; it scales with the board density. Default 16.",
|
|
3697
3901
|
url: "Source URL of the image.",
|
|
@@ -3712,7 +3916,7 @@ var OPTION_DOCS = {
|
|
|
3712
3916
|
tileUrl: "Raster tile URL template, e.g. https://tiles.example.com/{z}/{x}/{y}.png. Leave empty to inherit the tenant's basemap; setting one overrides it for this board only.",
|
|
3713
3917
|
attribution: "Credit line the tile source requires, shown on the map. Set whatever the provider you chose asks for.",
|
|
3714
3918
|
style: "A plain bar (default) or a thermometer: a vertical tube with a bulb. A thermometer is always vertical.",
|
|
3715
|
-
markAlarms: "Mark this device
|
|
3919
|
+
markAlarms: "Mark this device’s alarms on the chart, from raise to clear.",
|
|
3716
3920
|
markAlarmsScope: "Which alarms to mark: only those about what this chart plots (series, the default for a new chart), or every alarm on the device. An alarm with no known measurement is never marked in series mode; it is listed under the chart as another alarm on the device. A chart saved before this option marks the whole device.",
|
|
3717
3921
|
markCommands: "Mark the commands sent to this device on the chart.",
|
|
3718
3922
|
orientation: "Direction of a bar: horizontal (default) or vertical. Ignored by a thermometer.",
|
|
@@ -3720,9 +3924,9 @@ var OPTION_DOCS = {
|
|
|
3720
3924
|
onAt: "For an on/off signal: the lamp is lit at or above this value and dark below it. Unset keeps the lamp lit while a value is present, coloured by its threshold band.",
|
|
3721
3925
|
parameter: "Which parameter of the command this control sets. May be left blank when the command has exactly one parameter of the right type.",
|
|
3722
3926
|
step: "Distance between values. Defaults to 1 for a whole-number parameter, else a hundredth of the range.",
|
|
3723
|
-
mode: "Slider (default) or stepper:
|
|
3927
|
+
mode: "Slider (default) or stepper: − / + and Send.",
|
|
3724
3928
|
stat: "Which figure to show. Default average.",
|
|
3725
|
-
sparkline: "Draw the measurement
|
|
3929
|
+
sparkline: "Draw the measurement’s trend over the span under the figure. Default off.",
|
|
3726
3930
|
sort: "Order of the categories. Default: as the data source lists them.",
|
|
3727
3931
|
columns: "Heading, unit and precision per measurement column; a column with none shows its name.",
|
|
3728
3932
|
"columns.measurement": "The measurement column this entry applies to.",
|
|
@@ -3784,7 +3988,7 @@ var OPTION_DOC_OVERRIDES = {
|
|
|
3784
3988
|
staleAfterSeconds: "Marks the ring stale once the status of its devices has not been read for longer than this many seconds (it is re-read every 15 seconds, so only reads that keep failing make it stale). Unset, the age is shown and nothing is marked stale."
|
|
3785
3989
|
},
|
|
3786
3990
|
"history-table": {
|
|
3787
|
-
columns: "Which measurements are columns, in order, with a heading, unit and precision each. With none, the columns are the datasource
|
|
3991
|
+
columns: "Which measurements are columns, in order, with a heading, unit and precision each. With none, the columns are the datasource’s measurements (or, when it names none, every measurement the device reported in the range). Every figure is the average of the readings in a time bucket.",
|
|
3788
3992
|
precision: "Decimal places to round displayed averages to, for a column that sets none. Unset rounds to at most 3 decimals (4 significant digits under 1). The CSV export is rounded the same way.",
|
|
3789
3993
|
pageSize: "Rows per page. Default 10. The CSV export holds every row, not just the page.",
|
|
3790
3994
|
staleAfterSeconds: "Marks the table stale once its history has not been read for longer than this many seconds (it is re-read at the end of each time bucket, so only reads that keep failing make it stale). Unset, the age is shown and nothing is marked stale."
|
|
@@ -3796,12 +4000,12 @@ var OPTION_DOC_OVERRIDES = {
|
|
|
3796
4000
|
measurement: "The signal that drives the symbol. A 0/1 signal needs nothing else; a speed or current is read against On at.",
|
|
3797
4001
|
min: "Value of an empty tank. Used by the tank symbol only; set it with Max.",
|
|
3798
4002
|
max: "Value of a full tank. Used by the tank symbol only; set it with Min.",
|
|
3799
|
-
thresholds: "Severity bands over the value. A value in a major or critical band shows the symbol as faulted, in that band
|
|
4003
|
+
thresholds: "Severity bands over the value. A value in a major or critical band shows the symbol as faulted, in that band’s colour; a tank takes its liquid colour from the band it is in."
|
|
3800
4004
|
},
|
|
3801
4005
|
"status-grid": {
|
|
3802
|
-
worstFirst: "Put the devices in the most severe band first (top-left). Off keeps the fleet
|
|
4006
|
+
worstFirst: "Put the devices in the most severe band first (top-left). Off keeps the fleet’s own order.",
|
|
3803
4007
|
measurement: "The measurement each tile shows. Defaults to the first the datasource selects.",
|
|
3804
|
-
thresholds: "Severity bands over the measurement. A tile takes the colour of the band its device
|
|
4008
|
+
thresholds: "Severity bands over the measurement. A tile takes the colour of the band its device’s latest reading is in; a reading outside every band, or in a normal band, keeps the neutral colour. A device with no reading is drawn hollow, never as OK.",
|
|
3805
4009
|
staleAfterSeconds: "Marks the grid stale once its newest reading in the fleet is older than this many seconds. Unset, the age is shown and nothing is marked stale."
|
|
3806
4010
|
},
|
|
3807
4011
|
"state-timeline": {
|
|
@@ -3820,7 +4024,7 @@ var OPTION_DOC_OVERRIDES = {
|
|
|
3820
4024
|
max: "High end of the value axis, above min. Unset, the chart picks. A reading or threshold above it still shows: the axis widens to take it in.",
|
|
3821
4025
|
groupBy: "One line per measurement of one device (the default), or one line per device of a group for the measurement set below. Per device, stored history is drawn as the average of each time bucket (the chart says so), and thresholds are reference lines over it.",
|
|
3822
4026
|
measurement: "The measurement compared across the group. Defaults to the first the datasource selects. Used only with one line per device.",
|
|
3823
|
-
markAlarms: "Mark this device
|
|
4027
|
+
markAlarms: "Mark this device’s alarms on the chart, from raise to clear. Not drawn with one line per device.",
|
|
3824
4028
|
markCommands: "Mark the commands sent to this device on the chart. Not drawn with one line per device."
|
|
3825
4029
|
},
|
|
3826
4030
|
"bar-chart": {
|
|
@@ -3891,7 +4095,10 @@ var WIDGET_BINDS_DATASOURCE = Object.freeze(
|
|
|
3891
4095
|
);
|
|
3892
4096
|
|
|
3893
4097
|
// src/index.ts
|
|
3894
|
-
import {
|
|
4098
|
+
import {
|
|
4099
|
+
pickSample as pickSample4,
|
|
4100
|
+
optBoolean as optBoolean3
|
|
4101
|
+
} from "@devicechain/widget-sdk";
|
|
3895
4102
|
|
|
3896
4103
|
// src/options.ts
|
|
3897
4104
|
import {
|