@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.
Files changed (161) hide show
  1. package/README.md +19 -0
  2. package/dist/bigconsole/BigConsoleRoot.js +88 -82
  3. package/dist/bigconsole/BigConsoleRoutes.js +163 -136
  4. package/dist/bigconsole/assistant/assistantProduct.js +1 -4
  5. package/dist/bigconsole/assistant/pageContext.d.ts +0 -14
  6. package/dist/bigconsole/assistant/pageContext.js +1 -6
  7. package/dist/bigconsole/assistant/recordAdapters.js +26 -27
  8. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
  9. package/dist/bigconsole/components/common/index.d.ts +0 -1
  10. package/dist/bigconsole/components/common/index.js +0 -1
  11. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
  12. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
  13. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
  14. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +58 -57
  15. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
  16. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
  17. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
  18. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
  19. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
  20. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
  21. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
  22. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -173
  23. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
  24. package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
  25. package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
  26. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
  27. package/dist/bigconsole/components/dashboard/WidgetPalette.js +165 -163
  28. package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
  29. package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
  30. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
  31. package/dist/bigconsole/components/datasink/DataSinkCard.js +50 -51
  32. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
  33. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
  34. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
  35. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
  36. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
  37. package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
  38. package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
  39. package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
  40. package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
  41. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +76 -77
  42. package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -96
  43. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
  44. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
  45. package/dist/bigconsole/components/widgets/PropertiesPanel.js +499 -507
  46. package/dist/bigconsole/components/widgets/WidgetRegistry.js +0 -1
  47. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
  48. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
  49. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
  50. package/dist/bigconsole/components/widgets/custom/CustomWidget.js +73 -131
  51. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
  52. package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
  53. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
  54. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
  55. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.d.ts +28 -9
  56. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +115 -42
  57. package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.d.ts +20 -0
  58. package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.js +10 -0
  59. package/dist/bigconsole/components/widgets/iframe-widget/index.d.ts +2 -1
  60. package/dist/bigconsole/components/widgets/iframe-widget/index.js +3 -2
  61. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
  62. package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
  63. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
  64. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
  65. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
  66. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
  67. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
  68. package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
  69. package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +110 -27
  70. package/dist/bigconsole/components/widgets/text-widget/textData.d.ts +6 -0
  71. package/dist/bigconsole/components/widgets/text-widget/textData.js +17 -14
  72. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
  73. package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
  74. package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
  75. package/dist/bigconsole/context/BigConsoleContext.d.ts +10 -0
  76. package/dist/bigconsole/context/BigConsoleContext.js +47 -30
  77. package/dist/bigconsole/context/index.d.ts +1 -1
  78. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +58 -49
  79. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +74 -72
  80. package/dist/bigconsole/customWidget/proposalPreview.d.ts +5 -0
  81. package/dist/bigconsole/customWidget/proposalPreview.js +31 -0
  82. package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +0 -23
  83. package/dist/bigconsole/hooks/useDataSinkAlerts.js +113 -138
  84. package/dist/bigconsole/hooks/useDataSinkOperations.d.ts +7 -0
  85. package/dist/bigconsole/hooks/useDataSinkOperations.js +109 -98
  86. package/dist/bigconsole/hooks/useDataSinkSubscription.js +0 -1
  87. package/dist/bigconsole/hooks/useDrilldown.js +68 -67
  88. package/dist/bigconsole/hooks/useExportDataSink.js +1 -1
  89. package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
  90. package/dist/bigconsole/hooks/useImportDataSink.js +102 -90
  91. package/dist/bigconsole/pages/AdminPage.js +130 -130
  92. package/dist/bigconsole/pages/DashboardBuilderPage.js +60 -72
  93. package/dist/bigconsole/pages/DashboardViewPage.js +235 -258
  94. package/dist/bigconsole/pages/DashboardsPage.js +221 -269
  95. package/dist/bigconsole/pages/DataParsersPage.js +157 -180
  96. package/dist/bigconsole/pages/DataSinkAlertsPage.js +55 -62
  97. package/dist/bigconsole/pages/DataSinkBuilderPage.js +318 -295
  98. package/dist/bigconsole/pages/DataSinkViewPage.js +256 -255
  99. package/dist/bigconsole/pages/DataSinksPage.js +216 -251
  100. package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
  101. package/dist/bigconsole/pages/InsightsPage.js +265 -279
  102. package/dist/bigconsole/pages/OverviewPage.js +47 -47
  103. package/dist/bigconsole/pages/ParserBuilderPage.js +213 -229
  104. package/dist/bigconsole/pages/ParserViewPage.js +97 -97
  105. package/dist/bigconsole/pages/PipelineBuilderPage.js +214 -256
  106. package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
  107. package/dist/bigconsole/pages/PipelinesPage.js +88 -107
  108. package/dist/bigconsole/pages/SettingsPage.js +173 -179
  109. package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
  110. package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
  111. package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
  112. package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
  113. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +235 -122
  114. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.d.ts +6 -1
  115. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +151 -151
  116. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
  117. package/dist/bigconsole/renderers/adapters/adaptiveCardContent.d.ts +29 -0
  118. package/dist/bigconsole/renderers/adapters/adaptiveCardContent.js +51 -0
  119. package/dist/bigconsole/store/widgetStore.d.ts +0 -12
  120. package/dist/bigconsole/store/widgetStore.js +1 -3
  121. package/dist/bigconsole/types/index.d.ts +17 -2
  122. package/dist/bigconsole/utils/backendError.d.ts +0 -18
  123. package/dist/bigconsole/utils/dataSinkPayload.d.ts +48 -0
  124. package/dist/bigconsole/utils/dataSinkPayload.js +38 -0
  125. package/dist/bigconsole/utils/index.d.ts +2 -0
  126. package/dist/bigconsole/utils/safeUrl.d.ts +79 -0
  127. package/dist/bigconsole/utils/safeUrl.js +93 -0
  128. package/dist/bigconsole/utils/sanitizeHtml.d.ts +16 -0
  129. package/dist/bigconsole/utils/sanitizeHtml.js +67 -0
  130. package/dist/bigconsole/workflowOpen.js +14 -15
  131. package/dist/generated/wspace-operations.d.ts +138 -8
  132. package/dist/generated/wspace-operations.js +281 -240
  133. package/dist/node_modules/dompurify/dist/purify.es.js +800 -0
  134. package/package.json +9 -5
  135. package/dist/bigconsole/assistant/displayCopy.d.ts +0 -32
  136. package/dist/bigconsole/assistant/pageControls.d.ts +0 -81
  137. package/dist/bigconsole/assistant/pageControls.js +0 -169
  138. package/dist/bigconsole/assistant/previewControl.d.ts +0 -16
  139. package/dist/bigconsole/assistant/previewControl.js +0 -10
  140. package/dist/bigconsole/assistant/usePreviewControl.d.ts +0 -2
  141. package/dist/bigconsole/assistant/usePreviewControl.js +0 -20
  142. package/dist/bigconsole/components/common/SortBySelect.d.ts +0 -11
  143. package/dist/bigconsole/components/common/SortBySelect.js +0 -29
  144. package/dist/bigconsole/constants/backendErrors.js +0 -94
  145. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +0 -14
  146. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +0 -32
  147. package/dist/bigconsole/utils/backendError.js +0 -42
  148. package/dist/bigconsole/utils/dashboardList.d.ts +0 -28
  149. package/dist/bigconsole/utils/dashboardList.js +0 -15
  150. package/dist/bigconsole/utils/dataSinkList.d.ts +0 -15
  151. package/dist/bigconsole/utils/dataSinkList.js +0 -15
  152. package/dist/bigconsole/utils/formDirty.d.ts +0 -82
  153. package/dist/bigconsole/utils/formDirty.js +0 -21
  154. package/dist/bigconsole/utils/insightsDraft.d.ts +0 -29
  155. package/dist/bigconsole/utils/insightsDraft.js +0 -8
  156. package/dist/bigconsole/utils/layoutBaseline.d.ts +0 -130
  157. package/dist/bigconsole/utils/layoutBaseline.js +0 -96
  158. package/dist/bigconsole/utils/listSort.d.ts +0 -80
  159. package/dist/bigconsole/utils/listSort.js +0 -85
  160. package/dist/bigconsole/utils/widgetFormDirty.d.ts +0 -16
  161. package/dist/bigconsole/utils/widgetFormDirty.js +0 -13
@@ -1,16 +1,18 @@
1
- import { memo as e, useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
2
- import { useI18n as a } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
3
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
- import * as c from "adaptivecards";
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 l(e, t, n) {
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 = u(t, i);
10
- return a === void 0 && r !== t && (a = u(r, i)), a === void 0 ? e : String(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 = l(e, t, r);
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 = u(t, n[1].trim()) || u(r, n[1].trim());
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 l(e, {
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] = l(a, t, r));
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 u(e, t) {
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
- var d = (e) => e ? e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/__(.+?)__/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/_(.+?)_/g, "<em>$1</em>").replace(/`(.+?)`/g, "<code style=\"background:#f3f4f6;padding:0.125rem 0.25rem;border-radius:0.25rem;font-family:monospace;\">$1</code>").replace(/\[(.+?)\]\((.+?)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"color:#2563eb;text-decoration:underline;\">$1</a>").replace(/\n/g, "<br/>") : "";
53
- c.AdaptiveCard.onProcessMarkdown || (c.AdaptiveCard.onProcessMarkdown = (e, t) => {
54
- t.outputHtml = d(e), t.didProcess = !0;
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: c.Spacing.Default,
146
+ spacing: h.Spacing.Default,
146
147
  buttonSpacing: 8,
147
148
  showCard: {
148
- actionMode: c.ShowCardActionMode.Inline,
149
+ actionMode: h.ShowCardActionMode.Inline,
149
150
  inlineTopMargin: 12
150
151
  },
151
- actionsOrientation: c.Orientation.Horizontal,
152
- actionAlignment: c.ActionAlignment.Left
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: c.TextColor.Default,
159
- size: c.TextSize.Default,
159
+ color: h.TextColor.Default,
160
+ size: h.TextSize.Default,
160
161
  isSubtle: !0,
161
- weight: c.TextWeight.Bolder,
162
+ weight: h.TextWeight.Bolder,
162
163
  wrap: !0
163
164
  },
164
165
  value: {
165
- color: c.TextColor.Default,
166
- size: c.TextSize.Default,
166
+ color: h.TextColor.Default,
167
+ size: h.TextSize.Default,
167
168
  isSubtle: !1,
168
- weight: c.TextWeight.Default,
169
+ weight: h.TextWeight.Default,
169
170
  wrap: !0
170
171
  },
171
172
  spacing: 8
172
173
  }
173
- }), p = new c.HostConfig({
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: c.Spacing.Default,
191
+ spacing: h.Spacing.Default,
191
192
  buttonSpacing: 8,
192
193
  showCard: {
193
- actionMode: c.ShowCardActionMode.Inline,
194
+ actionMode: h.ShowCardActionMode.Inline,
194
195
  inlineTopMargin: 12
195
196
  },
196
- actionsOrientation: c.Orientation.Horizontal,
197
- actionAlignment: c.ActionAlignment.Left
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: c.TextColor.Default,
204
- size: c.TextSize.Default,
204
+ color: h.TextColor.Default,
205
+ size: h.TextSize.Default,
205
206
  isSubtle: !0,
206
- weight: c.TextWeight.Bolder,
207
+ weight: h.TextWeight.Bolder,
207
208
  wrap: !0
208
209
  },
209
210
  value: {
210
- color: c.TextColor.Default,
211
- size: c.TextSize.Default,
211
+ color: h.TextColor.Default,
212
+ size: h.TextSize.Default,
212
213
  isSubtle: !1,
213
- weight: c.TextWeight.Default,
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
- }), m = e(function({ widget: e, data: u, template: d, isLoading: m, error: h, onAction: g }) {
291
- let { t: _ } = a(), v = r(null), y = r(null), [b, x] = i(null), [S, C] = i(!1), [w, T] = i([]), [E, D] = i(null), [O, k] = i(null);
292
- n(() => {
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 && D(t);
296
+ e && j(t);
296
297
  }).catch((t) => {
297
- e && k(t.message || _("bigconsole.widget.renderer.adaptiveCard.templatingLoadFailed", "Failed to load templating library"));
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
- }, [_]), n(() => {
302
+ }, [x]), l(() => {
302
303
  let e = () => {
303
- C(document.documentElement.classList.contains("dark"));
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 A = t((e) => {
313
- e instanceof c.OpenUrlAction ? e.url && window.open(e.url, "_blank", "noopener,noreferrer") : e instanceof c.SubmitAction ? g && g(e.title || "submit", e.data || {}) : e instanceof c.ExecuteAction ? g && g(e.verb || "execute", e.data || {}) : e instanceof c.ShowCardAction;
314
- }, [g]);
315
- return n(() => {
316
- if (v.current && !m) {
317
- v.current.innerHTML = "", x(null), T([]);
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 t = null, n = [];
320
- if (d) {
321
- let r = typeof d == "string" ? JSON.parse(d) : d;
322
- if (E) try {
323
- let i = new E.Template(r), a = {
324
- $root: u || {},
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: e?.id,
327
- widgetTitle: e?.title,
328
- theme: S ? "dark" : "light"
327
+ widgetId: n?.id,
328
+ widgetTitle: n?.title,
329
+ theme: E ? "dark" : "light"
329
330
  }
330
331
  };
331
- t = i.expand(a), n = i.getLastTemplateExpansionWarnings(), n.length > 0 && T(n);
332
+ e = i.expand(o), t = i.getLastTemplateExpansionWarnings(), t.length > 0 && k(t);
332
333
  } catch {
333
- t = l(r, u || {}), n.push(_("bigconsole.widget.renderer.adaptiveCard.simplifiedExpansion", "Using simplified template expansion (some features may not work)")), T(n);
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 t = l(r, u || {}), O && (n.push(_("bigconsole.widget.renderer.adaptiveCard.fallbackExpansion", "Using fallback expansion: {{error}}", { error: O ?? "" })), T(n));
336
- } else u && typeof u == "object" && "type" in u && u.type === "AdaptiveCard" ? t = u : u && typeof u == "object" && "body" in u && (t = {
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
- ...u
340
+ ...r
340
341
  });
341
- if (!t) {
342
- x(_("bigconsole.widget.renderer.adaptiveCard.noValidData", "No template or valid Adaptive Card data provided"));
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
- y.current ||= new c.AdaptiveCard();
346
- let r = y.current;
347
- r.hostConfig = S ? p : f, r.onExecuteAction = A, r.parse(t);
348
- let i = r.render();
349
- i ? (i.style.height = "100%", i.style.overflow = "auto", i.classList.add("adaptive-card-container"), v.current.appendChild(i)) : x(_("bigconsole.widget.renderer.adaptiveCard.renderFailed", "Failed to render Adaptive Card"));
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
- x(e.message || _("bigconsole.widget.renderer.adaptiveCard.unknownError", "Unknown error rendering card"));
352
+ T(e.message || x("bigconsole.widget.renderer.adaptiveCard.unknownError", "Unknown error rendering card"));
352
353
  }
353
354
  }
354
355
  }, [
355
- d,
356
- u,
357
- e,
358
- m,
359
- S,
360
- A,
356
+ i,
357
+ r,
358
+ n,
359
+ s,
361
360
  E,
362
- O,
363
- _
364
- ]), m ? /* @__PURE__ */ o("div", {
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__ */ s("div", {
367
+ children: /* @__PURE__ */ p("div", {
367
368
  className: "animate-pulse space-y-3 w-full",
368
369
  children: [
369
- /* @__PURE__ */ o("div", { className: "h-5 bg-bg-sunken rounded w-3/4" }),
370
- /* @__PURE__ */ s("div", {
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__ */ o("div", { className: "h-10 w-10 bg-bg-sunken rounded-full" }), /* @__PURE__ */ s("div", {
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__ */ o("div", { className: "h-4 bg-bg-sunken rounded w-1/2" }), /* @__PURE__ */ o("div", { className: "h-3 bg-bg-sunken rounded w-1/3" })]
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__ */ o("div", { className: "h-4 bg-bg-sunken rounded w-full" }),
378
- /* @__PURE__ */ o("div", { className: "h-4 bg-bg-sunken rounded w-5/6" }),
379
- /* @__PURE__ */ s("div", {
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__ */ o("div", { className: "h-3 bg-bg-sunken rounded" }),
383
- /* @__PURE__ */ o("div", { className: "h-3 bg-bg-sunken rounded" }),
384
- /* @__PURE__ */ o("div", { className: "h-3 bg-bg-sunken rounded" }),
385
- /* @__PURE__ */ o("div", { className: "h-3 bg-bg-sunken rounded" })
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
- }) : h || b ? /* @__PURE__ */ o("div", {
391
+ }) : _ || w ? /* @__PURE__ */ f("div", {
391
392
  className: "flex items-center justify-center h-full p-4",
392
- children: /* @__PURE__ */ s("div", {
393
+ children: /* @__PURE__ */ p("div", {
393
394
  className: "text-center max-w-sm",
394
395
  children: [
395
- /* @__PURE__ */ o("div", {
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__ */ o("svg", {
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__ */ o("path", {
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__ */ o("p", {
411
+ /* @__PURE__ */ f("p", {
411
412
  className: "font-medium text-status-error-text",
412
- children: _("bigconsole.widget.renderer.adaptiveCard.errorRendering", "Error rendering card")
413
+ children: x("bigconsole.widget.renderer.adaptiveCard.errorRendering", "Error rendering card")
413
414
  }),
414
- /* @__PURE__ */ o("p", {
415
+ /* @__PURE__ */ f("p", {
415
416
  className: "text-sm text-secondary mt-1",
416
- children: h || b
417
+ children: _ || w
417
418
  }),
418
- w.length > 0 && /* @__PURE__ */ s("div", {
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__ */ o("p", {
421
+ children: [/* @__PURE__ */ f("p", {
421
422
  className: "text-xs font-medium text-yellow-700 dark:text-yellow-400 mb-1",
422
- children: _("bigconsole.widget.renderer.adaptiveCard.templateWarnings", "Template Warnings:")
423
- }), w.map((e, t) => /* @__PURE__ */ o("p", {
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
- }) : !d && !u ? /* @__PURE__ */ o("div", {
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__ */ s("div", {
433
+ children: /* @__PURE__ */ p("div", {
433
434
  className: "text-center max-w-sm",
434
435
  children: [
435
- /* @__PURE__ */ o("div", {
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__ */ o("svg", {
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__ */ o("path", {
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__ */ o("p", {
451
+ /* @__PURE__ */ f("p", {
451
452
  className: "font-medium text-secondary",
452
- children: _("bigconsole.widget.renderer.adaptiveCard.noContent", "No content")
453
+ children: x("bigconsole.widget.renderer.adaptiveCard.noContent", "No content")
453
454
  }),
454
- /* @__PURE__ */ o("p", {
455
+ /* @__PURE__ */ f("p", {
455
456
  className: "text-sm text-text-secondary mt-1",
456
- children: _("bigconsole.widget.renderer.adaptiveCard.noContentHint", "Configure a template or provide data to display an Adaptive Card")
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__ */ o("div", {
461
- ref: v,
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
- }), h = "adaptive-card-global-styles";
466
- if (typeof document < "u" && !document.getElementById(h)) {
466
+ }), x = "adaptive-card-global-styles";
467
+ if (typeof document < "u" && !document.getElementById(x)) {
467
468
  let e = document.createElement("style");
468
- e.id = h, e.textContent = "\n .adaptive-card-wrapper {\n font-family: Inter, system-ui, -apple-system, sans-serif;\n }\n\n .adaptive-card-wrapper .ac-textBlock {\n font-family: inherit;\n }\n\n .adaptive-card-wrapper .ac-image.ac-image-person {\n border-radius: 50%;\n object-fit: cover;\n }\n\n .adaptive-card-wrapper .ac-pushButton {\n font-family: inherit;\n font-weight: 500;\n border-radius: 0.375rem;\n padding: 0.5rem 1rem;\n transition: all 0.15s ease-in-out;\n }\n\n .adaptive-card-wrapper .ac-pushButton:hover {\n filter: brightness(0.95);\n }\n\n .adaptive-card-wrapper .ac-input {\n font-family: inherit;\n border-radius: 0.375rem;\n border: 1px solid #d1d5db;\n padding: 0.5rem 0.75rem;\n }\n\n .dark .adaptive-card-wrapper .ac-input {\n border-color: #4b5563;\n background-color: #1f2937;\n color: #f9fafb;\n }\n\n .adaptive-card-wrapper .ac-input:focus {\n outline: none;\n ring: 2px;\n ring-color: #3b82f6;\n }\n\n .adaptive-card-wrapper .ac-separator {\n margin: 0.5rem 0;\n }\n\n .adaptive-card-wrapper .ac-factSet {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: 0.25rem 1rem;\n }\n\n .adaptive-card-wrapper .ac-fact-title {\n color: #6b7280;\n }\n\n .dark .adaptive-card-wrapper .ac-fact-title {\n color: #9ca3af;\n }\n\n .adaptive-card-wrapper .ac-actionSet {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin-top: 1rem;\n padding-top: 1rem;\n border-top: 1px solid #e5e7eb;\n }\n\n .dark .adaptive-card-wrapper .ac-actionSet {\n border-top-color: #374151;\n }\n\n /* Markdown rendered code blocks in dark mode */\n .dark .adaptive-card-wrapper code {\n background: #374151 !important;\n color: #f9fafb !important;\n }\n\n /* Markdown links in dark mode */\n .dark .adaptive-card-wrapper a {\n color: #60a5fa !important;\n }\n\n /* TextBlock with markdown - ensure proper wrapping */\n .adaptive-card-wrapper .ac-textBlock p {\n margin: 0;\n }\n\n .adaptive-card-wrapper .ac-textBlock strong {\n font-weight: 600;\n }\n\n .adaptive-card-wrapper .ac-textBlock em {\n font-style: italic;\n }\n ", document.head.appendChild(e);
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 { m as default };
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;