@burdenoff/microfe-bigconsole 2026.805.2 → 2026.805.3
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/components/builder/inspector/DataBindingSection.js +109 -113
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +115 -113
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +71 -62
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +90 -89
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +56 -54
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +126 -125
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +151 -150
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +77 -76
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +97 -96
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +172 -191
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +75 -83
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +151 -154
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +181 -190
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +110 -108
- package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +102 -103
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js.map +1 -1
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +36 -41
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +38 -37
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +113 -117
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +182 -197
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +166 -168
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js.map +1 -1
- package/dist/bigconsole/components/parser/DataSinkSelector.js +87 -86
- package/dist/bigconsole/components/parser/DataSinkSelector.js.map +1 -1
- package/dist/bigconsole/components/parser/ImportParserDialog.js +196 -211
- package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
- package/dist/bigconsole/components/parser/ParserSelector.js +130 -128
- package/dist/bigconsole/components/parser/ParserSelector.js.map +1 -1
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +66 -63
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js.map +1 -1
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -91
- package/dist/bigconsole/components/preview/AiPreviewPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +222 -215
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +149 -145
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +504 -470
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +44 -47
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +143 -142
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +101 -88
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js.map +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +135 -134
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
- package/dist/bigconsole/components/widgets/form/FormWidget.js +167 -159
- package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +69 -68
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +64 -72
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +60 -59
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/list/ListConfig.js +57 -56
- package/dist/bigconsole/components/widgets/list/ListConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +70 -69
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +35 -34
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +20 -19
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js.map +1 -1
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +178 -177
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +76 -75
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +183 -168
- package/dist/bigconsole/components/widgets/table/TableConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +187 -180
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +40 -38
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js.map +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +150 -148
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js.map +1 -1
- package/dist/bigconsole/pages/DashboardBuilderPage.js +181 -176
- package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardViewPage.js +196 -192
- package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardsPage.js +223 -219
- package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
- package/dist/bigconsole/pages/DataParsersPage.js +167 -170
- package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +204 -189
- package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +175 -169
- package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSourcesPage.js +8 -7
- package/dist/bigconsole/pages/DataSourcesPage.js.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.js +238 -208
- package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
- package/dist/bigconsole/pages/ParserBuilderPage.js +464 -412
- package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/ParserViewPage.js +92 -90
- package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineBuilderPage.js +221 -194
- package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineViewPage.js +181 -184
- package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelinesPage.js +128 -127
- package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
- package/dist/bigconsole/pages/SettingsPage.js +177 -172
- package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
- package/dist/bigconsole/pages/WidgetDemoPage.js +121 -83
- package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowViewPage.js +199 -193
- package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +129 -128
- package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +111 -109
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +127 -126
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +103 -103
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,258 +1,259 @@
|
|
|
1
1
|
import e, { memo as t, useCallback as n, useMemo as r } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
4
|
//#region src/bigconsole/renderers/adapters/BlockKitRenderer.tsx
|
|
4
|
-
function
|
|
5
|
+
function s(t) {
|
|
5
6
|
if (!t) return null;
|
|
6
7
|
if (typeof t == "string") return t;
|
|
7
8
|
if (t.type === "mrkdwn") {
|
|
8
|
-
let n = t.text || "", r = [],
|
|
9
|
-
for (;
|
|
10
|
-
let t =
|
|
9
|
+
let n = t.text || "", r = [], i = n, o = 0;
|
|
10
|
+
for (; i.length > 0;) {
|
|
11
|
+
let t = i.match(/^\*([^*]+)\*/);
|
|
11
12
|
if (t) {
|
|
12
|
-
r.push(/* @__PURE__ */
|
|
13
|
+
r.push(/* @__PURE__ */ a("strong", { children: t[1] }, o++)), i = i.slice(t[0].length);
|
|
13
14
|
continue;
|
|
14
15
|
}
|
|
15
|
-
let n =
|
|
16
|
+
let n = i.match(/^_([^_]+)_/);
|
|
16
17
|
if (n) {
|
|
17
|
-
r.push(/* @__PURE__ */
|
|
18
|
+
r.push(/* @__PURE__ */ a("em", { children: n[1] }, o++)), i = i.slice(n[0].length);
|
|
18
19
|
continue;
|
|
19
20
|
}
|
|
20
|
-
let s =
|
|
21
|
+
let s = i.match(/^~([^~]+)~/);
|
|
21
22
|
if (s) {
|
|
22
|
-
r.push(/* @__PURE__ */
|
|
23
|
+
r.push(/* @__PURE__ */ a("del", { children: s[1] }, o++)), i = i.slice(s[0].length);
|
|
23
24
|
continue;
|
|
24
25
|
}
|
|
25
|
-
let c =
|
|
26
|
+
let c = i.match(/^`([^`]+)`/);
|
|
26
27
|
if (c) {
|
|
27
|
-
r.push(/* @__PURE__ */
|
|
28
|
+
r.push(/* @__PURE__ */ a("code", {
|
|
28
29
|
className: "bg-bg-sunken px-1 rounded text-sm",
|
|
29
30
|
children: c[1]
|
|
30
|
-
}, o++)),
|
|
31
|
+
}, o++)), i = i.slice(c[0].length);
|
|
31
32
|
continue;
|
|
32
33
|
}
|
|
33
|
-
let l =
|
|
34
|
+
let l = i.match(/^<([^|>]+)\|([^>]+)>/);
|
|
34
35
|
if (l) {
|
|
35
|
-
r.push(/* @__PURE__ */
|
|
36
|
+
r.push(/* @__PURE__ */ a("a", {
|
|
36
37
|
href: l[1],
|
|
37
38
|
className: "text-blue-600 dark:text-blue-400 underline",
|
|
38
39
|
target: "_blank",
|
|
39
40
|
rel: "noopener noreferrer",
|
|
40
41
|
children: l[2]
|
|
41
|
-
}, o++)),
|
|
42
|
+
}, o++)), i = i.slice(l[0].length);
|
|
42
43
|
continue;
|
|
43
44
|
}
|
|
44
|
-
let u =
|
|
45
|
+
let u = i.match(/^<([^|>]+)>/);
|
|
45
46
|
if (u) {
|
|
46
|
-
r.push(/* @__PURE__ */
|
|
47
|
+
r.push(/* @__PURE__ */ a("a", {
|
|
47
48
|
href: u[1],
|
|
48
49
|
className: "text-blue-600 dark:text-blue-400 underline",
|
|
49
50
|
target: "_blank",
|
|
50
51
|
rel: "noopener noreferrer",
|
|
51
52
|
children: u[1]
|
|
52
|
-
}, o++)),
|
|
53
|
+
}, o++)), i = i.slice(u[0].length);
|
|
53
54
|
continue;
|
|
54
55
|
}
|
|
55
|
-
let d =
|
|
56
|
+
let d = i.match(/^[^*_~`<]+/);
|
|
56
57
|
if (d) {
|
|
57
|
-
r.push(/* @__PURE__ */
|
|
58
|
+
r.push(/* @__PURE__ */ a(e.Fragment, { children: d[0] }, o++)), i = i.slice(d[0].length);
|
|
58
59
|
continue;
|
|
59
60
|
}
|
|
60
|
-
r.push(/* @__PURE__ */
|
|
61
|
+
r.push(/* @__PURE__ */ a(e.Fragment, { children: i[0] }, o++)), i = i.slice(1);
|
|
61
62
|
}
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ a("span", { children: r });
|
|
63
64
|
}
|
|
64
65
|
return t.text;
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function c(e) {
|
|
67
68
|
switch (e) {
|
|
68
69
|
case "primary": return "bg-status-success-bg hover:bg-status-success-bg/90 text-white transition-colors";
|
|
69
70
|
case "danger": return "bg-status-error-bg hover:bg-status-error-bg/90 text-white transition-colors";
|
|
70
71
|
default: return "bg-bg-sunken hover:bg-bg-sunken/80 text-primary transition-colors";
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function l(e, t) {
|
|
74
75
|
if (e == null) return e;
|
|
75
76
|
if (typeof e == "string") return e.replace(/\$\{([^}]+)\}/g, (e, n) => {
|
|
76
|
-
let r =
|
|
77
|
+
let r = u(t, n.trim());
|
|
77
78
|
return r === void 0 ? "" : String(r);
|
|
78
79
|
});
|
|
79
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
80
|
+
if (Array.isArray(e)) return e.map((e) => l(e, t));
|
|
80
81
|
if (typeof e == "object") {
|
|
81
82
|
let n = {};
|
|
82
|
-
for (let [r, i] of Object.entries(e)) n[r] =
|
|
83
|
+
for (let [r, i] of Object.entries(e)) n[r] = l(i, t);
|
|
83
84
|
return n;
|
|
84
85
|
}
|
|
85
86
|
return e;
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function u(e, t) {
|
|
88
89
|
let n = t.split("."), r = e;
|
|
89
90
|
for (let e of n) if (r && typeof r == "object" && e in r) r = r[e];
|
|
90
91
|
else return;
|
|
91
92
|
return r;
|
|
92
93
|
}
|
|
93
|
-
var
|
|
94
|
+
var d = t(function({ block: e, index: t, onAction: n }) {
|
|
94
95
|
switch (e.type) {
|
|
95
|
-
case "header": return /* @__PURE__ */
|
|
96
|
+
case "header": return /* @__PURE__ */ a("div", {
|
|
96
97
|
className: "py-2",
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ a("h2", {
|
|
98
99
|
className: "text-lg font-bold text-primary",
|
|
99
|
-
children:
|
|
100
|
+
children: s(e.text)
|
|
100
101
|
})
|
|
101
102
|
});
|
|
102
|
-
case "section": return /* @__PURE__ */
|
|
103
|
+
case "section": return /* @__PURE__ */ o("div", {
|
|
103
104
|
className: "py-2 flex items-start gap-4",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ o("div", {
|
|
105
106
|
className: "flex-1",
|
|
106
|
-
children: [e.text && /* @__PURE__ */
|
|
107
|
+
children: [e.text && /* @__PURE__ */ a("p", {
|
|
107
108
|
className: "text-primary",
|
|
108
|
-
children:
|
|
109
|
-
}), e.fields && e.fields.length > 0 && /* @__PURE__ */
|
|
109
|
+
children: s(e.text)
|
|
110
|
+
}), e.fields && e.fields.length > 0 && /* @__PURE__ */ a("div", {
|
|
110
111
|
className: "grid grid-cols-2 gap-2 mt-2",
|
|
111
|
-
children: e.fields.map((e, t) => /* @__PURE__ */
|
|
112
|
+
children: e.fields.map((e, t) => /* @__PURE__ */ a("div", {
|
|
112
113
|
className: "text-sm",
|
|
113
|
-
children:
|
|
114
|
+
children: s(e)
|
|
114
115
|
}, t))
|
|
115
116
|
})]
|
|
116
|
-
}), e.accessory && /* @__PURE__ */
|
|
117
|
+
}), e.accessory && /* @__PURE__ */ a("div", {
|
|
117
118
|
className: "flex-shrink-0",
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ a(f, {
|
|
119
120
|
accessory: e.accessory,
|
|
120
121
|
onAction: n
|
|
121
122
|
})
|
|
122
123
|
})]
|
|
123
124
|
});
|
|
124
|
-
case "divider": return /* @__PURE__ */
|
|
125
|
-
case "image": return /* @__PURE__ */
|
|
125
|
+
case "divider": return /* @__PURE__ */ a("hr", { className: "my-2 border-default" });
|
|
126
|
+
case "image": return /* @__PURE__ */ o("div", {
|
|
126
127
|
className: "py-2",
|
|
127
|
-
children: [e.title && /* @__PURE__ */
|
|
128
|
+
children: [e.title && /* @__PURE__ */ a("p", {
|
|
128
129
|
className: "text-sm text-secondary mb-1",
|
|
129
|
-
children:
|
|
130
|
-
}), /* @__PURE__ */
|
|
130
|
+
children: s(e.title)
|
|
131
|
+
}), /* @__PURE__ */ a("img", {
|
|
131
132
|
src: e.image_url,
|
|
132
133
|
alt: e.alt_text || "",
|
|
133
134
|
className: "max-w-full h-auto rounded"
|
|
134
135
|
})]
|
|
135
136
|
});
|
|
136
|
-
case "context": return /* @__PURE__ */
|
|
137
|
+
case "context": return /* @__PURE__ */ a("div", {
|
|
137
138
|
className: "py-1 flex items-center gap-2 flex-wrap text-sm text-secondary",
|
|
138
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
139
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ a("span", { children: e.type === "image" ? /* @__PURE__ */ a("img", {
|
|
139
140
|
src: e.image_url,
|
|
140
141
|
alt: e.alt_text || "",
|
|
141
142
|
className: "w-5 h-5 rounded inline-block"
|
|
142
|
-
}) :
|
|
143
|
+
}) : s(e.text) }, t))
|
|
143
144
|
});
|
|
144
|
-
case "actions": return /* @__PURE__ */
|
|
145
|
+
case "actions": return /* @__PURE__ */ a("div", {
|
|
145
146
|
className: "py-2 flex gap-2 flex-wrap",
|
|
146
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
147
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ a(p, {
|
|
147
148
|
element: e,
|
|
148
149
|
onAction: n
|
|
149
150
|
}, t))
|
|
150
151
|
});
|
|
151
|
-
case "input": return /* @__PURE__ */
|
|
152
|
+
case "input": return /* @__PURE__ */ o("div", {
|
|
152
153
|
className: "py-2",
|
|
153
|
-
children: [e.label ? /* @__PURE__ */
|
|
154
|
+
children: [e.label ? /* @__PURE__ */ a("label", {
|
|
154
155
|
className: "block text-sm font-medium text-secondary mb-1",
|
|
155
|
-
children:
|
|
156
|
-
}) : null, /* @__PURE__ */
|
|
156
|
+
children: s(e.label)
|
|
157
|
+
}) : null, /* @__PURE__ */ a("input", {
|
|
157
158
|
type: "text",
|
|
158
159
|
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",
|
|
159
160
|
placeholder: (() => {
|
|
160
161
|
let t = e.element;
|
|
161
|
-
return t?.placeholder ?
|
|
162
|
+
return t?.placeholder ? s(t.placeholder) : "";
|
|
162
163
|
})()
|
|
163
164
|
})]
|
|
164
165
|
});
|
|
165
|
-
case "rich_text": return /* @__PURE__ */
|
|
166
|
+
case "rich_text": return /* @__PURE__ */ a("div", {
|
|
166
167
|
className: "py-2 text-primary",
|
|
167
|
-
children: e.elements?.map((e, t) => /* @__PURE__ */
|
|
168
|
+
children: e.elements?.map((e, t) => /* @__PURE__ */ a("span", { children: s(e.text) }, t))
|
|
168
169
|
});
|
|
169
170
|
default: return null;
|
|
170
171
|
}
|
|
171
|
-
}),
|
|
172
|
+
}), f = t(function({ accessory: e, onAction: t }) {
|
|
172
173
|
switch (e.type) {
|
|
173
|
-
case "image": return /* @__PURE__ */
|
|
174
|
+
case "image": return /* @__PURE__ */ a("img", {
|
|
174
175
|
src: e.image_url,
|
|
175
176
|
alt: e.alt_text || "",
|
|
176
177
|
className: "w-12 h-12 rounded object-cover"
|
|
177
178
|
});
|
|
178
|
-
case "button": return /* @__PURE__ */
|
|
179
|
+
case "button": return /* @__PURE__ */ a("button", {
|
|
179
180
|
type: "button",
|
|
180
181
|
onClick: () => t?.(e.action_id || "", e.value),
|
|
181
|
-
className: `px-3 py-1.5 text-sm font-medium rounded ${
|
|
182
|
-
children:
|
|
182
|
+
className: `px-3 py-1.5 text-sm font-medium rounded ${c(e.style)}`,
|
|
183
|
+
children: s(e.text)
|
|
183
184
|
});
|
|
184
|
-
case "overflow": return /* @__PURE__ */
|
|
185
|
+
case "overflow": return /* @__PURE__ */ a("button", {
|
|
185
186
|
type: "button",
|
|
186
187
|
className: "p-1 text-secondary hover:text-primary transition-colors",
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ a("svg", {
|
|
188
189
|
className: "w-5 h-5",
|
|
189
190
|
fill: "currentColor",
|
|
190
191
|
viewBox: "0 0 20 20",
|
|
191
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ a("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" })
|
|
192
193
|
})
|
|
193
194
|
});
|
|
194
195
|
default: return null;
|
|
195
196
|
}
|
|
196
|
-
}),
|
|
197
|
+
}), p = t(function({ element: e, onAction: t }) {
|
|
197
198
|
let r = n(() => {
|
|
198
199
|
e.action_id && t?.(e.action_id, e.value), e.url && window.open(e.url, "_blank");
|
|
199
200
|
}, [e, t]);
|
|
200
201
|
switch (e.type) {
|
|
201
|
-
case "button": return /* @__PURE__ */
|
|
202
|
+
case "button": return /* @__PURE__ */ a("button", {
|
|
202
203
|
type: "button",
|
|
203
204
|
onClick: r,
|
|
204
|
-
className: `px-4 py-2 text-sm font-medium rounded ${
|
|
205
|
-
children:
|
|
205
|
+
className: `px-4 py-2 text-sm font-medium rounded ${c(e.style)}`,
|
|
206
|
+
children: s(e.text)
|
|
206
207
|
});
|
|
207
|
-
case "static_select": return /* @__PURE__ */
|
|
208
|
+
case "static_select": return /* @__PURE__ */ o("select", {
|
|
208
209
|
className: "px-3 py-2 text-sm border border-default rounded bg-surface text-primary transition-colors focus:ring-2 focus:ring-primary/20",
|
|
209
210
|
onChange: (n) => t?.(e.action_id || "", n.target.value),
|
|
210
|
-
children: [e.placeholder ? /* @__PURE__ */
|
|
211
|
+
children: [e.placeholder ? /* @__PURE__ */ a("option", {
|
|
211
212
|
value: "",
|
|
212
|
-
children:
|
|
213
|
-
}) : null, e.options?.map((e, t) => /* @__PURE__ */
|
|
213
|
+
children: s(e.placeholder)
|
|
214
|
+
}) : null, e.options?.map((e, t) => /* @__PURE__ */ a("option", {
|
|
214
215
|
value: e.value,
|
|
215
|
-
children:
|
|
216
|
+
children: s(e.text)
|
|
216
217
|
}, t))]
|
|
217
218
|
});
|
|
218
|
-
case "datepicker": return /* @__PURE__ */
|
|
219
|
+
case "datepicker": return /* @__PURE__ */ a("input", {
|
|
219
220
|
type: "date",
|
|
220
221
|
className: "px-3 py-2 text-sm border border-default rounded bg-surface text-primary transition-colors focus:ring-2 focus:ring-primary/20",
|
|
221
222
|
onChange: (n) => t?.(e.action_id || "", n.target.value)
|
|
222
223
|
});
|
|
223
|
-
case "checkboxes": return /* @__PURE__ */
|
|
224
|
+
case "checkboxes": return /* @__PURE__ */ a("div", {
|
|
224
225
|
className: "space-y-1",
|
|
225
|
-
children: e.options?.map((n, r) => /* @__PURE__ */
|
|
226
|
+
children: e.options?.map((n, r) => /* @__PURE__ */ o("label", {
|
|
226
227
|
className: "flex items-center gap-2 text-sm",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ a("input", {
|
|
228
229
|
type: "checkbox",
|
|
229
230
|
className: "rounded border-default transition-colors",
|
|
230
231
|
onChange: (r) => t?.(e.action_id || "", n.value, { checked: r.target.checked })
|
|
231
|
-
}),
|
|
232
|
+
}), s(n.text)]
|
|
232
233
|
}, r))
|
|
233
234
|
});
|
|
234
|
-
case "radio_buttons": return /* @__PURE__ */
|
|
235
|
+
case "radio_buttons": return /* @__PURE__ */ a("div", {
|
|
235
236
|
className: "space-y-1",
|
|
236
|
-
children: e.options?.map((n, r) => /* @__PURE__ */
|
|
237
|
+
children: e.options?.map((n, r) => /* @__PURE__ */ o("label", {
|
|
237
238
|
className: "flex items-center gap-2 text-sm",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ a("input", {
|
|
239
240
|
type: "radio",
|
|
240
241
|
name: e.action_id,
|
|
241
242
|
className: "border-default transition-colors",
|
|
242
243
|
onChange: () => t?.(e.action_id || "", n.value)
|
|
243
|
-
}),
|
|
244
|
+
}), s(n.text)]
|
|
244
245
|
}, r))
|
|
245
246
|
});
|
|
246
247
|
default: return null;
|
|
247
248
|
}
|
|
248
249
|
});
|
|
249
|
-
function
|
|
250
|
+
function m(e) {
|
|
250
251
|
let t = [];
|
|
251
252
|
for (let [n, r] of Object.entries(e)) if (r != null) if (Array.isArray(r)) t.push({
|
|
252
253
|
type: "header",
|
|
253
254
|
text: {
|
|
254
255
|
type: "plain_text",
|
|
255
|
-
text:
|
|
256
|
+
text: h(n),
|
|
256
257
|
emoji: !0
|
|
257
258
|
}
|
|
258
259
|
}), r.forEach((e, n) => {
|
|
@@ -260,7 +261,7 @@ function p(e) {
|
|
|
260
261
|
let n = [];
|
|
261
262
|
for (let [t, r] of Object.entries(e)) r != null && n.push({
|
|
262
263
|
type: "mrkdwn",
|
|
263
|
-
text: `*${
|
|
264
|
+
text: `*${h(t)}:*\n${g(r)}`
|
|
264
265
|
});
|
|
265
266
|
n.length > 0 && t.push({
|
|
266
267
|
type: "section",
|
|
@@ -270,7 +271,7 @@ function p(e) {
|
|
|
270
271
|
type: "section",
|
|
271
272
|
text: {
|
|
272
273
|
type: "mrkdwn",
|
|
273
|
-
text: `${n + 1}. ${
|
|
274
|
+
text: `${n + 1}. ${g(e)}`
|
|
274
275
|
}
|
|
275
276
|
});
|
|
276
277
|
n < r.length - 1 && t.push({ type: "divider" });
|
|
@@ -280,14 +281,14 @@ function p(e) {
|
|
|
280
281
|
type: "header",
|
|
281
282
|
text: {
|
|
282
283
|
type: "plain_text",
|
|
283
|
-
text:
|
|
284
|
+
text: h(n),
|
|
284
285
|
emoji: !0
|
|
285
286
|
}
|
|
286
287
|
});
|
|
287
288
|
let e = [];
|
|
288
289
|
for (let [t, n] of Object.entries(r)) n != null && e.push({
|
|
289
290
|
type: "mrkdwn",
|
|
290
|
-
text: `*${
|
|
291
|
+
text: `*${h(t)}:*\n${g(n)}`
|
|
291
292
|
});
|
|
292
293
|
e.length > 0 && t.push({
|
|
293
294
|
type: "section",
|
|
@@ -297,88 +298,88 @@ function p(e) {
|
|
|
297
298
|
type: "section",
|
|
298
299
|
text: {
|
|
299
300
|
type: "mrkdwn",
|
|
300
|
-
text: `*${
|
|
301
|
+
text: `*${h(n)}:* ${g(r)}`
|
|
301
302
|
}
|
|
302
303
|
});
|
|
303
304
|
return t;
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function h(e) {
|
|
306
307
|
return e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim();
|
|
307
308
|
}
|
|
308
|
-
function
|
|
309
|
+
function g(e) {
|
|
309
310
|
return e == null ? "-" : typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
310
311
|
}
|
|
311
|
-
var
|
|
312
|
-
let
|
|
313
|
-
if (
|
|
312
|
+
var _ = t(function({ widget: e, data: t, template: s, isLoading: c, error: u, onDrilldown: f, onAction: p }) {
|
|
313
|
+
let { t: h } = i(), g = r(() => {
|
|
314
|
+
if (s && "blocks" in s) return l(s, t);
|
|
314
315
|
if (t && "blocks" in t) return t;
|
|
315
316
|
if (t && Object.keys(t).length > 0) {
|
|
316
|
-
let e =
|
|
317
|
+
let e = m(t);
|
|
317
318
|
if (e.length > 0) return { blocks: e };
|
|
318
319
|
}
|
|
319
|
-
if (
|
|
320
|
-
let e =
|
|
320
|
+
if (s) {
|
|
321
|
+
let e = l(s, t);
|
|
321
322
|
if (e?.blocks?.length) return e;
|
|
322
323
|
}
|
|
323
324
|
return null;
|
|
324
|
-
}, [
|
|
325
|
-
|
|
325
|
+
}, [s, t]), _ = n((e, t, n) => {
|
|
326
|
+
p && p(e, {
|
|
326
327
|
value: t,
|
|
327
328
|
...n
|
|
328
329
|
});
|
|
329
|
-
}, [
|
|
330
|
-
return
|
|
330
|
+
}, [p]);
|
|
331
|
+
return c ? /* @__PURE__ */ a("div", {
|
|
331
332
|
className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ o("div", {
|
|
333
334
|
className: "animate-pulse space-y-2 w-full",
|
|
334
335
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-3/4" }),
|
|
337
|
+
/* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-1/2" }),
|
|
338
|
+
/* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-5/6" })
|
|
338
339
|
]
|
|
339
340
|
})
|
|
340
|
-
}) :
|
|
341
|
+
}) : u ? /* @__PURE__ */ a("div", {
|
|
341
342
|
className: "flex items-center justify-center h-full p-4 text-red-600 dark:text-red-400",
|
|
342
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ o("div", {
|
|
343
344
|
className: "text-center",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ a("p", {
|
|
345
346
|
className: "font-medium",
|
|
346
|
-
children: "Error rendering blocks"
|
|
347
|
-
}), /* @__PURE__ */
|
|
347
|
+
children: h("bigconsole.widget.renderer.blockKit.errorRendering", "Error rendering blocks")
|
|
348
|
+
}), /* @__PURE__ */ a("p", {
|
|
348
349
|
className: "text-sm mt-1",
|
|
349
|
-
children:
|
|
350
|
+
children: u
|
|
350
351
|
})]
|
|
351
352
|
})
|
|
352
|
-
}) :
|
|
353
|
+
}) : g?.blocks?.length ? /* @__PURE__ */ o("div", {
|
|
353
354
|
className: "flex flex-col h-full p-4 bg-surface",
|
|
354
|
-
children: [
|
|
355
|
+
children: [g.blocks.map((e, t) => /* @__PURE__ */ a(d, {
|
|
355
356
|
block: e,
|
|
356
357
|
index: t,
|
|
357
|
-
onAction:
|
|
358
|
-
}, t)),
|
|
358
|
+
onAction: _
|
|
359
|
+
}, t)), g.attachments?.map((e, t) => /* @__PURE__ */ o("div", {
|
|
359
360
|
className: "mt-4 border-l-4 pl-3",
|
|
360
361
|
style: { borderLeftColor: e.color || "var(--color-border)" },
|
|
361
|
-
children: [e.blocks?.map((e, t) => /* @__PURE__ */
|
|
362
|
+
children: [e.blocks?.map((e, t) => /* @__PURE__ */ a(d, {
|
|
362
363
|
block: e,
|
|
363
364
|
index: t,
|
|
364
|
-
onAction:
|
|
365
|
-
}, t)), e.fallback && !e.blocks && /* @__PURE__ */
|
|
365
|
+
onAction: _
|
|
366
|
+
}, t)), e.fallback && !e.blocks && /* @__PURE__ */ a("p", {
|
|
366
367
|
className: "text-sm text-secondary",
|
|
367
368
|
children: e.fallback
|
|
368
369
|
})]
|
|
369
370
|
}, `attachment-${t}`))]
|
|
370
|
-
}) : /* @__PURE__ */
|
|
371
|
+
}) : /* @__PURE__ */ a("div", {
|
|
371
372
|
className: "flex items-center justify-center h-full p-4 text-secondary animate-in fade-in duration-200",
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ o("div", {
|
|
373
374
|
className: "text-center",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ a("p", { children: h("bigconsole.widget.renderer.blockKit.noContent", "No content to display") }), /* @__PURE__ */ a("p", {
|
|
375
376
|
className: "text-sm mt-1",
|
|
376
|
-
children: "Configure blocks or provide data"
|
|
377
|
+
children: h("bigconsole.widget.renderer.blockKit.configureBlocks", "Configure blocks or provide data")
|
|
377
378
|
})]
|
|
378
379
|
})
|
|
379
380
|
});
|
|
380
381
|
});
|
|
381
382
|
//#endregion
|
|
382
|
-
export {
|
|
383
|
+
export { _ as default };
|
|
383
384
|
|
|
384
385
|
//# sourceMappingURL=BlockKitRenderer.js.map
|