@devicechain/widgets 0.21.1 → 0.22.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 (78) hide show
  1. package/README.md +28 -7
  2. package/dist/aggregate-feed.d.ts +14 -0
  3. package/dist/aggregate-fold.d.ts +11 -0
  4. package/dist/aggregate-reading.d.ts +19 -0
  5. package/dist/aggregate-strings.d.ts +16 -0
  6. package/dist/binding-policy.d.ts +3 -1
  7. package/dist/builtin-descriptors.d.ts +1210 -8
  8. package/dist/builtin-registry.d.ts +1197 -8
  9. package/dist/category-geometry.d.ts +19 -0
  10. package/dist/category-items.d.ts +10 -0
  11. package/dist/chunks/aggregate-feed-6ZYKOQOB.js +130 -0
  12. package/dist/chunks/aggregate-feed-6ZYKOQOB.js.map +7 -0
  13. package/dist/chunks/aggregate-widgets-WVXAW3UL.js +895 -0
  14. package/dist/chunks/aggregate-widgets-WVXAW3UL.js.map +7 -0
  15. package/dist/chunks/chunk-2D7JNKFE.js +65 -0
  16. package/dist/chunks/chunk-2D7JNKFE.js.map +7 -0
  17. package/dist/chunks/chunk-S2OMBJLI.js +200 -0
  18. package/dist/chunks/chunk-S2OMBJLI.js.map +7 -0
  19. package/dist/chunks/chunk-XQQQNTBX.js +76 -0
  20. package/dist/chunks/chunk-XQQQNTBX.js.map +7 -0
  21. package/dist/chunks/chunk-YPFB6DAL.js +157 -0
  22. package/dist/chunks/chunk-YPFB6DAL.js.map +7 -0
  23. package/dist/chunks/chunk-ZR74ORIT.js +35 -0
  24. package/dist/chunks/chunk-ZR74ORIT.js.map +7 -0
  25. package/dist/chunks/control-widgets-UDS4ET3T.js +775 -0
  26. package/dist/chunks/control-widgets-UDS4ET3T.js.map +7 -0
  27. package/dist/chunks/fleet-feed-FK4ZMKIK.js +252 -0
  28. package/dist/chunks/fleet-feed-FK4ZMKIK.js.map +7 -0
  29. package/dist/chunks/level-widgets-MJB7TOLU.js +833 -0
  30. package/dist/chunks/level-widgets-MJB7TOLU.js.map +7 -0
  31. package/dist/command-control-core.d.ts +68 -0
  32. package/dist/command-control-strings.d.ts +32 -0
  33. package/dist/command-control.d.ts +31 -0
  34. package/dist/dashboard-renderer.d.ts +15 -4
  35. package/dist/fleet-feed.d.ts +21 -0
  36. package/dist/fleet-model.d.ts +43 -0
  37. package/dist/fleet-seed.d.ts +7 -0
  38. package/dist/fleet-strings.d.ts +25 -0
  39. package/dist/heading.d.ts +3 -0
  40. package/dist/index.d.ts +3 -2
  41. package/dist/index.js +1774 -676
  42. package/dist/index.js.map +4 -4
  43. package/dist/level-reading.d.ts +29 -0
  44. package/dist/level-readout.d.ts +25 -0
  45. package/dist/level-strings.d.ts +13 -0
  46. package/dist/options.d.ts +1 -1
  47. package/dist/time-range-bar.d.ts +28 -0
  48. package/dist/use-held.d.ts +1 -0
  49. package/dist/value-scale.d.ts +30 -0
  50. package/dist/widgets/aggregate-lazy.d.ts +305 -0
  51. package/dist/widgets/aggregate-widgets.d.ts +4 -0
  52. package/dist/widgets/alarm-count.d.ts +1 -0
  53. package/dist/widgets/alarm-table.d.ts +4 -1
  54. package/dist/widgets/bar-chart.d.ts +5 -0
  55. package/dist/widgets/battery.d.ts +7 -0
  56. package/dist/widgets/command-slider.d.ts +2 -0
  57. package/dist/widgets/command-toggle.d.ts +4 -0
  58. package/dist/widgets/compass.d.ts +2 -0
  59. package/dist/widgets/control-lazy.d.ts +92 -0
  60. package/dist/widgets/control-widgets.d.ts +2 -0
  61. package/dist/widgets/fleet-table.d.ts +13 -0
  62. package/dist/widgets/gauge.d.ts +52 -0
  63. package/dist/widgets/label.d.ts +1 -1
  64. package/dist/widgets/latest-card.d.ts +44 -1
  65. package/dist/widgets/lazy-chunk.d.ts +8 -0
  66. package/dist/widgets/level-gauge.d.ts +2 -0
  67. package/dist/widgets/level-lazy.d.ts +647 -0
  68. package/dist/widgets/level-widgets.d.ts +7 -0
  69. package/dist/widgets/linear-gauge.d.ts +2 -0
  70. package/dist/widgets/pie-chart.d.ts +2 -0
  71. package/dist/widgets/progress-ring.d.ts +3 -0
  72. package/dist/widgets/severity.d.ts +2 -1
  73. package/dist/widgets/signal-bars.d.ts +3 -0
  74. package/dist/widgets/stat-card.d.ts +3 -0
  75. package/dist/widgets/status-light.d.ts +7 -0
  76. package/dist/widgets/table.d.ts +9 -1
  77. package/dist/widgets/time-series-chart.d.ts +62 -4
  78. package/package.json +8 -8
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/widgets/battery.tsx", "../../src/level-reading.ts", "../../src/level-strings.ts", "../../src/widgets/compass.tsx", "../../src/heading.ts", "../../src/widgets/level-gauge.tsx", "../../src/widgets/linear-gauge.tsx", "../../src/widgets/progress-ring.tsx", "../../src/widgets/signal-bars.tsx", "../../src/widgets/status-light.tsx"],
4
+ "sourcesContent": ["// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// battery \u2014 the charge of a device as a battery glyph filled to value% of its scale. The scale\n// is the documented percent default (0..100) unless the options set another, so a voltage can\n// be shown by configuring min and max. The fill takes the colour of the threshold band the\n// value is in (\"critical below 15\") and keeps the neutral accent in a `normal` band.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { emptyReason, useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\nimport { readRange } from '../value-scale';\n\n// The percent scale the battery uses when the options set none, stated in its descriptor.\nexport const BATTERY_DEFAULT_RANGE = { min: 0, max: 100 } as const;\n\n// The glyph's own geometry, in its viewBox: a body, a terminal nub on the right, and the fill\n// inset inside the body.\nconst VIEW = { w: 120, h: 60 };\nconst BODY = { x: 3, y: 3, w: 104, h: 54, r: 9 };\nconst NUB = { x: 110, y: 20, w: 8, h: 20, r: 3 };\nconst INSET = 7;\nexport const BATTERY_FILL_WIDTH = BODY.w - INSET * 2;\n\nexport function Battery({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n range: readRange(optNumber(widget.options, 'min'), optNumber(widget.options, 'max'), BATTERY_DEFAULT_RANGE),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <BatteryBody reading={reading} scale={scale} />}\n </WidgetFrame>\n );\n}\n\nfunction BatteryBody({ reading: r, scale: ws }: { reading: LevelReading; scale: WidgetScale }) {\n const reason = emptyReason(r);\n if (reason !== undefined || !r.range?.ok || !r.fill) return <LevelEmpty message={reason ?? r.strings.noData} />;\n const range = r.range.range;\n const fill = r.fill;\n // The readout takes the lower share of the box; the glyph keeps the rest, scaled to fit it.\n const readoutHeight = Math.max(ws.px('font-md') * 1.6, ws.size.height * 0.4);\n return (\n <div\n data-threshold-level={r.band?.level}\n data-out-of-range={fill.position === 'within' ? undefined : fill.position}\n data-fill={fill.fraction}\n style={{ height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column', gap: ws.px('space-1') }}\n >\n <div style={{ flex: '1 1 0', minHeight: 0 }}>\n <svg\n role=\"meter\"\n aria-valuemin={range.min}\n aria-valuemax={range.max}\n aria-valuenow={range.min + fill.fraction * (range.max - range.min)}\n aria-valuetext={`${r.display}${r.unit ? ` ${r.unit}` : ''}`}\n viewBox={`0 0 ${VIEW.w} ${VIEW.h}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ width: '100%', height: '100%', display: 'block' }}\n >\n <rect\n x={BODY.x}\n y={BODY.y}\n width={BODY.w}\n height={BODY.h}\n rx={BODY.r}\n style={{ fill: 'none', stroke: css('muted-foreground'), strokeWidth: 4 }}\n />\n <rect x={NUB.x} y={NUB.y} width={NUB.w} height={NUB.h} rx={NUB.r} style={{ fill: css('muted-foreground') }} />\n {fill.fraction > 0 ? (\n <rect\n data-fill-bar=\"\"\n x={BODY.x + INSET}\n y={BODY.y + INSET}\n width={BATTERY_FILL_WIDTH * fill.fraction}\n height={BODY.h - INSET * 2}\n rx={3}\n style={{ fill: r.fillColor }}\n />\n ) : null}\n </svg>\n </div>\n <div style={{ flex: '0 0 auto', height: readoutHeight, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n <LevelReadout\n text={r.display}\n unit={r.unit}\n color={r.levelColor}\n position={fill.position}\n size={{ width: ws.size.width, height: readoutHeight }}\n scale={ws.scale}\n strings={r.strings}\n />\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// What every level-and-indicator widget reads off its options and data, once: the sample it\n// shows, how it formats, the threshold band the value is in and that band's colour, the scale\n// and the fill on it. A widget adds its own drawing on top.\n\nimport {\n bandAt,\n css,\n formatValue,\n levelColor,\n pickSample,\n primaryMeasurementName,\n useSeverityColors,\n type MeasurementStreamState,\n type SeverityLevel,\n type Threshold,\n} from '@devicechain/widget-sdk';\nimport type { MeasurementSample, WidgetInstance } from '@devicechain/dashboards';\n\nimport { levelStrings, type LevelStrings } from './level-strings';\nimport { fillOf, type Fill, type RangeResult } from './value-scale';\n\nexport interface LevelReading {\n // The measurement shown (the title's fallback).\n name: string | undefined;\n sample: MeasurementSample | undefined;\n value: number | undefined;\n unit: string | undefined;\n precision: number | undefined;\n display: string;\n thresholds: Threshold[];\n band: Threshold | undefined;\n // The band's severity colour; undefined for no band and for `normal`, so the widget draws its\n // OWN neutral. `fillColor` below is that choice made for the common case.\n levelColor: string | undefined;\n // The colour a given level resolves to (undefined for `normal`), for drawing the bands themselves.\n colorOf: (level: SeverityLevel | undefined) => string | undefined;\n // The colour of a lit or filled part: the band's, else the chart accent (never a hue of its own).\n fillColor: string;\n range: RangeResult | undefined;\n fill: Fill | undefined;\n strings: LevelStrings;\n}\n\n// What a widget reads off its own options and hands in: the hook reads none itself, so each\n// widget's source states every option it honors (options.test.ts holds that to the schema).\n// `range` is the widget's scale, read with readRange; an indicator with no scale omits it.\nexport interface LevelInput {\n thresholds: Threshold[];\n unit: string | undefined;\n precision: number | undefined;\n range?: RangeResult;\n // Maps the sample's raw value to the one the widget shows (a compass folds a heading onto\n // 0..360); undefined means \"no usable value\". Band, display and fill all read the mapped value.\n normalize?: (raw: number | undefined) => number | undefined;\n}\n\nexport function useLevelReading(widget: WidgetInstance, data: MeasurementStreamState, input: LevelInput): LevelReading {\n const severity = useSeverityColors();\n const name = primaryMeasurementName(widget);\n const sample = pickSample(data.latest, name);\n const { thresholds, unit, precision, range, normalize } = input;\n const raw = sample?.value ?? undefined;\n const value = normalize ? normalize(raw) : raw;\n const band = bandAt(thresholds, value);\n const bandColor = levelColor(severity, band?.level);\n return {\n name,\n sample,\n value,\n unit,\n precision,\n display: formatValue(value, precision),\n thresholds,\n band,\n levelColor: bandColor,\n colorOf: (level) => levelColor(severity, level),\n fillColor: bandColor ?? css('chart-1'),\n range,\n fill: range?.ok ? fillOf(value, range.range) : undefined,\n strings: levelStrings(),\n };\n}\n\n// The reason a scale widget has nothing to draw, or undefined when it can draw. The author's\n// fix (the scale) is named before the absence of data, which resolves itself.\nexport function emptyReason(r: LevelReading): string | undefined {\n if (r.range && !r.range.ok) return r.range.reason === 'missing' ? r.strings.setRange : r.strings.badRange;\n if (r.value === undefined) return r.strings.noData;\n return undefined;\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The few fixed words the level-and-indicator widgets render themselves (the reasons they give\n// instead of a value, and the on/off captions). The widget packages carry no i18n runtime, so\n// this is the one small per-language table, modelled on the SDK's freshness words: a host that\n// adds a runtime later replaces exactly this file. Option labels are translated in the\n// console's catalogs, not here.\n\nimport { viewerLocale } from '@devicechain/widget-sdk';\n\nexport interface LevelStrings {\n // No sample for the bound measurement yet.\n noData: string;\n // A scale widget with no min/max configured.\n setRange: string;\n // max is not above min.\n badRange: string;\n // signal-bars with fewer thresholds than it needs bars.\n setThresholds: string;\n aboveScale: string;\n belowScale: string;\n on: string;\n off: string;\n // The four points of the compass, in N, E, S, W order (West is \"O\" in Spanish).\n cardinals: readonly [string, string, string, string];\n}\n\nexport const LEVEL_STRINGS: Record<'en' | 'es', LevelStrings> = {\n en: {\n noData: 'No data',\n setRange: 'Set min and max',\n badRange: 'Max must be above min',\n setThresholds: 'Set at least two thresholds',\n aboveScale: 'Above scale',\n belowScale: 'Below scale',\n on: 'On',\n off: 'Off',\n cardinals: ['N', 'E', 'S', 'W'],\n },\n es: {\n noData: 'Sin datos',\n setRange: 'Defina m\u00EDn. y m\u00E1x.',\n badRange: 'El m\u00E1x. debe superar el m\u00EDn.',\n setThresholds: 'Defina al menos dos umbrales',\n aboveScale: 'Sobre la escala',\n belowScale: 'Bajo la escala',\n on: 'Encendido',\n off: 'Apagado',\n cardinals: ['N', 'E', 'S', 'O'],\n },\n};\n\nexport function levelStrings(locale: string | undefined = viewerLocale()): LevelStrings {\n return locale?.toLowerCase().split('-')[0] === 'es' ? LEVEL_STRINGS.es : LEVEL_STRINGS.en;\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// compass \u2014 a heading (wind direction, bearing) as a needle on a full turn. North is at the top\n// and the angle runs clockwise, so 90 is east. A reading outside 0..360 folds onto the dial\n// (370 is 10, -90 is 270). The dial is the registered gauge series; the degrees and the nearest\n// of the eight points are DOM text beneath it, so the readability gate can measure them.\n\nimport { useMemo } from 'react';\n\nimport {\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\nimport { buildCompassOption, EChart, useChartTheme } from '@devicechain/widget-sdk/echarts';\n\nimport { cardinalOf, shownHeading } from '../heading';\nimport { emptyReason, useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\n\n// Whole degrees unless the options ask for more: a bearing is rarely good to a tenth.\nconst DEFAULT_PRECISION = 0;\n// The share of the box the readout strip takes; the dial keeps the rest.\nconst READOUT_SHARE = 0.22;\n\nexport function Compass({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const precision = optNumber(widget.options, 'precision') ?? DEFAULT_PRECISION;\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: undefined,\n precision,\n normalize: (raw) => shownHeading(raw, precision),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null} flush>\n {(scale) => <CompassBody reading={reading} title={title} scale={scale} />}\n </WidgetFrame>\n );\n}\n\nfunction CompassBody({ reading: r, title, scale: ws }: { reading: LevelReading; title: string | undefined; scale: WidgetScale }) {\n const theme = useChartTheme();\n const option = useMemo(\n () => buildCompassOption(r.value ?? null, theme, { cardinals: r.strings.cardinals, thresholds: r.thresholds, scale: ws.scale }, ws.size),\n [r.value, theme, r.strings, r.thresholds, ws.scale, ws.size],\n );\n const reason = emptyReason(r);\n if (reason !== undefined || r.value === undefined) return <LevelEmpty message={reason ?? r.strings.noData} />;\n const point = cardinalOf(r.value, r.strings.cardinals);\n const stripHeight = Math.max(ws.px('font-md') * 1.6, ws.size.height * READOUT_SHARE);\n return (\n <div\n role=\"img\"\n aria-label={`${title ? `${title}, ` : ''}${r.display}\u00B0 ${point}`}\n data-threshold-level={r.band?.level}\n style={{ height: '100%', display: 'flex', flexDirection: 'column' }}\n >\n <div style={{ flex: '1 1 0', minHeight: 0 }}>\n <EChart option={option} />\n </div>\n <div style={{ height: stripHeight, display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>\n <LevelReadout\n text={`${r.display}\u00B0`}\n unit={point}\n color={r.levelColor}\n size={{ width: ws.size.width, height: stripHeight }}\n scale={ws.scale}\n strings={r.strings}\n />\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// The compass's pure helpers: rounding a heading before it is folded onto 0..360, and naming the\n// eight-point direction it is nearest. React-free, so the rules are asserted by value.\n\nimport { wrapHeading } from '@devicechain/widget-sdk/echarts';\n\nimport type { LevelStrings } from './level-strings';\n\n// The heading a compass shows: rounded to `precision` places FIRST, then folded onto [0, 360).\n// In that order so 359.6 at whole degrees is 0, not a display of 360. A value that is not a\n// finite number has no heading (undefined).\nexport function shownHeading(raw: number | undefined, precision: number): number | undefined {\n if (raw === undefined || !Number.isFinite(raw)) return undefined;\n const places = Math.min(100, Math.max(0, Math.trunc(precision)));\n return wrapHeading(Number(raw.toFixed(places)));\n}\n\nconst EIGHT_POINT = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'] as const;\nconst LETTER_INDEX: Record<string, 0 | 1 | 2 | 3> = { N: 0, E: 1, S: 2, W: 3 };\n\n// The nearest of the eight points (N, NE, E, ...), written with the locale's letters.\nexport function cardinalOf(heading: number, letters: LevelStrings['cardinals']): string {\n const point = EIGHT_POINT[Math.round(heading / 45) % 8];\n return [...point].map((c) => letters[LETTER_INDEX[c]]).join('');\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// level-gauge \u2014 a tank: the current value of one measurement as how full a vessel is, between a\n// configured min (empty) and max (full). The liquid takes the colour of the threshold band the\n// value is in and keeps the widget's neutral accent in a `normal` band; the readout floats over\n// it, as the value or as a percent of the scale. All DOM, so the readability gate sees its text.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n formatValue,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { emptyReason, useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\nimport { bandSpans, readRange } from '../value-scale';\n\n// The strength of a band the level is not in: the linear gauge's track strength.\nconst MUTED_BAND_OPACITY = 0.35;\n\nexport function LevelGauge({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n range: readRange(optNumber(widget.options, 'min'), optNumber(widget.options, 'max')),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n const percent = optString(widget.options, 'readout') === 'percent';\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <TankBody reading={reading} percent={percent} scale={scale} />}\n </WidgetFrame>\n );\n}\n\nfunction TankBody({ reading: r, percent, scale: ws }: { reading: LevelReading; percent: boolean; scale: WidgetScale }) {\n const reason = emptyReason(r);\n if (reason !== undefined || !r.range?.ok || !r.fill) return <LevelEmpty message={reason ?? r.strings.noData} />;\n const range = r.range.range;\n const fill = r.fill;\n const wall = 2;\n const stripe = ws.px('space-1');\n // The percent is of the scale and is NOT clamped: 130 % of a tank is the truth the marker flags.\n const text = percent ? `${formatValue(fill.ratio * 100, r.precision ?? 0)}` : r.display;\n const unit = percent ? '%' : r.unit;\n // A band is a SCALE MARKER until the level is in it: drawn muted, as the linear gauge draws its\n // track, so a full tank's low-fuel band does not read as a warning at a glance. The band the\n // level is in is drawn at full strength, agreeing with the liquid's colour.\n const bands = bandSpans(r.thresholds, range).flatMap((b) => {\n const color = r.colorOf(b.level);\n const active = fill.fraction >= b.from && (fill.fraction < b.to || (b.to >= 1 && fill.fraction >= 1));\n return color === undefined ? [] : [{ from: b.from, to: b.to, color, active }];\n });\n const inner = { width: Math.max(0, ws.size.width - wall * 2 - stripe), height: Math.max(0, ws.size.height - wall * 2) };\n return (\n <div\n data-threshold-level={r.band?.level}\n data-out-of-range={fill.position === 'within' ? undefined : fill.position}\n data-fill={fill.fraction}\n style={{ height: '100%', boxSizing: 'border-box', display: 'flex', gap: ws.px('space-1') }}\n >\n <div\n role=\"meter\"\n aria-valuemin={range.min}\n aria-valuemax={range.max}\n aria-valuenow={range.min + fill.fraction * (range.max - range.min)}\n aria-valuetext={`${r.display}${r.unit ? ` ${r.unit}` : ''}`}\n style={{\n position: 'relative',\n flex: '1 1 0',\n minWidth: 0,\n overflow: 'hidden',\n boxSizing: 'border-box',\n border: `${wall}px solid ${css('border')}`,\n borderRadius: ws.px('space-2'),\n background: css('muted'),\n }}\n >\n <div\n data-liquid=\"\"\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n height: `${fill.fraction * 100}%`,\n background: r.fillColor,\n opacity: 0.55,\n borderTop: fill.fraction > 0 && fill.fraction < 1 ? `2px solid ${r.fillColor}` : undefined,\n }}\n />\n <div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n <LevelReadout\n text={text}\n unit={unit}\n color={r.levelColor}\n position={fill.position}\n size={inner}\n scale={ws.scale}\n strings={r.strings}\n />\n </div>\n </div>\n {/* The bands as a strip beside the tank, so the thresholds read against the level. */}\n <div style={{ position: 'relative', width: stripe, flexShrink: 0, borderRadius: stripe / 2, background: css('muted'), overflow: 'hidden' }}>\n {bands.map((b, i) => (\n <div\n key={i}\n data-band=\"\"\n data-band-active={b.active ? '' : undefined}\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: `${b.from * 100}%`,\n height: `${(b.to - b.from) * 100}%`,\n background: b.color,\n opacity: b.active ? 1 : MUTED_BAND_OPACITY,\n }}\n />\n ))}\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// linear-gauge \u2014 the current value of one measurement on a straight scale: a horizontal or\n// vertical bar, or a thermometer (a vertical tube with a bulb). Threshold bands sit on the\n// track; the fill and the readout take the colour of the band the value is in, and keep the\n// widget's own neutral in a `normal` band. All DOM, so the readability gate measures its text.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n fontVar,\n formatValue,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { emptyReason, useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\nimport { bandSpans, readRange } from '../value-scale';\n\nexport function LinearGauge({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n range: readRange(optNumber(widget.options, 'min'), optNumber(widget.options, 'max')),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n const thermometer = optString(widget.options, 'style') === 'thermometer';\n // A thermometer is always vertical; `orientation` applies to the bar.\n const vertical = thermometer || optString(widget.options, 'orientation') === 'vertical';\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <LinearBody reading={reading} thermometer={thermometer} vertical={vertical} scale={scale} />}\n </WidgetFrame>\n );\n}\n\ninterface BodyProps {\n reading: LevelReading;\n thermometer: boolean;\n vertical: boolean;\n scale: WidgetScale;\n}\n\nfunction LinearBody({ reading: r, thermometer, vertical, scale: ws }: BodyProps) {\n const reason = emptyReason(r);\n if (reason !== undefined || !r.range?.ok || !r.fill) return <LevelEmpty message={reason ?? r.strings.noData} />;\n const range = r.range.range;\n const fill = r.fill;\n const { size, scale } = ws;\n const thickness = ws.px('space-3');\n const gap = ws.px('space-2');\n const labelPx = ws.px('font-xs');\n const minText = formatValue(range.min, r.precision);\n const maxText = formatValue(range.max, r.precision);\n const bulb = thermometer ? thickness * 2 : 0;\n\n // Only coloured levels draw a band: `normal`, and the stretch below the lowest threshold,\n // stay the track's own neutral.\n const bands = bandSpans(r.thresholds, range).flatMap((b) => {\n const color = r.colorOf(b.level);\n return color === undefined ? [] : [{ from: b.from, to: b.to, color }];\n });\n const track = (\n <Track\n vertical={vertical}\n thickness={thickness}\n fraction={fill.fraction}\n color={r.fillColor}\n bands={bands}\n bulb={bulb}\n aria={{\n min: range.min,\n max: range.max,\n now: range.min + fill.fraction * (range.max - range.min),\n text: `${r.display}${r.unit ? ` ${r.unit}` : ''}`,\n }}\n />\n );\n const readout = (room: { width: number; height: number }) => (\n <LevelReadout\n text={r.display}\n unit={r.unit}\n color={r.levelColor}\n position={fill.position}\n size={room}\n scale={scale}\n strings={r.strings}\n />\n );\n const labelStyle = { fontSize: fontVar('xs'), color: css('muted-foreground'), lineHeight: 1.1 } as const;\n const root = {\n height: '100%',\n boxSizing: 'border-box',\n overflow: 'hidden',\n display: 'flex',\n gap,\n } as const;\n const marks = {\n 'data-threshold-level': r.band?.level,\n 'data-out-of-range': fill.position === 'within' ? undefined : fill.position,\n 'data-fill': fill.fraction,\n };\n\n if (!vertical) {\n // The readout on top, fitted to what the track and its end labels leave; the track under it.\n const trackRoom = thickness + labelPx * 1.4 + gap * 2;\n return (\n <div {...marks} style={{ ...root, flexDirection: 'column', justifyContent: 'safe center' }}>\n <div style={{ flex: '1 1 0', minHeight: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {readout({ width: size.width, height: Math.max(0, size.height - trackRoom) })}\n </div>\n {track}\n <div style={{ display: 'flex', justifyContent: 'space-between', gap, ...labelStyle }}>\n <span>{minText}</span>\n <span>{maxText}</span>\n </div>\n </div>\n );\n }\n\n // Vertical: the end labels beside the tube (max on top), the readout in the room that is left.\n const labelRoom = Math.ceil(Math.max(minText.length, maxText.length) * labelPx * 0.62);\n const sideRoom = Math.max(thickness, bulb) + labelRoom + gap * 2;\n return (\n <div {...marks} style={{ ...root, flexDirection: 'row', alignItems: 'stretch' }}>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n alignItems: 'flex-end',\n paddingBottom: bulb,\n ...labelStyle,\n }}\n >\n <span>{maxText}</span>\n <span>{minText}</span>\n </div>\n {track}\n <div style={{ flex: '1 1 0', minWidth: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {readout({ width: Math.max(0, size.width - sideRoom), height: size.height })}\n </div>\n </div>\n );\n}\n\ninterface TrackProps {\n vertical: boolean;\n thickness: number;\n fraction: number;\n color: string;\n bands: { from: number; to: number; color: string }[];\n bulb: number;\n aria: { min: number; max: number; now: number; text: string };\n}\n\nfunction Track({ vertical, thickness, fraction, color, bands, bulb, aria }: TrackProps) {\n const pct = (f: number) => `${f * 100}%`;\n const radius = thickness / 2;\n const tube = (\n <div\n role=\"meter\"\n aria-valuemin={aria.min}\n aria-valuemax={aria.max}\n aria-valuenow={aria.now}\n aria-valuetext={aria.text}\n style={{\n position: 'relative',\n overflow: 'hidden',\n background: css('muted'),\n borderRadius: radius,\n flexShrink: 0,\n ...(vertical ? { width: thickness, flex: '1 1 0', minHeight: 0 } : { width: '100%', height: thickness }),\n }}\n >\n {bands.map((b, i) => (\n <div\n key={i}\n data-band=\"\"\n style={{\n position: 'absolute',\n background: b.color,\n opacity: 0.35,\n ...(vertical\n ? { left: 0, right: 0, bottom: pct(b.from), height: pct(b.to - b.from) }\n : { top: 0, bottom: 0, left: pct(b.from), width: pct(b.to - b.from) }),\n }}\n />\n ))}\n <div\n data-fill-bar=\"\"\n style={{\n position: 'absolute',\n background: color,\n ...(vertical\n ? { left: 0, right: 0, bottom: 0, height: pct(fraction) }\n : { top: 0, bottom: 0, left: 0, width: pct(fraction) }),\n }}\n />\n <div\n data-marker=\"\"\n style={{\n position: 'absolute',\n background: css('foreground'),\n ...(vertical\n ? { left: 0, right: 0, height: 2, bottom: `calc(${pct(fraction)} - 1px)` }\n : { top: 0, bottom: 0, width: 2, left: `calc(${pct(fraction)} - 1px)` }),\n }}\n />\n </div>\n );\n if (!vertical) return tube;\n // A vertical tube sits in a column of its own so a thermometer's bulb (wider than the tube)\n // can hang under it, overlapping its foot so the two read as one glass.\n return (\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', minHeight: 0, flex: '0 0 auto', width: Math.max(thickness, bulb) }}>\n {tube}\n {bulb > 0 ? (\n <div\n data-bulb=\"\"\n style={{ width: bulb, height: bulb, borderRadius: '50%', background: color, marginTop: -radius, flexShrink: 0 }}\n />\n ) : null}\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// progress-ring \u2014 how far one measurement has come between a configured min and max, as a ring\n// that fills clockwise from the top. The readout in the middle is the percent of the scale (or\n// the value itself, by option). The arc takes the colour of the threshold band the value is in\n// and keeps the neutral accent in a `normal` band. A value off the scale pins the ring to its\n// end and carries a marker beside the true reading. SVG and DOM, so the gate sees the text.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n formatValue,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { emptyReason, useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\nimport { readRange } from '../value-scale';\n\n// The ring's geometry in its 100 x 100 viewBox.\nconst RING_RADIUS = 42;\nconst RING_STROKE = 10;\nexport const RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;\n// The readout's room inside the ring, as a share of the side.\nconst INNER = { width: 0.62, height: 0.34 };\n\nexport function ProgressRing({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n range: readRange(optNumber(widget.options, 'min'), optNumber(widget.options, 'max')),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n const percent = optString(widget.options, 'readout') !== 'value';\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <RingBody reading={reading} percent={percent} scale={scale} />}\n </WidgetFrame>\n );\n}\n\nfunction RingBody({ reading: r, percent, scale: ws }: { reading: LevelReading; percent: boolean; scale: WidgetScale }) {\n const reason = emptyReason(r);\n if (reason !== undefined || !r.range?.ok || !r.fill) return <LevelEmpty message={reason ?? r.strings.noData} />;\n const range = r.range.range;\n const fill = r.fill;\n // The percent is of the scale and is NOT clamped: 150 % is the truth the marker flags.\n const text = percent ? formatValue(fill.ratio * 100, r.precision ?? 0) : r.display;\n const unit = percent ? '%' : r.unit;\n const side = Math.max(0, Math.min(ws.size.width, ws.size.height));\n return (\n <div\n role=\"meter\"\n aria-valuemin={range.min}\n aria-valuemax={range.max}\n aria-valuenow={range.min + fill.fraction * (range.max - range.min)}\n aria-valuetext={`${r.display}${r.unit ? ` ${r.unit}` : ''}`}\n data-threshold-level={r.band?.level}\n data-out-of-range={fill.position === 'within' ? undefined : fill.position}\n data-fill={fill.fraction}\n style={{ height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }}\n >\n <div style={{ position: 'relative', width: side || '100%', height: side || '100%', aspectRatio: '1' }}>\n <svg viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\" aria-hidden=\"true\" style={{ display: 'block' }}>\n <circle cx=\"50\" cy=\"50\" r={RING_RADIUS} fill=\"none\" strokeWidth={RING_STROKE} style={{ stroke: css('muted') }} />\n <circle\n data-ring-fill=\"\"\n cx=\"50\"\n cy=\"50\"\n r={RING_RADIUS}\n fill=\"none\"\n strokeWidth={RING_STROKE}\n strokeDasharray={`${fill.fraction * RING_CIRCUMFERENCE} ${RING_CIRCUMFERENCE}`}\n transform=\"rotate(-90 50 50)\"\n style={{ stroke: r.fillColor }}\n />\n </svg>\n <div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n <LevelReadout\n text={text}\n unit={unit}\n color={r.levelColor}\n position={fill.position}\n size={{ width: side * INNER.width, height: side * INNER.height }}\n scale={ws.scale}\n strings={r.strings}\n />\n </div>\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// signal-bars \u2014 a signal-strength glyph. The author's thresholds ARE the bars: one bar per\n// threshold, lit for each the value has reached, in the colour of the band the value is in\n// (neutral accent in a `normal` band). Nothing is assumed about the unit or the scale, so a dBm\n// board and a 0-31 CSQ board configure their own steps; with fewer than two thresholds there is\n// nothing to draw and the widget says so.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { useLevelReading, type LevelReading } from '../level-reading';\nimport { LevelEmpty, LevelReadout } from '../level-readout';\nimport { litBars } from '../value-scale';\n\nexport const SIGNAL_MIN_BARS = 2;\n\nconst VIEW = { w: 100, h: 60 };\n\nexport function SignalBars({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <BarsBody reading={reading} scale={scale} />}\n </WidgetFrame>\n );\n}\n\nfunction BarsBody({ reading: r, scale: ws }: { reading: LevelReading; scale: WidgetScale }) {\n if (r.thresholds.length < SIGNAL_MIN_BARS) return <LevelEmpty message={r.strings.setThresholds} />;\n const bars = litBars(r.thresholds, r.value);\n if (!bars) return <LevelEmpty message={r.strings.noData} />;\n const n = bars.total;\n // n bars and n-1 gaps of a third of a bar's width across the viewBox.\n const barW = VIEW.w / (n + (n - 1) / 3);\n const gapW = barW / 3;\n const readoutHeight = Math.max(ws.px('font-md') * 1.6, ws.size.height * 0.34);\n return (\n <div\n data-threshold-level={r.band?.level}\n data-bars-lit={bars.lit}\n data-bars-total={bars.total}\n style={{ height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column', gap: ws.px('space-1') }}\n >\n <div style={{ flex: '1 1 0', minHeight: 0 }}>\n <svg\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={bars.total}\n aria-valuenow={bars.lit}\n aria-valuetext={`${bars.lit}/${bars.total}`}\n viewBox={`0 0 ${VIEW.w} ${VIEW.h}`}\n preserveAspectRatio=\"xMidYMax meet\"\n style={{ width: '100%', height: '100%', display: 'block' }}\n >\n {Array.from({ length: n }, (_, i) => {\n const h = (VIEW.h * (i + 1)) / n;\n const lit = i < bars.lit;\n return (\n <rect\n key={i}\n data-bar={lit ? 'lit' : 'unlit'}\n x={i * (barW + gapW)}\n y={VIEW.h - h}\n width={barW}\n height={h}\n rx={Math.min(3, barW / 3)}\n style={{ fill: lit ? r.fillColor : css('muted') }}\n />\n );\n })}\n </svg>\n </div>\n <div style={{ flex: '0 0 auto', height: readoutHeight, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n <LevelReadout\n text={r.display}\n unit={r.unit}\n color={r.levelColor}\n size={{ width: ws.size.width, height: readoutHeight }}\n scale={ws.scale}\n strings={r.strings}\n />\n </div>\n </div>\n );\n}\n", "// Copyright The DeviceChain Authors\n// SPDX-License-Identifier: Apache-2.0\n\n// status-light \u2014 an indicator lamp for one measurement. Without `onAt` the lamp is lit while a\n// value is present and takes the colour of the threshold band the value is in (neutral accent\n// in a `normal` band), captioned with the band's label or the formatted value. With `onAt` it\n// reads a 0/1-style signal: lit at or above `onAt`, dark below, captioned On/Off. No data is a\n// hollow lamp captioned as such, never \"off\", which would be a claim about the device.\n\nimport { useMemo } from 'react';\n\nimport {\n css,\n fontVar,\n optNumber,\n optString,\n optThresholds,\n WidgetFrame,\n type WidgetProps,\n type WidgetScale,\n} from '@devicechain/widget-sdk';\n\nimport { useLevelReading, type LevelReading } from '../level-reading';\n\nexport function StatusLight({ widget, data }: WidgetProps) {\n const thresholds = useMemo(() => optThresholds(widget.options, 'thresholds'), [widget.options]);\n const reading = useLevelReading(widget, data, {\n thresholds,\n unit: optString(widget.options, 'unit'),\n precision: optNumber(widget.options, 'precision'),\n });\n const title = optString(widget.options, 'title') ?? reading.name;\n const onAt = optNumber(widget.options, 'onAt');\n return (\n <WidgetFrame title={title} sampleTime={reading.sample?.occurredTime ?? null}>\n {(scale) => <LampBody reading={reading} onAt={onAt} scale={scale} />}\n </WidgetFrame>\n );\n}\n\n// What the lamp shows, decided once so the drawing and the tests agree.\nexport function lampState(r: LevelReading, onAt: number | undefined): { lit: boolean | undefined; caption: string } {\n if (r.value === undefined) return { lit: undefined, caption: r.strings.noData };\n const lit = onAt === undefined ? true : r.value >= onAt;\n const fallback = onAt === undefined ? `${r.display}${r.unit ? ` ${r.unit}` : ''}` : lit ? r.strings.on : r.strings.off;\n return { lit, caption: r.band?.label ?? fallback };\n}\n\nfunction LampBody({ reading: r, onAt, scale: ws }: { reading: LevelReading; onAt: number | undefined; scale: WidgetScale }) {\n const { lit, caption } = lampState(r, onAt);\n const captionRoom = ws.px('font-md') * 2.8;\n const smallest = ws.px('space-4');\n const measured = ws.size.width > 0 && ws.size.height > 0;\n // The caption goes UNDER the lamp while there is room for a lamp twice its smallest size and a\n // caption; below that (the 2x2 minimum with a subject line and a freshness footer, at the\n // smallest cell) it goes BESIDE it, on one line, so the minimum the descriptor declares holds\n // its whole content rather than pushing the caption out of the box.\n const beside = measured && ws.size.height - captionRoom < smallest * 2;\n const diameter = !measured\n ? smallest * 3\n : beside\n ? Math.max(Math.min(smallest, ws.size.height), Math.floor(Math.min(ws.size.height, ws.size.width * 0.4) * 0.8))\n : Math.max(smallest, Math.floor(Math.min(ws.size.width, ws.size.height - captionRoom) * 0.8));\n const color = r.fillColor;\n return (\n <div\n data-threshold-level={lit ? r.band?.level : undefined}\n data-lit={lit === undefined ? undefined : String(lit)}\n data-lamp-layout={beside ? 'beside' : 'under'}\n style={{\n height: '100%',\n boxSizing: 'border-box',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: beside ? 'row' : 'column',\n alignItems: 'center',\n justifyContent: 'safe center',\n gap: ws.px('space-2'),\n textAlign: 'center',\n }}\n >\n <div\n data-lamp=\"\"\n style={{\n width: diameter,\n height: diameter,\n flexShrink: 0,\n borderRadius: '50%',\n boxSizing: 'border-box',\n background: lit ? color : 'transparent',\n border: `2px solid ${lit ? color : css('muted-foreground')}`,\n boxShadow: lit ? `0 0 ${Math.round(diameter / 4)}px ${color}` : 'none',\n }}\n />\n <div\n data-lamp-caption=\"\"\n style={{\n fontSize: fontVar('md'),\n fontWeight: 600,\n lineHeight: 1.2,\n color: lit === undefined ? css('muted-foreground') : css('foreground'),\n overflowWrap: 'anywhere',\n maxWidth: '100%',\n minWidth: 0,\n }}\n >\n {caption}\n </div>\n </div>\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;AAQA,SAAS,eAAe;AAExB;AAAA,EACE,OAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACXP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;;;ACTP,SAAS,oBAAoB;AAmBtB,IAAM,gBAAmD;AAAA,EAC9D,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,WAAW,CAAC,KAAK,KAAK,KAAK,GAAG;AAAA,EAChC;AAAA,EACA,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,WAAW,CAAC,KAAK,KAAK,KAAK,GAAG;AAAA,EAChC;AACF;AAEO,SAAS,aAAa,SAA6B,aAAa,GAAiB;AACtF,SAAO,QAAQ,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,OAAO,cAAc,KAAK,cAAc;AACzF;;;ADIO,SAAS,gBAAgB,QAAwB,MAA8B,OAAiC;AACrH,QAAM,WAAW,kBAAkB;AACn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,OAAO,QAAQ,SAAYD,KAAI,kBAAkB,IAAIA,KAAI,YAAY;AAAA,cACrE,cAAc;AAAA,cACd,UAAU;AAAA,cACV,UAAU;AAAA,YACZ;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
+ "names": ["css", "css", "useMemo", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "useMemo", "optThresholds", "optNumber", "optString", "WidgetFrame", "useMemo", "css", "formatValue", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "useMemo", "optThresholds", "optString", "optNumber", "WidgetFrame", "formatValue", "css", "useMemo", "css", "formatValue", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "useMemo", "optThresholds", "optString", "optNumber", "WidgetFrame", "formatValue", "css", "useMemo", "css", "formatValue", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "useMemo", "optThresholds", "optString", "optNumber", "WidgetFrame", "formatValue", "css", "useMemo", "css", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "VIEW", "useMemo", "optThresholds", "optString", "optNumber", "WidgetFrame", "css", "useMemo", "css", "fontVar", "optNumber", "optString", "optThresholds", "WidgetFrame", "jsx", "jsxs", "useMemo", "optThresholds", "optString", "optNumber", "WidgetFrame", "css", "fontVar"]
7
+ }
@@ -0,0 +1,68 @@
1
+ import type { CommandParameter, CommandRow } from '@devicechain/dashboards';
2
+ export type ControlKind = 'number' | 'boolean';
3
+ export type Refusal = {
4
+ code: 'noCommand';
5
+ } | {
6
+ code: 'setParameter';
7
+ } | {
8
+ code: 'parameterMissing';
9
+ name: string;
10
+ } | {
11
+ code: 'wrongType';
12
+ name: string;
13
+ kind: ControlKind;
14
+ } | {
15
+ code: 'fixedChoices';
16
+ name: string;
17
+ } | {
18
+ code: 'otherRequired';
19
+ names: string[];
20
+ } | {
21
+ code: 'badDefault';
22
+ names: string[];
23
+ } | {
24
+ code: 'setRange';
25
+ } | {
26
+ code: 'badRange';
27
+ };
28
+ export interface BindInput {
29
+ commandName: string | undefined;
30
+ parameterSchema: string | null | undefined;
31
+ parameter: string | undefined;
32
+ min?: number;
33
+ max?: number;
34
+ step?: number;
35
+ }
36
+ export interface Range {
37
+ min: number;
38
+ max: number;
39
+ step: number;
40
+ integer: boolean;
41
+ }
42
+ export type Binding = {
43
+ ok: true;
44
+ kind: ControlKind;
45
+ param: CommandParameter;
46
+ range?: Range;
47
+ sent: CommandParameter[];
48
+ } | {
49
+ ok: false;
50
+ refusal: Refusal;
51
+ };
52
+ export declare function bindControl(kind: ControlKind, input: BindInput): Binding;
53
+ export declare function clampToRange(range: Range, raw: number): number;
54
+ export declare function payloadFor(binding: Extract<Binding, {
55
+ ok: true;
56
+ }>, value: number | boolean): string;
57
+ export type DeliveryGroup = 'pending' | 'delivered' | 'failed' | 'unknown';
58
+ export declare function deliveryGroup(status: string): DeliveryGroup;
59
+ export interface LastSent {
60
+ token: string;
61
+ value: number | boolean | undefined;
62
+ status: string;
63
+ }
64
+ export interface Optimistic {
65
+ token: string;
66
+ value: number | boolean;
67
+ }
68
+ export declare function lastSent(kind: ControlKind, commands: readonly CommandRow[], commandName: string, parameter: string, optimistic: Optimistic | null): LastSent | null;
@@ -0,0 +1,32 @@
1
+ export interface ControlStrings {
2
+ noCommand: string;
3
+ setParameter: string;
4
+ parameterMissing: (name: string) => string;
5
+ wrongType: (name: string, expected: string) => string;
6
+ fixedChoices: (name: string) => string;
7
+ otherRequired: (names: string[]) => string;
8
+ badDefault: (names: string[]) => string;
9
+ setRange: string;
10
+ badRange: string;
11
+ numberKind: string;
12
+ booleanKind: string;
13
+ lastSent: string;
14
+ nothingSent: string;
15
+ beyondHistory: string;
16
+ noValue: string;
17
+ unsent: string;
18
+ sliderHint: string;
19
+ pending: string;
20
+ delivered: string;
21
+ failed: string;
22
+ sending: string;
23
+ on: string;
24
+ off: string;
25
+ viewOnly: string;
26
+ noPermission: string;
27
+ noSeam: string;
28
+ noDevice: string;
29
+ sendFailed: string;
30
+ }
31
+ export declare const CONTROL_STRINGS: Record<'en' | 'es', ControlStrings>;
32
+ export declare function controlStrings(locale?: string | undefined): ControlStrings;
@@ -0,0 +1,31 @@
1
+ import type { WidgetActions } from '@devicechain/dashboards';
2
+ import { type ControlStrings } from './command-control-strings';
3
+ import { type LastSent, type Optimistic, type Refusal } from './command-control-core';
4
+ export declare const TOUCH_TARGET_PX = 44;
5
+ export declare function refusalText(r: Refusal, s: ControlStrings, expect: 'number' | 'boolean'): string;
6
+ export interface CommandSender {
7
+ strings: ControlStrings;
8
+ readOnlyReason: string | undefined;
9
+ canSend: boolean;
10
+ pending: boolean;
11
+ error: string | null;
12
+ optimistic: Optimistic | null;
13
+ send: (payload: string, value: number | boolean) => boolean;
14
+ }
15
+ export declare function useCommandSender(actions: WidgetActions | undefined, deviceToken: string | null | undefined, commandName: string | undefined, resetKey: string): CommandSender;
16
+ export declare function ControlEmpty({ message }: {
17
+ message: string;
18
+ }): import("react").JSX.Element;
19
+ export declare const readOnlyId: (captionId: string) => string;
20
+ export declare function ControlNotes({ sender, captionId }: {
21
+ sender: CommandSender;
22
+ captionId: string;
23
+ }): import("react").JSX.Element;
24
+ export declare function LastSentCaption({ id, last, format, strings, override, truncated, }: {
25
+ id: string;
26
+ last: LastSent | null;
27
+ format: (value: number | boolean | undefined) => string;
28
+ strings: ControlStrings;
29
+ override?: string;
30
+ truncated?: boolean;
31
+ }): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { type CanvasBackground, type CanvasSizing, type DashboardDefinition, type WidgetActions, type WidgetBox, type WidgetDataSource, type SlotBinding, type WidgetInstance } from '@devicechain/dashboards';
2
- import type { WidgetRegistry } from '@devicechain/widget-sdk';
1
+ import { type CanvasBackground, type CanvasDensity, type CanvasGrid, type CanvasSizing, type DashboardDefinition, type GridLength, type GridPlacement, type RelativePlacement, type WidgetActions, type WidgetDataSource, type SlotBinding, type TimeRangeState, type WidgetInstance } from '@devicechain/dashboards';
2
+ import { type WidgetRegistry } from '@devicechain/widget-sdk';
3
3
  import { type CSSProperties } from 'react';
4
4
  import { type WidgetCandidates, type WidgetSelect } from '@devicechain/widget-sdk';
5
5
  export interface DashboardRendererProps {
@@ -14,9 +14,20 @@ export interface DashboardRendererProps {
14
14
  candidates?: WidgetCandidates;
15
15
  timeZone?: string;
16
16
  themeRoot?: Element;
17
+ density?: CanvasDensity;
18
+ timeRange?: TimeRangeState;
17
19
  }
18
- export declare function DashboardRenderer({ definition, hub, registry: registryProp, actions, seedHistory, bindings, sizing, select, candidates, timeZone, themeRoot, }: DashboardRendererProps): import("react").JSX.Element;
19
- export declare function gridItemStyle(box: WidgetBox, columns: number): CSSProperties;
20
+ export declare function DashboardRenderer({ definition, hub, registry: registryProp, actions, seedHistory, bindings, sizing, select, candidates, timeZone, themeRoot, density, timeRange, }: DashboardRendererProps): import("react").JSX.Element;
21
+ export interface GridCss {
22
+ gutterX: string;
23
+ gutterY: string;
24
+ padding: string;
25
+ cell: string;
26
+ }
27
+ export declare function gridLengthCss(len: GridLength): string;
28
+ export declare function gridCss(grid: CanvasGrid, columns: number): GridCss;
29
+ export declare function gridItemStyle(p: GridPlacement, columns: number): CSSProperties;
30
+ export declare function relativeBoxStyle(p: RelativePlacement, lengths: Pick<GridCss, 'gutterX' | 'gutterY'>): CSSProperties;
20
31
  export declare function sizingStyle(sizing: CanvasSizing, bg: CanvasBackground | undefined): CSSProperties;
21
32
  export declare function resolveWidgets(widgets: WidgetInstance[], bindings: Record<string, SlotBinding> | undefined): WidgetInstance[];
22
33
  export declare function widgetSubjectLabel(widget: WidgetInstance): string | undefined;
@@ -0,0 +1,21 @@
1
+ import { type WidgetActions, type WidgetDataSource, type WidgetDescriptor, type WidgetInstance } from '@devicechain/dashboards';
2
+ import { type ComponentType } from 'react';
3
+ export declare const FLUSH_MS = 250;
4
+ export interface FleetFeedProps {
5
+ hub: WidgetDataSource;
6
+ widget: WidgetInstance;
7
+ descriptor: WidgetDescriptor;
8
+ Component: ComponentType<any>;
9
+ actions: WidgetActions | undefined;
10
+ ErrorFrame: ComponentType<{
11
+ widget: WidgetInstance;
12
+ error: unknown;
13
+ }>;
14
+ refuse?: boolean;
15
+ }
16
+ export declare function GroupRefusal({ widget, descriptor }: {
17
+ widget: WidgetInstance;
18
+ descriptor: WidgetDescriptor;
19
+ }): import("react").JSX.Element;
20
+ export declare function shownMeasurements(widget: WidgetInstance): string[];
21
+ export default function FleetEntry(props: FleetFeedProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { type FleetMember, type FleetState, type HistoryWindow, type MeasurementSample, type MemberRoster, type MemberSeed } from '@devicechain/dashboards';
2
+ export declare function seedWindow(spanSeconds: number, at: number): HistoryWindow;
3
+ export interface FleetInputs {
4
+ roster: MemberRoster | null;
5
+ seeds: ReadonlyMap<string, MemberSeed | 'failed'>;
6
+ live: ReadonlyMap<string, ReadonlyMap<string, MeasurementSample>>;
7
+ since: number;
8
+ forbidden: boolean;
9
+ }
10
+ export declare function buildFleet(i: FleetInputs): FleetState;
11
+ export declare function newestMemberTime(fleet: FleetState): number | undefined;
12
+ export type Cell = {
13
+ kind: 'value';
14
+ sample: MeasurementSample;
15
+ value: number;
16
+ } | {
17
+ kind: 'loading';
18
+ } | {
19
+ kind: 'failed';
20
+ } | {
21
+ kind: 'not-reported';
22
+ } | {
23
+ kind: 'unread';
24
+ } | {
25
+ kind: 'no-data';
26
+ };
27
+ export declare function cellFor(member: FleetMember, measurement: string): Cell;
28
+ export declare function columnNames(named: readonly string[], members: readonly FleetMember[]): string[];
29
+ export interface SortKey {
30
+ by: string | null;
31
+ descending: boolean;
32
+ }
33
+ export declare function deviceLabel(member: Pick<FleetMember, 'name' | 'token'>): string;
34
+ export declare function sortMembers(members: readonly FleetMember[], key: SortKey): FleetMember[];
35
+ export declare const DEFAULT_PAGE_SIZE = 20;
36
+ export declare function pageCount(rows: number, pageSize: number): number;
37
+ export declare function clampPage(page: number, rows: number, pageSize: number): number;
38
+ export interface DeviceBar {
39
+ label: string;
40
+ token: string;
41
+ value: number | null;
42
+ }
43
+ export declare function deviceBars(members: readonly FleetMember[], measurement: string, sort: 'none' | 'ascending' | 'descending'): DeviceBar[];
@@ -0,0 +1,7 @@
1
+ import type { HistoryWindow, MeasurementBucket, MemberSeed, MemberSeedPlan } from '@devicechain/dashboards';
2
+ export declare const TAIL_SECONDS = 300;
3
+ export declare const MAX_NARROW_READS = 2;
4
+ export declare function foldMemberSeed(deviceToken: string, buckets: readonly MeasurementBucket[], notBefore?: string): MemberSeed;
5
+ export declare function mergeSeeds(newer: MemberSeed, older: MemberSeed): MemberSeed;
6
+ export declare function tailWindow(window: HistoryWindow): HistoryWindow | undefined;
7
+ export declare function memberSeedPlan(window: HistoryWindow, names: readonly string[]): MemberSeedPlan;
@@ -0,0 +1,25 @@
1
+ export interface FleetStrings {
2
+ device: string;
3
+ loading: string;
4
+ notReported: string;
5
+ unread: string;
6
+ noData: string;
7
+ failed: string;
8
+ unbound: string;
9
+ forbidden: string;
10
+ unsupported: string;
11
+ noMembers: string;
12
+ noMeasurement: string;
13
+ oneDevice: string;
14
+ useFleetTable: string;
15
+ usePerDevice: string;
16
+ stale: string;
17
+ truncated: (shown: number, total: number) => string;
18
+ range: (from: number, to: number, of: number) => string;
19
+ previous: string;
20
+ next: string;
21
+ sortBy: (column: string) => string;
22
+ drill: (device: string) => string;
23
+ }
24
+ export declare const FLEET_STRINGS: Record<'en' | 'es', FleetStrings>;
25
+ export declare function fleetStrings(locale?: string | undefined): FleetStrings;
@@ -0,0 +1,3 @@
1
+ import type { LevelStrings } from './level-strings';
2
+ export declare function shownHeading(raw: number | undefined, precision: number): number | undefined;
3
+ export declare function cardinalOf(heading: number, letters: LevelStrings['cardinals']): string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { DashboardRenderer, resolveWidgets, widgetSubjectLabel, type DashboardRendererProps } from './dashboard-renderer';
2
+ export { DEFAULT_TIME_RANGE_LABELS, PausedIndicator, TimeRangeBar, useBoardTimeRange, type TimeRangeControls, type TimeRangeLabels, } from './time-range-bar';
2
3
  export { ConnectedWidget, type ConnectedWidgetProps } from './connected-widget';
3
4
  export { builtinWidgetCatalog, builtinWidgetDescriptors } from './builtin-descriptors';
4
5
  export { builtinWidgetDefinitions, createBuiltinWidgetRegistry } from './builtin-registry';
@@ -6,7 +7,7 @@ export { WIDGET_CHANNEL, WIDGET_BINDS_DATASOURCE, type WidgetChannel } from './r
6
7
  export { pickSample, optBoolean, type WidgetProps, type WidgetComponent } from '@devicechain/widget-sdk';
7
8
  export { TenantBasemapProvider, useTenantBasemap } from './basemap-context';
8
9
  export { MapRuntimeProvider, useMapRuntime, type MapRuntime } from './map-runtime-context';
9
- export { WIDGET_OPTIONS, validateWidgetOptions, numberOptionSpec, clampNumberOption, enumOptionValues, type WidgetOptions, type WidgetOptionSpecs, type OptionSpec, type StringOptionSpec, type NumberOptionSpec, type BooleanOptionSpec, type EnumOptionSpec, type OptionIssue, type OptionIssueCode, } from './options';
10
+ export { WIDGET_OPTIONS, validateWidgetOptions, numberOptionSpec, clampNumberOption, enumOptionValues, type WidgetOptions, type WidgetOptionSpecs, type OptionSpec, type StringOptionSpec, type NumberOptionSpec, type BooleanOptionSpec, type EnumOptionSpec, type ListItemFieldSpec, type ListOptionSpec, type OptionIssue, type OptionIssueCode, } from './options';
10
11
  export { validateDefinitionOptions, stripUnknownOptions, type DefinitionOptionIssue, type DefinitionValidationOptions, } from './definition-options';
11
12
  export { LatestCard } from './widgets/latest-card';
12
13
  export { Gauge } from './widgets/gauge';
@@ -23,5 +24,5 @@ export { placeable, projectToPanel, describePosition, formatDegrees, rasterStyle
23
24
  export { severityColor, severityLabel, severityRank, highestSeverity, } from './widgets/severity';
24
25
  export { commandStatusColor, commandStatusLabel, isTerminalStatus } from './widgets/command-status';
25
26
  export { parseParameterSchema, defaultValues, validateParams, buildPayload, isScalar, } from './widgets/command-params';
26
- export { WidgetFrame, WidgetSubjectProvider, WidgetSelectProvider, useWidgetSelect, WidgetTimeZoneProvider, useWidgetTimeZone, WidgetThemeRootProvider, useWidgetThemeRoot, WidgetCandidatesProvider, useWidgetCandidates, useFlashOnChange, flashTextStyle, flashBackgroundStyle, FlashValue, useMeasurementStream, useAlarmStream, useCommandStream, useLocationStream, useDatasourceAvailability, useDashboardHub, useResolvedBindings, useSlotCandidates, useCandidates, css, type FlashDirection, type WidgetFrameProps, type WidgetSelect, type WidgetCandidates, type MeasurementStreamState, type AlarmStreamState, type CommandStreamState, type LocationStreamState, type CandidatesState, type DatasourceAvailability, type ThemeVar, } from '@devicechain/widget-sdk';
27
+ export { WidgetFrame, WidgetSubjectProvider, WidgetSelectProvider, useWidgetSelect, WidgetTimeZoneProvider, useWidgetTimeZone, WidgetThemeRootProvider, useWidgetThemeRoot, WidgetCandidatesProvider, useWidgetCandidates, useFlashOnChange, flashTextStyle, flashBackgroundStyle, FlashValue, fitValueFont, useMeasurementStream, useAlarmStream, useCommandStream, useLocationStream, useDatasourceAvailability, useDashboardHub, useHubConnectionState, HubConnectionBadge, useResolvedBindings, useSlotCandidates, useCandidates, css, type FlashDirection, type WidgetFrameProps, type WidgetSelect, type WidgetCandidates, type MeasurementStreamState, type AlarmStreamState, type CommandStreamState, type LocationStreamState, type CandidatesState, type DatasourceAvailability, type HubConnectionBadgeProps, type ThemeVar, } from '@devicechain/widget-sdk';
27
28
  export { EChart, buildLineOption, buildGaugeOption, resolveChartTheme, useChartTheme, type EChartOption, type LineChartOptions, type GaugeChartOptions, type ChartTheme, } from '@devicechain/widget-sdk/echarts';