@burdenoff/microfe-bigconsole 2026.1010.12 → 2026.1012.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/README.md +19 -0
- package/dist/bigconsole/BigConsoleRoot.js +88 -82
- package/dist/bigconsole/BigConsoleRoutes.js +163 -136
- package/dist/bigconsole/assistant/assistantProduct.js +1 -4
- package/dist/bigconsole/assistant/pageContext.d.ts +0 -14
- package/dist/bigconsole/assistant/pageContext.js +1 -6
- package/dist/bigconsole/assistant/recordAdapters.js +26 -27
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
- package/dist/bigconsole/components/common/index.d.ts +0 -1
- package/dist/bigconsole/components/common/index.js +0 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +58 -57
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -173
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +165 -163
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
- package/dist/bigconsole/components/datasink/DataSinkCard.js +50 -51
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
- package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
- package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
- package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +76 -77
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -96
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +499 -507
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +0 -1
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
- package/dist/bigconsole/components/widgets/custom/CustomWidget.js +73 -131
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
- package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.d.ts +28 -9
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +115 -42
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.d.ts +20 -0
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.js +10 -0
- package/dist/bigconsole/components/widgets/iframe-widget/index.d.ts +2 -1
- package/dist/bigconsole/components/widgets/iframe-widget/index.js +3 -2
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
- package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
- package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
- package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +110 -27
- package/dist/bigconsole/components/widgets/text-widget/textData.d.ts +6 -0
- package/dist/bigconsole/components/widgets/text-widget/textData.js +17 -14
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
- package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
- package/dist/bigconsole/context/BigConsoleContext.d.ts +10 -0
- package/dist/bigconsole/context/BigConsoleContext.js +47 -30
- package/dist/bigconsole/context/index.d.ts +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +58 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +74 -72
- package/dist/bigconsole/customWidget/proposalPreview.d.ts +5 -0
- package/dist/bigconsole/customWidget/proposalPreview.js +31 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +0 -23
- package/dist/bigconsole/hooks/useDataSinkAlerts.js +113 -138
- package/dist/bigconsole/hooks/useDataSinkOperations.d.ts +7 -0
- package/dist/bigconsole/hooks/useDataSinkOperations.js +109 -98
- package/dist/bigconsole/hooks/useDataSinkSubscription.js +0 -1
- package/dist/bigconsole/hooks/useDrilldown.js +68 -67
- package/dist/bigconsole/hooks/useExportDataSink.js +1 -1
- package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
- package/dist/bigconsole/hooks/useImportDataSink.js +102 -90
- package/dist/bigconsole/pages/AdminPage.js +130 -130
- package/dist/bigconsole/pages/DashboardBuilderPage.js +60 -72
- package/dist/bigconsole/pages/DashboardViewPage.js +235 -258
- package/dist/bigconsole/pages/DashboardsPage.js +221 -269
- package/dist/bigconsole/pages/DataParsersPage.js +157 -180
- package/dist/bigconsole/pages/DataSinkAlertsPage.js +55 -62
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +318 -295
- package/dist/bigconsole/pages/DataSinkViewPage.js +256 -255
- package/dist/bigconsole/pages/DataSinksPage.js +216 -251
- package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
- package/dist/bigconsole/pages/InsightsPage.js +265 -279
- package/dist/bigconsole/pages/OverviewPage.js +47 -47
- package/dist/bigconsole/pages/ParserBuilderPage.js +213 -229
- package/dist/bigconsole/pages/ParserViewPage.js +97 -97
- package/dist/bigconsole/pages/PipelineBuilderPage.js +214 -256
- package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
- package/dist/bigconsole/pages/PipelinesPage.js +88 -107
- package/dist/bigconsole/pages/SettingsPage.js +173 -179
- package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
- package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +235 -122
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.d.ts +6 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +151 -151
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.d.ts +29 -0
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.js +51 -0
- package/dist/bigconsole/store/widgetStore.d.ts +0 -12
- package/dist/bigconsole/store/widgetStore.js +1 -3
- package/dist/bigconsole/types/index.d.ts +17 -2
- package/dist/bigconsole/utils/backendError.d.ts +0 -18
- package/dist/bigconsole/utils/dataSinkPayload.d.ts +48 -0
- package/dist/bigconsole/utils/dataSinkPayload.js +38 -0
- package/dist/bigconsole/utils/index.d.ts +2 -0
- package/dist/bigconsole/utils/safeUrl.d.ts +79 -0
- package/dist/bigconsole/utils/safeUrl.js +93 -0
- package/dist/bigconsole/utils/sanitizeHtml.d.ts +16 -0
- package/dist/bigconsole/utils/sanitizeHtml.js +67 -0
- package/dist/bigconsole/workflowOpen.js +14 -15
- package/dist/generated/wspace-operations.d.ts +138 -8
- package/dist/generated/wspace-operations.js +281 -240
- package/dist/node_modules/dompurify/dist/purify.es.js +800 -0
- package/package.json +9 -5
- package/dist/bigconsole/assistant/displayCopy.d.ts +0 -32
- package/dist/bigconsole/assistant/pageControls.d.ts +0 -81
- package/dist/bigconsole/assistant/pageControls.js +0 -169
- package/dist/bigconsole/assistant/previewControl.d.ts +0 -16
- package/dist/bigconsole/assistant/previewControl.js +0 -10
- package/dist/bigconsole/assistant/usePreviewControl.d.ts +0 -2
- package/dist/bigconsole/assistant/usePreviewControl.js +0 -20
- package/dist/bigconsole/components/common/SortBySelect.d.ts +0 -11
- package/dist/bigconsole/components/common/SortBySelect.js +0 -29
- package/dist/bigconsole/constants/backendErrors.js +0 -94
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +0 -14
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +0 -32
- package/dist/bigconsole/utils/backendError.js +0 -42
- package/dist/bigconsole/utils/dashboardList.d.ts +0 -28
- package/dist/bigconsole/utils/dashboardList.js +0 -15
- package/dist/bigconsole/utils/dataSinkList.d.ts +0 -15
- package/dist/bigconsole/utils/dataSinkList.js +0 -15
- package/dist/bigconsole/utils/formDirty.d.ts +0 -82
- package/dist/bigconsole/utils/formDirty.js +0 -21
- package/dist/bigconsole/utils/insightsDraft.d.ts +0 -29
- package/dist/bigconsole/utils/insightsDraft.js +0 -8
- package/dist/bigconsole/utils/layoutBaseline.d.ts +0 -130
- package/dist/bigconsole/utils/layoutBaseline.js +0 -96
- package/dist/bigconsole/utils/listSort.d.ts +0 -80
- package/dist/bigconsole/utils/listSort.js +0 -85
- package/dist/bigconsole/utils/widgetFormDirty.d.ts +0 -16
- package/dist/bigconsole/utils/widgetFormDirty.js +0 -13
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { openExternalUrl as e } from "../../utils/safeUrl.js";
|
|
2
|
+
import { CARD_LINK_POLICY as t, CARD_MARKDOWN_CODE_CLASS as n, CARD_MARKDOWN_LINK_CLASS as r, processCardMarkdown as i, removeUnsafeOpenUrlActions as a, scrubRenderedLinks as o } from "./adaptiveCardContent.js";
|
|
3
|
+
import { memo as s, useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
4
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
6
|
+
import * as h from "adaptivecards";
|
|
5
7
|
//#region src/bigconsole/renderers/adapters/AdaptiveCardRenderer.tsx
|
|
6
|
-
function
|
|
8
|
+
function g(e, t, n) {
|
|
7
9
|
let r = n || t;
|
|
8
10
|
if (typeof e == "string") return e.replace(/\$\{([^}]+)\}/g, (e, n) => {
|
|
9
|
-
let i = n.trim(), a =
|
|
10
|
-
return a === void 0 && r !== t && (a =
|
|
11
|
+
let i = n.trim(), a = _(t, i);
|
|
12
|
+
return a === void 0 && r !== t && (a = _(r, i)), a === void 0 ? e : String(a);
|
|
11
13
|
});
|
|
12
14
|
if (Array.isArray(e)) return e.flatMap((e) => {
|
|
13
|
-
let n =
|
|
15
|
+
let n = g(e, t, r);
|
|
14
16
|
return Array.isArray(n) ? n : [n];
|
|
15
17
|
});
|
|
16
18
|
if (e && typeof e == "object") {
|
|
@@ -20,7 +22,7 @@ function l(e, t, n) {
|
|
|
20
22
|
if (typeof e == "string") {
|
|
21
23
|
let n = e.match(/^\$\{([^}]+)\}$/);
|
|
22
24
|
if (n) {
|
|
23
|
-
let e =
|
|
25
|
+
let e = _(t, n[1].trim()) || _(r, n[1].trim());
|
|
24
26
|
Array.isArray(e) && (i = e);
|
|
25
27
|
}
|
|
26
28
|
} else Array.isArray(e) && (i = e);
|
|
@@ -28,7 +30,7 @@ function l(e, t, n) {
|
|
|
28
30
|
let e = Object.fromEntries(Object.entries(n).filter(([e]) => e !== "$data"));
|
|
29
31
|
return i.map((t) => {
|
|
30
32
|
let n = typeof t == "object" && t ? t : { value: t };
|
|
31
|
-
return
|
|
33
|
+
return g(e, {
|
|
32
34
|
...r,
|
|
33
35
|
...n
|
|
34
36
|
}, r);
|
|
@@ -36,12 +38,12 @@ function l(e, t, n) {
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
let i = {};
|
|
39
|
-
for (let [e, a] of Object.entries(n)) e !== "$data" && e !== "$when" && (i[e] =
|
|
41
|
+
for (let [e, a] of Object.entries(n)) e !== "$data" && e !== "$when" && (i[e] = g(a, t, r));
|
|
40
42
|
return i;
|
|
41
43
|
}
|
|
42
44
|
return e;
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function _(e, t) {
|
|
45
47
|
let n = t.split("."), r = e;
|
|
46
48
|
for (let e of n) {
|
|
47
49
|
if (typeof r != "object" || !r) return;
|
|
@@ -49,11 +51,10 @@ function u(e, t) {
|
|
|
49
51
|
}
|
|
50
52
|
return r;
|
|
51
53
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var f = new c.HostConfig({
|
|
54
|
+
h.AdaptiveCard.onProcessMarkdown = (e, t) => {
|
|
55
|
+
t.outputHtml = i(e), t.didProcess = !0;
|
|
56
|
+
};
|
|
57
|
+
var v = new h.HostConfig({
|
|
57
58
|
fontFamily: "Inter, system-ui, -apple-system, sans-serif",
|
|
58
59
|
containerStyles: {
|
|
59
60
|
default: {
|
|
@@ -142,35 +143,35 @@ var f = new c.HostConfig({
|
|
|
142
143
|
},
|
|
143
144
|
actions: {
|
|
144
145
|
maxActions: 5,
|
|
145
|
-
spacing:
|
|
146
|
+
spacing: h.Spacing.Default,
|
|
146
147
|
buttonSpacing: 8,
|
|
147
148
|
showCard: {
|
|
148
|
-
actionMode:
|
|
149
|
+
actionMode: h.ShowCardActionMode.Inline,
|
|
149
150
|
inlineTopMargin: 12
|
|
150
151
|
},
|
|
151
|
-
actionsOrientation:
|
|
152
|
-
actionAlignment:
|
|
152
|
+
actionsOrientation: h.Orientation.Horizontal,
|
|
153
|
+
actionAlignment: h.ActionAlignment.Left
|
|
153
154
|
},
|
|
154
155
|
adaptiveCard: { allowCustomStyle: !0 },
|
|
155
156
|
textBlock: { headingLevel: 2 },
|
|
156
157
|
factSet: {
|
|
157
158
|
title: {
|
|
158
|
-
color:
|
|
159
|
-
size:
|
|
159
|
+
color: h.TextColor.Default,
|
|
160
|
+
size: h.TextSize.Default,
|
|
160
161
|
isSubtle: !0,
|
|
161
|
-
weight:
|
|
162
|
+
weight: h.TextWeight.Bolder,
|
|
162
163
|
wrap: !0
|
|
163
164
|
},
|
|
164
165
|
value: {
|
|
165
|
-
color:
|
|
166
|
-
size:
|
|
166
|
+
color: h.TextColor.Default,
|
|
167
|
+
size: h.TextSize.Default,
|
|
167
168
|
isSubtle: !1,
|
|
168
|
-
weight:
|
|
169
|
+
weight: h.TextWeight.Default,
|
|
169
170
|
wrap: !0
|
|
170
171
|
},
|
|
171
172
|
spacing: 8
|
|
172
173
|
}
|
|
173
|
-
}),
|
|
174
|
+
}), y = new h.HostConfig({
|
|
174
175
|
fontFamily: "Inter, system-ui, -apple-system, sans-serif",
|
|
175
176
|
spacing: {
|
|
176
177
|
small: 4,
|
|
@@ -187,30 +188,30 @@ var f = new c.HostConfig({
|
|
|
187
188
|
},
|
|
188
189
|
actions: {
|
|
189
190
|
maxActions: 5,
|
|
190
|
-
spacing:
|
|
191
|
+
spacing: h.Spacing.Default,
|
|
191
192
|
buttonSpacing: 8,
|
|
192
193
|
showCard: {
|
|
193
|
-
actionMode:
|
|
194
|
+
actionMode: h.ShowCardActionMode.Inline,
|
|
194
195
|
inlineTopMargin: 12
|
|
195
196
|
},
|
|
196
|
-
actionsOrientation:
|
|
197
|
-
actionAlignment:
|
|
197
|
+
actionsOrientation: h.Orientation.Horizontal,
|
|
198
|
+
actionAlignment: h.ActionAlignment.Left
|
|
198
199
|
},
|
|
199
200
|
adaptiveCard: { allowCustomStyle: !0 },
|
|
200
201
|
textBlock: { headingLevel: 2 },
|
|
201
202
|
factSet: {
|
|
202
203
|
title: {
|
|
203
|
-
color:
|
|
204
|
-
size:
|
|
204
|
+
color: h.TextColor.Default,
|
|
205
|
+
size: h.TextSize.Default,
|
|
205
206
|
isSubtle: !0,
|
|
206
|
-
weight:
|
|
207
|
+
weight: h.TextWeight.Bolder,
|
|
207
208
|
wrap: !0
|
|
208
209
|
},
|
|
209
210
|
value: {
|
|
210
|
-
color:
|
|
211
|
-
size:
|
|
211
|
+
color: h.TextColor.Default,
|
|
212
|
+
size: h.TextSize.Default,
|
|
212
213
|
isSubtle: !1,
|
|
213
|
-
weight:
|
|
214
|
+
weight: h.TextWeight.Default,
|
|
214
215
|
wrap: !0
|
|
215
216
|
},
|
|
216
217
|
spacing: 8
|
|
@@ -287,20 +288,20 @@ var f = new c.HostConfig({
|
|
|
287
288
|
lineThickness: 1,
|
|
288
289
|
lineColor: "#374151"
|
|
289
290
|
}
|
|
290
|
-
}),
|
|
291
|
-
let { t:
|
|
292
|
-
|
|
291
|
+
}), b = s(function({ widget: n, data: r, template: i, isLoading: s, error: _, onAction: b }) {
|
|
292
|
+
let { t: x } = m(), S = u(null), C = u(null), [w, T] = d(null), [E, D] = d(!1), [O, k] = d([]), [A, j] = d(null), [M, N] = d(null);
|
|
293
|
+
l(() => {
|
|
293
294
|
let e = !0;
|
|
294
295
|
return import("adaptivecards-templating").then((t) => {
|
|
295
|
-
e &&
|
|
296
|
+
e && j(t);
|
|
296
297
|
}).catch((t) => {
|
|
297
|
-
e &&
|
|
298
|
+
e && N(t.message || x("bigconsole.widget.renderer.adaptiveCard.templatingLoadFailed", "Failed to load templating library"));
|
|
298
299
|
}), () => {
|
|
299
300
|
e = !1;
|
|
300
301
|
};
|
|
301
|
-
}, [
|
|
302
|
+
}, [x]), l(() => {
|
|
302
303
|
let e = () => {
|
|
303
|
-
|
|
304
|
+
D(document.documentElement.classList.contains("dark"));
|
|
304
305
|
};
|
|
305
306
|
e();
|
|
306
307
|
let t = new MutationObserver(e);
|
|
@@ -309,97 +310,97 @@ var f = new c.HostConfig({
|
|
|
309
310
|
attributeFilter: ["class"]
|
|
310
311
|
}), () => t.disconnect();
|
|
311
312
|
}, []);
|
|
312
|
-
let
|
|
313
|
-
|
|
314
|
-
}, [
|
|
315
|
-
return
|
|
316
|
-
if (
|
|
317
|
-
|
|
313
|
+
let P = c((n) => {
|
|
314
|
+
n instanceof h.OpenUrlAction ? e(n.url, t) : n instanceof h.SubmitAction ? b && b(n.title || "submit", n.data || {}) : n instanceof h.ExecuteAction ? b && b(n.verb || "execute", n.data || {}) : n instanceof h.ShowCardAction;
|
|
315
|
+
}, [b]);
|
|
316
|
+
return l(() => {
|
|
317
|
+
if (S.current && !s) {
|
|
318
|
+
S.current.innerHTML = "", T(null), k([]);
|
|
318
319
|
try {
|
|
319
|
-
let
|
|
320
|
-
if (
|
|
321
|
-
let
|
|
322
|
-
if (
|
|
323
|
-
let i = new
|
|
324
|
-
$root:
|
|
320
|
+
let e = null, t = [];
|
|
321
|
+
if (i) {
|
|
322
|
+
let a = typeof i == "string" ? JSON.parse(i) : i;
|
|
323
|
+
if (A) try {
|
|
324
|
+
let i = new A.Template(a), o = {
|
|
325
|
+
$root: r || {},
|
|
325
326
|
$host: {
|
|
326
|
-
widgetId:
|
|
327
|
-
widgetTitle:
|
|
328
|
-
theme:
|
|
327
|
+
widgetId: n?.id,
|
|
328
|
+
widgetTitle: n?.title,
|
|
329
|
+
theme: E ? "dark" : "light"
|
|
329
330
|
}
|
|
330
331
|
};
|
|
331
|
-
|
|
332
|
+
e = i.expand(o), t = i.getLastTemplateExpansionWarnings(), t.length > 0 && k(t);
|
|
332
333
|
} catch {
|
|
333
|
-
|
|
334
|
+
e = g(a, r || {}), t.push(x("bigconsole.widget.renderer.adaptiveCard.simplifiedExpansion", "Using simplified template expansion (some features may not work)")), k(t);
|
|
334
335
|
}
|
|
335
|
-
else
|
|
336
|
-
} else
|
|
336
|
+
else e = g(a, r || {}), M && (t.push(x("bigconsole.widget.renderer.adaptiveCard.fallbackExpansion", "Using fallback expansion: {{error}}", { error: M ?? "" })), k(t));
|
|
337
|
+
} else r && typeof r == "object" && "type" in r && r.type === "AdaptiveCard" ? e = r : r && typeof r == "object" && "body" in r && (e = {
|
|
337
338
|
type: "AdaptiveCard",
|
|
338
339
|
version: "1.6",
|
|
339
|
-
...
|
|
340
|
+
...r
|
|
340
341
|
});
|
|
341
|
-
if (!
|
|
342
|
-
x(
|
|
342
|
+
if (!e) {
|
|
343
|
+
T(x("bigconsole.widget.renderer.adaptiveCard.noValidData", "No template or valid Adaptive Card data provided"));
|
|
343
344
|
return;
|
|
344
345
|
}
|
|
345
|
-
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
let
|
|
349
|
-
|
|
346
|
+
C.current ||= new h.AdaptiveCard();
|
|
347
|
+
let s = C.current;
|
|
348
|
+
s.hostConfig = E ? y : v, s.onExecuteAction = P, s.parse(a(e));
|
|
349
|
+
let c = s.render();
|
|
350
|
+
c ? (o(c), c.style.height = "100%", c.style.overflow = "auto", c.classList.add("adaptive-card-container"), S.current.appendChild(c)) : T(x("bigconsole.widget.renderer.adaptiveCard.renderFailed", "Failed to render Adaptive Card"));
|
|
350
351
|
} catch (e) {
|
|
351
|
-
|
|
352
|
+
T(e.message || x("bigconsole.widget.renderer.adaptiveCard.unknownError", "Unknown error rendering card"));
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
}, [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
S,
|
|
360
|
-
A,
|
|
356
|
+
i,
|
|
357
|
+
r,
|
|
358
|
+
n,
|
|
359
|
+
s,
|
|
361
360
|
E,
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
P,
|
|
362
|
+
A,
|
|
363
|
+
M,
|
|
364
|
+
x
|
|
365
|
+
]), s ? /* @__PURE__ */ f("div", {
|
|
365
366
|
className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
|
|
366
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ p("div", {
|
|
367
368
|
className: "animate-pulse space-y-3 w-full",
|
|
368
369
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ f("div", { className: "h-5 bg-bg-sunken rounded w-3/4" }),
|
|
371
|
+
/* @__PURE__ */ p("div", {
|
|
371
372
|
className: "flex gap-3",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ f("div", { className: "h-10 w-10 bg-bg-sunken rounded-full" }), /* @__PURE__ */ p("div", {
|
|
373
374
|
className: "flex-1 space-y-2",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ f("div", { className: "h-4 bg-bg-sunken rounded w-1/2" }), /* @__PURE__ */ f("div", { className: "h-3 bg-bg-sunken rounded w-1/3" })]
|
|
375
376
|
})]
|
|
376
377
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ f("div", { className: "h-4 bg-bg-sunken rounded w-full" }),
|
|
379
|
+
/* @__PURE__ */ f("div", { className: "h-4 bg-bg-sunken rounded w-5/6" }),
|
|
380
|
+
/* @__PURE__ */ p("div", {
|
|
380
381
|
className: "grid grid-cols-2 gap-2 mt-4",
|
|
381
382
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ f("div", { className: "h-3 bg-bg-sunken rounded" }),
|
|
384
|
+
/* @__PURE__ */ f("div", { className: "h-3 bg-bg-sunken rounded" }),
|
|
385
|
+
/* @__PURE__ */ f("div", { className: "h-3 bg-bg-sunken rounded" }),
|
|
386
|
+
/* @__PURE__ */ f("div", { className: "h-3 bg-bg-sunken rounded" })
|
|
386
387
|
]
|
|
387
388
|
})
|
|
388
389
|
]
|
|
389
390
|
})
|
|
390
|
-
}) :
|
|
391
|
+
}) : _ || w ? /* @__PURE__ */ f("div", {
|
|
391
392
|
className: "flex items-center justify-center h-full p-4",
|
|
392
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ p("div", {
|
|
393
394
|
className: "text-center max-w-sm",
|
|
394
395
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ f("div", {
|
|
396
397
|
className: "w-12 h-12 mx-auto mb-3 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",
|
|
397
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ f("svg", {
|
|
398
399
|
className: "w-6 h-6 text-red-600 dark:text-red-400",
|
|
399
400
|
fill: "none",
|
|
400
401
|
viewBox: "0 0 24 24",
|
|
401
402
|
stroke: "currentColor",
|
|
402
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ f("path", {
|
|
403
404
|
strokeLinecap: "round",
|
|
404
405
|
strokeLinejoin: "round",
|
|
405
406
|
strokeWidth: 2,
|
|
@@ -407,39 +408,39 @@ var f = new c.HostConfig({
|
|
|
407
408
|
})
|
|
408
409
|
})
|
|
409
410
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ f("p", {
|
|
411
412
|
className: "font-medium text-status-error-text",
|
|
412
|
-
children:
|
|
413
|
+
children: x("bigconsole.widget.renderer.adaptiveCard.errorRendering", "Error rendering card")
|
|
413
414
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ f("p", {
|
|
415
416
|
className: "text-sm text-secondary mt-1",
|
|
416
|
-
children:
|
|
417
|
+
children: _ || w
|
|
417
418
|
}),
|
|
418
|
-
|
|
419
|
+
O.length > 0 && /* @__PURE__ */ p("div", {
|
|
419
420
|
className: "mt-3 p-2 bg-yellow-50 dark:bg-yellow-900/20 rounded text-left",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ f("p", {
|
|
421
422
|
className: "text-xs font-medium text-yellow-700 dark:text-yellow-400 mb-1",
|
|
422
|
-
children:
|
|
423
|
-
}),
|
|
423
|
+
children: x("bigconsole.widget.renderer.adaptiveCard.templateWarnings", "Template Warnings:")
|
|
424
|
+
}), O.map((e, t) => /* @__PURE__ */ f("p", {
|
|
424
425
|
className: "text-xs text-yellow-600 dark:text-yellow-300",
|
|
425
426
|
children: e
|
|
426
427
|
}, t))]
|
|
427
428
|
})
|
|
428
429
|
]
|
|
429
430
|
})
|
|
430
|
-
}) : !
|
|
431
|
+
}) : !i && !r ? /* @__PURE__ */ f("div", {
|
|
431
432
|
className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ p("div", {
|
|
433
434
|
className: "text-center max-w-sm",
|
|
434
435
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ f("div", {
|
|
436
437
|
className: "w-12 h-12 mx-auto mb-3 rounded-full bg-bg-sunken flex items-center justify-center",
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ f("svg", {
|
|
438
439
|
className: "w-6 h-6 text-text-secondary",
|
|
439
440
|
fill: "none",
|
|
440
441
|
viewBox: "0 0 24 24",
|
|
441
442
|
stroke: "currentColor",
|
|
442
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ f("path", {
|
|
443
444
|
strokeLinecap: "round",
|
|
444
445
|
strokeLinejoin: "round",
|
|
445
446
|
strokeWidth: 2,
|
|
@@ -447,25 +448,137 @@ var f = new c.HostConfig({
|
|
|
447
448
|
})
|
|
448
449
|
})
|
|
449
450
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ f("p", {
|
|
451
452
|
className: "font-medium text-secondary",
|
|
452
|
-
children:
|
|
453
|
+
children: x("bigconsole.widget.renderer.adaptiveCard.noContent", "No content")
|
|
453
454
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ f("p", {
|
|
455
456
|
className: "text-sm text-text-secondary mt-1",
|
|
456
|
-
children:
|
|
457
|
+
children: x("bigconsole.widget.renderer.adaptiveCard.noContentHint", "Configure a template or provide data to display an Adaptive Card")
|
|
457
458
|
})
|
|
458
459
|
]
|
|
459
460
|
})
|
|
460
|
-
}) : /* @__PURE__ */
|
|
461
|
-
ref:
|
|
461
|
+
}) : /* @__PURE__ */ f("div", {
|
|
462
|
+
ref: S,
|
|
462
463
|
className: "adaptive-card-wrapper h-full overflow-auto",
|
|
463
464
|
style: { "--ac-font-family": "Inter, system-ui, -apple-system, sans-serif" }
|
|
464
465
|
});
|
|
465
|
-
}),
|
|
466
|
-
if (typeof document < "u" && !document.getElementById(
|
|
466
|
+
}), x = "adaptive-card-global-styles";
|
|
467
|
+
if (typeof document < "u" && !document.getElementById(x)) {
|
|
467
468
|
let e = document.createElement("style");
|
|
468
|
-
e.id =
|
|
469
|
+
e.id = x, e.textContent = `
|
|
470
|
+
.adaptive-card-wrapper {
|
|
471
|
+
font-family: Inter, system-ui, -apple-system, sans-serif;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.adaptive-card-wrapper .ac-textBlock {
|
|
475
|
+
font-family: inherit;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.adaptive-card-wrapper .ac-image.ac-image-person {
|
|
479
|
+
border-radius: 50%;
|
|
480
|
+
object-fit: cover;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.adaptive-card-wrapper .ac-pushButton {
|
|
484
|
+
font-family: inherit;
|
|
485
|
+
font-weight: 500;
|
|
486
|
+
border-radius: 0.375rem;
|
|
487
|
+
padding: 0.5rem 1rem;
|
|
488
|
+
transition: all 0.15s ease-in-out;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.adaptive-card-wrapper .ac-pushButton:hover {
|
|
492
|
+
filter: brightness(0.95);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.adaptive-card-wrapper .ac-input {
|
|
496
|
+
font-family: inherit;
|
|
497
|
+
border-radius: 0.375rem;
|
|
498
|
+
border: 1px solid #d1d5db;
|
|
499
|
+
padding: 0.5rem 0.75rem;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.dark .adaptive-card-wrapper .ac-input {
|
|
503
|
+
border-color: #4b5563;
|
|
504
|
+
background-color: #1f2937;
|
|
505
|
+
color: #f9fafb;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.adaptive-card-wrapper .ac-input:focus {
|
|
509
|
+
outline: none;
|
|
510
|
+
ring: 2px;
|
|
511
|
+
ring-color: #3b82f6;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.adaptive-card-wrapper .ac-separator {
|
|
515
|
+
margin: 0.5rem 0;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.adaptive-card-wrapper .ac-factSet {
|
|
519
|
+
display: grid;
|
|
520
|
+
grid-template-columns: auto 1fr;
|
|
521
|
+
gap: 0.25rem 1rem;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.adaptive-card-wrapper .ac-fact-title {
|
|
525
|
+
color: #6b7280;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.dark .adaptive-card-wrapper .ac-fact-title {
|
|
529
|
+
color: #9ca3af;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.adaptive-card-wrapper .ac-actionSet {
|
|
533
|
+
display: flex;
|
|
534
|
+
flex-wrap: wrap;
|
|
535
|
+
gap: 0.5rem;
|
|
536
|
+
margin-top: 1rem;
|
|
537
|
+
padding-top: 1rem;
|
|
538
|
+
border-top: 1px solid #e5e7eb;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.dark .adaptive-card-wrapper .ac-actionSet {
|
|
542
|
+
border-top-color: #374151;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/* Markdown output (classes set by adaptiveCardContent.ts) */
|
|
546
|
+
.adaptive-card-wrapper .${n} {
|
|
547
|
+
background: var(--color-bg-sunken);
|
|
548
|
+
padding: 0.125rem 0.25rem;
|
|
549
|
+
border-radius: 0.25rem;
|
|
550
|
+
font-family: monospace;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.adaptive-card-wrapper .${r} {
|
|
554
|
+
color: var(--color-text-link);
|
|
555
|
+
text-decoration: underline;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/* Markdown rendered code blocks in dark mode */
|
|
559
|
+
.dark .adaptive-card-wrapper code {
|
|
560
|
+
background: #374151 !important;
|
|
561
|
+
color: #f9fafb !important;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/* Markdown links in dark mode */
|
|
565
|
+
.dark .adaptive-card-wrapper a {
|
|
566
|
+
color: #60a5fa !important;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/* TextBlock with markdown - ensure proper wrapping */
|
|
570
|
+
.adaptive-card-wrapper .ac-textBlock p {
|
|
571
|
+
margin: 0;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.adaptive-card-wrapper .ac-textBlock strong {
|
|
575
|
+
font-weight: 600;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.adaptive-card-wrapper .ac-textBlock em {
|
|
579
|
+
font-style: italic;
|
|
580
|
+
}
|
|
581
|
+
`, document.head.appendChild(e);
|
|
469
582
|
}
|
|
470
583
|
//#endregion
|
|
471
|
-
export {
|
|
584
|
+
export { b as default };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { RendererProps } from '../types/renderer';
|
|
2
|
+
import { RendererProps, BlockKitText } from '../types/renderer';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Render Block Kit text (plain_text or mrkdwn)
|
|
6
|
+
* Uses React elements instead of dangerouslySetInnerHTML for better security
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderText(text: BlockKitText | string | undefined): React.ReactNode;
|
|
4
9
|
export declare const BlockKitRenderer: React.FC<RendererProps>;
|
|
5
10
|
export default BlockKitRenderer;
|