@panoboard/core 1.3.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotations/executor.d.ts +32 -0
- package/dist/annotations/executor.d.ts.map +1 -0
- package/dist/annotations/executor.js +74 -0
- package/dist/annotations/executor.js.map +1 -0
- package/dist/annotations/index.d.ts +2 -0
- package/dist/annotations/index.d.ts.map +1 -0
- package/dist/annotations/index.js +15 -0
- package/dist/annotations/index.js.map +1 -0
- package/dist/cache/keys.d.ts.map +1 -1
- package/dist/cache/keys.js +4 -4
- package/dist/cache/keys.js.map +1 -1
- package/dist/components/ConfigErrorBanner.d.ts.map +1 -1
- package/dist/components/ConfigErrorBanner.js +38 -10
- package/dist/components/ConfigErrorBanner.js.map +1 -1
- package/dist/components/CrosshairContext.d.ts +13 -0
- package/dist/components/CrosshairContext.d.ts.map +1 -0
- package/dist/components/CrosshairContext.js +37 -0
- package/dist/components/CrosshairContext.js.map +1 -0
- package/dist/components/DashboardCard.d.ts +3 -1
- package/dist/components/DashboardCard.d.ts.map +1 -1
- package/dist/components/DashboardCard.js +65 -12
- package/dist/components/DashboardCard.js.map +1 -1
- package/dist/components/DashboardDescription.d.ts +19 -0
- package/dist/components/DashboardDescription.d.ts.map +1 -0
- package/dist/components/DashboardDescription.js +61 -0
- package/dist/components/DashboardDescription.js.map +1 -0
- package/dist/components/DashboardLinks.d.ts +8 -0
- package/dist/components/DashboardLinks.d.ts.map +1 -0
- package/dist/components/DashboardLinks.js +53 -0
- package/dist/components/DashboardLinks.js.map +1 -0
- package/dist/components/DashboardShell.d.ts +5 -1
- package/dist/components/DashboardShell.d.ts.map +1 -1
- package/dist/components/DashboardShell.js +42 -25
- package/dist/components/DashboardShell.js.map +1 -1
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +7 -1
- package/dist/components/EmptyState.js.map +1 -1
- package/dist/components/ErrorPage.d.ts.map +1 -1
- package/dist/components/ErrorPage.js +22 -33
- package/dist/components/ErrorPage.js.map +1 -1
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +21 -5
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/NotificationCenter.d.ts +6 -0
- package/dist/components/NotificationCenter.d.ts.map +1 -0
- package/dist/components/NotificationCenter.js +83 -0
- package/dist/components/NotificationCenter.js.map +1 -0
- package/dist/components/NotificationIndicator.d.ts +6 -0
- package/dist/components/NotificationIndicator.d.ts.map +1 -0
- package/dist/components/NotificationIndicator.js +24 -0
- package/dist/components/NotificationIndicator.js.map +1 -0
- package/dist/components/PanelGrid.js +2 -2
- package/dist/components/PanelGrid.js.map +1 -1
- package/dist/components/PanelWrapper.d.ts +2 -1
- package/dist/components/PanelWrapper.d.ts.map +1 -1
- package/dist/components/PanelWrapper.js +101 -16
- package/dist/components/PanelWrapper.js.map +1 -1
- package/dist/components/RefreshContext.d.ts +3 -0
- package/dist/components/RefreshContext.d.ts.map +1 -0
- package/dist/components/RefreshContext.js +7 -0
- package/dist/components/RefreshContext.js.map +1 -0
- package/dist/components/RefreshControl.d.ts +17 -0
- package/dist/components/RefreshControl.d.ts.map +1 -0
- package/dist/components/RefreshControl.js +72 -0
- package/dist/components/RefreshControl.js.map +1 -0
- package/dist/components/SectionGrid.d.ts +9 -0
- package/dist/components/SectionGrid.d.ts.map +1 -0
- package/dist/components/SectionGrid.js +76 -0
- package/dist/components/SectionGrid.js.map +1 -0
- package/dist/components/SectionHeader.d.ts +8 -0
- package/dist/components/SectionHeader.d.ts.map +1 -0
- package/dist/components/SectionHeader.js +21 -0
- package/dist/components/SectionHeader.js.map +1 -0
- package/dist/components/TagPills.d.ts +7 -0
- package/dist/components/TagPills.d.ts.map +1 -0
- package/dist/components/TagPills.js +41 -0
- package/dist/components/TagPills.js.map +1 -0
- package/dist/components/filters/BooleanFilter.d.ts.map +1 -1
- package/dist/components/filters/BooleanFilter.js +1 -3
- package/dist/components/filters/BooleanFilter.js.map +1 -1
- package/dist/components/filters/CalendarGrid.d.ts.map +1 -1
- package/dist/components/filters/CalendarGrid.js +1 -1
- package/dist/components/filters/CalendarGrid.js.map +1 -1
- package/dist/components/filters/DateRangeFilter.d.ts.map +1 -1
- package/dist/components/filters/DateRangeFilter.js +4 -6
- package/dist/components/filters/DateRangeFilter.js.map +1 -1
- package/dist/components/filters/FilterChips.d.ts.map +1 -1
- package/dist/components/filters/FilterChips.js +71 -10
- package/dist/components/filters/FilterChips.js.map +1 -1
- package/dist/components/filters/IntervalFilter.d.ts +9 -0
- package/dist/components/filters/IntervalFilter.d.ts.map +1 -0
- package/dist/components/filters/IntervalFilter.js +32 -0
- package/dist/components/filters/IntervalFilter.js.map +1 -0
- package/dist/components/filters/MultiSelectFilter.d.ts.map +1 -1
- package/dist/components/filters/MultiSelectFilter.js +1 -3
- package/dist/components/filters/MultiSelectFilter.js.map +1 -1
- package/dist/components/filters/NumberFilter.d.ts.map +1 -1
- package/dist/components/filters/NumberFilter.js +5 -1
- package/dist/components/filters/NumberFilter.js.map +1 -1
- package/dist/components/filters/SelectFilter.d.ts +2 -1
- package/dist/components/filters/SelectFilter.d.ts.map +1 -1
- package/dist/components/filters/SelectFilter.js +9 -10
- package/dist/components/filters/SelectFilter.js.map +1 -1
- package/dist/components/filters/TextFilter.d.ts.map +1 -1
- package/dist/components/filters/TextFilter.js +5 -1
- package/dist/components/filters/TextFilter.js.map +1 -1
- package/dist/components/index.d.ts +11 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +14 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/panels/AnnotationLayer.d.ts +28 -0
- package/dist/components/panels/AnnotationLayer.d.ts.map +1 -0
- package/dist/components/panels/AnnotationLayer.js +102 -0
- package/dist/components/panels/AnnotationLayer.js.map +1 -0
- package/dist/components/panels/AreaChart.d.ts +3 -1
- package/dist/components/panels/AreaChart.d.ts.map +1 -1
- package/dist/components/panels/AreaChart.js +87 -5
- package/dist/components/panels/AreaChart.js.map +1 -1
- package/dist/components/panels/BarChart.d.ts.map +1 -1
- package/dist/components/panels/BarChart.js +61 -7
- package/dist/components/panels/BarChart.js.map +1 -1
- package/dist/components/panels/BulletChart.js +1 -1
- package/dist/components/panels/BulletChart.js.map +1 -1
- package/dist/components/panels/CalendarHeatmap.d.ts.map +1 -1
- package/dist/components/panels/CalendarHeatmap.js +7 -4
- package/dist/components/panels/CalendarHeatmap.js.map +1 -1
- package/dist/components/panels/ChartTooltip.d.ts.map +1 -1
- package/dist/components/panels/ChartTooltip.js +9 -48
- package/dist/components/panels/ChartTooltip.js.map +1 -1
- package/dist/components/panels/DataLinks.d.ts +35 -0
- package/dist/components/panels/DataLinks.d.ts.map +1 -0
- package/dist/components/panels/DataLinks.js +67 -0
- package/dist/components/panels/DataLinks.js.map +1 -0
- package/dist/components/panels/GaugePanel.d.ts +7 -0
- package/dist/components/panels/GaugePanel.d.ts.map +1 -0
- package/dist/components/panels/GaugePanel.js +116 -0
- package/dist/components/panels/GaugePanel.js.map +1 -0
- package/dist/components/panels/HistogramPanel.d.ts +18 -0
- package/dist/components/panels/HistogramPanel.d.ts.map +1 -0
- package/dist/components/panels/HistogramPanel.js +92 -0
- package/dist/components/panels/HistogramPanel.js.map +1 -0
- package/dist/components/panels/LineChart.d.ts +3 -1
- package/dist/components/panels/LineChart.d.ts.map +1 -1
- package/dist/components/panels/LineChart.js +90 -5
- package/dist/components/panels/LineChart.js.map +1 -1
- package/dist/components/panels/ListPanel.d.ts.map +1 -1
- package/dist/components/panels/ListPanel.js +1 -1
- package/dist/components/panels/ListPanel.js.map +1 -1
- package/dist/components/panels/MarkdownPanel.d.ts +15 -1
- package/dist/components/panels/MarkdownPanel.d.ts.map +1 -1
- package/dist/components/panels/MarkdownPanel.js +70 -7
- package/dist/components/panels/MarkdownPanel.js.map +1 -1
- package/dist/components/panels/MetricPanel.d.ts.map +1 -1
- package/dist/components/panels/MetricPanel.js +1 -1
- package/dist/components/panels/MetricPanel.js.map +1 -1
- package/dist/components/panels/PanelEmpty.d.ts.map +1 -1
- package/dist/components/panels/PanelEmpty.js +1 -1
- package/dist/components/panels/PanelEmpty.js.map +1 -1
- package/dist/components/panels/PanelError.d.ts.map +1 -1
- package/dist/components/panels/PanelError.js +4 -1
- package/dist/components/panels/PanelError.js.map +1 -1
- package/dist/components/panels/PanelSkeleton.js +2 -2
- package/dist/components/panels/PanelSkeleton.js.map +1 -1
- package/dist/components/panels/RadialBarChart.js +1 -1
- package/dist/components/panels/RadialBarChart.js.map +1 -1
- package/dist/components/panels/ScatterChart.d.ts +15 -1
- package/dist/components/panels/ScatterChart.d.ts.map +1 -1
- package/dist/components/panels/ScatterChart.js +96 -26
- package/dist/components/panels/ScatterChart.js.map +1 -1
- package/dist/components/panels/Sparkline.d.ts +21 -0
- package/dist/components/panels/Sparkline.d.ts.map +1 -0
- package/dist/components/panels/Sparkline.js +53 -0
- package/dist/components/panels/Sparkline.js.map +1 -0
- package/dist/components/panels/StatPanel.d.ts +3 -1
- package/dist/components/panels/StatPanel.d.ts.map +1 -1
- package/dist/components/panels/StatPanel.js +33 -4
- package/dist/components/panels/StatPanel.js.map +1 -1
- package/dist/components/panels/TablePanel.d.ts +2 -1
- package/dist/components/panels/TablePanel.d.ts.map +1 -1
- package/dist/components/panels/TablePanel.js +96 -6
- package/dist/components/panels/TablePanel.js.map +1 -1
- package/dist/components/panels/VideoPanel.d.ts.map +1 -1
- package/dist/components/panels/VideoPanel.js +1 -1
- package/dist/components/panels/VideoPanel.js.map +1 -1
- package/dist/components/panels/nivo-theme.d.ts +1 -44
- package/dist/components/panels/nivo-theme.d.ts.map +1 -1
- package/dist/components/panels/nivo-theme.js +9 -104
- package/dist/components/panels/nivo-theme.js.map +1 -1
- package/dist/components/panels/semantic-colors.d.ts.map +1 -1
- package/dist/components/panels/semantic-colors.js +2 -39
- package/dist/components/panels/semantic-colors.js.map +1 -1
- package/dist/components/ui/Button.d.ts +1 -1
- package/dist/components/ui/Button.d.ts.map +1 -1
- package/dist/components/ui/Button.js +6 -9
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Tabs.d.ts.map +1 -1
- package/dist/components/ui/Tabs.js +1 -1
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/connectors/bigquery.d.ts.map +1 -1
- package/dist/connectors/bigquery.js +6 -1
- package/dist/connectors/bigquery.js.map +1 -1
- package/dist/connectors/postgres.d.ts.map +1 -1
- package/dist/connectors/postgres.js +3 -0
- package/dist/connectors/postgres.js.map +1 -1
- package/dist/connectors/redshift.d.ts.map +1 -1
- package/dist/connectors/redshift.js +3 -0
- package/dist/connectors/redshift.js.map +1 -1
- package/dist/contexts/NotificationContext.d.ts +10 -0
- package/dist/contexts/NotificationContext.d.ts.map +1 -0
- package/dist/contexts/NotificationContext.js +24 -0
- package/dist/contexts/NotificationContext.js.map +1 -0
- package/dist/filters/daterange.d.ts +1 -1
- package/dist/filters/daterange.d.ts.map +1 -1
- package/dist/filters/daterange.js +54 -9
- package/dist/filters/daterange.js.map +1 -1
- package/dist/filters/index.d.ts +2 -0
- package/dist/filters/index.d.ts.map +1 -1
- package/dist/filters/index.js +2 -0
- package/dist/filters/index.js.map +1 -1
- package/dist/filters/interval.d.ts +13 -0
- package/dist/filters/interval.d.ts.map +1 -0
- package/dist/filters/interval.js +40 -0
- package/dist/filters/interval.js.map +1 -0
- package/dist/filters/resolver.d.ts +1 -1
- package/dist/filters/resolver.d.ts.map +1 -1
- package/dist/filters/resolver.js +28 -2
- package/dist/filters/resolver.js.map +1 -1
- package/dist/flattenTabs.d.ts +8 -0
- package/dist/flattenTabs.d.ts.map +1 -0
- package/dist/flattenTabs.js +24 -0
- package/dist/flattenTabs.js.map +1 -0
- package/dist/formats.d.ts +1 -1
- package/dist/formats.d.ts.map +1 -1
- package/dist/formats.js +19 -9
- package/dist/formats.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +5 -0
- package/dist/hooks/useNotifications.d.ts.map +1 -0
- package/dist/hooks/useNotifications.js +48 -0
- package/dist/hooks/useNotifications.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interpolation.d.ts +10 -0
- package/dist/interpolation.d.ts.map +1 -0
- package/dist/interpolation.js +64 -0
- package/dist/interpolation.js.map +1 -0
- package/dist/panels/conditional.d.ts +12 -0
- package/dist/panels/conditional.d.ts.map +1 -0
- package/dist/panels/conditional.js +90 -0
- package/dist/panels/conditional.js.map +1 -0
- package/dist/panels/index.d.ts +11 -0
- package/dist/panels/index.d.ts.map +1 -0
- package/dist/panels/index.js +19 -0
- package/dist/panels/index.js.map +1 -0
- package/dist/panels/mappings.d.ts +40 -0
- package/dist/panels/mappings.d.ts.map +1 -0
- package/dist/panels/mappings.js +83 -0
- package/dist/panels/mappings.js.map +1 -0
- package/dist/panels/overrides.d.ts +37 -0
- package/dist/panels/overrides.d.ts.map +1 -0
- package/dist/panels/overrides.js +57 -0
- package/dist/panels/overrides.js.map +1 -0
- package/dist/panels/threshold-layers.d.ts +18 -0
- package/dist/panels/threshold-layers.d.ts.map +1 -0
- package/dist/panels/threshold-layers.js +35 -0
- package/dist/panels/threshold-layers.js.map +1 -0
- package/dist/panels/thresholds.d.ts +36 -0
- package/dist/panels/thresholds.d.ts.map +1 -0
- package/dist/panels/thresholds.js +81 -0
- package/dist/panels/thresholds.js.map +1 -0
- package/dist/schemas/annotations.d.ts +34 -0
- package/dist/schemas/annotations.d.ts.map +1 -0
- package/dist/schemas/annotations.js +19 -0
- package/dist/schemas/annotations.js.map +1 -0
- package/dist/schemas/config.d.ts +1 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/config.js +1 -0
- package/dist/schemas/config.js.map +1 -1
- package/dist/schemas/dashboard.d.ts +5861 -235
- package/dist/schemas/dashboard.d.ts.map +1 -1
- package/dist/schemas/dashboard.js +173 -10
- package/dist/schemas/dashboard.js.map +1 -1
- package/dist/schemas/index.d.ts +6 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +6 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/mappings.d.ts +46 -0
- package/dist/schemas/mappings.d.ts.map +1 -0
- package/dist/schemas/mappings.js +46 -0
- package/dist/schemas/mappings.js.map +1 -0
- package/dist/schemas/overrides.d.ts +77 -0
- package/dist/schemas/overrides.d.ts.map +1 -0
- package/dist/schemas/overrides.js +38 -0
- package/dist/schemas/overrides.js.map +1 -0
- package/dist/schemas/theme.d.ts +89 -7
- package/dist/schemas/theme.d.ts.map +1 -1
- package/dist/schemas/theme.js +40 -24
- package/dist/schemas/theme.js.map +1 -1
- package/dist/schemas/thresholds.d.ts +19 -0
- package/dist/schemas/thresholds.d.ts.map +1 -0
- package/dist/schemas/thresholds.js +31 -0
- package/dist/schemas/thresholds.js.map +1 -0
- package/dist/schemas/transforms.d.ts +54 -0
- package/dist/schemas/transforms.d.ts.map +1 -0
- package/dist/schemas/transforms.js +51 -0
- package/dist/schemas/transforms.js.map +1 -0
- package/dist/startup/sql-lint.d.ts.map +1 -1
- package/dist/startup/sql-lint.js +3 -2
- package/dist/startup/sql-lint.js.map +1 -1
- package/dist/theme/builtin.d.ts.map +1 -1
- package/dist/theme/builtin.js +56 -62
- package/dist/theme/builtin.js.map +1 -1
- package/dist/theme/colors.d.ts +11 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +71 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/context.d.ts.map +1 -1
- package/dist/theme/context.js +16 -3
- package/dist/theme/context.js.map +1 -1
- package/dist/theme/loader-export.d.ts +1 -1
- package/dist/theme/loader-export.d.ts.map +1 -1
- package/dist/theme/loader-export.js +1 -1
- package/dist/theme/loader-export.js.map +1 -1
- package/dist/theme/loader.d.ts +8 -3
- package/dist/theme/loader.d.ts.map +1 -1
- package/dist/theme/loader.js +24 -13
- package/dist/theme/loader.js.map +1 -1
- package/dist/transforms/computed.d.ts +11 -0
- package/dist/transforms/computed.d.ts.map +1 -0
- package/dist/transforms/computed.js +24 -0
- package/dist/transforms/computed.js.map +1 -0
- package/dist/transforms/engine.d.ts +17 -0
- package/dist/transforms/engine.d.ts.map +1 -0
- package/dist/transforms/engine.js +65 -0
- package/dist/transforms/engine.js.map +1 -0
- package/dist/transforms/expression.d.ts +9 -0
- package/dist/transforms/expression.d.ts.map +1 -0
- package/dist/transforms/expression.js +306 -0
- package/dist/transforms/expression.js.map +1 -0
- package/dist/transforms/filter.d.ts +11 -0
- package/dist/transforms/filter.d.ts.map +1 -0
- package/dist/transforms/filter.js +10 -0
- package/dist/transforms/filter.js.map +1 -0
- package/dist/transforms/index.d.ts +10 -0
- package/dist/transforms/index.d.ts.map +1 -0
- package/dist/transforms/index.js +9 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/transforms/limit.d.ts +11 -0
- package/dist/transforms/limit.d.ts.map +1 -0
- package/dist/transforms/limit.js +4 -0
- package/dist/transforms/limit.js.map +1 -0
- package/dist/transforms/percentage.d.ts +11 -0
- package/dist/transforms/percentage.d.ts.map +1 -0
- package/dist/transforms/percentage.js +25 -0
- package/dist/transforms/percentage.js.map +1 -0
- package/dist/transforms/rename.d.ts +11 -0
- package/dist/transforms/rename.d.ts.map +1 -0
- package/dist/transforms/rename.js +17 -0
- package/dist/transforms/rename.js.map +1 -0
- package/dist/transforms/sort.d.ts +11 -0
- package/dist/transforms/sort.d.ts.map +1 -0
- package/dist/transforms/sort.js +21 -0
- package/dist/transforms/sort.js.map +1 -0
- package/dist/types/config-error.d.ts +1 -1
- package/dist/types/config-error.d.ts.map +1 -1
- package/dist/types/notification.d.ts +19 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/notification.js +15 -0
- package/dist/types/notification.js.map +1 -0
- package/package.json +12 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2026 Mataki Labs LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
import { useState, useEffect } from "react";
|
|
16
|
+
import { NotificationContext } from "../contexts/NotificationContext";
|
|
17
|
+
export function NotificationProvider({ children }) {
|
|
18
|
+
const [notifications, setNotifications] = useState([]);
|
|
19
|
+
const [status, setStatus] = useState("healthy");
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let cancelled = false;
|
|
22
|
+
async function poll() {
|
|
23
|
+
try {
|
|
24
|
+
const res = await fetch("/api/notifications");
|
|
25
|
+
if (!res.ok)
|
|
26
|
+
return;
|
|
27
|
+
const data = await res.json();
|
|
28
|
+
if (cancelled)
|
|
29
|
+
return;
|
|
30
|
+
setNotifications(data.notifications);
|
|
31
|
+
setStatus(data.status);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Network error — don't update state
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Initial fetch
|
|
38
|
+
poll();
|
|
39
|
+
// Poll every 30 seconds
|
|
40
|
+
const id = setInterval(poll, 30_000);
|
|
41
|
+
return () => {
|
|
42
|
+
cancelled = true;
|
|
43
|
+
clearInterval(id);
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
return (_jsx(NotificationContext.Provider, { value: { notifications, status, count: notifications.length }, children: children }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=useNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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,GAAG,IAAI,CAAC;YACjB,aAAa,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,mBAAmB,CAAC,QAAQ,IAC3B,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,YAE5D,QAAQ,GACoB,CAChC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ export * from "./schemas";
|
|
|
3
3
|
export * from "./interfaces";
|
|
4
4
|
export * from "./connectors";
|
|
5
5
|
export * from "./query";
|
|
6
|
+
export * from "./transforms";
|
|
6
7
|
export * from "./cache";
|
|
7
8
|
export * from "./filters";
|
|
8
9
|
export * from "./components";
|
|
9
10
|
export * from "./theme";
|
|
10
11
|
export type { ConfigError, ConfigErrorYamlContext } from "./types/config-error";
|
|
12
|
+
export type { Notification, NotificationResponse, NotificationType, NotificationSeverity, SystemStatus, } from "./types/notification";
|
|
11
13
|
export * from "./locale";
|
|
12
14
|
export { formatValue, formatValueShort } from "./formats";
|
|
15
|
+
export { flattenTabs } from "./flattenTabs";
|
|
13
16
|
export * from "./startup";
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAChF,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAG9B,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export * from "./interfaces";
|
|
|
20
20
|
export * from "./connectors";
|
|
21
21
|
// Query engine
|
|
22
22
|
export * from "./query";
|
|
23
|
+
// Transforms
|
|
24
|
+
export * from "./transforms";
|
|
23
25
|
// Cache
|
|
24
26
|
export * from "./cache";
|
|
25
27
|
// Filters
|
|
@@ -32,6 +34,8 @@ export * from "./theme";
|
|
|
32
34
|
export * from "./locale";
|
|
33
35
|
// Formatting
|
|
34
36
|
export { formatValue, formatValueShort } from "./formats";
|
|
37
|
+
// Tab utilities
|
|
38
|
+
export { flattenTabs } from "./flattenTabs";
|
|
35
39
|
// SQL lint
|
|
36
40
|
export * from "./startup";
|
|
37
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,kBAAkB;AAClB,cAAc,WAAW,CAAC;AAE1B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,eAAe;AACf,cAAc,SAAS,CAAC;AAExB,QAAQ;AACR,cAAc,SAAS,CAAC;AAExB,UAAU;AACV,cAAc,WAAW,CAAC;AAE1B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,QAAQ;AACR,cAAc,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,kBAAkB;AAClB,cAAc,WAAW,CAAC;AAE1B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,eAAe;AACf,cAAc,SAAS,CAAC;AAExB,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,QAAQ;AACR,cAAc,SAAS,CAAC;AAExB,UAAU;AACV,cAAc,WAAW,CAAC;AAE1B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,QAAQ;AACR,cAAc,SAAS,CAAC;AAYxB,SAAS;AACT,cAAc,UAAU,CAAC;AAEzB,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE1D,gBAAgB;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,WAAW;AACX,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpolate ${variable} and ${variable:format} placeholders in a template string.
|
|
3
|
+
*
|
|
4
|
+
* - `${name}` resolves to `values[name]` using default formatting
|
|
5
|
+
* - `${name:csv}` applies the csv format hint
|
|
6
|
+
* - `$${literal}` escapes to `${literal}` (not resolved)
|
|
7
|
+
* - Unresolved variables resolve to empty string
|
|
8
|
+
*/
|
|
9
|
+
export declare function interpolate(template: string, values: Record<string, unknown>): string;
|
|
10
|
+
//# sourceMappingURL=interpolation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../src/interpolation.ts"],"names":[],"mappings":"AA6CA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAqBR"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
// Variable interpolation engine for Panoboard.
|
|
15
|
+
// Resolves ${filter_name} and ${filter_name:format} in template strings.
|
|
16
|
+
/**
|
|
17
|
+
* Format a value using the specified format hint.
|
|
18
|
+
* Supported formats: csv, quoted, pipe, raw.
|
|
19
|
+
* Default (no format): string as-is, array as comma-separated.
|
|
20
|
+
*/
|
|
21
|
+
function formatValue(value, format) {
|
|
22
|
+
if (value === null || value === undefined)
|
|
23
|
+
return "";
|
|
24
|
+
const values = Array.isArray(value) ? value.map(String) : [String(value)];
|
|
25
|
+
switch (format) {
|
|
26
|
+
case "csv":
|
|
27
|
+
return values.join(",");
|
|
28
|
+
case "quoted":
|
|
29
|
+
return values.map((v) => `'${v.replace(/'/g, "''")}'`).join(",");
|
|
30
|
+
case "pipe":
|
|
31
|
+
return values.join("|");
|
|
32
|
+
case "raw":
|
|
33
|
+
return values[0] ?? "";
|
|
34
|
+
default:
|
|
35
|
+
// Default: string value as-is, array as comma-separated
|
|
36
|
+
return Array.isArray(value) ? values.join(",") : String(value);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Interpolate ${variable} and ${variable:format} placeholders in a template string.
|
|
41
|
+
*
|
|
42
|
+
* - `${name}` resolves to `values[name]` using default formatting
|
|
43
|
+
* - `${name:csv}` applies the csv format hint
|
|
44
|
+
* - `$${literal}` escapes to `${literal}` (not resolved)
|
|
45
|
+
* - Unresolved variables resolve to empty string
|
|
46
|
+
*/
|
|
47
|
+
export function interpolate(template, values) {
|
|
48
|
+
if (!template)
|
|
49
|
+
return template;
|
|
50
|
+
// First pass: replace escaped $${...} with a placeholder
|
|
51
|
+
const ESCAPE_TOKEN = "\x00ESC\x00";
|
|
52
|
+
let result = template.replace(/\$\$\{/g, ESCAPE_TOKEN);
|
|
53
|
+
// Second pass: resolve ${name} and ${name:format}
|
|
54
|
+
result = result.replace(/\$\{([^}:]+?)(?::([^}]+))?\}/g, (_match, name, format) => {
|
|
55
|
+
const value = values[name];
|
|
56
|
+
if (value === null || value === undefined)
|
|
57
|
+
return "";
|
|
58
|
+
return formatValue(value, format);
|
|
59
|
+
});
|
|
60
|
+
// Third pass: restore escaped sequences
|
|
61
|
+
result = result.replace(new RegExp(ESCAPE_TOKEN, "g"), "${");
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=interpolation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolation.js","sourceRoot":"","sources":["../src/interpolation.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,+CAA+C;AAC/C,yEAAyE;AAEzE;;;;GAIG;AACH,SAAS,WAAW,CAClB,KAAc,EACd,MAA0B;IAE1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAErD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1E,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK;YACR,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnE,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,KAAK,KAAK;YACR,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB;YACE,wDAAwD;YACxD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,MAA+B;IAE/B,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE/B,yDAAyD;IACzD,MAAM,YAAY,GAAG,aAAa,CAAC;IACnC,IAAI,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAEvD,kDAAkD;IAClD,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,+BAA+B,EAC/B,CAAC,MAAM,EAAE,IAAY,EAAE,MAA0B,EAAE,EAAE;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QACrD,OAAO,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC,CACF,CAAC;IAEF,wCAAwC;IACxC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IAE7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConditionalStyle {
|
|
2
|
+
background?: string;
|
|
3
|
+
color?: string;
|
|
4
|
+
weight?: "bold" | "normal";
|
|
5
|
+
italic?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ConditionalRule {
|
|
8
|
+
when: string;
|
|
9
|
+
style: ConditionalStyle;
|
|
10
|
+
}
|
|
11
|
+
export declare function evaluateConditional(value: unknown, rules: ConditionalRule[] | undefined): ConditionalStyle | undefined;
|
|
12
|
+
//# sourceMappingURL=conditional.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../src/panels/conditional.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;CACzB;AA0BD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,eAAe,EAAE,GAAG,SAAS,GACnC,gBAAgB,GAAG,SAAS,CAiD9B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
function parseWhen(when) {
|
|
15
|
+
const match = when
|
|
16
|
+
.trim()
|
|
17
|
+
.match(/^(>=|<=|!=|==|>|<)\s*(.+)$/);
|
|
18
|
+
if (!match)
|
|
19
|
+
return undefined;
|
|
20
|
+
const operator = match[1];
|
|
21
|
+
let operand = match[2].trim();
|
|
22
|
+
const strMatch = operand.match(/^['"](.*)['"]$/);
|
|
23
|
+
if (strMatch) {
|
|
24
|
+
operand = strMatch[1];
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const num = Number(operand);
|
|
28
|
+
if (!isNaN(num)) {
|
|
29
|
+
operand = num;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return { operator, operand };
|
|
33
|
+
}
|
|
34
|
+
export function evaluateConditional(value, rules) {
|
|
35
|
+
if (!rules || rules.length === 0)
|
|
36
|
+
return undefined;
|
|
37
|
+
if (value === null || value === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
for (const rule of rules) {
|
|
40
|
+
const parsed = parseWhen(rule.when);
|
|
41
|
+
if (!parsed)
|
|
42
|
+
continue;
|
|
43
|
+
const { operator, operand } = parsed;
|
|
44
|
+
if (typeof operand === "string") {
|
|
45
|
+
const strVal = String(value);
|
|
46
|
+
switch (operator) {
|
|
47
|
+
case "==":
|
|
48
|
+
if (strVal === operand)
|
|
49
|
+
return rule.style;
|
|
50
|
+
break;
|
|
51
|
+
case "!=":
|
|
52
|
+
if (strVal !== operand)
|
|
53
|
+
return rule.style;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const numVal = Number(value);
|
|
59
|
+
if (isNaN(numVal))
|
|
60
|
+
continue;
|
|
61
|
+
switch (operator) {
|
|
62
|
+
case ">":
|
|
63
|
+
if (numVal > operand)
|
|
64
|
+
return rule.style;
|
|
65
|
+
break;
|
|
66
|
+
case ">=":
|
|
67
|
+
if (numVal >= operand)
|
|
68
|
+
return rule.style;
|
|
69
|
+
break;
|
|
70
|
+
case "<":
|
|
71
|
+
if (numVal < operand)
|
|
72
|
+
return rule.style;
|
|
73
|
+
break;
|
|
74
|
+
case "<=":
|
|
75
|
+
if (numVal <= operand)
|
|
76
|
+
return rule.style;
|
|
77
|
+
break;
|
|
78
|
+
case "==":
|
|
79
|
+
if (numVal === operand)
|
|
80
|
+
return rule.style;
|
|
81
|
+
break;
|
|
82
|
+
case "!=":
|
|
83
|
+
if (numVal !== operand)
|
|
84
|
+
return rule.style;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../src/panels/conditional.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAcjC,SAAS,SAAS,CAChB,IAAY;IAEZ,MAAM,KAAK,GAAG,IAAI;SACf,IAAI,EAAE;SACN,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,OAAO,GAAoB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE/C,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACjD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,GAAG,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU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P,IAAI,MAAM,IAAI,OAAO;oBAAE,OAAO,IAAI,CAAC,KAAK,CAAC;gBACzC,MAAM;YACR,KAAK,IAAI;gBACP,IAAI,MAAM,KAAK,OAAO;oBAAE,OAAO,IAAI,CAAC,KAAK,CAAC;gBAC1C,MAAM;YACR,KAAK,IAAI;gBACP,IAAI,MAAM,KAAK,OAAO;oBAAE,OAAO,IAAI,CAAC,KAAK,CAAC;gBAC1C,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { resolveThresholdColor, resolveSemanticHex } from "./thresholds";
|
|
2
|
+
export type { ThresholdConfig, ThresholdStep } from "./thresholds";
|
|
3
|
+
export { resolveOverrides, simpleGlobMatch } from "./overrides";
|
|
4
|
+
export type { FieldOverride, OverrideMatch, OverrideProperties, ResolvedOverrideProperties, } from "./overrides";
|
|
5
|
+
export { applyMappings } from "./mappings";
|
|
6
|
+
export type { ValueMapping, ValueMappingExact, ValueMappingRange, ValueMappingNull, ValueMappingRegex, MappingResult, } from "./mappings";
|
|
7
|
+
export { evaluateConditional } from "./conditional";
|
|
8
|
+
export type { ConditionalRule, ConditionalStyle } from "./conditional";
|
|
9
|
+
export { buildThresholdBands } from "./threshold-layers";
|
|
10
|
+
export type { ThresholdBand, ChartBounds } from "./threshold-layers";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/panels/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
export { resolveThresholdColor, resolveSemanticHex } from "./thresholds";
|
|
15
|
+
export { resolveOverrides, simpleGlobMatch } from "./overrides";
|
|
16
|
+
export { applyMappings } from "./mappings";
|
|
17
|
+
export { evaluateConditional } from "./conditional";
|
|
18
|
+
export { buildThresholdBands } from "./threshold-layers";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/panels/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQhE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAU3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ValueMappingExact {
|
|
2
|
+
type: "value";
|
|
3
|
+
match: number | string | boolean;
|
|
4
|
+
text: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ValueMappingRange {
|
|
8
|
+
type: "range";
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
text: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ValueMappingNull {
|
|
15
|
+
type: "null";
|
|
16
|
+
text: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ValueMappingRegex {
|
|
20
|
+
type: "regex";
|
|
21
|
+
pattern: string;
|
|
22
|
+
text: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
}
|
|
25
|
+
export type ValueMapping = ValueMappingExact | ValueMappingRange | ValueMappingNull | ValueMappingRegex;
|
|
26
|
+
export interface MappingResult {
|
|
27
|
+
text: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Apply value mappings to a raw value.
|
|
32
|
+
*
|
|
33
|
+
* Evaluation order follows the spec: value > range > regex > null.
|
|
34
|
+
* Within each type, mappings are evaluated in declaration order.
|
|
35
|
+
* First match wins.
|
|
36
|
+
*
|
|
37
|
+
* Returns { text, color } if a mapping matches, or undefined if none match.
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyMappings(value: unknown, mappings: ValueMapping[] | undefined): MappingResult | undefined;
|
|
40
|
+
//# sourceMappingURL=mappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.d.ts","sourceRoot":"","sources":["../../src/panels/mappings.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,YAAY,EAAE,GAAG,SAAS,GACnC,aAAa,GAAG,SAAS,CAgE3B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
/**
|
|
15
|
+
* Apply value mappings to a raw value.
|
|
16
|
+
*
|
|
17
|
+
* Evaluation order follows the spec: value > range > regex > null.
|
|
18
|
+
* Within each type, mappings are evaluated in declaration order.
|
|
19
|
+
* First match wins.
|
|
20
|
+
*
|
|
21
|
+
* Returns { text, color } if a mapping matches, or undefined if none match.
|
|
22
|
+
*/
|
|
23
|
+
export function applyMappings(value, mappings) {
|
|
24
|
+
if (!mappings || mappings.length === 0)
|
|
25
|
+
return undefined;
|
|
26
|
+
// Group mappings by type for ordered evaluation
|
|
27
|
+
const byType = {
|
|
28
|
+
value: [],
|
|
29
|
+
range: [],
|
|
30
|
+
regex: [],
|
|
31
|
+
null: [],
|
|
32
|
+
};
|
|
33
|
+
for (const m of mappings) {
|
|
34
|
+
if (byType[m.type]) {
|
|
35
|
+
byType[m.type].push(m);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// 1. Check value (exact match) mappings first
|
|
39
|
+
for (const m of byType.value) {
|
|
40
|
+
const vm = m;
|
|
41
|
+
// Loose comparison for number/string coercion (e.g., "0" == 0)
|
|
42
|
+
if (value === vm.match || String(value) === String(vm.match)) {
|
|
43
|
+
return { text: vm.text, color: vm.color };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// 2. Check range mappings
|
|
47
|
+
if (value !== null && value !== undefined) {
|
|
48
|
+
const num = Number(value);
|
|
49
|
+
if (!isNaN(num)) {
|
|
50
|
+
for (const m of byType.range) {
|
|
51
|
+
const rm = m;
|
|
52
|
+
if (num >= rm.from && num <= rm.to) {
|
|
53
|
+
return { text: rm.text, color: rm.color };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// 3. Check regex mappings
|
|
59
|
+
if (value !== null && value !== undefined) {
|
|
60
|
+
const str = String(value);
|
|
61
|
+
for (const m of byType.regex) {
|
|
62
|
+
const rxm = m;
|
|
63
|
+
try {
|
|
64
|
+
const regex = new RegExp(rxm.pattern);
|
|
65
|
+
if (regex.test(str)) {
|
|
66
|
+
return { text: rxm.text, color: rxm.color };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Invalid regex — skip
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// 4. Check null mappings
|
|
75
|
+
if (value === null || value === undefined) {
|
|
76
|
+
for (const m of byType.null) {
|
|
77
|
+
const nm = m;
|
|
78
|
+
return { text: nm.text, color: nm.color };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.js","sourceRoot":"","sources":["../../src/panels/mappings.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAyCjC;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa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ACnC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,CAAsB,CAAC;YACnC,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACtC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBACpB,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;gBAC9C,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,uBAAuB;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAED,yBAAyB;IACzB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,CAAqB,CAAC;YACjC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ThresholdConfig } from "./thresholds";
|
|
2
|
+
export interface OverrideMatch {
|
|
3
|
+
field?: string;
|
|
4
|
+
pattern?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface OverrideProperties {
|
|
7
|
+
format?: string;
|
|
8
|
+
decimals?: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
unit?: string;
|
|
14
|
+
thresholds?: ThresholdConfig;
|
|
15
|
+
}
|
|
16
|
+
export interface FieldOverride {
|
|
17
|
+
match: OverrideMatch;
|
|
18
|
+
properties: OverrideProperties;
|
|
19
|
+
}
|
|
20
|
+
export type ResolvedOverrideProperties = OverrideProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Simple glob matching with `*` wildcards only.
|
|
23
|
+
* No full glob semantics — just `*` matching zero or more characters.
|
|
24
|
+
*/
|
|
25
|
+
export declare function simpleGlobMatch(pattern: string, value: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve override properties for a given field name.
|
|
28
|
+
*
|
|
29
|
+
* Matches overrides in order. For each override:
|
|
30
|
+
* - `match.field` matches by exact field name
|
|
31
|
+
* - `match.pattern` matches by simple glob (`*` wildcards)
|
|
32
|
+
*
|
|
33
|
+
* Properties are merged in order — later matches override earlier ones.
|
|
34
|
+
* Returns a merged properties object (all fields optional).
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveOverrides(fieldName: string, overrides: FieldOverride[] | undefined): ResolvedOverrideProperties;
|
|
37
|
+
//# sourceMappingURL=overrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/panels/overrides.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAGD,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,aAAa,EAAE,GAAG,SAAS,GACrC,0BAA0B,CA0B5B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
/**
|
|
15
|
+
* Simple glob matching with `*` wildcards only.
|
|
16
|
+
* No full glob semantics — just `*` matching zero or more characters.
|
|
17
|
+
*/
|
|
18
|
+
export function simpleGlobMatch(pattern, value) {
|
|
19
|
+
// Convert glob pattern to regex: escape special regex chars, replace * with .*
|
|
20
|
+
const escaped = pattern
|
|
21
|
+
.replace(/[.+^${}()|[\]\\]/g, "\\$&")
|
|
22
|
+
.replace(/\*/g, ".*");
|
|
23
|
+
const regex = new RegExp(`^${escaped}$`);
|
|
24
|
+
return regex.test(value);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve override properties for a given field name.
|
|
28
|
+
*
|
|
29
|
+
* Matches overrides in order. For each override:
|
|
30
|
+
* - `match.field` matches by exact field name
|
|
31
|
+
* - `match.pattern` matches by simple glob (`*` wildcards)
|
|
32
|
+
*
|
|
33
|
+
* Properties are merged in order — later matches override earlier ones.
|
|
34
|
+
* Returns a merged properties object (all fields optional).
|
|
35
|
+
*/
|
|
36
|
+
export function resolveOverrides(fieldName, overrides) {
|
|
37
|
+
if (!overrides || overrides.length === 0) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
const merged = {};
|
|
41
|
+
for (const override of overrides) {
|
|
42
|
+
let matches = false;
|
|
43
|
+
if (override.match.field && override.match.field === fieldName) {
|
|
44
|
+
matches = true;
|
|
45
|
+
}
|
|
46
|
+
else if (override.match.pattern &&
|
|
47
|
+
simpleGlobMatch(override.match.pattern, fieldName)) {
|
|
48
|
+
matches = true;
|
|
49
|
+
}
|
|
50
|
+
if (matches) {
|
|
51
|
+
// Merge properties — later values overwrite earlier ones
|
|
52
|
+
Object.assign(merged, override.properties);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return merged;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/panels/overrides.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA4BjC;;;GAGG;AACH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
|
+
y1: number;
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChartBounds {
|
|
8
|
+
yMin: number;
|
|
9
|
+
yMax: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Build horizontal threshold bands for rendering behind chart data.
|
|
13
|
+
*
|
|
14
|
+
* Each band spans from step[i].value to step[i+1].value (or yMax for the last step).
|
|
15
|
+
* Bands are clamped to the chart's visible y-axis range.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildThresholdBands(thresholds: ThresholdConfig | undefined, bounds: ChartBounds): ThresholdBand[];
|
|
18
|
+
//# sourceMappingURL=threshold-layers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threshold-layers.d.ts","sourceRoot":"","sources":["../../src/panels/threshold-layers.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,MAAM,EAAE,WAAW,GAClB,aAAa,EAAE,CAmBjB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2026 Mataki Labs LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Business Source License 1.1 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://github.com/panoboard/panoboard/blob/main/LICENSE
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
/**
|
|
15
|
+
* Build horizontal threshold bands for rendering behind chart data.
|
|
16
|
+
*
|
|
17
|
+
* Each band spans from step[i].value to step[i+1].value (or yMax for the last step).
|
|
18
|
+
* Bands are clamped to the chart's visible y-axis range.
|
|
19
|
+
*/
|
|
20
|
+
export function buildThresholdBands(thresholds, bounds) {
|
|
21
|
+
if (!thresholds || !thresholds.steps || thresholds.steps.length === 0) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const sorted = [...thresholds.steps].sort((a, b) => a.value - b.value);
|
|
25
|
+
const bands = [];
|
|
26
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
27
|
+
const step = sorted[i];
|
|
28
|
+
const nextValue = i < sorted.length - 1 ? sorted[i + 1].value : bounds.yMax;
|
|
29
|
+
const y0 = Math.min(Math.max(step.value, bounds.yMin), bounds.yMax);
|
|
30
|
+
const y1 = Math.min(nextValue, bounds.yMax);
|
|
31
|
+
bands.push({ y0, y1, color: step.color });
|
|
32
|
+
}
|
|
33
|
+
return bands;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=threshold-layers.js.map
|