@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.
Files changed (113) hide show
  1. package/README.md +14 -1
  2. package/dist/access-strings.d.ts +1 -1
  3. package/dist/aggregate-strings.d.ts +3 -1
  4. package/dist/alarm-strings.d.ts +4 -1
  5. package/dist/chunks/{aggregate-feed-HCF5FYIJ.js → aggregate-feed-QJRO7Y4V.js} +7 -4
  6. package/dist/chunks/aggregate-feed-QJRO7Y4V.js.map +7 -0
  7. package/dist/chunks/{aggregate-widgets-IFZUFYXV.js → aggregate-widgets-SHPHUHNL.js} +39 -62
  8. package/dist/chunks/aggregate-widgets-SHPHUHNL.js.map +7 -0
  9. package/dist/chunks/{alarm-widgets-TTQYBKMZ.js → alarm-widgets-DQEITFVN.js} +2 -2
  10. package/dist/chunks/alarm-widgets-DQEITFVN.js.map +7 -0
  11. package/dist/chunks/{chunk-FM7OI5TQ.js → chunk-2GMBZTQD.js} +44 -5
  12. package/dist/chunks/chunk-2GMBZTQD.js.map +7 -0
  13. package/dist/chunks/{chunk-AF4M5OXQ.js → chunk-4BEFYYM3.js} +3 -3
  14. package/dist/chunks/chunk-5UDZ5R5F.js +60 -0
  15. package/dist/chunks/chunk-5UDZ5R5F.js.map +7 -0
  16. package/dist/chunks/{chunk-VTGKDO44.js → chunk-7TEFJ64H.js} +19 -5
  17. package/dist/chunks/chunk-7TEFJ64H.js.map +7 -0
  18. package/dist/chunks/{chunk-GUCEPNGM.js → chunk-EFTUK5YX.js} +1 -1
  19. package/dist/chunks/chunk-EFTUK5YX.js.map +7 -0
  20. package/dist/chunks/{chunk-EQOWBDS7.js → chunk-G5UBMPMX.js} +2 -2
  21. package/dist/chunks/{chunk-EQOWBDS7.js.map → chunk-G5UBMPMX.js.map} +2 -2
  22. package/dist/chunks/{chunk-RG2AYYKO.js → chunk-GWH5AHG3.js} +6 -4
  23. package/dist/chunks/chunk-GWH5AHG3.js.map +7 -0
  24. package/dist/chunks/{chunk-XJ7UF2CP.js → chunk-O763YMOG.js} +1 -1
  25. package/dist/chunks/chunk-O763YMOG.js.map +7 -0
  26. package/dist/chunks/{chunk-ZX4K3GT5.js → chunk-R2XEYQEJ.js} +45 -24
  27. package/dist/chunks/chunk-R2XEYQEJ.js.map +7 -0
  28. package/dist/chunks/{chunk-JVC6JYUR.js → chunk-RLVZXNPJ.js} +1 -1
  29. package/dist/chunks/{chunk-JVC6JYUR.js.map → chunk-RLVZXNPJ.js.map} +1 -1
  30. package/dist/chunks/{chunk-QHTO5ZEM.js → chunk-UDQVBVXJ.js} +1 -1
  31. package/dist/chunks/chunk-UDQVBVXJ.js.map +7 -0
  32. package/dist/chunks/chunk-UVLEBGAC.js +17 -0
  33. package/dist/chunks/chunk-UVLEBGAC.js.map +7 -0
  34. package/dist/chunks/chunk-VR6643C7.js +119 -0
  35. package/dist/chunks/chunk-VR6643C7.js.map +7 -0
  36. package/dist/chunks/{chunk-ZR74ORIT.js → chunk-XDHKONWK.js} +1 -1
  37. package/dist/chunks/chunk-XDHKONWK.js.map +7 -0
  38. package/dist/chunks/{chunk-3FSXS67N.js → chunk-ZKR5WDF5.js} +68 -18
  39. package/dist/chunks/chunk-ZKR5WDF5.js.map +7 -0
  40. package/dist/chunks/{compare-feed-MLHG7YFN.js → compare-feed-K46QVE5D.js} +28 -16
  41. package/dist/chunks/compare-feed-K46QVE5D.js.map +7 -0
  42. package/dist/chunks/{control-widgets-KTH6BWMH.js → control-widgets-VMWBTRC6.js} +70 -34
  43. package/dist/chunks/control-widgets-VMWBTRC6.js.map +7 -0
  44. package/dist/chunks/entity-selector-IRUFUDQ6.js +7 -0
  45. package/dist/chunks/{event-markers-feed-BQO4T367.js → event-markers-feed-TOAQ53YC.js} +29 -11
  46. package/dist/chunks/event-markers-feed-TOAQ53YC.js.map +7 -0
  47. package/dist/chunks/{export-rows-OEWIBIUY.js → export-rows-XKIVLOM3.js} +3 -3
  48. package/dist/chunks/{fleet-feed-AKJ7QIMP.js → fleet-feed-AYNL3CC2.js} +6 -6
  49. package/dist/chunks/{history-widgets-7GNKTE5X.js → history-widgets-WJ4KRTG7.js} +55 -20
  50. package/dist/chunks/history-widgets-WJ4KRTG7.js.map +7 -0
  51. package/dist/chunks/{level-widgets-DKCQT2XF.js → level-widgets-3SRESJYW.js} +46 -14
  52. package/dist/chunks/level-widgets-3SRESJYW.js.map +7 -0
  53. package/dist/chunks/{natural-earth-data-VMKQ6LY3.js → natural-earth-data-R7NPQARR.js} +1 -1
  54. package/dist/chunks/natural-earth-data-R7NPQARR.js.map +7 -0
  55. package/dist/chunks/{no-reading-B4MPXAS2.js → no-reading-CTQCMNYA.js} +4 -4
  56. package/dist/chunks/{presence-widgets-7OGANOLB.js → presence-widgets-P2H3A2SD.js} +34 -16
  57. package/dist/chunks/presence-widgets-P2H3A2SD.js.map +7 -0
  58. package/dist/chunks/table-HAKFOUMS.js +8 -0
  59. package/dist/command-control-strings.d.ts +1 -1
  60. package/dist/compare-strings.d.ts +1 -1
  61. package/dist/event-markers-strings.d.ts +1 -1
  62. package/dist/fleet-strings.d.ts +1 -1
  63. package/dist/history-strings.d.ts +1 -1
  64. package/dist/host-context.js +1 -1
  65. package/dist/index.d.ts +112 -4
  66. package/dist/index.js +338 -131
  67. package/dist/index.js.map +4 -4
  68. package/dist/level-strings.d.ts +1 -1
  69. package/dist/presence-strings.d.ts +1 -1
  70. package/dist/registry.d.ts +2 -0
  71. package/dist/scada-strings.d.ts +1 -1
  72. package/dist/selection-strings.d.ts +10 -0
  73. package/dist/shared-strings.d.ts +38 -0
  74. package/dist/state-timeline-strings.d.ts +1 -1
  75. package/dist/status-grid-strings.d.ts +1 -1
  76. package/dist/table-strings.d.ts +1 -1
  77. package/dist/time-range-bar.d.ts +1 -2
  78. package/dist/time-range-strings.d.ts +8 -0
  79. package/dist/vite.js.map +1 -1
  80. package/dist/widgets/command-status.d.ts +1 -0
  81. package/dist/widgets/map-geometry.d.ts +2 -0
  82. package/package.json +8 -8
  83. package/dist/chunks/aggregate-feed-HCF5FYIJ.js.map +0 -7
  84. package/dist/chunks/aggregate-widgets-IFZUFYXV.js.map +0 -7
  85. package/dist/chunks/alarm-widgets-TTQYBKMZ.js.map +0 -7
  86. package/dist/chunks/chunk-3FSXS67N.js.map +0 -7
  87. package/dist/chunks/chunk-BRH66T5F.js +0 -15
  88. package/dist/chunks/chunk-BRH66T5F.js.map +0 -7
  89. package/dist/chunks/chunk-FM7OI5TQ.js.map +0 -7
  90. package/dist/chunks/chunk-GUCEPNGM.js.map +0 -7
  91. package/dist/chunks/chunk-QHTO5ZEM.js.map +0 -7
  92. package/dist/chunks/chunk-QMGKB6J3.js +0 -84
  93. package/dist/chunks/chunk-QMGKB6J3.js.map +0 -7
  94. package/dist/chunks/chunk-RG2AYYKO.js.map +0 -7
  95. package/dist/chunks/chunk-VTGKDO44.js.map +0 -7
  96. package/dist/chunks/chunk-XJ7UF2CP.js.map +0 -7
  97. package/dist/chunks/chunk-ZR74ORIT.js.map +0 -7
  98. package/dist/chunks/chunk-ZX4K3GT5.js.map +0 -7
  99. package/dist/chunks/compare-feed-MLHG7YFN.js.map +0 -7
  100. package/dist/chunks/control-widgets-KTH6BWMH.js.map +0 -7
  101. package/dist/chunks/entity-selector-3JJFI4DT.js +0 -7
  102. package/dist/chunks/event-markers-feed-BQO4T367.js.map +0 -7
  103. package/dist/chunks/history-widgets-7GNKTE5X.js.map +0 -7
  104. package/dist/chunks/level-widgets-DKCQT2XF.js.map +0 -7
  105. package/dist/chunks/natural-earth-data-VMKQ6LY3.js.map +0 -7
  106. package/dist/chunks/presence-widgets-7OGANOLB.js.map +0 -7
  107. package/dist/chunks/table-2UGM2Q4H.js +0 -8
  108. /package/dist/chunks/{chunk-AF4M5OXQ.js.map → chunk-4BEFYYM3.js.map} +0 -0
  109. /package/dist/chunks/{entity-selector-3JJFI4DT.js.map → entity-selector-IRUFUDQ6.js.map} +0 -0
  110. /package/dist/chunks/{export-rows-OEWIBIUY.js.map → export-rows-XKIVLOM3.js.map} +0 -0
  111. /package/dist/chunks/{fleet-feed-AKJ7QIMP.js.map → fleet-feed-AYNL3CC2.js.map} +0 -0
  112. /package/dist/chunks/{no-reading-B4MPXAS2.js.map → no-reading-CTQCMNYA.js.map} +0 -0
  113. /package/dist/chunks/{table-2UGM2Q4H.js.map → table-HAKFOUMS.js.map} +0 -0
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  measurementSpan
3
- } from "./chunk-GUCEPNGM.js";
3
+ } from "./chunk-EFTUK5YX.js";
4
4
  import {
5
5
  fleetStrings
6
- } from "./chunk-QMGKB6J3.js";
7
- import "./chunk-BRH66T5F.js";
6
+ } from "./chunk-VR6643C7.js";
7
+ import "./chunk-UVLEBGAC.js";
8
8
  import {
9
9
  Explained
10
- } from "./chunk-AF4M5OXQ.js";
11
- import "./chunk-JVC6JYUR.js";
10
+ } from "./chunk-4BEFYYM3.js";
11
+ import "./chunk-RLVZXNPJ.js";
12
12
  import {
13
13
  LevelEmpty
14
- } from "./chunk-EQOWBDS7.js";
14
+ } from "./chunk-G5UBMPMX.js";
15
15
  import {
16
16
  samplesExport
17
- } from "./chunk-VTGKDO44.js";
18
- import "./chunk-XJ7UF2CP.js";
17
+ } from "./chunk-7TEFJ64H.js";
18
+ import "./chunk-O763YMOG.js";
19
19
  import {
20
20
  seedWindow
21
21
  } from "./chunk-62CHYCHI.js";
@@ -114,25 +114,37 @@ var COMPARE_STRINGS = {
114
114
  bucketed: (bucket) => `avg per ${bucket}`,
115
115
  bucketedTitle: (bucket) => `Stored history is drawn as the average of each ${bucket} bucket, one point per bucket; readings that arrived live since are drawn as they came, unaveraged.`,
116
116
  thresholdNote: "Thresholds are reference lines; a plotted history point is a bucket average, not a reading.",
117
- historyFailed: (n) => n === 1 ? "1 device\u2019s history could not be read; its line starts from live readings." : `${n} devices\u2019 history could not be read; their lines start from live readings.`,
117
+ historyFailed: (n) => n === 1 ? "1 device’s history could not be read; its line starts from live readings." : `${n} devices’ history could not be read; their lines start from live readings.`,
118
118
  cappedShort: (shown, total) => `${shown} of ${total} devices`,
119
119
  thresholdShort: "thresholds are references",
120
120
  historyFailedShort: (n) => `${n} unread`
121
121
  },
122
122
  es: {
123
- capped: (shown, total) => `Mostrando ${shown} de ${total} dispositivos (los primeros ${shown}); aumente M\xE1ximo de l\xEDneas, hasta 12, para ver m\xE1s.`,
124
- cappedPage: (shown, read, total) => `Mostrando ${shown} de ${total} dispositivos: el grupo es mayor que los ${read} dispositivos le\xEDdos, y se dibujan los primeros ${shown}.`,
123
+ capped: (shown, total) => `Mostrando ${shown} de ${total} dispositivos (los primeros ${shown}); aumente Máximo de líneas, hasta 12, para ver más.`,
124
+ cappedPage: (shown, read, total) => `Mostrando ${shown} de ${total} dispositivos: el grupo es mayor que los ${read} dispositivos leídos, y se dibujan los primeros ${shown}.`,
125
125
  bucketed: (bucket) => `prom. por ${bucket}`,
126
126
  bucketedTitle: (bucket) => `El historial almacenado se dibuja como el promedio de cada intervalo de ${bucket}, un punto por intervalo; las lecturas llegadas en vivo desde entonces se dibujan tal cual, sin promediar.`,
127
- thresholdNote: "Los umbrales son l\xEDneas de referencia; un punto de historial es un promedio por intervalo, no una lectura.",
128
- historyFailed: (n) => n === 1 ? "No se pudo leer el historial de 1 dispositivo; su l\xEDnea parte de lecturas en vivo." : `No se pudo leer el historial de ${n} dispositivos; sus l\xEDneas parten de lecturas en vivo.`,
127
+ thresholdNote: "Los umbrales son líneas de referencia; un punto de historial es un promedio por intervalo, no una lectura.",
128
+ historyFailed: (n) => n === 1 ? "No se pudo leer el historial de 1 dispositivo; su línea parte de lecturas en vivo." : `No se pudo leer el historial de ${n} dispositivos; sus líneas parten de lecturas en vivo.`,
129
129
  cappedShort: (shown, total) => `${shown} de ${total} dispositivos`,
130
130
  thresholdShort: "umbrales son referencias",
131
131
  historyFailedShort: (n) => `${n} sin leer`
132
+ },
133
+ "zh-CN": {
134
+ capped: (shown, total) => `显示 ${total} 台设备中的前 ${shown} 台;提高“最多曲线数”(最多 12 条)可查看更多。`,
135
+ cappedPage: (shown, read, total) => `显示 ${total} 台设备中的 ${shown} 台:此组的设备数超过已读取的 ${read} 台,仅绘制前 ${shown} 台。`,
136
+ bucketed: (bucket) => `每 ${bucket} 的平均值`,
137
+ bucketedTitle: (bucket) => `已存储的历史记录按每 ${bucket} 时间桶的平均值绘制,每桶一个点;此后实时到达的读数按原值绘制,不取平均。`,
138
+ thresholdNote: "阈值为参考线;历史数据点是时间桶的平均值,而非单次读数。",
139
+ historyFailed: (n) => `${n} 台设备的历史记录无法读取;其曲线从实时读数开始。`,
140
+ cappedShort: (shown, total) => `${total} 台中的 ${shown} 台`,
141
+ thresholdShort: "阈值仅供参考",
142
+ historyFailedShort: (n) => `${n} 台未读取`
132
143
  }
133
144
  };
134
145
  function compareStrings(locale = viewerLocale()) {
135
- return locale?.toLowerCase().split("-")[0] === "es" ? COMPARE_STRINGS.es : COMPARE_STRINGS.en;
146
+ const language = locale?.toLowerCase().split("-")[0];
147
+ return language === "es" ? COMPARE_STRINGS.es : language === "zh" ? COMPARE_STRINGS["zh-CN"] : COMPARE_STRINGS.en;
136
148
  }
137
149
 
138
150
  // src/compare-feed.tsx
@@ -357,7 +369,7 @@ function CompareBody({
357
369
  /* @__PURE__ */ jsx("div", { style: { position: "relative", flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx(EChart, { option }) }),
358
370
  compact ? /* @__PURE__ */ jsxs("div", { "data-compare-notes": facts.length > 0 ? "" : void 0, "data-compare-compact": "", title: facts.map((f) => f.full).join(" "), style: noteStyle, children: [
359
371
  badge,
360
- facts.map((f) => ` \xB7 ${f.short}`).join("")
372
+ facts.map((f) => ` · ${f.short}`).join("")
361
373
  ] }) : /* @__PURE__ */ jsxs("div", { "data-compare-notes": facts.length > 0 ? "" : void 0, title: facts.length > 0 ? facts.map((f) => f.full).join(" ") : void 0, style: noteStyle, children: [
362
374
  /* @__PURE__ */ jsx("div", { children: badge }),
363
375
  facts.map((f) => /* @__PURE__ */ jsx("div", { children: f.full }, f.full))
@@ -368,4 +380,4 @@ export {
368
380
  FLUSH_MS,
369
381
  CompareFeed as default
370
382
  };
371
- //# sourceMappingURL=compare-feed-MLHG7YFN.js.map
383
+ //# sourceMappingURL=compare-feed-K46QVE5D.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/compare-feed.tsx", "../../src/compare-model.ts", "../../src/compare-strings.ts"],
4
+ "sourcesContent": ["// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The multi-device compare chart: ONE measurement, a line per member of a group, over the board's\n// span. Its own lazy chunk, loaded from the fleet feed's entry only when a time-series chart is set\n// to one line per device -- a board without one never downloads it.\n//\n// - ONE live subscription (hub.subscribeMembers), then one history read per DRAWN member through\n// hub.readMemberSeeds: bounded hub-wide (MEMBER_SEED_CONCURRENCY) and shared with any widget\n// asking the same question. There is no batched history read in the platform (the store\n// aggregates one device at a time), so the cost of the chart is the number of lines it draws --\n// which is why that number is capped (`maxSeries`) and the cap is said on the chart.\n// - A history read is the measurement alone (the store narrows by name), over the board's span (or\n// the chart's pinned one) ending at the last minute boundary, in buckets of bucketSecondsFor(span):\n// one point per bucket, the bucket's AVERAGE. The chart says so (the badge), and says that\n// threshold lines are references, never a reading of a bucket.\n// - Live readings extend each line past the history's end. While the board is paused the view is\n// cut at the freeze instant; the buffer keeps filling and the chart catches up on resume.\n// - A member stream that resumes after an interruption re-reads the histories, at once and again\n// just after the next minute boundary (as the fleet feed does).\n//\n// Rebuilding the state per sample would re-render the chart hundreds of times a second, so changes\n// are folded into a store and flushed at most once per FLUSH_MS.\n\nimport {\n DEFAULT_TIME_RANGE_SECONDS,\n spanLabel,\n type MemberRoster,\n type MeasurementSample,\n type WidgetDataSource,\n type WidgetDescriptor,\n type WidgetInstance,\n} from '@devicechain/dashboards';\nimport {\n css,\n fontVar,\n optNumber,\n optString,\n optThresholds,\n resolveStaleAfterSeconds,\n spaceVar,\n useWidgetScale,\n useWidgetTimeRange,\n WidgetFrame,\n WidgetFreshnessProvider,\n} from '@devicechain/widget-sdk';\nimport { buildLineOption, EChart, useChartTheme } from '@devicechain/widget-sdk/echarts';\nimport { useEffect, useMemo, useReducer, useRef, useState, type ComponentType } from 'react';\n\nimport { measurementSpan } from './binding-policy';\nimport { bucketSamples, capMembers, composeSeries, memberLabels, pushLive, seriesLimit, type CappedMembers, type MemberHistory } from './compare-model';\nimport { compareStrings } from './compare-strings';\nimport { seedWindow } from './fleet-model';\nimport { fleetStrings } from './fleet-strings';\nimport { samplesExport } from './export-rows';\nimport { LevelEmpty } from './level-readout';\nimport { Explained } from './no-reading';\n\nexport const FLUSH_MS = 250;\nconst MINUTE_MS = 60_000;\n// How long past a minute boundary the second re-read after an interruption waits (the fleet feed's).\nconst RESEED_SETTLE_MS = 2_000;\n// A reading ages out of the span with no event to say so.\nconst AGE_OUT_MS = 30_000;\n// Below this width or height (px) the notes under the chart are said in a line.\nconst COMPACT_WIDTH = 320;\nconst COMPACT_HEIGHT = 200;\n\ninterface Store {\n key: string | null;\n roster: MemberRoster | null;\n live: Map<string, MeasurementSample[]>;\n history: Map<string, MemberHistory | 'failed'>;\n forbidden: boolean;\n error: unknown | null;\n}\n\nconst emptyStore = (key: string | null): Store => ({ key, roster: null, live: new Map(), history: new Map(), forbidden: false, error: null });\n\nexport interface CompareFeedProps {\n hub: WidgetDataSource;\n widget: WidgetInstance;\n descriptor: WidgetDescriptor;\n ErrorFrame: ComponentType<{ widget: WidgetInstance; error: unknown }>;\n}\n\nexport default function CompareFeed({ hub, widget, descriptor, ErrorFrame }: CompareFeedProps) {\n const range = useWidgetTimeRange();\n const now = useMemo(() => (hub.now ? () => hub.now!() : Date.now), [hub]);\n const spanSeconds = measurementSpan(descriptor, widget, range?.spanSeconds) ?? range?.spanSeconds ?? DEFAULT_TIME_RANGE_SECONDS;\n const pausedAt = range?.paused ? range.pausedAt : undefined;\n const measurement = optString(widget.options, 'measurement') ?? widget.datasource?.measurements[0];\n const limit = seriesLimit(optNumber(widget.options, 'maxSeries'));\n // The datasource the live feed is asked for: the one measurement, so the hub delivers no other.\n const ds = widget.datasource && measurement ? { ...widget.datasource, measurements: [measurement] } : undefined;\n const dsKey = JSON.stringify(ds ?? null);\n const supported = hub.subscribeMembers !== undefined && hub.readMemberSeeds !== undefined;\n\n const store = useRef<Store>(emptyStore(dsKey));\n const [version, bump] = useReducer((n: number) => n + 1, 0);\n const [rosterKey, setRosterKey] = useState<string | null>(null);\n const generation = useRef(0);\n const flushTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const boundaryTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const [resumes, resumed] = useReducer((n: number) => n + 1, 0);\n // The tokens drawn, which the live feed filters by.\n const drawn = useRef<Set<string>>(new Set());\n\n const schedule = (): void => {\n if (flushTimer.current !== undefined) return;\n flushTimer.current = setTimeout(() => {\n flushTimer.current = undefined;\n bump();\n }, FLUSH_MS);\n };\n\n useEffect(() => {\n const s = emptyStore(dsKey);\n store.current = s;\n drawn.current = new Set();\n setRosterKey(null);\n bump();\n const gen = ++generation.current;\n if (!ds || !supported) return;\n const dispose = hub.subscribeMembers!(ds, {\n roster: (roster) => {\n s.roster = roster;\n drawn.current = new Set(capMembers(roster, limit).shown.map((m) => m.token));\n setRosterKey(`${gen}\\n${[...drawn.current].join('\\n')}`);\n schedule();\n },\n next: (sample) => {\n if (!drawn.current.has(sample.deviceToken)) return;\n let buffer = s.live.get(sample.deviceToken);\n if (!buffer) s.live.set(sample.deviceToken, (buffer = []));\n pushLive(buffer, sample);\n schedule();\n },\n forbidden: () => {\n s.forbidden = true;\n schedule();\n },\n error: (err) => {\n s.error = err;\n schedule();\n },\n reconnected: () => {\n resumed();\n if (boundaryTimer.current !== undefined) return;\n const at = now();\n boundaryTimer.current = setTimeout(() => {\n boundaryTimer.current = undefined;\n resumed();\n }, MINUTE_MS - (at % MINUTE_MS) + RESEED_SETTLE_MS);\n },\n });\n return () => {\n dispose();\n if (flushTimer.current !== undefined) clearTimeout(flushTimer.current);\n flushTimer.current = undefined;\n if (boundaryTimer.current !== undefined) clearTimeout(boundaryTimer.current);\n boundaryTimer.current = undefined;\n };\n // `ds` is read through `dsKey` (value identity); a new limit re-draws from the same roster below.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hub, dsKey, supported, limit]);\n\n // One history read per drawn member, again when the span or the freeze instant changes.\n useEffect(() => {\n const s = store.current;\n if (!supported || !s.roster || rosterKey === null || !measurement) return;\n const tokens = capMembers(s.roster, limit).shown.map((m) => m.token);\n if (tokens.length === 0) return;\n const window = seedWindow(spanSeconds, pausedAt ?? now());\n const end = Date.parse(window.endTime);\n let cancelled = false;\n void hub.readMemberSeeds!(\n tokens,\n {\n // The plan reads the one measurement over the span and keeps its buckets; the seed it returns\n // is empty because this chart draws the history itself, not a \"latest\" cell.\n seed: async (token, read) => {\n const buckets = await read({ startTime: window.startTime, endTime: window.endTime, intervalSeconds: window.intervalSeconds, name: measurement });\n // A read this effect no longer wants (the span, the freeze instant or the roster moved on\n // while it was in flight) must not overwrite the newer one's history when it lands last.\n if (!cancelled) s.history.set(token, { samples: bucketSamples(token, measurement, buckets, window.intervalSeconds), end });\n return { latest: {}, observed: [] };\n },\n },\n (token, seed, failure) => {\n if (cancelled) return;\n if (failure === 'forbidden') s.forbidden = true;\n // A re-read that failed keeps the history it would have replaced: those points are still true.\n else if (!seed && !s.history.has(token)) s.history.set(token, 'failed');\n schedule();\n },\n () => cancelled,\n );\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hub, supported, dsKey, rosterKey, spanSeconds, pausedAt, limit, resumes]);\n\n // A reading ages out of the span with no event to say so.\n useEffect(() => {\n if (pausedAt !== undefined) return;\n const id = setInterval(bump, AGE_OUT_MS);\n return () => clearInterval(id);\n }, [pausedAt]);\n\n const view = useMemo(() => {\n const s = store.current.key === dsKey ? store.current : emptyStore(dsKey);\n const capped = s.roster ? capMembers(s.roster, limit) : undefined;\n const labels = capped ? memberLabels(capped.shown) : new Map<string, string>();\n const until = pausedAt ?? now();\n const composed =\n capped && measurement\n ? composeSeries({ shown: capped.shown, labels, measurement, history: s.history, live: s.live, since: until - spanSeconds * 1000, until })\n : undefined;\n return { s, capped, labels, composed };\n // `version` is the store's change counter; the store itself is mutable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [version, dsKey, limit, spanSeconds, pausedAt, now, measurement]);\n\n const { s, capped, labels, composed } = view;\n const freshness = useMemo(\n () => (descriptor.freshness === true ? { at: composed?.newest, staleAfterSeconds: resolveStaleAfterSeconds(widget.options) } : undefined),\n [descriptor, widget.options, composed?.newest],\n );\n if (s.error) return <ErrorFrame widget={widget} error={s.error} />;\n\n const title = optString(widget.options, 'title');\n const strings = fleetStrings();\n const empty = (message: string, kind?: 'unbound' | 'forbidden') => (\n <WidgetFrame title={title}>\n {kind ? <Explained kind={kind} message={message} /> : <LevelEmpty message={message} />}\n </WidgetFrame>\n );\n if (!measurement) return empty(strings.noMeasurement);\n if (!supported) return empty(strings.unsupported);\n if (s.forbidden) return empty(strings.forbidden, 'forbidden');\n if (ds?.kind === 'unbound') return empty(strings.unbound, 'unbound');\n if (!capped) return empty(strings.loading);\n if (capped.shown.length === 0) return empty(strings.noMembers);\n\n return (\n <WidgetFreshnessProvider freshness={freshness}>\n <WidgetFrame\n title={title}\n flush\n exportRows={() =>\n samplesExport({\n subject: title ?? measurement,\n samples: composed?.samples ?? [],\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n seriesIs: 'device',\n spanSeconds,\n })\n }\n >\n <CompareBody\n widget={widget}\n names={capped.shown.map((m) => labels.get(m.token) ?? m.token)}\n samples={composed?.samples ?? []}\n bucketSeconds={seedWindow(spanSeconds, pausedAt ?? now()).intervalSeconds}\n capped={capped}\n historyFailed={composed?.historyFailed ?? 0}\n />\n </WidgetFrame>\n </WidgetFreshnessProvider>\n );\n}\n\nfunction CompareBody({\n widget,\n names,\n samples,\n bucketSeconds,\n capped,\n historyFailed,\n}: {\n widget: WidgetInstance;\n names: string[];\n samples: MeasurementSample[];\n bucketSeconds: number;\n capped: CappedMembers;\n historyFailed: number;\n}) {\n const theme = useChartTheme();\n const { size, scale } = useWidgetScale();\n const strings = compareStrings();\n const unit = optString(widget.options, 'unit');\n const precision = optNumber(widget.options, 'precision');\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const min = optNumber(widget.options, 'min');\n const max = optNumber(widget.options, 'max');\n const namesKey = names.join('\\n');\n const option = useMemo(\n () => buildLineOption(samples, theme, { measurements: names, unit, precision, thresholds, scale, min, max }, size),\n // `names` is read through `namesKey` (value identity): the array is rebuilt on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [samples, theme, namesKey, unit, precision, thresholds, scale, size, min, max],\n );\n const bucket = spanLabel(bucketSeconds);\n // The sentences, or (in a box too narrow for them: the widget's smallest span is 4 cells) the same\n // facts in a line, with the sentences in its title. Nothing is dropped, only shortened.\n const compact = (size.width > 0 && size.width < COMPACT_WIDTH) || (size.height > 0 && size.height < COMPACT_HEIGHT);\n const facts: Array<{ full: string; short: string }> = [];\n if (capped.capped) {\n const full = capped.pagedBySource ? strings.cappedPage(capped.shown.length, capped.read, capped.total) : strings.capped(capped.shown.length, capped.total);\n facts.push({ full, short: strings.cappedShort(capped.shown.length, capped.total) });\n }\n if (historyFailed > 0) facts.push({ full: strings.historyFailed(historyFailed), short: strings.historyFailedShort(historyFailed) });\n if (thresholds.length > 0) facts.push({ full: strings.thresholdNote, short: strings.thresholdShort });\n const badge = (\n <span\n data-compare-bucket={bucket}\n title={strings.bucketedTitle(bucket)}\n style={{\n padding: `0 ${spaceVar(1)}`,\n fontSize: fontVar('xs'),\n whiteSpace: 'nowrap',\n color: css('muted-foreground'),\n background: css('muted'),\n borderRadius: 4,\n }}\n >\n {strings.bucketed(bucket)}\n </span>\n );\n const noteStyle = { flexShrink: 0, padding: `${spaceVar(1)} ${spaceVar(2)}`, fontSize: fontVar('xs'), color: css('muted-foreground') } as const;\n return (\n <div style={{ display: 'flex', flexDirection: 'column', width: '100%', height: '100%' }} data-compare-chart=\"\">\n <div style={{ position: 'relative', flex: 1, minHeight: 0 }}>\n <EChart option={option} />\n </div>\n {/* Under the chart, never over it: a corner of the plot is where the legend runs once it fills\n the width (five devices on a phone) and where a threshold's label sits, and the badge\n covered both. */}\n {compact ? (\n <div data-compare-notes={facts.length > 0 ? '' : undefined} data-compare-compact=\"\" title={facts.map((f) => f.full).join(' ')} style={noteStyle}>\n {badge}\n {facts.map((f) => ` · ${f.short}`).join('')}\n </div>\n ) : (\n <div data-compare-notes={facts.length > 0 ? '' : undefined} title={facts.length > 0 ? facts.map((f) => f.full).join(' ') : undefined} style={noteStyle}>\n <div>{badge}</div>\n {facts.map((f) => (\n <div key={f.full}>{f.full}</div>\n ))}\n </div>\n )}\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The multi-device compare chart's state, decided apart from the drawing and from the hub: which\n// members get a line, what each line is called, and which readings make it up. Pure, so each rule\n// is a test.\n//\n// A line is one member's readings of ONE measurement over the span: its stored history (one point\n// per bucket, the bucket's AVERAGE) followed by the readings that arrived live after the history\n// was read (raw). Everything is keyed by device; nothing here looks a value up by name alone.\n\nimport type { MeasurementBucket, MeasurementSample, MemberRef } from '@devicechain/dashboards';\n\n// The lines drawn when the author sets no limit: the chart palette's width, so no two lines share\n// a colour. The most an author may ask for: a comparison past this is a table, not a chart.\nexport const DEFAULT_MAX_SERIES = 5;\nexport const MAX_SERIES_LIMIT = 12;\n\n// Live readings kept per member. A comparison is a few lines over a span; this bounds the memory of\n// a chatty device (a reading a second over a week) without touching the stored history, which is\n// already bucketed to at most a couple of hundred points.\nexport const LIVE_PER_MEMBER = 600;\n\n// The limit as the author set it, held to what the chart supports. Unset, or anything that is not a\n// whole number of at least one, is the default: a typo must not turn into a different chart.\nexport function seriesLimit(value: number | undefined): number {\n if (value === undefined || !Number.isInteger(value) || value < 1) return DEFAULT_MAX_SERIES;\n return Math.min(value, MAX_SERIES_LIMIT);\n}\n\nexport interface CappedMembers {\n shown: MemberRef[];\n // The size of the group, as the source reports it. Never less than the members read.\n total: number;\n // True when lines were left out, for either reason: the author's limit, or a group larger than\n // the page the source read (shown + not drawn < total).\n capped: boolean;\n // True when the source itself read less than the group: the total is then the group's size and\n // `read` the members it listed.\n pagedBySource: boolean;\n read: number;\n}\n\n// The first `limit` members of the roster, in the roster's order (a stable order, so a line keeps\n// its colour as readings arrive). Which members are left out is the roster's, not the readings':\n// choosing \"the busiest\" would reshuffle the chart as data moves.\nexport function capMembers(roster: { members: readonly MemberRef[]; total: number }, limit: number): CappedMembers {\n const read = roster.members.length;\n const total = Math.max(roster.total, read);\n const shown = roster.members.slice(0, limit);\n return { shown, total, capped: shown.length < total, pagedBySource: total > read, read };\n}\n\n// A name per member: its device name, else its token. Two members with the same name get their\n// token appended, so two lines never carry one legend entry.\nexport function memberLabels(members: readonly MemberRef[]): Map<string, string> {\n const base = members.map((m) => m.name?.trim() || m.token);\n const count = new Map<string, number>();\n for (const b of base) count.set(b, (count.get(b) ?? 0) + 1);\n const labels = new Map<string, string>();\n members.forEach((m, i) => labels.set(m.token, (count.get(base[i]) ?? 0) > 1 && base[i] !== m.token ? `${base[i]} (${m.token})` : base[i]));\n return labels;\n}\n\n// One member's stored history as samples: a point per bucket that has an average, stamped at the\n// bucket's start, oldest first. A bucket with no readings has no average and no point.\nexport function bucketSamples(token: string, measurement: string, buckets: readonly MeasurementBucket[], bucketSeconds?: number): MeasurementSample[] {\n return buckets\n .filter((b) => b.name === measurement && b.avg != null)\n .map((b) => ({\n id: `cmp-${token}-${b.name}-${b.bucketStart}`,\n deviceToken: token,\n eventType: 0,\n occurredTime: b.bucketStart,\n name: b.name,\n value: b.avg,\n classifier: null,\n // A stored point is a bucket's average, and says how wide the bucket was (the export tells it from a reading).\n ...(bucketSeconds !== undefined ? { bucketSeconds } : {}),\n }))\n .sort((a, b) => Date.parse(a.occurredTime as string) - Date.parse(b.occurredTime as string));\n}\n\n// A member's stored history once read: the points, and the instant the read ended (epoch ms), after\n// which live readings are the only source.\nexport interface MemberHistory {\n samples: MeasurementSample[];\n end: number;\n}\n\n// Appends a live reading to a member's buffer: newest wins on a repeat id, and the buffer keeps the\n// newest LIVE_PER_MEMBER.\nexport function pushLive(buffer: MeasurementSample[], sample: MeasurementSample): void {\n if (buffer.some((s) => s.id === sample.id)) return;\n buffer.push(sample);\n if (buffer.length > LIVE_PER_MEMBER) buffer.splice(0, buffer.length - LIVE_PER_MEMBER);\n}\n\nexport interface ComposeInputs {\n shown: readonly MemberRef[];\n labels: ReadonlyMap<string, string>;\n measurement: string;\n history: ReadonlyMap<string, MemberHistory | 'failed'>;\n live: ReadonlyMap<string, readonly MeasurementSample[]>;\n // The span, epoch ms: nothing before `since` or after `until` is drawn (the board's freeze\n // instant while paused).\n since: number;\n until: number;\n}\n\nexport interface Composed {\n // One sample per point, named by the member's LABEL so the line chart draws one line per member.\n samples: MeasurementSample[];\n // Members whose stored history could not be read: their lines hold live readings only.\n historyFailed: number;\n // The newest reading drawn, epoch ms, for the frame's age.\n newest: number | undefined;\n}\n\nexport function composeSeries(i: ComposeInputs): Composed {\n const samples: MeasurementSample[] = [];\n let historyFailed = 0;\n let newest: number | undefined;\n for (const m of i.shown) {\n const label = i.labels.get(m.token) ?? m.token;\n const h = i.history.get(m.token);\n if (h === 'failed') historyFailed += 1;\n const stored = h && h !== 'failed' ? h.samples : [];\n // Live readings count only after the stored history's read ended: before it, the history holds\n // them already (as an average), and drawing both would put two values on one instant.\n const after = h && h !== 'failed' ? h.end : Number.NEGATIVE_INFINITY;\n const live = (i.live.get(m.token) ?? []).filter((s) => s.name === i.measurement && s.value != null && s.occurredTime != null && Date.parse(s.occurredTime) > after);\n const points = [...stored, ...live]\n .filter((s) => {\n const t = Date.parse(s.occurredTime as string);\n return t >= i.since && t <= i.until;\n })\n .sort((a, b) => Date.parse(a.occurredTime as string) - Date.parse(b.occurredTime as string));\n for (const s of points) {\n samples.push({ ...s, name: label });\n const t = Date.parse(s.occurredTime as string);\n if (newest === undefined || t > newest) newest = t;\n }\n }\n return { samples, historyFailed, newest };\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The fixed words the multi-device compare chart renders itself. The widget packages carry no i18n\n// runtime, so this is the one small per-language table (modelled on fleet-strings.ts); the option\n// labels are translated in the console's catalogs, not here. Loaded with the compare feed (a lazy\n// chunk), never by a board without a compare chart.\n\nimport { viewerLocale } from '@devicechain/widget-sdk';\n\nexport interface CompareStrings {\n // The group is larger than the lines drawn: say how many, and which ones.\n capped: (shown: number, total: number) => string;\n // The group was larger than what the resolver read: the total is a floor, not the size.\n cappedPage: (shown: number, read: number, total: number) => string;\n // History is a per-bucket average; the live tail is the raw readings.\n bucketed: (bucket: string) => string;\n bucketedTitle: (bucket: string) => string;\n // A threshold line is a reference drawn at a value, never a verdict on an average.\n thresholdNote: string;\n // Some devices' history could not be read: their lines hold only what arrived live.\n historyFailed: (n: number) => string;\n // The same facts for a box too narrow for the sentences above; the full text stays in the title.\n cappedShort: (shown: number, total: number) => string;\n thresholdShort: string;\n historyFailedShort: (n: number) => string;\n}\n\nexport const COMPARE_STRINGS: Record<'en' | 'es' | 'zh-CN', CompareStrings> = {\n en: {\n capped: (shown, total) => `Showing ${shown} of ${total} devices (the first ${shown}); raise Most lines, up to 12, to see more.`,\n cappedPage: (shown, read, total) =>\n `Showing ${shown} of ${total} devices: the group is larger than the ${read} devices read, and the first ${shown} are drawn.`,\n bucketed: (bucket) => `avg per ${bucket}`,\n bucketedTitle: (bucket) =>\n `Stored history is drawn as the average of each ${bucket} bucket, one point per bucket; readings that arrived live since are drawn as they came, unaveraged.`,\n thresholdNote: 'Thresholds are reference lines; a plotted history point is a bucket average, not a reading.',\n historyFailed: (n) => (n === 1 ? '1 device’s history could not be read; its line starts from live readings.' : `${n} devices’ history could not be read; their lines start from live readings.`),\n cappedShort: (shown, total) => `${shown} of ${total} devices`,\n thresholdShort: 'thresholds are references',\n historyFailedShort: (n) => `${n} unread`,\n },\n es: {\n capped: (shown, total) =>\n `Mostrando ${shown} de ${total} dispositivos (los primeros ${shown}); aumente Máximo de líneas, hasta 12, para ver más.`,\n cappedPage: (shown, read, total) =>\n `Mostrando ${shown} de ${total} dispositivos: el grupo es mayor que los ${read} dispositivos leídos, y se dibujan los primeros ${shown}.`,\n bucketed: (bucket) => `prom. por ${bucket}`,\n bucketedTitle: (bucket) =>\n `El historial almacenado se dibuja como el promedio de cada intervalo de ${bucket}, un punto por intervalo; las lecturas llegadas en vivo desde entonces se dibujan tal cual, sin promediar.`,\n thresholdNote: 'Los umbrales son líneas de referencia; un punto de historial es un promedio por intervalo, no una lectura.',\n historyFailed: (n) =>\n n === 1 ? 'No se pudo leer el historial de 1 dispositivo; su línea parte de lecturas en vivo.' : `No se pudo leer el historial de ${n} dispositivos; sus líneas parten de lecturas en vivo.`,\n cappedShort: (shown, total) => `${shown} de ${total} dispositivos`,\n thresholdShort: 'umbrales son referencias',\n historyFailedShort: (n) => `${n} sin leer`,\n },\n 'zh-CN': {\n capped: (shown, total) => `显示 ${total} 台设备中的前 ${shown} 台;提高“最多曲线数”(最多 12 条)可查看更多。`,\n cappedPage: (shown, read, total) => `显示 ${total} 台设备中的 ${shown} 台:此组的设备数超过已读取的 ${read} 台,仅绘制前 ${shown} 台。`,\n bucketed: (bucket) => `每 ${bucket} 的平均值`,\n bucketedTitle: (bucket) => `已存储的历史记录按每 ${bucket} 时间桶的平均值绘制,每桶一个点;此后实时到达的读数按原值绘制,不取平均。`,\n thresholdNote: '阈值为参考线;历史数据点是时间桶的平均值,而非单次读数。',\n historyFailed: (n) => `${n} 台设备的历史记录无法读取;其曲线从实时读数开始。`,\n cappedShort: (shown, total) => `${total} 台中的 ${shown} 台`, thresholdShort: '阈值仅供参考',\n historyFailedShort: (n) => `${n} 台未读取`,\n },\n};\n\nexport function compareStrings(locale: string | undefined = viewerLocale()): CompareStrings {\n const language = locale?.toLowerCase().split('-')[0];\n return language === 'es' ? COMPARE_STRINGS.es : language === 'zh' ? COMPARE_STRINGS['zh-CN'] : COMPARE_STRINGS.en;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB,QAAQ,qBAAqB;AACvD,SAAS,WAAW,SAAS,YAAY,QAAQ,gBAAoC;;;AChC9E,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAKzB,IAAM,kBAAkB;AAIxB,SAAS,YAAY,OAAmC;AAC7D,MAAI,UAAU,UAAa,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,EAAG,QAAO;AACzE,SAAO,KAAK,IAAI,OAAO,gBAAgB;AACzC;AAkBO,SAAS,WAAW,QAA0D,OAA8B;AACjH,QAAM,OAAO,OAAO,QAAQ;AAC5B,QAAM,QAAQ,KAAK,IAAI,OAAO,OAAO,IAAI;AACzC,QAAM,QAAQ,OAAO,QAAQ,MAAM,GAAG,KAAK;AAC3C,SAAO,EAAE,OAAO,OAAO,QAAQ,MAAM,SAAS,OAAO,eAAe,QAAQ,MAAM,KAAK;AACzF;AAIO,SAAS,aAAa,SAAoD;AAC/E,QAAM,OAAO,QAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,KAAK,EAAE,KAAK;AACzD,QAAM,QAAQ,oBAAI,IAAoB;AACtC,aAAW,KAAK,KAAM,OAAM,IAAI,IAAI,MAAM,IAAI,CAAC,KAAK,KAAK,CAAC;AAC1D,QAAM,SAAS,oBAAI,IAAoB;AACvC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KAEJ;AAEJ;",
6
+ "names": ["s", "capped", "labels", "composed"]
7
+ }
@@ -6,7 +6,7 @@ import {
6
6
  isScalar,
7
7
  parseParameterSchema,
8
8
  validateParams
9
- } from "./chunk-ZX4K3GT5.js";
9
+ } from "./chunk-R2XEYQEJ.js";
10
10
 
11
11
  // src/widgets/command-slider.tsx
12
12
  import { useEffect as useEffect2, useId, useMemo, useRef as useRef2, useState as useState2 } from "react";
@@ -152,11 +152,11 @@ var CONTROL_STRINGS = {
152
152
  en: {
153
153
  noCommand: "No command configured",
154
154
  setParameter: "Set which parameter this control sends",
155
- parameterMissing: (n) => `The command has no parameter \u201C${n}\u201D`,
156
- wrongType: (n, e) => `Parameter \u201C${n}\u201D is not ${e}`,
157
- fixedChoices: (n) => `Parameter \u201C${n}\u201D takes fixed choices, not a range`,
158
- otherRequired: (ns) => `Not sent: the command also requires ${ns.map((n) => `\u201C${n}\u201D`).join(", ")}, which has no default value`,
159
- badDefault: (ns) => `Not sent: the default value of ${ns.map((n) => `\u201C${n}\u201D`).join(", ")} is not valid for the command`,
155
+ parameterMissing: (n) => `The command has no parameter “${n}”`,
156
+ wrongType: (n, e) => `Parameter “${n}” is not ${e}`,
157
+ fixedChoices: (n) => `Parameter “${n}” takes fixed choices, not a range`,
158
+ otherRequired: (ns) => `Not sent: the command also requires ${ns.map((n) => `“${n}”`).join(", ")}, which has no default value`,
159
+ badDefault: (ns) => `Not sent: the default value of ${ns.map((n) => `“${n}”`).join(", ")} is not valid for the command`,
160
160
  setRange: "Set min and max",
161
161
  badRange: "Max must be above min",
162
162
  numberKind: "a number",
@@ -175,53 +175,89 @@ var CONTROL_STRINGS = {
175
175
  pending: "Pending",
176
176
  delivered: "Delivered",
177
177
  failed: "Failed",
178
- sending: "Sending\u2026",
178
+ sending: "Sending…",
179
179
  on: "On",
180
180
  off: "Off",
181
181
  viewOnly: "View only",
182
- noPermission: "You don\u2019t have permission to send commands.",
183
- noSeam: "Commands aren\u2019t available in this view.",
182
+ noPermission: "You don’t have permission to send commands.",
183
+ noSeam: "Commands aren’t available in this view.",
184
184
  noDevice: "No device is selected for this command.",
185
- sendFailed: "Couldn\u2019t send the command. Try again."
185
+ sendFailed: "Couldn’t send the command. Try again."
186
186
  },
187
187
  es: {
188
188
  noCommand: "No hay un comando configurado",
189
- setParameter: "Defina qu\xE9 par\xE1metro env\xEDa este control",
190
- parameterMissing: (n) => `El comando no tiene el par\xE1metro \u201C${n}\u201D`,
191
- wrongType: (n, e) => `El par\xE1metro \u201C${n}\u201D no es ${e}`,
192
- fixedChoices: (n) => `El par\xE1metro \u201C${n}\u201D admite opciones fijas, no un rango`,
193
- otherRequired: (ns) => `No se env\xEDa: el comando tambi\xE9n exige ${ns.map((n) => `\u201C${n}\u201D`).join(", ")}, que no tiene valor por defecto`,
194
- badDefault: (ns) => `No se env\xEDa: el valor por defecto de ${ns.map((n) => `\u201C${n}\u201D`).join(", ")} no es v\xE1lido para el comando`,
195
- setRange: "Defina m\xEDn. y m\xE1x.",
196
- badRange: "El m\xE1x. debe superar el m\xEDn.",
197
- numberKind: "un n\xFAmero",
189
+ setParameter: "Defina qué parámetro envía este control",
190
+ parameterMissing: (n) => `El comando no tiene el parámetro “${n}”`,
191
+ wrongType: (n, e) => `El parámetro “${n}” no es ${e}`,
192
+ fixedChoices: (n) => `El parámetro “${n}” admite opciones fijas, no un rango`,
193
+ otherRequired: (ns) => `No se envía: el comando también exige ${ns.map((n) => `“${n}”`).join(", ")}, que no tiene valor por defecto`,
194
+ badDefault: (ns) => `No se envía: el valor por defecto de ${ns.map((n) => `“${n}”`).join(", ")} no es válido para el comando`,
195
+ setRange: "Defina mín. y máx.",
196
+ badRange: "El máx. debe superar el mín.",
197
+ numberKind: "un número",
198
198
  booleanKind: "un booleano",
199
- lastSent: "\xDAltimo enviado",
200
- nothingSent: "A\xFAn no se ha enviado nada",
199
+ lastSent: "Último enviado",
200
+ nothingSent: "Aún no se ha enviado nada",
201
201
  beyondHistory: "No figura entre los comandos recientes",
202
202
  noValue: "sin valor",
203
- unsent: "A\xFAn no enviado. Suelte o pulse Intro para enviar",
203
+ unsent: "Aún no enviado. Suelte o pulse Intro para enviar",
204
204
  sliderHint: "Las flechas eligen un valor; pulse Intro para enviarlo o Escape para descartarlo.",
205
- stepperHint: "Las flechas y Re P\xE1g o Av P\xE1g cambian el valor; pulse Intro para enviarlo o Escape para descartarlo.",
206
- stepperUnsent: "A\xFAn no enviado. Pulse Enviar",
205
+ stepperHint: "Las flechas y Re Pág o Av Pág cambian el valor; pulse Intro para enviarlo o Escape para descartarlo.",
206
+ stepperUnsent: "Aún no enviado. Pulse Enviar",
207
207
  send: "Enviar",
208
208
  decrease: "Disminuir",
209
209
  increase: "Aumentar",
210
210
  pending: "Pendiente",
211
211
  delivered: "Entregado",
212
212
  failed: "Fallido",
213
- sending: "Enviando\u2026",
213
+ sending: "Enviando…",
214
214
  on: "Encendido",
215
215
  off: "Apagado",
216
216
  viewOnly: "Solo lectura",
217
217
  noPermission: "No tiene permiso para enviar comandos.",
218
- noSeam: "Los comandos no est\xE1n disponibles en esta vista.",
218
+ noSeam: "Los comandos no están disponibles en esta vista.",
219
219
  noDevice: "No hay un dispositivo seleccionado para este comando.",
220
- sendFailed: "No se pudo enviar el comando. Int\xE9ntelo de nuevo."
220
+ sendFailed: "No se pudo enviar el comando. Inténtelo de nuevo."
221
+ },
222
+ "zh-CN": {
223
+ noCommand: "尚未配置命令",
224
+ setParameter: "请设置此控件发送的参数",
225
+ parameterMissing: (n) => `命令没有参数“${n}”`,
226
+ wrongType: (n, e) => `参数“${n}”不是${e}`,
227
+ fixedChoices: (n) => `参数“${n}”使用固定选项,不能设置范围`,
228
+ otherRequired: (ns) => `未发送:命令还需要 ${ns.map((n) => `“${n}”`).join("、")},且未设置默认值`,
229
+ badDefault: (ns) => `未发送:${ns.map((n) => `“${n}”`).join("、")} 的默认值不符合命令要求`,
230
+ setRange: "请设置最小值和最大值",
231
+ badRange: "最大值必须大于最小值",
232
+ numberKind: "数字",
233
+ booleanKind: "布尔值",
234
+ lastSent: "上次发送",
235
+ nothingSent: "尚未发送",
236
+ beyondHistory: "未出现在最近的命令中",
237
+ noValue: "无值",
238
+ unsent: "尚未发送,松开或按 Enter 发送",
239
+ sliderHint: "使用方向键选择值;按 Enter 发送,或按 Escape 放弃。",
240
+ stepperHint: "使用方向键和 Page Up 或 Page Down 更改值;按 Enter 发送,或按 Escape 放弃。",
241
+ stepperUnsent: "尚未发送,请点击“发送”",
242
+ send: "发送",
243
+ decrease: "减小",
244
+ increase: "增大",
245
+ pending: "等待中",
246
+ delivered: "已送达",
247
+ failed: "失败",
248
+ sending: "正在发送…",
249
+ on: "开",
250
+ off: "关",
251
+ viewOnly: "仅查看",
252
+ noPermission: "您没有发送命令的权限。",
253
+ noSeam: "此视图中无法使用命令。",
254
+ noDevice: "尚未为此命令选择设备。",
255
+ sendFailed: "无法发送命令,请重试。"
221
256
  }
222
257
  };
223
258
  function controlStrings(locale = viewerLocale()) {
224
- return locale?.toLowerCase().split("-")[0] === "es" ? CONTROL_STRINGS.es : CONTROL_STRINGS.en;
259
+ const language = locale?.toLowerCase().split("-")[0];
260
+ return language === "es" ? CONTROL_STRINGS.es : language === "zh" ? CONTROL_STRINGS["zh-CN"] : CONTROL_STRINGS.en;
225
261
  }
226
262
 
227
263
  // src/command-control.tsx
@@ -265,7 +301,7 @@ function useCommandSender(actions, deviceToken, commandName, resetKey) {
265
301
  setPending(false);
266
302
  setError(null);
267
303
  setOptimistic(null);
268
- }, [resetKey]);
304
+ }, [resetKey, deviceToken]);
269
305
  const send = useCallback(
270
306
  (payload, value) => {
271
307
  if (!canSend || inFlight.current || !actions?.sendCommand || !deviceToken || !commandName) return false;
@@ -359,7 +395,7 @@ function LastSentCaption({
359
395
  ":"
360
396
  ] }),
361
397
  /* @__PURE__ */ jsx("span", { style: { color: css("foreground"), fontWeight: 600 }, children: format(last.value) }),
362
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7" }),
398
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "·" }),
363
399
  /* @__PURE__ */ jsxs(
364
400
  "span",
365
401
  {
@@ -416,7 +452,7 @@ function StepperBody({
416
452
  const rest = lastValue !== void 0 ? clampToRange(range, lastValue) : range.min;
417
453
  const shown = draft ?? rest;
418
454
  const known = draft !== null || lastValue !== void 0;
419
- const readout = known ? String(shown) : "\u2014";
455
+ const readout = known ? String(shown) : "—";
420
456
  const text = unit && known ? `${shown} ${unit}` : String(shown);
421
457
  const by = (steps) => {
422
458
  if (inert) return;
@@ -459,7 +495,7 @@ function StepperBody({
459
495
  "data-step": "down",
460
496
  onClick: () => by(-1),
461
497
  style: button(inert || atMin),
462
- children: "\u2212"
498
+ children: "−"
463
499
  }
464
500
  ),
465
501
  /* @__PURE__ */ jsxs2(
@@ -665,7 +701,7 @@ function SliderBody({
665
701
  const rest = lastValue !== void 0 ? clampToRange(range, lastValue) : range.min;
666
702
  const shown = draft ?? rest;
667
703
  const known = draft !== null || lastValue !== void 0;
668
- const readout = known ? String(shown) : "\u2014";
704
+ const readout = known ? String(shown) : "—";
669
705
  const chars = useStickyChars2(readout.length + (unit && known ? Math.ceil(unit.length / 2) + 1 : 0));
670
706
  const floor = Math.round(FIT_MIN_FONT_PX2 * ws.scale);
671
707
  const measured = ws.size.width > 0 && ws.size.height > 0;
@@ -963,4 +999,4 @@ export {
963
999
  CommandSlider,
964
1000
  CommandToggle
965
1001
  };
966
- //# sourceMappingURL=control-widgets-KTH6BWMH.js.map
1002
+ //# sourceMappingURL=control-widgets-VMWBTRC6.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/widgets/command-slider.tsx", "../../src/command-control-core.ts", "../../src/widgets/command-stepper.tsx", "../../src/command-control.tsx", "../../src/command-control-strings.ts", "../../src/widgets/command-toggle.tsx"],
4
+ "sourcesContent": ["// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// command-slider — sends a command carrying ONE numeric parameter, chosen with a slider. The range\n// comes from the command definition baked into the options (the same snapshot the command button\n// renders its form from); the author's min/max/step fill only what the definition leaves open.\n//\n// 🔴 DRAGGING SENDS NOTHING. The thumb stages a value; releasing it on the slider (or pressing\n// Enter, for a keyboard user) sends it, once. A staged value that is not committed is DISCARDED,\n// never sent later: a cancelled pointer (the browser took the gesture for a scroll), a lost\n// capture or a release off the slider, Escape, or focus leaving the slider. While a send is in\n// flight the slider is aria-disabled and ignores input, so a second release cannot queue a second\n// command; it is not `disabled`, which would drop a keyboard user's focus on the page body.\n//\n// Keyboard: the arrow, Page and Home/End keys stage a value (the native range input's own\n// behaviour, so aria-valuetext follows the staged value) and Enter sends it. That departure from a\n// plain slider is announced: the input is described by a hint saying so, as well as by the\n// last-sent caption, which reads \"Not sent yet. ... press Enter to send\" while a value is staged.\n//\n// 🔴 IT SHOWS WHAT WAS SENT, NOT WHAT THE DEVICE IS DOING. The thumb rests at the last value sent\n// (read off the command history) and the caption says so with that command's delivery status.\n// With nothing sent the thumb rests at the bottom of the range and the readout is a dash.\n\nimport { useEffect, useId, useMemo, useRef, useState, type ReactNode } from 'react';\n\nimport {\n css,\n FIT_MIN_FONT_PX,\n fitValueFont,\n fitValueFontCss,\n fontVar,\n optNumber,\n optString,\n spaceVar,\n useStickyChars,\n WidgetFrame,\n type CommandStreamState,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport {\n bindControl,\n clampToRange,\n lastSent,\n payloadFor,\n type Binding,\n} from '../command-control-core';\nimport { StepperBody } from './command-stepper';\nimport {\n ControlEmpty,\n ControlNotes,\n readOnlyId,\n LastSentCaption,\n refusalText,\n TOUCH_TARGET_PX,\n useCommandSender,\n type CommandSender,\n} from '../command-control';\n\ntype Bound = Extract<Binding, { ok: true }>;\n\nconst withUnit = (v: number, unit: string | undefined) => (unit ? `${v} ${unit}` : String(v));\n\nexport function CommandSlider({ widget, data, actions }: WidgetProps<CommandStreamState>) {\n const commandName = optString(widget.options, 'commandName');\n const commandLabel = optString(widget.options, 'commandLabel') ?? commandName;\n const parameterSchema = optString(widget.options, 'parameterSchema') ?? null;\n const parameter = optString(widget.options, 'parameter');\n const min = optNumber(widget.options, 'min');\n const max = optNumber(widget.options, 'max');\n const step = optNumber(widget.options, 'step');\n // Additive: absent, or anything but 'stepper', is the slider as before.\n const stepper = optString(widget.options, 'mode') === 'stepper';\n\n const binding = useMemo(\n () => bindControl('number', { commandName, parameterSchema, parameter, min, max, step }),\n [commandName, parameterSchema, parameter, min, max, step],\n );\n const sender = useCommandSender(\n actions,\n data.deviceToken,\n commandName,\n `${commandName ?? ''}::${parameterSchema ?? ''}::${parameter ?? ''}`,\n );\n\n const last =\n binding.ok && commandName\n ? lastSent('number', data.commands, commandName, binding.param.name, sender.optimistic)\n : null;\n\n // The staged value. A ref mirrors it so a release reads what the last change set, not the value\n // the previous render closed over.\n const [draft, setDraftState] = useState<number | null>(null);\n const draftRef = useRef<number | null>(null);\n const setDraft = (v: number | null) => {\n draftRef.current = v;\n setDraftState(v);\n };\n const captionId = useId();\n const hintId = useId();\n\n // 🔴 A STAGED STEPPER VALUE DOES NOT OUTLIVE A NEWER COMMAND. The stepper keeps a value staged\n // until Send (a slider's lasts only as long as the drag), so it can sit on a wall display while\n // someone else sends this command. It was chosen relative to the value that was current then; a\n // Send after that would quietly overwrite the newer one. A new last-sent command discards it, and\n // the readout returns to what was actually sent. The control's own send clears the draft before\n // its command appears, so this never fires on it.\n const lastToken = last?.token;\n useEffect(() => {\n if (!stepper || draftRef.current === null) return;\n draftRef.current = null;\n setDraftState(null);\n }, [lastToken, stepper]);\n\n // A pointer pressed on the slider whose release has not been seen. A release anywhere but on\n // the slider, a cancel or a lost capture while it is set discards the staged value.\n const pressed = useRef(false);\n const offRelease = useRef<(() => void) | null>(null);\n useEffect(() => () => offRelease.current?.(), []);\n const discard = () => {\n pressed.current = false;\n offRelease.current?.();\n offRelease.current = null;\n if (draftRef.current !== null) setDraft(null);\n };\n const press = (input: HTMLInputElement) => {\n pressed.current = true;\n offRelease.current?.();\n const doc = input.ownerDocument;\n const onRelease = (e: PointerEvent) => {\n // The slider's own release commits through onPointerUp; this one sees releases elsewhere.\n if (e.target instanceof Node && input.contains(e.target)) return;\n discard();\n };\n doc.addEventListener('pointerup', onRelease, true);\n offRelease.current = () => doc.removeEventListener('pointerup', onRelease, true);\n };\n\n const commit = () => {\n if (!binding.ok) return;\n const staged = draftRef.current;\n if (staged === null || !sender.canSend) return;\n if (sender.send(payloadFor(binding, staged), staged)) setDraft(null);\n };\n const release = () => {\n pressed.current = false;\n offRelease.current?.();\n offRelease.current = null;\n commit();\n };\n\n const caption = binding.ok ? (\n <LastSentCaption\n id={captionId}\n last={last}\n strings={sender.strings}\n truncated={data.total > data.commands.length}\n format={(v) => (typeof v === 'number' ? withUnit(v, binding.param.unit) : sender.strings.noValue)}\n override={\n draft !== null\n ? stepper\n ? sender.strings.stepperUnsent\n : sender.strings.unsent\n : sender.pending\n ? sender.strings.sending\n : undefined\n }\n />\n ) : null;\n const onStage = (v: number) => {\n // A value moved while a send is in flight is not staged: the control is aria-disabled.\n if (binding.ok && !sender.pending) setDraft(clampToRange(binding.range!, v));\n };\n\n return (\n <WidgetFrame title={optString(widget.options, 'title')}>\n {(scale) => {\n if (!binding.ok) return <ControlEmpty message={refusalText(binding.refusal, sender.strings, 'number')} />;\n const common = {\n binding,\n label: commandLabel ?? binding.param.name,\n draft,\n lastValue: typeof last?.value === 'number' ? last.value : undefined,\n sender,\n captionId,\n hintId,\n caption,\n onStage,\n onCommit: commit,\n onDiscard: discard,\n scale,\n };\n return stepper ? (\n <StepperBody {...common} />\n ) : (\n <SliderBody\n {...common}\n onPress={press}\n onRelease={release}\n onLostCapture={() => {\n if (pressed.current) discard();\n }}\n />\n );\n }}\n </WidgetFrame>\n );\n}\n\nfunction SliderBody({\n binding,\n label,\n draft,\n lastValue,\n sender,\n captionId,\n hintId,\n caption,\n onStage,\n onCommit,\n onPress,\n onRelease,\n onDiscard,\n onLostCapture,\n scale: ws,\n}: {\n binding: Bound;\n label: string;\n draft: number | null;\n lastValue: number | undefined;\n sender: CommandSender;\n captionId: string;\n hintId: string;\n caption: ReactNode;\n onStage: (v: number) => void;\n onCommit: () => void;\n onPress: (input: HTMLInputElement) => void;\n onRelease: () => void;\n onDiscard: () => void;\n onLostCapture: () => void;\n scale: WidgetScale;\n}) {\n const range = binding.range!;\n const unit = binding.param.unit;\n // Read-only is `disabled`; in flight is only aria-disabled, so focus stays on the slider.\n const disabled = !sender.canSend;\n const busy = sender.pending;\n const rest = lastValue !== undefined ? clampToRange(range, lastValue) : range.min;\n const shown = draft ?? rest;\n const known = draft !== null || lastValue !== undefined;\n const readout = known ? String(shown) : '—';\n\n // The readout fits the room left beside the track, with the same curve the value widgets use.\n const chars = useStickyChars(readout.length + (unit && known ? Math.ceil(unit.length / 2) + 1 : 0));\n const floor = Math.round(FIT_MIN_FONT_PX * ws.scale);\n const measured = ws.size.width > 0 && ws.size.height > 0;\n const room = {\n width: Math.floor(ws.size.width * 0.34),\n height: Math.max(TOUCH_TARGET_PX, Math.floor(ws.size.height * 0.5)),\n };\n const font = measured ? fitValueFont(room, chars, { floor }) : fitValueFontCss(chars, { floor });\n\n return (\n <div\n style={{\n height: '100%',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'safe center',\n gap: spaceVar(1),\n overflow: 'hidden',\n }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: spaceVar(2), minHeight: TOUCH_TARGET_PX }}>\n <input\n type=\"range\"\n aria-label={label}\n aria-valuetext={withUnit(shown, unit)}\n aria-describedby={`${hintId} ${captionId}${sender.readOnlyReason ? ` ${readOnlyId(captionId)}` : ''}`}\n aria-disabled={busy || undefined}\n aria-busy={busy || undefined}\n min={range.min}\n max={range.max}\n step={range.step}\n value={shown}\n disabled={disabled}\n data-staged={draft !== null ? 'true' : undefined}\n onChange={(e) => onStage(Number(e.target.value))}\n onPointerDown={(e) => onPress(e.currentTarget)}\n onPointerUp={onRelease}\n onPointerCancel={onDiscard}\n onLostPointerCapture={onLostCapture}\n onBlur={onDiscard}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onCommit();\n else if (e.key === 'Escape') onDiscard();\n }}\n style={{\n flex: '1 1 0',\n minWidth: 0,\n height: TOUCH_TARGET_PX,\n margin: 0,\n accentColor: css('primary'),\n cursor: disabled || busy ? 'not-allowed' : 'pointer',\n }}\n />\n <span id={hintId} hidden>\n {sender.strings.sliderHint}\n </span>\n <output\n aria-hidden=\"true\"\n data-slider-readout=\"\"\n style={{\n flex: '0 0 auto',\n fontSize: font,\n fontWeight: 600,\n lineHeight: 1.1,\n whiteSpace: 'nowrap',\n fontVariantNumeric: 'tabular-nums',\n color: draft !== null ? css('foreground') : css('muted-foreground'),\n }}\n >\n {readout}\n {unit && known ? (\n <span style={{ fontSize: fontVar('sm'), marginLeft: spaceVar(1), color: css('muted-foreground') }}>{unit}</span>\n ) : null}\n </output>\n </div>\n {/* One row, so the short read-only caption costs no height at a two-row widget's minimum span. */}\n <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'baseline', columnGap: spaceVar(2) }}>\n {caption}\n <ControlNotes sender={sender} captionId={captionId} />\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The pure half of the command slider and toggle: which parameter a control is bound to and why\n// it may refuse to be, the payload it sends, and the last value sent read back off the command\n// history. Nothing here reads a widget's options (the widgets hand the values in), so it is\n// tested on its own.\n//\n// 🔴 A CONTROL THAT CANNOT SEND SAYS SO. Every way the binding can be wrong is a named refusal\n// with the parameter it concerns, never a fallback value: a control that guesses at its range, its\n// type or a required parameter sends a plausible command the author did not mean.\n\nimport type { CommandParameter, CommandRow } from '@devicechain/dashboards';\n\nimport { buildPayload, isScalar, parseParameterSchema, validateParams } from './widgets/command-params';\n\nexport type ControlKind = 'number' | 'boolean';\n\nexport type Refusal =\n | { code: 'noCommand' }\n | { code: 'setParameter' }\n | { code: 'parameterMissing'; name: string }\n | { code: 'wrongType'; name: string; kind: ControlKind }\n | { code: 'fixedChoices'; name: string }\n | { code: 'otherRequired'; names: string[] }\n | { code: 'badDefault'; names: string[] }\n | { code: 'setRange' }\n | { code: 'badRange' };\n\nexport interface BindInput {\n commandName: string | undefined;\n parameterSchema: string | null | undefined;\n parameter: string | undefined;\n // Authored fallbacks for a slider: used only where the command definition leaves the end (or\n // the step) open. The definition is the authority on what the command accepts.\n min?: number;\n max?: number;\n step?: number;\n}\n\nexport interface Range {\n min: number;\n max: number;\n step: number;\n integer: boolean;\n}\n\nexport type Binding =\n | { ok: true; kind: ControlKind; param: CommandParameter; range?: Range; sent: CommandParameter[] }\n | { ok: false; refusal: Refusal };\n\nconst refuse = (refusal: Refusal): Binding => ({ ok: false, refusal });\n\n// 100 notches across a continuous range: the step a DOUBLE slider gets when nobody set one.\nconst DEFAULT_NOTCHES = 100;\n\nexport function bindControl(kind: ControlKind, input: BindInput): Binding {\n if (!input.commandName) return refuse({ code: 'noCommand' });\n const params = parseParameterSchema(input.parameterSchema);\n const wanted = (p: CommandParameter) =>\n isScalar(p) && (kind === 'boolean' ? p.dataType === 'BOOLEAN' : p.dataType === 'INT' || p.dataType === 'DOUBLE');\n\n let param: CommandParameter | undefined;\n if (input.parameter) {\n param = params.find((p) => p.name === input.parameter);\n if (!param) return refuse({ code: 'parameterMissing', name: input.parameter });\n if (!wanted(param)) return refuse({ code: 'wrongType', name: param.name, kind });\n } else {\n // Unambiguous or not at all: one candidate of the right type is the parameter; none or several\n // is the author's to resolve.\n const candidates = params.filter(wanted);\n if (candidates.length !== 1) return refuse({ code: 'setParameter' });\n param = candidates[0];\n }\n if (param.enum && param.enum.length > 0) return refuse({ code: 'fixedChoices', name: param.name });\n\n // Every other parameter either has a declared default (sent as is) or is optional (omitted).\n // A required one with neither would have to be invented, so the control refuses instead.\n const others = params.filter((p) => p !== param);\n const unsatisfied = others.filter((p) => p.required && (!isScalar(p) || p.default == null || p.default === ''));\n if (unsatisfied.length > 0) return refuse({ code: 'otherRequired', names: unsatisfied.map((p) => p.name) });\n const defaulted = others.filter((p) => isScalar(p) && p.default != null && p.default !== '');\n // A default is sent as written, so one the definition's own rules reject (not a number, not a\n // whole number, outside its range) would be a command the server refuses on every send.\n const invalid = new Set(\n Object.keys(validateParams(defaulted, Object.fromEntries(defaulted.map((p) => [p.name, p.default ?? ''])))),\n );\n for (const p of defaulted) if (p.enum && p.enum.length > 0 && !p.enum.includes(p.default ?? '')) invalid.add(p.name);\n if (invalid.size > 0) return refuse({ code: 'badDefault', names: defaulted.filter((p) => invalid.has(p.name)).map((p) => p.name) });\n const sent = [param, ...defaulted];\n\n if (kind === 'boolean') return { ok: true, kind, param, sent };\n\n const min = param.minValue ?? input.min;\n const max = param.maxValue ?? input.max;\n if (min === undefined || max === undefined) return refuse({ code: 'setRange' });\n if (!(max > min)) return refuse({ code: 'badRange' });\n const integer = param.dataType === 'INT';\n const step = input.step !== undefined && input.step > 0 ? input.step : integer ? 1 : (max - min) / DEFAULT_NOTCHES;\n return { ok: true, kind, param, range: { min, max, step, integer }, sent };\n}\n\n// The decimals a step carries, so snapped values do not pick up float noise (0.1 steps).\nfunction decimalsOf(n: number): number {\n const text = String(n);\n const e = /e-(\\d+)$/.exec(text);\n if (e) return Number(e[1]);\n const dot = text.indexOf('.');\n return dot < 0 ? 0 : text.length - dot - 1;\n}\n\n// clampToRange puts a raw value on the slider's grid: inside [min, max], on a whole step from min\n// (an INT rounds to a whole number whatever the step), and never NaN.\nexport function clampToRange(range: Range, raw: number): number {\n const finite = Number.isFinite(raw) ? raw : range.min;\n const bounded = Math.min(range.max, Math.max(range.min, finite));\n const steps = Math.round((bounded - range.min) / range.step);\n const decimals = Math.max(decimalsOf(range.step), decimalsOf(range.min));\n let snapped = Number((range.min + steps * range.step).toFixed(Math.min(decimals, 12)));\n if (snapped > range.max) snapped = Number((snapped - range.step).toFixed(Math.min(decimals, 12)));\n if (range.integer) snapped = Math.round(snapped);\n return Math.min(range.max, Math.max(range.min, snapped));\n}\n\n// The JSON the command carries: the bound parameter as its real type, the other parameters that\n// have a declared default, nothing else.\nexport function payloadFor(binding: Extract<Binding, { ok: true }>, value: number | boolean): string {\n const values: Record<string, string> = {};\n for (const p of binding.sent) {\n values[p.name] = p.default ?? '';\n if (p === binding.param) values[p.name] = String(value);\n }\n const payload = buildPayload(binding.sent, values);\n // sent always holds the bound parameter, so a payload always exists.\n return payload as string;\n}\n\nexport type DeliveryGroup = 'pending' | 'delivered' | 'failed' | 'unknown';\n\n// Which of the three things an operator asks of a command its status answers. An unrecognised\n// status is its own group, rendered as the raw word: it is not known to be pending.\nexport function deliveryGroup(status: string): DeliveryGroup {\n switch (status) {\n case 'QUEUED':\n case 'HELD':\n case 'SENT':\n case 'PARKED':\n return 'pending';\n case 'SUCCESSFUL':\n return 'delivered';\n case 'FAILED':\n case 'TIMEOUT':\n case 'EXPIRED':\n case 'CANCELLED':\n return 'failed';\n default:\n return 'unknown';\n }\n}\n\nexport interface LastSent {\n token: string;\n // The value the command carried for the bound parameter; undefined when the command (sent from\n // somewhere else) did not carry one this control can read.\n value: number | boolean | undefined;\n status: string;\n}\n\n// An accepted send not yet seen in the history.\nexport interface Optimistic {\n token: string;\n value: number | boolean;\n}\n\nfunction readValue(kind: ControlKind, payload: string | null, name: string): number | boolean | undefined {\n if (!payload) return undefined;\n let parsed: unknown;\n try {\n parsed = JSON.parse(payload);\n } catch {\n return undefined;\n }\n if (typeof parsed !== 'object' || parsed === null) return undefined;\n const v = (parsed as Record<string, unknown>)[name];\n if (kind === 'number') return typeof v === 'number' && Number.isFinite(v) ? v : undefined;\n if (typeof v === 'boolean') return v;\n return undefined;\n}\n\n// lastSent reads the newest command of this control's name off the history. It is the newest, not\n// the newest that happens to parse: skipping to an older row would report a value that has since\n// been superseded. A send the history has not caught up with yet stands in until it does.\nexport function lastSent(\n kind: ControlKind,\n commands: readonly CommandRow[],\n commandName: string,\n parameter: string,\n optimistic: Optimistic | null,\n): LastSent | null {\n let newest: CommandRow | undefined;\n for (const c of commands) {\n if (c.name !== commandName) continue;\n if (!newest || (c.queuedTime ?? '') > (newest.queuedTime ?? '')) newest = c;\n }\n if (optimistic && !commands.some((c) => c.token === optimistic.token)) {\n return { token: optimistic.token, value: optimistic.value, status: 'QUEUED' };\n }\n if (!newest) return null;\n return { token: newest.token, value: readValue(kind, newest.payload, parameter), status: newest.status };\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The command slider's stepper mode: − / value / + and a Send button, for a touch wall where\n// dragging a thumb is too fine. The range and step come from the command parameter's declared\n// schema, exactly as the slider's do (command-slider.tsx binds them and owns the staged value).\n//\n// 🔴 PRESSING − OR + SENDS NOTHING. It stages a value; only Send (or Enter on the value) sends it,\n// once. A command that steps a setpoint or a rate is acted on by the device, and a held-down or\n// double-tapped button must not become a burst of commands. The explicit Send is also where a\n// disruptive command is chosen on purpose (the platform then holds it for the maintenance window).\n// Escape discards a staged value. Focus moving to the Send button does NOT discard it, and nor\n// does focus leaving the widget: on a touch wall a tap elsewhere is not a decision, and a browser\n// that never focuses a tapped button (Safari) would blur the value on every tap of − or +. What does\n// discard it is a newer command than the one it was staged against (command-slider.tsx).\n\nimport type { KeyboardEvent, ReactNode } from 'react';\n\nimport {\n css,\n FIT_MIN_FONT_PX,\n fitValueFont,\n fitValueFontCss,\n fontVar,\n spaceVar,\n useStickyChars,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { clampToRange, type Binding } from '../command-control-core';\nimport { ControlNotes, readOnlyId, TOUCH_TARGET_PX, type CommandSender } from '../command-control';\n\ntype Bound = Extract<Binding, { ok: true }>;\n\nconst PAGE_STEPS = 10;\n\nconst button = (off: boolean) =>\n ({\n flex: '0 0 auto',\n boxSizing: 'border-box',\n minWidth: TOUCH_TARGET_PX,\n height: TOUCH_TARGET_PX,\n padding: `0 ${spaceVar(2)}`,\n border: `1px solid ${css('border')}`,\n borderRadius: 6,\n background: css('card'),\n color: css('foreground'),\n font: 'inherit',\n fontSize: fontVar('md'),\n fontWeight: 600,\n cursor: off ? 'not-allowed' : 'pointer',\n opacity: off ? 0.5 : 1,\n }) as const;\n\nexport function StepperBody({\n binding,\n label,\n draft,\n lastValue,\n sender,\n captionId,\n hintId,\n caption,\n onStage,\n onCommit,\n onDiscard,\n scale: ws,\n}: {\n binding: Bound;\n label: string;\n draft: number | null;\n lastValue: number | undefined;\n sender: CommandSender;\n captionId: string;\n hintId: string;\n caption: ReactNode;\n onStage: (v: number) => void;\n onCommit: () => void;\n onDiscard: () => void;\n scale: WidgetScale;\n}) {\n const range = binding.range!;\n const unit = binding.param.unit;\n const busy = sender.pending;\n const inert = !sender.canSend || busy;\n const rest = lastValue !== undefined ? clampToRange(range, lastValue) : range.min;\n const shown = draft ?? rest;\n const known = draft !== null || lastValue !== undefined;\n const readout = known ? String(shown) : '—';\n const text = unit && known ? `${shown} ${unit}` : String(shown);\n\n // clampToRange snaps to the grid from min and trims float noise, so 0.1 steps stay 0.3, not 0.30000000000000004.\n const by = (steps: number) => {\n if (inert) return;\n const next = clampToRange(range, shown + steps * range.step);\n if (next !== shown || draft === null) onStage(next);\n };\n const canSendNow = draft !== null && !inert;\n\n const chars = useStickyChars(readout.length + (unit && known ? Math.ceil(unit.length / 2) + 1 : 0));\n const floor = Math.round(FIT_MIN_FONT_PX * ws.scale);\n const measured = ws.size.width > 0 && ws.size.height > 0;\n const font = measured\n ? fitValueFont({ width: Math.floor(ws.size.width * 0.3), height: Math.max(TOUCH_TARGET_PX, Math.floor(ws.size.height * 0.5)) }, chars, { floor })\n : fitValueFontCss(chars, { floor });\n\n const key = (e: KeyboardEvent) => {\n const k = e.key;\n if (k === 'ArrowUp' || k === 'ArrowRight') by(1);\n else if (k === 'ArrowDown' || k === 'ArrowLeft') by(-1);\n else if (k === 'PageUp') by(PAGE_STEPS);\n else if (k === 'PageDown') by(-PAGE_STEPS);\n else if (k === 'Home') inert || onStage(range.min);\n else if (k === 'End') inert || onStage(range.max);\n else if (k === 'Enter') onCommit();\n else if (k === 'Escape') onDiscard();\n else return;\n e.preventDefault();\n };\n\n const atMin = shown <= range.min;\n const atMax = shown >= range.max;\n return (\n <div\n style={{ height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column', justifyContent: 'safe center', gap: spaceVar(1), overflow: 'hidden' }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: spaceVar(1), minHeight: TOUCH_TARGET_PX }}>\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={sender.strings.decrease}\n aria-disabled={inert || atMin || undefined}\n data-step=\"down\"\n onClick={() => by(-1)}\n style={button(inert || atMin)}\n >\n −\n </button>\n <div\n role=\"spinbutton\"\n tabIndex={0}\n aria-label={label}\n aria-valuemin={range.min}\n aria-valuemax={range.max}\n aria-valuenow={known ? shown : undefined}\n aria-valuetext={known ? text : sender.strings.noValue}\n aria-describedby={`${hintId} ${captionId}${sender.readOnlyReason ? ` ${readOnlyId(captionId)}` : ''}`}\n aria-disabled={inert || undefined}\n aria-busy={busy || undefined}\n data-staged={draft !== null ? 'true' : undefined}\n onKeyDown={key}\n style={{\n flex: '1 1 0',\n minWidth: 0,\n textAlign: 'center',\n fontSize: font,\n fontWeight: 600,\n lineHeight: 1.1,\n whiteSpace: 'nowrap',\n fontVariantNumeric: 'tabular-nums',\n color: draft !== null ? css('foreground') : css('muted-foreground'),\n }}\n >\n {readout}\n {unit && known ? (\n <span style={{ fontSize: fontVar('sm'), marginLeft: spaceVar(1), color: css('muted-foreground') }}>{unit}</span>\n ) : null}\n </div>\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={sender.strings.increase}\n aria-disabled={inert || atMax || undefined}\n data-step=\"up\"\n onClick={() => by(1)}\n style={button(inert || atMax)}\n >\n +\n </button>\n <button\n type=\"button\"\n aria-disabled={!canSendNow || undefined}\n data-step=\"send\"\n onClick={() => canSendNow && onCommit()}\n style={{ ...button(!canSendNow), background: canSendNow ? css('primary') : css('card'), color: canSendNow ? css('primary-foreground') : css('foreground') }}\n >\n {sender.strings.send}\n </button>\n <span id={hintId} hidden>\n {sender.strings.stepperHint}\n </span>\n </div>\n <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'baseline', columnGap: spaceVar(2) }}>\n {caption}\n <ControlNotes sender={sender} captionId={captionId} />\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// What the command slider and toggle share beyond the pure logic: the send itself (one at a time,\n// the permission gate, the refusal's reason), the \"last sent\" caption with its delivery status, and\n// the explained empty state. Neither control shows device state: the caption names what was SENT.\n\nimport type { CommandDispatch, WidgetActions } from '@devicechain/dashboards';\nimport { useCallback, useEffect, useRef, useState, type CSSProperties } from 'react';\n\nimport { css, fontVar, spaceVar } from '@devicechain/widget-sdk';\n\nimport { controlStrings, type ControlStrings } from './command-control-strings';\nimport { deliveryGroup, type LastSent, type Optimistic, type Refusal } from './command-control-core';\nimport { commandStatusColor, commandStatusLabel } from './widgets/command-status';\n\n// The smallest hit area a touch control may have, in CSS px.\nexport const TOUCH_TARGET_PX = 44;\n\nexport function refusalText(r: Refusal, s: ControlStrings, expect: 'number' | 'boolean'): string {\n switch (r.code) {\n case 'noCommand':\n return s.noCommand;\n case 'setParameter':\n return s.setParameter;\n case 'parameterMissing':\n return s.parameterMissing(r.name);\n case 'wrongType':\n return s.wrongType(r.name, expect === 'number' ? s.numberKind : s.booleanKind);\n case 'fixedChoices':\n return s.fixedChoices(r.name);\n case 'otherRequired':\n return s.otherRequired(r.names);\n case 'badDefault':\n return s.badDefault(r.names);\n case 'setRange':\n return s.setRange;\n case 'badRange':\n return s.badRange;\n }\n}\n\nexport interface CommandSender {\n strings: ControlStrings;\n // Why the control is read-only, or undefined when the viewer may send.\n readOnlyReason: string | undefined;\n canSend: boolean;\n // A dispatch is in flight.\n pending: boolean;\n error: string | null;\n // A send the platform accepted, until the history shows it.\n optimistic: Optimistic | null;\n // Returns whether a command was dispatched. At most one is in flight at a time.\n send: (payload: string, value: number | boolean) => boolean;\n}\n\n// useCommandSender owns one control's sending. `resetKey` identifies the configured command: when\n// it or the device changes, an in-flight send's result is dropped rather than landing under the\n// new subject.\nexport function useCommandSender(\n actions: WidgetActions | undefined,\n deviceToken: string | null | undefined,\n commandName: string | undefined,\n resetKey: string,\n): CommandSender {\n const strings = controlStrings();\n const canWrite = actions?.can('command:write') ?? false;\n const hasSeam = typeof actions?.sendCommand === 'function';\n const canSend = canWrite && hasSeam && !!deviceToken && !!commandName;\n\n // The in-flight flag is a ref, not state: two clicks in the same tick both see the state before\n // either has re-rendered, and only a ref closes that window.\n const inFlight = useRef(false);\n const generation = useRef(0);\n const [pending, setPending] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [optimistic, setOptimistic] = useState<Optimistic | null>(null);\n\n useEffect(() => {\n generation.current += 1;\n inFlight.current = false;\n setPending(false);\n setError(null);\n setOptimistic(null);\n }, [resetKey, deviceToken]);\n\n const send = useCallback(\n (payload: string, value: number | boolean): boolean => {\n if (!canSend || inFlight.current || !actions?.sendCommand || !deviceToken || !commandName) return false;\n const gen = generation.current;\n inFlight.current = true;\n setPending(true);\n setError(null);\n const settle = () => {\n if (gen !== generation.current) return;\n inFlight.current = false;\n setPending(false);\n };\n let promise: Promise<CommandDispatch>;\n try {\n promise = actions.sendCommand(deviceToken, commandName, payload);\n } catch {\n setError(strings.sendFailed);\n settle();\n return true;\n }\n promise\n .then((dispatch) => {\n if (gen !== generation.current) return;\n // A refusal is shown with the server's reason (it is client-safe and the operator can act\n // on it); a thrown error is an availability failure whose text is internal, so it gets\n // one fixed message instead. A refused value is not \"last sent\".\n if (dispatch.status === 'rejected') setError(dispatch.reason);\n else setOptimistic({ token: dispatch.token, value });\n })\n .catch(() => {\n if (gen === generation.current) setError(strings.sendFailed);\n })\n .finally(settle);\n return true;\n },\n [actions, canSend, commandName, deviceToken, strings.sendFailed],\n );\n\n // A view with no send seam at all (a read-only embed) is told so, rather than blamed on the\n // viewer's permissions.\n const readOnlyReason = !hasSeam\n ? strings.noSeam\n : !canWrite\n ? strings.noPermission\n : !deviceToken\n ? strings.noDevice\n : undefined;\n return { strings, readOnlyReason, canSend, pending, error, optimistic, send };\n}\n\nconst note: CSSProperties = {\n fontSize: fontVar('xs'),\n lineHeight: 1.25,\n color: css('muted-foreground'),\n overflowWrap: 'anywhere',\n};\n\n// The explained empty state: why the control has nothing to offer, as an alert so it is announced.\nexport function ControlEmpty({ message }: { message: string }) {\n return (\n <div\n role=\"alert\"\n data-control-empty=\"\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n textAlign: 'center',\n color: css('muted-foreground'),\n fontSize: fontVar('sm'),\n overflowWrap: 'anywhere',\n }}\n >\n {message}\n </div>\n );\n}\n\n// The id of the full read-only reason, derived from the caption's id so the control can name it in\n// aria-describedby. The visible caption is the short \"View only\" so it fits a two-row widget at\n// one-column width; the full sentence lives here, hidden from the eye but not from assistive tech.\nexport const readOnlyId = (captionId: string) => `${captionId}-ro`;\n\n// The notes under a control: a short \"View only\" caption (the full reason is its title and the\n// control's description), and the last send's error.\nexport function ControlNotes({ sender, captionId }: { sender: CommandSender; captionId: string }) {\n return (\n <>\n {sender.readOnlyReason ? (\n <span id={readOnlyId(captionId)} hidden>\n {sender.readOnlyReason}\n </span>\n ) : null}\n {sender.readOnlyReason ? (\n <div data-read-only=\"\" title={sender.readOnlyReason} style={{ ...note, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>\n {sender.strings.viewOnly}\n </div>\n ) : null}\n {sender.error ? (\n <div role=\"alert\" style={{ ...note, color: commandStatusColor('FAILED') }}>\n {sender.error}\n </div>\n ) : null}\n </>\n );\n}\n\n// \"Last sent: 22 C · Pending\". The words are the viewer's: pending, delivered or failed, with the\n// precise status on hover. `override` replaces the whole line (the slider's \"not sent yet\" while a\n// value is staged), so the caption never claims a staged value was sent.\nexport function LastSentCaption({\n id,\n last,\n format,\n strings,\n override,\n truncated = false,\n}: {\n id: string;\n last: LastSent | null;\n format: (value: number | boolean | undefined) => string;\n strings: ControlStrings;\n override?: string;\n // The device has more commands than the page read, so an empty match proves nothing.\n truncated?: boolean;\n}) {\n const group = last ? deliveryGroup(last.status) : undefined;\n const word =\n group === 'pending'\n ? strings.pending\n : group === 'delivered'\n ? strings.delivered\n : group === 'failed'\n ? strings.failed\n : last\n ? commandStatusLabel(last.status)\n : '';\n return (\n <div\n id={id}\n role=\"status\"\n aria-live=\"polite\"\n data-last-sent=\"\"\n data-delivery={group}\n style={{ ...note, fontSize: fontVar('sm'), display: 'flex', flexWrap: 'wrap', alignItems: 'center', columnGap: spaceVar(1) }}\n >\n {override ? (\n <span>{override}</span>\n ) : last ? (\n <>\n <span>{strings.lastSent}:</span>\n <span style={{ color: css('foreground'), fontWeight: 600 }}>{format(last.value)}</span>\n <span aria-hidden=\"true\">·</span>\n <span\n title={last.status}\n style={{ display: 'inline-flex', alignItems: 'center', gap: 4, color: commandStatusColor(last.status), fontWeight: 600 }}\n >\n <span aria-hidden=\"true\" style={{ width: 7, height: 7, borderRadius: '50%', background: commandStatusColor(last.status) }} />\n {word}\n </span>\n </>\n ) : (\n <span>{truncated ? strings.beyondHistory : strings.nothingSent}</span>\n )}\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The fixed words the command slider and toggle render themselves: why they will not send, what\n// they last sent, and where that command is in its delivery. The widget packages carry no i18n\n// runtime, so this is the one small per-language table, in the manner of level-strings.ts; option\n// labels are translated in the console's catalogs, not here.\n//\n// The caption is worded as what was SENT. These controls know the history of the commands issued\n// to the device, not what the device is doing, and no string here may read as the latter.\n\nimport { viewerLocale } from '@devicechain/widget-sdk';\n\nexport interface ControlStrings {\n noCommand: string;\n setParameter: string;\n parameterMissing: (name: string) => string;\n wrongType: (name: string, expected: string) => string;\n fixedChoices: (name: string) => string;\n otherRequired: (names: string[]) => string;\n badDefault: (names: string[]) => string;\n setRange: string;\n badRange: string;\n numberKind: string;\n booleanKind: string;\n // The caption.\n lastSent: string;\n nothingSent: string;\n // The history is longer than the page this control reads, and none of this command is on it.\n beyondHistory: string;\n noValue: string;\n unsent: string;\n // The slider's keyboard description: arrows choose, Enter sends.\n sliderHint: string;\n // The stepper: its keyboard description, the unsent caption, and its buttons.\n stepperHint: string;\n stepperUnsent: string;\n send: string;\n decrease: string;\n increase: string;\n pending: string;\n delivered: string;\n failed: string;\n sending: string;\n on: string;\n off: string;\n // Read-only reasons.\n // The short visible caption beside a read-only control; the full reason is its description.\n viewOnly: string;\n noPermission: string;\n noSeam: string;\n noDevice: string;\n sendFailed: string;\n}\n\nexport const CONTROL_STRINGS: Record<'en' | 'es' | 'zh-CN', ControlStrings> = {\n en: {\n noCommand: 'No command configured',\n setParameter: 'Set which parameter this control sends',\n parameterMissing: (n) => `The command has no parameter “${n}”`,\n wrongType: (n, e) => `Parameter “${n}” is not ${e}`,\n fixedChoices: (n) => `Parameter “${n}” takes fixed choices, not a range`,\n otherRequired: (ns) => `Not sent: the command also requires ${ns.map((n) => `“${n}”`).join(', ')}, which has no default value`,\n badDefault: (ns) => `Not sent: the default value of ${ns.map((n) => `“${n}”`).join(', ')} is not valid for the command`,\n setRange: 'Set min and max',\n badRange: 'Max must be above min',\n numberKind: 'a number',\n booleanKind: 'a boolean',\n lastSent: 'Last sent',\n nothingSent: 'Nothing sent yet',\n beyondHistory: 'Not among the recent commands',\n noValue: 'no value',\n unsent: 'Not sent yet. Release or press Enter to send',\n sliderHint: 'Arrow keys choose a value; press Enter to send it, or Escape to discard it.',\n stepperHint: 'Arrow keys and Page Up or Down change the value; press Enter to send it, or Escape to discard it.',\n stepperUnsent: 'Not sent yet. Press Send',\n send: 'Send',\n decrease: 'Decrease',\n increase: 'Increase',\n pending: 'Pending',\n delivered: 'Delivered',\n failed: 'Failed',\n sending: 'Sending…',\n on: 'On',\n off: 'Off',\n viewOnly: 'View only',\n noPermission: 'You don’t have permission to send commands.',\n noSeam: 'Commands aren’t available in this view.',\n noDevice: 'No device is selected for this command.',\n sendFailed: 'Couldn’t send the command. Try again.',\n },\n es: {\n noCommand: 'No hay un comando configurado',\n setParameter: 'Defina qué parámetro envía este control',\n parameterMissing: (n) => `El comando no tiene el parámetro “${n}”`,\n wrongType: (n, e) => `El parámetro “${n}” no es ${e}`,\n fixedChoices: (n) => `El parámetro “${n}” admite opciones fijas, no un rango`,\n otherRequired: (ns) => `No se envía: el comando también exige ${ns.map((n) => `“${n}”`).join(', ')}, que no tiene valor por defecto`,\n badDefault: (ns) => `No se envía: el valor por defecto de ${ns.map((n) => `“${n}”`).join(', ')} no es válido para el comando`,\n setRange: 'Defina mín. y máx.',\n badRange: 'El máx. debe superar el mín.',\n numberKind: 'un número',\n booleanKind: 'un booleano',\n lastSent: 'Último enviado',\n nothingSent: 'Aún no se ha enviado nada',\n beyondHistory: 'No figura entre los comandos recientes',\n noValue: 'sin valor',\n unsent: 'Aún no enviado. Suelte o pulse Intro para enviar',\n sliderHint: 'Las flechas eligen un valor; pulse Intro para enviarlo o Escape para descartarlo.',\n stepperHint: 'Las flechas y Re Pág o Av Pág cambian el valor; pulse Intro para enviarlo o Escape para descartarlo.',\n stepperUnsent: 'Aún no enviado. Pulse Enviar',\n send: 'Enviar',\n decrease: 'Disminuir',\n increase: 'Aumentar',\n pending: 'Pendiente',\n delivered: 'Entregado',\n failed: 'Fallido',\n sending: 'Enviando…',\n on: 'Encendido',\n off: 'Apagado',\n viewOnly: 'Solo lectura',\n noPermission: 'No tiene permiso para enviar comandos.',\n noSeam: 'Los comandos no están disponibles en esta vista.',\n noDevice: 'No hay un dispositivo seleccionado para este comando.',\n sendFailed: 'No se pudo enviar el comando. Inténtelo de nuevo.',\n },\n 'zh-CN': {\n noCommand: '尚未配置命令', setParameter: '请设置此控件发送的参数',\n parameterMissing: (n) => `命令没有参数“${n}”`, wrongType: (n, e) => `参数“${n}”不是${e}`,\n fixedChoices: (n) => `参数“${n}”使用固定选项,不能设置范围`,\n otherRequired: (ns) => `未发送:命令还需要 ${ns.map((n) => `“${n}”`).join('、')},且未设置默认值`,\n badDefault: (ns) => `未发送:${ns.map((n) => `“${n}”`).join('、')} 的默认值不符合命令要求`,\n setRange: '请设置最小值和最大值', badRange: '最大值必须大于最小值', numberKind: '数字', booleanKind: '布尔值',\n lastSent: '上次发送', nothingSent: '尚未发送', beyondHistory: '未出现在最近的命令中', noValue: '无值',\n unsent: '尚未发送,松开或按 Enter 发送', sliderHint: '使用方向键选择值;按 Enter 发送,或按 Escape 放弃。',\n stepperHint: '使用方向键和 Page Up 或 Page Down 更改值;按 Enter 发送,或按 Escape 放弃。',\n stepperUnsent: '尚未发送,请点击“发送”', send: '发送', decrease: '减小', increase: '增大', pending: '等待中',\n delivered: '已送达', failed: '失败', sending: '正在发送…', on: '开', off: '关', viewOnly: '仅查看',\n noPermission: '您没有发送命令的权限。', noSeam: '此视图中无法使用命令。', noDevice: '尚未为此命令选择设备。',\n sendFailed: '无法发送命令,请重试。',\n },\n};\n\nexport function controlStrings(locale: string | undefined = viewerLocale()): ControlStrings {\n const language = locale?.toLowerCase().split('-')[0];\n return language === 'es' ? CONTROL_STRINGS.es : language === 'zh' ? CONTROL_STRINGS['zh-CN'] : CONTROL_STRINGS.en;\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// command-toggle — sends a command carrying ONE boolean parameter, one command per click.\n//\n// 🔴 THE SWITCH SHOWS THE LAST VALUE SENT, NOT THE DEVICE'S STATE. It rests where the newest\n// command left it (read off the command history) and the caption says \"Last sent\" with that\n// command's delivery status.\n//\n// 🔴 IT NEVER GUESSES WHICH WAY TO FLIP. A click sends the opposite of the last value sent only\n// when that value is a live intent: a command that is pending or was delivered, carrying a value\n// this control can read. With nothing sent, a history too short to show this command, a newest\n// command with no readable value, or a newest command that FAILED (its value never reached the\n// device, so flipping relative to it would send what the operator may already have), the switch\n// is replaced by two explicit buttons, On and Off, and the operator chooses.\n//\n// A click while a send is in flight does nothing, so rapid clicks make one command, not a queue of\n// alternating ones.\n\nimport { useId, useMemo, type ReactNode } from 'react';\n\nimport {\n css,\n FIT_MIN_FONT_PX,\n fitValueFont,\n fitValueFontCss,\n optString,\n spaceVar,\n useStickyChars,\n WidgetFrame,\n type CommandStreamState,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { bindControl, deliveryGroup, lastSent, payloadFor, type Binding, type LastSent } from '../command-control-core';\nimport {\n ControlEmpty,\n ControlNotes,\n readOnlyId,\n LastSentCaption,\n refusalText,\n TOUCH_TARGET_PX,\n useCommandSender,\n type CommandSender,\n} from '../command-control';\n\ntype Bound = Extract<Binding, { ok: true }>;\n\nconst TRACK_W = 52;\nconst TRACK_H = 30;\nconst THUMB = 24;\n\nexport function CommandToggle({ widget, data, actions }: WidgetProps<CommandStreamState>) {\n const commandName = optString(widget.options, 'commandName');\n const commandLabel = optString(widget.options, 'commandLabel') ?? commandName;\n const parameterSchema = optString(widget.options, 'parameterSchema') ?? null;\n const parameter = optString(widget.options, 'parameter');\n\n const binding = useMemo(\n () => bindControl('boolean', { commandName, parameterSchema, parameter }),\n [commandName, parameterSchema, parameter],\n );\n const sender = useCommandSender(\n actions,\n data.deviceToken,\n commandName,\n `${commandName ?? ''}::${parameterSchema ?? ''}::${parameter ?? ''}`,\n );\n const last =\n binding.ok && commandName\n ? lastSent('boolean', data.commands, commandName, binding.param.name, sender.optimistic)\n : null;\n const captionId = useId();\n\n return (\n <WidgetFrame title={optString(widget.options, 'title')}>\n {(scale) =>\n !binding.ok ? (\n <ControlEmpty message={refusalText(binding.refusal, sender.strings, 'boolean')} />\n ) : (\n <ToggleBody\n binding={binding}\n label={commandLabel ?? binding.param.name}\n value={intentOf(last)}\n sender={sender}\n captionId={captionId}\n caption={\n <LastSentCaption\n id={captionId}\n last={last}\n strings={sender.strings}\n truncated={data.total > data.commands.length}\n format={(v) => (typeof v === 'boolean' ? (v ? sender.strings.on : sender.strings.off) : sender.strings.noValue)}\n override={sender.pending ? sender.strings.sending : undefined}\n />\n }\n scale={scale}\n />\n )\n }\n </WidgetFrame>\n );\n}\n\n// The value a flip may be computed from, or undefined when the operator has to choose. Only a\n// command that is still on its way, or arrived, states an intent the device is acting on.\nexport function intentOf(last: LastSent | null): boolean | undefined {\n if (!last || typeof last.value !== 'boolean') return undefined;\n const group = deliveryGroup(last.status);\n return group === 'pending' || group === 'delivered' ? last.value : undefined;\n}\n\nfunction ToggleBody({\n binding,\n label,\n value,\n sender,\n captionId,\n caption,\n scale: ws,\n}: {\n binding: Bound;\n label: string;\n value: boolean | undefined;\n sender: CommandSender;\n captionId: string;\n caption: ReactNode;\n scale: WidgetScale;\n}) {\n const checked = value === true;\n const unknown = value === undefined;\n const disabled = !sender.canSend;\n const word = checked ? sender.strings.on : sender.strings.off;\n\n const chars = useStickyChars(word.length);\n const floor = Math.round(FIT_MIN_FONT_PX * ws.scale);\n const measured = ws.size.width > 0 && ws.size.height > 0;\n const room = {\n width: Math.floor(ws.size.width - TRACK_W - 16),\n height: Math.max(TOUCH_TARGET_PX, Math.floor(ws.size.height * 0.5)),\n };\n const font = measured ? fitValueFont(room, chars, { floor }) : fitValueFontCss(chars, { floor });\n\n const sendValue = (next: boolean) => {\n sender.send(payloadFor(binding, next), next);\n };\n\n return (\n <div\n style={{\n height: '100%',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'safe center',\n gap: spaceVar(1),\n overflow: 'hidden',\n }}\n >\n {unknown ? (\n <div role=\"group\" aria-label={label} aria-describedby={sender.readOnlyReason ? `${captionId} ${readOnlyId(captionId)}` : captionId} data-toggle-choose=\"\" style={{ display: 'flex', gap: spaceVar(2) }}>\n {([true, false] as const).map((v) => (\n <button\n key={String(v)}\n type=\"button\"\n disabled={disabled}\n aria-busy={sender.pending}\n onClick={() => sendValue(v)}\n style={{\n flex: '1 1 0',\n minHeight: TOUCH_TARGET_PX,\n minWidth: TOUCH_TARGET_PX,\n padding: `0 ${spaceVar(2)}`,\n borderRadius: 6,\n border: `1px solid ${css('border')}`,\n background: css('background'),\n color: css('foreground'),\n fontWeight: 600,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n }}\n >\n {v ? sender.strings.on : sender.strings.off}\n </button>\n ))}\n </div>\n ) : (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={label}\n aria-describedby={sender.readOnlyReason ? `${captionId} ${readOnlyId(captionId)}` : captionId}\n aria-busy={sender.pending}\n disabled={disabled}\n onClick={() => sendValue(!checked)}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: spaceVar(2),\n minHeight: TOUCH_TARGET_PX,\n minWidth: TOUCH_TARGET_PX,\n padding: 0,\n border: 'none',\n background: 'transparent',\n color: css('foreground'),\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.6 : 1,\n textAlign: 'left',\n }}\n >\n <span\n aria-hidden=\"true\"\n style={{\n position: 'relative',\n flex: '0 0 auto',\n width: TRACK_W,\n height: TRACK_H,\n borderRadius: TRACK_H / 2,\n boxSizing: 'border-box',\n border: `1px solid ${css('border')}`,\n background: checked ? css('primary') : css('muted'),\n }}\n >\n <span\n style={{\n position: 'absolute',\n top: (TRACK_H - THUMB) / 2 - 1,\n left: checked ? TRACK_W - THUMB - 3 : 2,\n width: THUMB,\n height: THUMB,\n borderRadius: '50%',\n background: checked ? css('primary-foreground') : css('background'),\n border: `1px solid ${css('border')}`,\n boxSizing: 'border-box',\n }}\n />\n </span>\n <span\n data-toggle-word=\"\"\n style={{\n fontSize: font,\n fontWeight: 600,\n lineHeight: 1.1,\n whiteSpace: 'nowrap',\n color: css('foreground'),\n }}\n >\n {word}\n </span>\n </button>\n )}\n {/* One row, so the short read-only caption costs no height at a two-row widget's minimum span. */}\n <div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'baseline', columnGap: spaceVar(2) }}>\n {caption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ACF;AAEJ;",
6
+ "names": ["useEffect", "useRef", "useState", "css", "FIT_MIN_FONT_PX", "fitValueFont", "fitValueFontCss", "fontVar", "spaceVar", "useStickyChars", "css", "fontVar", "spaceVar", "jsx", "jsxs", "spaceVar", "css", "fontVar", "jsx", "jsxs", "useState", "useRef", "useEffect", "useStickyChars", "FIT_MIN_FONT_PX", "fitValueFont", "fitValueFontCss", "spaceVar", "css", "fontVar", "useId", "useMemo", "css", "FIT_MIN_FONT_PX", "fitValueFont", "fitValueFontCss", "optString", "spaceVar", "useStickyChars", "WidgetFrame", "jsx", "jsxs", "optString", "useMemo", "useId", "WidgetFrame", "useStickyChars", "FIT_MIN_FONT_PX", "fitValueFont", "fitValueFontCss", "spaceVar", "css"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ EntitySelector
3
+ } from "./chunk-2GMBZTQD.js";
4
+ export {
5
+ EntitySelector
6
+ };
7
+ //# sourceMappingURL=entity-selector-IRUFUDQ6.js.map