@burdenoff/microfe-bigconsole 2026.1123.6 → 2026.1124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/asof/AsOfControl.js +2 -2
- package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.js +107 -106
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.d.ts +34 -0
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.js +123 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +1 -1
- package/dist/bigconsole/components/dashboard/DashboardStatusPill.js +19 -35
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +119 -116
- package/dist/bigconsole/components/dashboard/LiveCanvasToggle.js +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.d.ts +0 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +172 -170
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +210 -208
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +97 -97
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +92 -92
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +149 -149
- package/dist/bigconsole/components/datasink/AnomalyDetectorPanel.js +54 -54
- package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js +30 -37
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +4 -4
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +130 -129
- package/dist/bigconsole/components/datasink/SetupStateBadge.js +24 -33
- package/dist/bigconsole/components/datasink/SinkWorkflowLinkForm.js +38 -38
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +57 -56
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +140 -140
- package/dist/bigconsole/components/explore/VisualBuilder.js +85 -84
- package/dist/bigconsole/components/explore/queryAccess/GrantsPanel.js +168 -167
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.js +2 -2
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.js +118 -117
- package/dist/bigconsole/components/insights/BoardLintPanel.js +2 -2
- package/dist/bigconsole/components/insights/OutlierSpottingDialog.js +123 -123
- package/dist/bigconsole/components/kpi-change/KpiChangePanel.js +2 -2
- package/dist/bigconsole/components/narrative/NarrativePanel.js +1 -1
- package/dist/bigconsole/components/overview/DataHealthCard.js +3 -0
- package/dist/bigconsole/components/overview/RecentDashboardsPanel.js +3 -0
- package/dist/bigconsole/components/parser/ParserStatusBadge.js +25 -28
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +23 -22
- package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js +15 -26
- package/dist/bigconsole/components/reconcile/KpiReconcileDialog.js +24 -24
- package/dist/bigconsole/components/settings/WidgetCatalogSection.js +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +188 -187
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +1 -1
- package/dist/bigconsole/components/widgets/UnsupportedDataSourceNotice.js +1 -1
- package/dist/bigconsole/components/widgets/WidgetCompareView.js +3 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.js +1 -1
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +45 -44
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +151 -147
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +48 -47
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +139 -138
- package/dist/bigconsole/components/widgets/form/FormWidget.js +149 -148
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +80 -77
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +58 -56
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +75 -73
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +86 -85
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +80 -77
- package/dist/bigconsole/components/widgets/retention/RetentionView.js +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +214 -211
- package/dist/bigconsole/components/widgets/table/TablePagination.js +59 -58
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +140 -138
- package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +74 -66
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +48 -48
- package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js +28 -37
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +69 -69
- package/dist/bigconsole/hooks/useDashboardListQuery.d.ts +22 -0
- package/dist/bigconsole/hooks/useDashboardListQuery.js +39 -0
- package/dist/bigconsole/pages/AdminPage.js +147 -146
- package/dist/bigconsole/pages/DashboardViewPage.js +2 -0
- package/dist/bigconsole/pages/DashboardsPage.js +638 -855
- package/dist/bigconsole/pages/DataParsersPage.js +5 -0
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +4 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +263 -261
- package/dist/bigconsole/pages/DataSinksPage.js +210 -186
- package/dist/bigconsole/pages/InsightsPage.js +386 -383
- package/dist/bigconsole/pages/ParserBuilderPage.js +413 -413
- package/dist/bigconsole/pages/ParserViewPage.js +2 -0
- package/dist/bigconsole/pages/PipelineBuilderPage.js +279 -276
- package/dist/bigconsole/pages/PipelineViewPage.js +3 -0
- package/dist/bigconsole/pages/PipelinesPage.js +198 -165
- package/dist/bigconsole/pages/SettingsPage.js +160 -160
- package/dist/bigconsole/pages/WidgetDemoPage.js +2 -0
- package/dist/bigconsole/pages/WorkflowViewPage.js +5 -0
- package/dist/bigconsole/pages/WorkflowsPage.js +144 -123
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +123 -122
- package/dist/bigconsole/utils/dashboardGallery.d.ts +84 -0
- package/dist/bigconsole/utils/dashboardGallery.js +93 -0
- package/dist/bigconsole/utils/statusTone.d.ts +17 -0
- package/dist/bigconsole/utils/statusTone.js +44 -0
- package/package.json +4 -4
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { openExternalUrl as e, toSafeHref as t } from "../../utils/safeUrl.js";
|
|
2
2
|
import n, { memo as r, useCallback as i, useMemo as a } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ThemedSelect as o } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
6
|
// src/bigconsole/renderers/adapters/BlockKitRenderer.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let a = t(r,
|
|
9
|
-
return a ? /* @__PURE__ */
|
|
7
|
+
var u = { allowMailto: !0 };
|
|
8
|
+
function d(e, r, i) {
|
|
9
|
+
let a = t(r, u);
|
|
10
|
+
return a ? /* @__PURE__ */ c("a", {
|
|
10
11
|
href: a,
|
|
11
12
|
className: "text-blue-600 dark:text-blue-400 underline",
|
|
12
13
|
target: "_blank",
|
|
13
14
|
rel: "noopener noreferrer",
|
|
14
15
|
children: i
|
|
15
|
-
}, e) : /* @__PURE__ */
|
|
16
|
+
}, e) : /* @__PURE__ */ c(n.Fragment, { children: i }, e);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function f(e) {
|
|
18
19
|
if (!e) return null;
|
|
19
20
|
if (typeof e == "string") return e;
|
|
20
21
|
if (e.type === "mrkdwn") {
|
|
@@ -22,235 +23,235 @@ function d(e) {
|
|
|
22
23
|
for (; i.length > 0;) {
|
|
23
24
|
let e = i.match(/^\*([^*]+)\*/);
|
|
24
25
|
if (e) {
|
|
25
|
-
r.push(/* @__PURE__ */
|
|
26
|
+
r.push(/* @__PURE__ */ c("strong", { children: e[1] }, a++)), i = i.slice(e[0].length);
|
|
26
27
|
continue;
|
|
27
28
|
}
|
|
28
29
|
let t = i.match(/^_([^_]+)_/);
|
|
29
30
|
if (t) {
|
|
30
|
-
r.push(/* @__PURE__ */
|
|
31
|
+
r.push(/* @__PURE__ */ c("em", { children: t[1] }, a++)), i = i.slice(t[0].length);
|
|
31
32
|
continue;
|
|
32
33
|
}
|
|
33
34
|
let o = i.match(/^~([^~]+)~/);
|
|
34
35
|
if (o) {
|
|
35
|
-
r.push(/* @__PURE__ */
|
|
36
|
+
r.push(/* @__PURE__ */ c("del", { children: o[1] }, a++)), i = i.slice(o[0].length);
|
|
36
37
|
continue;
|
|
37
38
|
}
|
|
38
|
-
let
|
|
39
|
-
if (
|
|
40
|
-
r.push(/* @__PURE__ */
|
|
39
|
+
let s = i.match(/^`([^`]+)`/);
|
|
40
|
+
if (s) {
|
|
41
|
+
r.push(/* @__PURE__ */ c("code", {
|
|
41
42
|
className: "bg-bg-sunken px-1 rounded text-sm",
|
|
42
|
-
children:
|
|
43
|
-
}, a++)), i = i.slice(
|
|
43
|
+
children: s[1]
|
|
44
|
+
}, a++)), i = i.slice(s[0].length);
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
47
|
let l = i.match(/^<([^|>]+)\|([^>]+)>/);
|
|
47
48
|
if (l) {
|
|
48
|
-
r.push(
|
|
49
|
+
r.push(d(a++, l[1], l[2])), i = i.slice(l[0].length);
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
53
|
-
r.push(
|
|
52
|
+
let u = i.match(/^<([^|>]+)>/);
|
|
53
|
+
if (u) {
|
|
54
|
+
r.push(d(a++, u[1], u[1])), i = i.slice(u[0].length);
|
|
54
55
|
continue;
|
|
55
56
|
}
|
|
56
57
|
let f = i.match(/^[^*_~`<]+/);
|
|
57
|
-
f ? (r.push(/* @__PURE__ */
|
|
58
|
+
f ? (r.push(/* @__PURE__ */ c(n.Fragment, { children: f[0] }, a++)), i = i.slice(f[0].length)) : (r.push(/* @__PURE__ */ c(n.Fragment, { children: i[0] }, a++)), i = i.slice(1));
|
|
58
59
|
}
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ c("span", { children: r });
|
|
60
61
|
}
|
|
61
62
|
return e.text;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function p(e) {
|
|
64
65
|
switch (e) {
|
|
65
|
-
case "primary": return "bg-
|
|
66
|
-
case "danger": return "bg-
|
|
66
|
+
case "primary": return "bg-[var(--color-action-primary-bg)] hover:bg-[var(--color-action-primary-bgHover)] text-[var(--color-action-primary-text)] transition-colors";
|
|
67
|
+
case "danger": return "bg-[var(--color-action-danger-bg)] hover:bg-[var(--color-action-danger-bgHover)] text-[var(--color-action-danger-text)] transition-colors";
|
|
67
68
|
default: return "bg-bg-sunken hover:bg-bg-sunken/80 text-primary transition-colors";
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function m(e, t) {
|
|
71
72
|
if (e == null) return e;
|
|
72
73
|
if (typeof e == "string") return e.replace(/\$\{([^}]+)\}/g, (e, n) => {
|
|
73
|
-
let r =
|
|
74
|
+
let r = h(t, n.trim());
|
|
74
75
|
return r === void 0 ? "" : String(r);
|
|
75
76
|
});
|
|
76
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
77
|
+
if (Array.isArray(e)) return e.map((e) => m(e, t));
|
|
77
78
|
if (typeof e == "object") {
|
|
78
79
|
let n = {};
|
|
79
|
-
for (let [r, i] of Object.entries(e)) n[r] =
|
|
80
|
+
for (let [r, i] of Object.entries(e)) n[r] = m(i, t);
|
|
80
81
|
return n;
|
|
81
82
|
}
|
|
82
83
|
return e;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function h(e, t) {
|
|
85
86
|
let n = t.split("."), r = e;
|
|
86
87
|
for (let e of n) if (r && typeof r == "object" && e in r) r = r[e];
|
|
87
88
|
else return;
|
|
88
89
|
return r;
|
|
89
90
|
}
|
|
90
|
-
var
|
|
91
|
+
var g = r(function({ block: e, index: t, onAction: n }) {
|
|
91
92
|
switch (e.type) {
|
|
92
|
-
case "header": return /* @__PURE__ */
|
|
93
|
+
case "header": return /* @__PURE__ */ c("div", {
|
|
93
94
|
className: "py-2",
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ c("h2", {
|
|
95
96
|
className: "text-lg font-bold text-primary",
|
|
96
|
-
children:
|
|
97
|
+
children: f(e.text)
|
|
97
98
|
})
|
|
98
99
|
});
|
|
99
|
-
case "section": return /* @__PURE__ */
|
|
100
|
+
case "section": return /* @__PURE__ */ l("div", {
|
|
100
101
|
className: "py-2 flex items-start gap-4",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ l("div", {
|
|
102
103
|
className: "flex-1",
|
|
103
|
-
children: [e.text && /* @__PURE__ */
|
|
104
|
+
children: [e.text && /* @__PURE__ */ c("p", {
|
|
104
105
|
className: "text-primary",
|
|
105
|
-
children:
|
|
106
|
-
}), e.fields && e.fields.length > 0 && /* @__PURE__ */
|
|
106
|
+
children: f(e.text)
|
|
107
|
+
}), e.fields && e.fields.length > 0 && /* @__PURE__ */ c("div", {
|
|
107
108
|
className: "grid grid-cols-2 gap-2 mt-2",
|
|
108
|
-
children: e.fields.map((e, t) => /* @__PURE__ */
|
|
109
|
+
children: e.fields.map((e, t) => /* @__PURE__ */ c("div", {
|
|
109
110
|
className: "text-sm",
|
|
110
|
-
children:
|
|
111
|
+
children: f(e)
|
|
111
112
|
}, t))
|
|
112
113
|
})]
|
|
113
|
-
}), e.accessory && /* @__PURE__ */
|
|
114
|
+
}), e.accessory && /* @__PURE__ */ c("div", {
|
|
114
115
|
className: "flex-shrink-0",
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ c(_, {
|
|
116
117
|
accessory: e.accessory,
|
|
117
118
|
onAction: n
|
|
118
119
|
})
|
|
119
120
|
})]
|
|
120
121
|
});
|
|
121
|
-
case "divider": return /* @__PURE__ */
|
|
122
|
-
case "image": return /* @__PURE__ */
|
|
122
|
+
case "divider": return /* @__PURE__ */ c("hr", { className: "my-2 border-default" });
|
|
123
|
+
case "image": return /* @__PURE__ */ l("div", {
|
|
123
124
|
className: "py-2",
|
|
124
|
-
children: [e.title && /* @__PURE__ */
|
|
125
|
+
children: [e.title && /* @__PURE__ */ c("p", {
|
|
125
126
|
className: "text-sm text-secondary mb-1",
|
|
126
|
-
children:
|
|
127
|
-
}), /* @__PURE__ */
|
|
127
|
+
children: f(e.title)
|
|
128
|
+
}), /* @__PURE__ */ c("img", {
|
|
128
129
|
src: e.image_url,
|
|
129
130
|
alt: e.alt_text || "",
|
|
130
131
|
className: "max-w-full h-auto rounded"
|
|
131
132
|
})]
|
|
132
133
|
});
|
|
133
|
-
case "context": return /* @__PURE__ */
|
|
134
|
+
case "context": return /* @__PURE__ */ c("div", {
|
|
134
135
|
className: "py-1 flex items-center gap-2 flex-wrap text-sm text-secondary",
|
|
135
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
136
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ c("span", { children: e.type === "image" ? /* @__PURE__ */ c("img", {
|
|
136
137
|
src: e.image_url,
|
|
137
138
|
alt: e.alt_text || "",
|
|
138
139
|
className: "w-5 h-5 rounded inline-block"
|
|
139
|
-
}) :
|
|
140
|
+
}) : f(e.text) }, t))
|
|
140
141
|
});
|
|
141
|
-
case "actions": return /* @__PURE__ */
|
|
142
|
+
case "actions": return /* @__PURE__ */ c("div", {
|
|
142
143
|
className: "py-2 flex gap-2 flex-wrap",
|
|
143
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
144
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ c(v, {
|
|
144
145
|
element: e,
|
|
145
146
|
onAction: n
|
|
146
147
|
}, t))
|
|
147
148
|
});
|
|
148
|
-
case "input": return /* @__PURE__ */
|
|
149
|
+
case "input": return /* @__PURE__ */ l("div", {
|
|
149
150
|
className: "py-2",
|
|
150
|
-
children: [e.label ? /* @__PURE__ */
|
|
151
|
+
children: [e.label ? /* @__PURE__ */ c("label", {
|
|
151
152
|
className: "block text-sm font-medium text-secondary mb-1",
|
|
152
|
-
children:
|
|
153
|
-
}) : null, /* @__PURE__ */
|
|
153
|
+
children: f(e.label)
|
|
154
|
+
}) : null, /* @__PURE__ */ c("input", {
|
|
154
155
|
type: "text",
|
|
155
156
|
className: "w-full px-3 py-2 border border-default rounded-md bg-surface text-primary transition-colors focus:ring-2 focus:ring-primary/20",
|
|
156
157
|
placeholder: (() => {
|
|
157
158
|
let t = e.element;
|
|
158
|
-
return t?.placeholder ?
|
|
159
|
+
return t?.placeholder ? f(t.placeholder) : "";
|
|
159
160
|
})()
|
|
160
161
|
})]
|
|
161
162
|
});
|
|
162
|
-
case "rich_text": return /* @__PURE__ */
|
|
163
|
+
case "rich_text": return /* @__PURE__ */ c("div", {
|
|
163
164
|
className: "py-2 text-primary",
|
|
164
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
165
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ c("span", { children: f(e.text) }, t))
|
|
165
166
|
});
|
|
166
167
|
default: return null;
|
|
167
168
|
}
|
|
168
|
-
}),
|
|
169
|
+
}), _ = r(function({ accessory: e, onAction: t }) {
|
|
169
170
|
switch (e.type) {
|
|
170
|
-
case "image": return /* @__PURE__ */
|
|
171
|
+
case "image": return /* @__PURE__ */ c("img", {
|
|
171
172
|
src: e.image_url,
|
|
172
173
|
alt: e.alt_text || "",
|
|
173
174
|
className: "w-12 h-12 rounded object-cover"
|
|
174
175
|
});
|
|
175
|
-
case "button": return /* @__PURE__ */
|
|
176
|
+
case "button": return /* @__PURE__ */ c("button", {
|
|
176
177
|
type: "button",
|
|
177
178
|
onClick: () => t?.(e.action_id || "", e.value),
|
|
178
|
-
className: `px-3 py-1.5 text-sm font-medium rounded ${
|
|
179
|
-
children:
|
|
179
|
+
className: `px-3 py-1.5 text-sm font-medium rounded ${p(e.style)}`,
|
|
180
|
+
children: f(e.text)
|
|
180
181
|
});
|
|
181
|
-
case "overflow": return /* @__PURE__ */
|
|
182
|
+
case "overflow": return /* @__PURE__ */ c("button", {
|
|
182
183
|
type: "button",
|
|
183
184
|
className: "p-1 text-secondary hover:text-primary transition-colors",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ c("svg", {
|
|
185
186
|
className: "w-5 h-5",
|
|
186
187
|
fill: "currentColor",
|
|
187
188
|
viewBox: "0 0 20 20",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ c("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" })
|
|
189
190
|
})
|
|
190
191
|
});
|
|
191
192
|
default: return null;
|
|
192
193
|
}
|
|
193
|
-
}),
|
|
194
|
+
}), v = r(function({ element: t, onAction: n }) {
|
|
194
195
|
let r = i(() => {
|
|
195
196
|
t.action_id && n?.(t.action_id, t.value), t.url && e(t.url);
|
|
196
197
|
}, [t, n]);
|
|
197
198
|
switch (t.type) {
|
|
198
|
-
case "button": return /* @__PURE__ */
|
|
199
|
+
case "button": return /* @__PURE__ */ c("button", {
|
|
199
200
|
type: "button",
|
|
200
201
|
onClick: r,
|
|
201
|
-
className: `px-4 py-2 text-sm font-medium rounded ${
|
|
202
|
-
children:
|
|
202
|
+
className: `px-4 py-2 text-sm font-medium rounded ${p(t.style)}`,
|
|
203
|
+
children: f(t.text)
|
|
203
204
|
});
|
|
204
|
-
case "static_select": return /* @__PURE__ */
|
|
205
|
+
case "static_select": return /* @__PURE__ */ l(o, {
|
|
205
206
|
className: "px-3 py-2 text-sm border border-default rounded bg-surface text-primary transition-colors focus:ring-2 focus:ring-primary/20",
|
|
206
207
|
onChange: (e) => n?.(t.action_id || "", e.target.value),
|
|
207
|
-
children: [t.placeholder ? /* @__PURE__ */
|
|
208
|
+
children: [t.placeholder ? /* @__PURE__ */ c("option", {
|
|
208
209
|
value: "",
|
|
209
|
-
children:
|
|
210
|
-
}) : null, t.options?.map((e, t) => /* @__PURE__ */
|
|
210
|
+
children: f(t.placeholder)
|
|
211
|
+
}) : null, t.options?.map((e, t) => /* @__PURE__ */ c("option", {
|
|
211
212
|
value: e.value,
|
|
212
|
-
children:
|
|
213
|
+
children: f(e.text)
|
|
213
214
|
}, t))]
|
|
214
215
|
});
|
|
215
|
-
case "datepicker": return /* @__PURE__ */
|
|
216
|
+
case "datepicker": return /* @__PURE__ */ c("input", {
|
|
216
217
|
type: "date",
|
|
217
218
|
className: "px-3 py-2 text-sm border border-default rounded bg-surface text-primary transition-colors focus:ring-2 focus:ring-primary/20",
|
|
218
219
|
onChange: (e) => n?.(t.action_id || "", e.target.value)
|
|
219
220
|
});
|
|
220
|
-
case "checkboxes": return /* @__PURE__ */
|
|
221
|
+
case "checkboxes": return /* @__PURE__ */ c("div", {
|
|
221
222
|
className: "space-y-1",
|
|
222
|
-
children: t.options?.map((e, r) => /* @__PURE__ */
|
|
223
|
+
children: t.options?.map((e, r) => /* @__PURE__ */ l("label", {
|
|
223
224
|
className: "flex items-center gap-2 text-sm",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ c("input", {
|
|
225
226
|
type: "checkbox",
|
|
226
227
|
className: "rounded border-default transition-colors",
|
|
227
228
|
onChange: (r) => n?.(t.action_id || "", e.value, { checked: r.target.checked })
|
|
228
|
-
}),
|
|
229
|
+
}), f(e.text)]
|
|
229
230
|
}, r))
|
|
230
231
|
});
|
|
231
|
-
case "radio_buttons": return /* @__PURE__ */
|
|
232
|
+
case "radio_buttons": return /* @__PURE__ */ c("div", {
|
|
232
233
|
className: "space-y-1",
|
|
233
|
-
children: t.options?.map((e, r) => /* @__PURE__ */
|
|
234
|
+
children: t.options?.map((e, r) => /* @__PURE__ */ l("label", {
|
|
234
235
|
className: "flex items-center gap-2 text-sm",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ c("input", {
|
|
236
237
|
type: "radio",
|
|
237
238
|
name: t.action_id,
|
|
238
239
|
className: "border-default transition-colors",
|
|
239
240
|
onChange: () => n?.(t.action_id || "", e.value)
|
|
240
|
-
}),
|
|
241
|
+
}), f(e.text)]
|
|
241
242
|
}, r))
|
|
242
243
|
});
|
|
243
244
|
default: return null;
|
|
244
245
|
}
|
|
245
246
|
});
|
|
246
|
-
function
|
|
247
|
+
function y(e) {
|
|
247
248
|
let t = [];
|
|
248
249
|
for (let [n, r] of Object.entries(e)) if (r != null) {
|
|
249
250
|
if (Array.isArray(r)) t.push({
|
|
250
251
|
type: "header",
|
|
251
252
|
text: {
|
|
252
253
|
type: "plain_text",
|
|
253
|
-
text:
|
|
254
|
+
text: b(n),
|
|
254
255
|
emoji: !0
|
|
255
256
|
}
|
|
256
257
|
}), r.forEach((e, n) => {
|
|
@@ -258,7 +259,7 @@ function v(e) {
|
|
|
258
259
|
let n = [];
|
|
259
260
|
for (let [t, r] of Object.entries(e)) r != null && n.push({
|
|
260
261
|
type: "mrkdwn",
|
|
261
|
-
text: `*${
|
|
262
|
+
text: `*${b(t)}:*\n${x(r)}`
|
|
262
263
|
});
|
|
263
264
|
n.length > 0 && t.push({
|
|
264
265
|
type: "section",
|
|
@@ -268,7 +269,7 @@ function v(e) {
|
|
|
268
269
|
type: "section",
|
|
269
270
|
text: {
|
|
270
271
|
type: "mrkdwn",
|
|
271
|
-
text: `${n + 1}. ${
|
|
272
|
+
text: `${n + 1}. ${x(e)}`
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
275
|
n < r.length - 1 && t.push({ type: "divider" });
|
|
@@ -278,14 +279,14 @@ function v(e) {
|
|
|
278
279
|
type: "header",
|
|
279
280
|
text: {
|
|
280
281
|
type: "plain_text",
|
|
281
|
-
text:
|
|
282
|
+
text: b(n),
|
|
282
283
|
emoji: !0
|
|
283
284
|
}
|
|
284
285
|
});
|
|
285
286
|
let e = [];
|
|
286
287
|
for (let [t, n] of Object.entries(r)) n != null && e.push({
|
|
287
288
|
type: "mrkdwn",
|
|
288
|
-
text: `*${
|
|
289
|
+
text: `*${b(t)}:*\n${x(n)}`
|
|
289
290
|
});
|
|
290
291
|
e.length > 0 && t.push({
|
|
291
292
|
type: "section",
|
|
@@ -295,86 +296,86 @@ function v(e) {
|
|
|
295
296
|
type: "section",
|
|
296
297
|
text: {
|
|
297
298
|
type: "mrkdwn",
|
|
298
|
-
text: `*${
|
|
299
|
+
text: `*${b(n)}:* ${x(r)}`
|
|
299
300
|
}
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
303
|
return t;
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function b(e) {
|
|
305
306
|
return e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim();
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
+
function x(e) {
|
|
308
309
|
return e == null ? "-" : typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
309
310
|
}
|
|
310
|
-
var
|
|
311
|
-
let { t: f } =
|
|
312
|
-
if (n && "blocks" in n) return
|
|
311
|
+
var S = r(function({ widget: e, data: t, template: n, isLoading: r, error: o, onDrilldown: u, onAction: d }) {
|
|
312
|
+
let { t: f } = s(), p = a(() => {
|
|
313
|
+
if (n && "blocks" in n) return m(n, t);
|
|
313
314
|
if (t && "blocks" in t) return t;
|
|
314
315
|
if (t && Object.keys(t).length > 0) {
|
|
315
|
-
let e =
|
|
316
|
+
let e = y(t);
|
|
316
317
|
if (e.length > 0) return { blocks: e };
|
|
317
318
|
}
|
|
318
319
|
if (n) {
|
|
319
|
-
let e =
|
|
320
|
+
let e = m(n, t);
|
|
320
321
|
if (e?.blocks?.length) return e;
|
|
321
322
|
}
|
|
322
323
|
return null;
|
|
323
|
-
}, [n, t]),
|
|
324
|
+
}, [n, t]), h = i((e, t, n) => {
|
|
324
325
|
d && d(e, {
|
|
325
326
|
value: t,
|
|
326
327
|
...n
|
|
327
328
|
});
|
|
328
329
|
}, [d]);
|
|
329
|
-
return r ? /* @__PURE__ */
|
|
330
|
+
return r ? /* @__PURE__ */ c("div", {
|
|
330
331
|
className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
|
|
331
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ l("div", {
|
|
332
333
|
className: "animate-pulse space-y-2 w-full",
|
|
333
334
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ c("div", { className: "h-4 bg-bg-sunken rounded w-3/4" }),
|
|
336
|
+
/* @__PURE__ */ c("div", { className: "h-4 bg-bg-sunken rounded w-1/2" }),
|
|
337
|
+
/* @__PURE__ */ c("div", { className: "h-4 bg-bg-sunken rounded w-5/6" })
|
|
337
338
|
]
|
|
338
339
|
})
|
|
339
|
-
}) :
|
|
340
|
+
}) : o ? /* @__PURE__ */ c("div", {
|
|
340
341
|
className: "flex items-center justify-center h-full p-4 text-red-600 dark:text-red-400",
|
|
341
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ l("div", {
|
|
342
343
|
className: "text-center",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ c("p", {
|
|
344
345
|
className: "font-medium",
|
|
345
346
|
children: f("bigconsole.widget.renderer.blockKit.errorRendering", "Error rendering blocks")
|
|
346
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ c("p", {
|
|
347
348
|
className: "text-sm mt-1",
|
|
348
|
-
children:
|
|
349
|
+
children: o
|
|
349
350
|
})]
|
|
350
351
|
})
|
|
351
|
-
}) :
|
|
352
|
+
}) : p?.blocks?.length ? /* @__PURE__ */ l("div", {
|
|
352
353
|
className: "flex flex-col h-full p-4 bg-surface",
|
|
353
|
-
children: [
|
|
354
|
+
children: [p.blocks.map((e, t) => /* @__PURE__ */ c(g, {
|
|
354
355
|
block: e,
|
|
355
356
|
index: t,
|
|
356
|
-
onAction:
|
|
357
|
-
}, t)),
|
|
357
|
+
onAction: h
|
|
358
|
+
}, t)), p.attachments?.map((e, t) => /* @__PURE__ */ l("div", {
|
|
358
359
|
className: "mt-4 border-l-4 pl-3",
|
|
359
360
|
style: { borderLeftColor: e.color || "var(--color-border)" },
|
|
360
|
-
children: [e.blocks?.map((e, t) => /* @__PURE__ */
|
|
361
|
+
children: [e.blocks?.map((e, t) => /* @__PURE__ */ c(g, {
|
|
361
362
|
block: e,
|
|
362
363
|
index: t,
|
|
363
|
-
onAction:
|
|
364
|
-
}, t)), e.fallback && !e.blocks && /* @__PURE__ */
|
|
364
|
+
onAction: h
|
|
365
|
+
}, t)), e.fallback && !e.blocks && /* @__PURE__ */ c("p", {
|
|
365
366
|
className: "text-sm text-secondary",
|
|
366
367
|
children: e.fallback
|
|
367
368
|
})]
|
|
368
369
|
}, `attachment-${t}`))]
|
|
369
|
-
}) : /* @__PURE__ */
|
|
370
|
+
}) : /* @__PURE__ */ c("div", {
|
|
370
371
|
className: "flex items-center justify-center h-full p-4 text-secondary animate-in fade-in duration-200",
|
|
371
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ l("div", {
|
|
372
373
|
className: "text-center",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ c("p", { children: f("bigconsole.widget.renderer.blockKit.noContent", "No content to display") }), /* @__PURE__ */ c("p", {
|
|
374
375
|
className: "text-sm mt-1",
|
|
375
376
|
children: f("bigconsole.widget.renderer.blockKit.configureBlocks", "Configure blocks or provide data")
|
|
376
377
|
})]
|
|
377
378
|
})
|
|
378
379
|
});
|
|
379
380
|
});
|
|
380
|
-
export {
|
|
381
|
+
export { S as BlockKitRenderer, S as default, f as renderText };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CategoryFacet } from '@burdenoff/fe-libs/ui';
|
|
2
|
+
import { ListSortValue } from './listSort';
|
|
3
|
+
/** The rail's value for "every category" (`GalleryCategoryRail` names it `all`). */
|
|
4
|
+
export declare const ALL_CATEGORIES = "all";
|
|
5
|
+
/**
|
|
6
|
+
* A category's value on the rail. Categories are words people type, so one could be called "all": the
|
|
7
|
+
* prefix keeps it apart from the rail's own "every category" value.
|
|
8
|
+
*/
|
|
9
|
+
export declare function categoryRailValue(category: string): string;
|
|
10
|
+
/** The category a rail value stands for; '' (every category) for "all" or anything unknown. */
|
|
11
|
+
export declare function categoryFromRail(value: string): string;
|
|
12
|
+
export interface GalleryRow {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string | null;
|
|
15
|
+
category?: string | null;
|
|
16
|
+
status?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CategoryFacetQuery {
|
|
19
|
+
search: string;
|
|
20
|
+
/** '' = every status. */
|
|
21
|
+
status: string;
|
|
22
|
+
/** The category picked now ('' = every category): it keeps its chip even when nothing matches. */
|
|
23
|
+
selected: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CategoryFacets {
|
|
26
|
+
/** One chip per category, most used first (then by name), with the rail's values. */
|
|
27
|
+
facets: CategoryFacet[];
|
|
28
|
+
/** Dashboards that match the search and the status, in every category: the "All" chip's count. */
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function categoryFacets(rows: readonly GalleryRow[], query: CategoryFacetQuery): CategoryFacets;
|
|
32
|
+
export interface GalleryPage {
|
|
33
|
+
/** The page the address asks for (1 when it names none, or something that is not a page). */
|
|
34
|
+
requested: number;
|
|
35
|
+
/** The page shown: the requested one, or the last page when that is past the end. */
|
|
36
|
+
page: number;
|
|
37
|
+
totalPages: number;
|
|
38
|
+
}
|
|
39
|
+
/** The page to show for `?page=` and this many results. */
|
|
40
|
+
export declare function galleryPage(rawPageParam: string | null, total: number, pageSize?: number): GalleryPage;
|
|
41
|
+
/**
|
|
42
|
+
* The address to replace the current one with so it names the page on screen, or null when it already
|
|
43
|
+
* does. Page 1 is the address without `?page=`; every other parameter is kept.
|
|
44
|
+
*/
|
|
45
|
+
export declare function correctedPageParams(params: URLSearchParams, page: number): URLSearchParams | null;
|
|
46
|
+
export interface DashboardListQuery {
|
|
47
|
+
search: string;
|
|
48
|
+
/** '' = every category. */
|
|
49
|
+
category: string;
|
|
50
|
+
/** '' = every status. */
|
|
51
|
+
status: string;
|
|
52
|
+
sort: ListSortValue;
|
|
53
|
+
}
|
|
54
|
+
export declare const DEFAULT_DASHBOARD_LIST_QUERY: DashboardListQuery;
|
|
55
|
+
/** The list's query as the address states it; a value the page does not know reads as its default. */
|
|
56
|
+
export declare function readDashboardListQuery(params: URLSearchParams): DashboardListQuery;
|
|
57
|
+
/**
|
|
58
|
+
* The address after a change to the query, in ONE step: the changed values (a default is left out) and back
|
|
59
|
+
* to page 1, so a shorter list never lands on a page it no longer has. Every other parameter is kept.
|
|
60
|
+
*/
|
|
61
|
+
export declare function withDashboardListQuery(params: URLSearchParams, change: Partial<DashboardListQuery>): URLSearchParams;
|
|
62
|
+
/**
|
|
63
|
+
* The address without the query values the page reads as their default (a status it cannot show, a sort it
|
|
64
|
+
* does not know), so the next update leaves no filter in the address that the page is not applying.
|
|
65
|
+
*/
|
|
66
|
+
export declare function cleanDashboardListParams(params: URLSearchParams): URLSearchParams;
|
|
67
|
+
/** One string per distinct query, to tell a changed query from a changed list. */
|
|
68
|
+
export declare function dashboardListQueryKey(query: DashboardListQuery): string;
|
|
69
|
+
export interface PageClampInput {
|
|
70
|
+
params: URLSearchParams;
|
|
71
|
+
/** The page the address asks for, and the page shown (the last one when that is past the end). */
|
|
72
|
+
requestedPage: number;
|
|
73
|
+
page: number;
|
|
74
|
+
totalPages: number;
|
|
75
|
+
/** The query when the page was last checked, and now. */
|
|
76
|
+
previousKey: string;
|
|
77
|
+
key: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The address to correct a page past the end to, or null. Only for an UNCHANGED query: a changed query
|
|
81
|
+
* brings its own page (1 after a change, the remembered one on Back), and correcting it in the same moment
|
|
82
|
+
* would race the change and could land on the wrong page.
|
|
83
|
+
*/
|
|
84
|
+
export declare function pageClampParams(input: PageClampInput): URLSearchParams | null;
|