@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.
Files changed (134) hide show
  1. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +109 -113
  2. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -1
  3. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +115 -113
  4. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
  5. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +71 -62
  6. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  7. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +90 -89
  8. package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
  9. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +56 -54
  10. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js.map +1 -1
  11. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +126 -125
  12. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js.map +1 -1
  13. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +151 -150
  14. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js.map +1 -1
  15. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +77 -76
  16. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js.map +1 -1
  17. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +97 -96
  18. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js.map +1 -1
  19. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +172 -191
  20. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
  21. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +75 -83
  22. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js.map +1 -1
  23. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +151 -154
  24. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js.map +1 -1
  25. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +181 -190
  26. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
  27. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
  28. package/dist/bigconsole/components/dashboard/WidgetPalette.js +110 -108
  29. package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
  30. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +102 -103
  31. package/dist/bigconsole/components/datasink/CacheTTLSelector.js.map +1 -1
  32. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +36 -41
  33. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js.map +1 -1
  34. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +38 -37
  35. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js.map +1 -1
  36. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +113 -117
  37. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
  38. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +182 -197
  39. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
  40. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +166 -168
  41. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js.map +1 -1
  42. package/dist/bigconsole/components/parser/DataSinkSelector.js +87 -86
  43. package/dist/bigconsole/components/parser/DataSinkSelector.js.map +1 -1
  44. package/dist/bigconsole/components/parser/ImportParserDialog.js +196 -211
  45. package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
  46. package/dist/bigconsole/components/parser/ParserSelector.js +130 -128
  47. package/dist/bigconsole/components/parser/ParserSelector.js.map +1 -1
  48. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +66 -63
  49. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js.map +1 -1
  50. package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -91
  51. package/dist/bigconsole/components/preview/AiPreviewPanel.js.map +1 -1
  52. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +222 -215
  53. package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
  54. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +149 -145
  55. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
  56. package/dist/bigconsole/components/widgets/PropertiesPanel.js +504 -470
  57. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  58. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +44 -47
  59. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js.map +1 -1
  60. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +143 -142
  61. package/dist/bigconsole/components/widgets/chart/ChartConfig.js.map +1 -1
  62. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +101 -88
  63. package/dist/bigconsole/components/widgets/comments/WidgetComments.js.map +1 -1
  64. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +135 -134
  65. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
  66. package/dist/bigconsole/components/widgets/form/FormWidget.js +167 -159
  67. package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
  68. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +69 -68
  69. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js.map +1 -1
  70. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +64 -72
  71. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js.map +1 -1
  72. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +60 -59
  73. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
  74. package/dist/bigconsole/components/widgets/list/ListConfig.js +57 -56
  75. package/dist/bigconsole/components/widgets/list/ListConfig.js.map +1 -1
  76. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +70 -69
  77. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js.map +1 -1
  78. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +35 -34
  79. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js.map +1 -1
  80. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +20 -19
  81. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js.map +1 -1
  82. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +178 -177
  83. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js.map +1 -1
  84. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +76 -75
  85. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js.map +1 -1
  86. package/dist/bigconsole/components/widgets/table/TableConfig.js +183 -168
  87. package/dist/bigconsole/components/widgets/table/TableConfig.js.map +1 -1
  88. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +187 -180
  89. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
  90. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +40 -38
  91. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js.map +1 -1
  92. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +150 -148
  93. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js.map +1 -1
  94. package/dist/bigconsole/pages/DashboardBuilderPage.js +181 -176
  95. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  96. package/dist/bigconsole/pages/DashboardViewPage.js +196 -192
  97. package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
  98. package/dist/bigconsole/pages/DashboardsPage.js +223 -219
  99. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  100. package/dist/bigconsole/pages/DataParsersPage.js +167 -170
  101. package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
  102. package/dist/bigconsole/pages/DataSinkBuilderPage.js +204 -189
  103. package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
  104. package/dist/bigconsole/pages/DataSinkViewPage.js +175 -169
  105. package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
  106. package/dist/bigconsole/pages/DataSourcesPage.js +8 -7
  107. package/dist/bigconsole/pages/DataSourcesPage.js.map +1 -1
  108. package/dist/bigconsole/pages/InsightsPage.js +238 -208
  109. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  110. package/dist/bigconsole/pages/ParserBuilderPage.js +464 -412
  111. package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
  112. package/dist/bigconsole/pages/ParserViewPage.js +92 -90
  113. package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
  114. package/dist/bigconsole/pages/PipelineBuilderPage.js +221 -194
  115. package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
  116. package/dist/bigconsole/pages/PipelineViewPage.js +181 -184
  117. package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
  118. package/dist/bigconsole/pages/PipelinesPage.js +128 -127
  119. package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
  120. package/dist/bigconsole/pages/SettingsPage.js +177 -172
  121. package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
  122. package/dist/bigconsole/pages/WidgetDemoPage.js +121 -83
  123. package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
  124. package/dist/bigconsole/pages/WorkflowViewPage.js +199 -193
  125. package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
  126. package/dist/bigconsole/pages/WorkflowsPage.js +129 -128
  127. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  128. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +111 -109
  129. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js.map +1 -1
  130. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +127 -126
  131. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js.map +1 -1
  132. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +103 -103
  133. package/dist/bigconsole/renderers/adapters/CustomRenderer.js.map +1 -1
  134. package/package.json +2 -1
@@ -1,15 +1,16 @@
1
1
  import { memo as e, useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
2
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
- import * as s from "adaptivecards";
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";
4
5
  //#region src/bigconsole/renderers/adapters/AdaptiveCardRenderer.tsx
5
- function c(e, t, n) {
6
+ function l(e, t, n) {
6
7
  let r = n || t;
7
8
  if (typeof e == "string") return e.replace(/\$\{([^}]+)\}/g, (e, n) => {
8
- let i = n.trim(), a = l(t, i);
9
- return a === void 0 && r !== t && (a = l(r, i)), a === void 0 ? e : String(a);
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);
10
11
  });
11
12
  if (Array.isArray(e)) return e.flatMap((e) => {
12
- let n = c(e, t, r);
13
+ let n = l(e, t, r);
13
14
  return Array.isArray(n) ? n : [n];
14
15
  });
15
16
  if (e && typeof e == "object") {
@@ -19,7 +20,7 @@ function c(e, t, n) {
19
20
  if (typeof e == "string") {
20
21
  let n = e.match(/^\$\{([^}]+)\}$/);
21
22
  if (n) {
22
- let e = l(t, n[1].trim()) || l(r, n[1].trim());
23
+ let e = u(t, n[1].trim()) || u(r, n[1].trim());
23
24
  Array.isArray(e) && (i = e);
24
25
  }
25
26
  } else Array.isArray(e) && (i = e);
@@ -27,7 +28,7 @@ function c(e, t, n) {
27
28
  let e = Object.fromEntries(Object.entries(n).filter(([e]) => e !== "$data"));
28
29
  return i.map((t) => {
29
30
  let n = typeof t == "object" && t ? t : { value: t };
30
- return c(e, {
31
+ return l(e, {
31
32
  ...r,
32
33
  ...n
33
34
  }, r);
@@ -35,12 +36,12 @@ function c(e, t, n) {
35
36
  }
36
37
  }
37
38
  let i = {};
38
- for (let [e, a] of Object.entries(n)) e !== "$data" && e !== "$when" && (i[e] = c(a, t, r));
39
+ for (let [e, a] of Object.entries(n)) e !== "$data" && e !== "$when" && (i[e] = l(a, t, r));
39
40
  return i;
40
41
  }
41
42
  return e;
42
43
  }
43
- function l(e, t) {
44
+ function u(e, t) {
44
45
  let n = t.split("."), r = e;
45
46
  for (let e of n) {
46
47
  if (typeof r != "object" || !r) return;
@@ -48,11 +49,11 @@ function l(e, t) {
48
49
  }
49
50
  return r;
50
51
  }
51
- var u = (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/>") : "";
52
- s.AdaptiveCard.onProcessMarkdown || (s.AdaptiveCard.onProcessMarkdown = (e, t) => {
53
- t.outputHtml = u(e), t.didProcess = !0;
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;
54
55
  });
55
- var d = new s.HostConfig({
56
+ var f = new c.HostConfig({
56
57
  fontFamily: "Inter, system-ui, -apple-system, sans-serif",
57
58
  containerStyles: {
58
59
  default: {
@@ -141,35 +142,35 @@ var d = new s.HostConfig({
141
142
  },
142
143
  actions: {
143
144
  maxActions: 5,
144
- spacing: s.Spacing.Default,
145
+ spacing: c.Spacing.Default,
145
146
  buttonSpacing: 8,
146
147
  showCard: {
147
- actionMode: s.ShowCardActionMode.Inline,
148
+ actionMode: c.ShowCardActionMode.Inline,
148
149
  inlineTopMargin: 12
149
150
  },
150
- actionsOrientation: s.Orientation.Horizontal,
151
- actionAlignment: s.ActionAlignment.Left
151
+ actionsOrientation: c.Orientation.Horizontal,
152
+ actionAlignment: c.ActionAlignment.Left
152
153
  },
153
154
  adaptiveCard: { allowCustomStyle: !0 },
154
155
  textBlock: { headingLevel: 2 },
155
156
  factSet: {
156
157
  title: {
157
- color: s.TextColor.Default,
158
- size: s.TextSize.Default,
158
+ color: c.TextColor.Default,
159
+ size: c.TextSize.Default,
159
160
  isSubtle: !0,
160
- weight: s.TextWeight.Bolder,
161
+ weight: c.TextWeight.Bolder,
161
162
  wrap: !0
162
163
  },
163
164
  value: {
164
- color: s.TextColor.Default,
165
- size: s.TextSize.Default,
165
+ color: c.TextColor.Default,
166
+ size: c.TextSize.Default,
166
167
  isSubtle: !1,
167
- weight: s.TextWeight.Default,
168
+ weight: c.TextWeight.Default,
168
169
  wrap: !0
169
170
  },
170
171
  spacing: 8
171
172
  }
172
- }), f = new s.HostConfig({
173
+ }), p = new c.HostConfig({
173
174
  fontFamily: "Inter, system-ui, -apple-system, sans-serif",
174
175
  spacing: {
175
176
  small: 4,
@@ -186,30 +187,30 @@ var d = new s.HostConfig({
186
187
  },
187
188
  actions: {
188
189
  maxActions: 5,
189
- spacing: s.Spacing.Default,
190
+ spacing: c.Spacing.Default,
190
191
  buttonSpacing: 8,
191
192
  showCard: {
192
- actionMode: s.ShowCardActionMode.Inline,
193
+ actionMode: c.ShowCardActionMode.Inline,
193
194
  inlineTopMargin: 12
194
195
  },
195
- actionsOrientation: s.Orientation.Horizontal,
196
- actionAlignment: s.ActionAlignment.Left
196
+ actionsOrientation: c.Orientation.Horizontal,
197
+ actionAlignment: c.ActionAlignment.Left
197
198
  },
198
199
  adaptiveCard: { allowCustomStyle: !0 },
199
200
  textBlock: { headingLevel: 2 },
200
201
  factSet: {
201
202
  title: {
202
- color: s.TextColor.Default,
203
- size: s.TextSize.Default,
203
+ color: c.TextColor.Default,
204
+ size: c.TextSize.Default,
204
205
  isSubtle: !0,
205
- weight: s.TextWeight.Bolder,
206
+ weight: c.TextWeight.Bolder,
206
207
  wrap: !0
207
208
  },
208
209
  value: {
209
- color: s.TextColor.Default,
210
- size: s.TextSize.Default,
210
+ color: c.TextColor.Default,
211
+ size: c.TextSize.Default,
211
212
  isSubtle: !1,
212
- weight: s.TextWeight.Default,
213
+ weight: c.TextWeight.Default,
213
214
  wrap: !0
214
215
  },
215
216
  spacing: 8
@@ -286,20 +287,20 @@ var d = new s.HostConfig({
286
287
  lineThickness: 1,
287
288
  lineColor: "#374151"
288
289
  }
289
- }), p = e(function({ widget: e, data: l, template: u, isLoading: p, error: m, onAction: h }) {
290
- let g = r(null), _ = r(null), [v, y] = i(null), [b, x] = i(!1), [S, C] = i([]), [w, T] = i(null), [E, D] = i(null);
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);
291
292
  n(() => {
292
293
  let e = !0;
293
294
  return import("adaptivecards-templating").then((t) => {
294
- e && T(t);
295
+ e && D(t);
295
296
  }).catch((t) => {
296
- e && D(t.message || "Failed to load templating library");
297
+ e && k(t.message || _("bigconsole.widget.renderer.adaptiveCard.templatingLoadFailed", "Failed to load templating library"));
297
298
  }), () => {
298
299
  e = !1;
299
300
  };
300
- }, []), n(() => {
301
+ }, [_]), n(() => {
301
302
  let e = () => {
302
- x(document.documentElement.classList.contains("dark"));
303
+ C(document.documentElement.classList.contains("dark"));
303
304
  };
304
305
  e();
305
306
  let t = new MutationObserver(e);
@@ -308,96 +309,97 @@ var d = new s.HostConfig({
308
309
  attributeFilter: ["class"]
309
310
  }), () => t.disconnect();
310
311
  }, []);
311
- let O = t((e) => {
312
- e instanceof s.OpenUrlAction ? e.url && window.open(e.url, "_blank", "noopener,noreferrer") : e instanceof s.SubmitAction ? h && h(e.title || "submit", e.data || {}) : e instanceof s.ExecuteAction ? h && h(e.verb || "execute", e.data || {}) : e instanceof s.ShowCardAction;
313
- }, [h]);
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]);
314
315
  return n(() => {
315
- if (g.current && !p) {
316
- g.current.innerHTML = "", y(null), C([]);
316
+ if (v.current && !m) {
317
+ v.current.innerHTML = "", x(null), T([]);
317
318
  try {
318
319
  let t = null, n = [];
319
- if (u) {
320
- let r = typeof u == "string" ? JSON.parse(u) : u;
321
- if (w) try {
322
- let i = new w.Template(r), a = {
323
- $root: l || {},
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 || {},
324
325
  $host: {
325
326
  widgetId: e?.id,
326
327
  widgetTitle: e?.title,
327
- theme: b ? "dark" : "light"
328
+ theme: S ? "dark" : "light"
328
329
  }
329
330
  };
330
- t = i.expand(a), n = i.getLastTemplateExpansionWarnings(), n.length > 0 && C(n);
331
+ t = i.expand(a), n = i.getLastTemplateExpansionWarnings(), n.length > 0 && T(n);
331
332
  } catch {
332
- t = c(r, l || {}), n.push("Using simplified template expansion (some features may not work)"), C(n);
333
+ t = l(r, u || {}), n.push(_("bigconsole.widget.renderer.adaptiveCard.simplifiedExpansion", "Using simplified template expansion (some features may not work)")), T(n);
333
334
  }
334
- else t = c(r, l || {}), E && (n.push(`Using fallback expansion: ${E}`), C(n));
335
- } else l && typeof l == "object" && "type" in l && l.type === "AdaptiveCard" ? t = l : l && typeof l == "object" && "body" in l && (t = {
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
337
  type: "AdaptiveCard",
337
338
  version: "1.6",
338
- ...l
339
+ ...u
339
340
  });
340
341
  if (!t) {
341
- y("No template or valid Adaptive Card data provided");
342
+ x(_("bigconsole.widget.renderer.adaptiveCard.noValidData", "No template or valid Adaptive Card data provided"));
342
343
  return;
343
344
  }
344
- _.current ||= new s.AdaptiveCard();
345
- let r = _.current;
346
- r.hostConfig = b ? f : d, r.onExecuteAction = O, r.parse(t);
345
+ y.current ||= new c.AdaptiveCard();
346
+ let r = y.current;
347
+ r.hostConfig = S ? p : f, r.onExecuteAction = A, r.parse(t);
347
348
  let i = r.render();
348
- i ? (i.style.height = "100%", i.style.overflow = "auto", i.classList.add("adaptive-card-container"), g.current.appendChild(i)) : y("Failed to render Adaptive Card");
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"));
349
350
  } catch (e) {
350
- y(e.message || "Unknown error rendering card");
351
+ x(e.message || _("bigconsole.widget.renderer.adaptiveCard.unknownError", "Unknown error rendering card"));
351
352
  }
352
353
  }
353
354
  }, [
355
+ d,
354
356
  u,
355
- l,
356
357
  e,
357
- p,
358
- b,
358
+ m,
359
+ S,
360
+ A,
361
+ E,
359
362
  O,
360
- w,
361
- E
362
- ]), p ? /* @__PURE__ */ a("div", {
363
+ _
364
+ ]), m ? /* @__PURE__ */ o("div", {
363
365
  className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
364
- children: /* @__PURE__ */ o("div", {
366
+ children: /* @__PURE__ */ s("div", {
365
367
  className: "animate-pulse space-y-3 w-full",
366
368
  children: [
367
- /* @__PURE__ */ a("div", { className: "h-5 bg-bg-sunken rounded w-3/4" }),
368
- /* @__PURE__ */ o("div", {
369
+ /* @__PURE__ */ o("div", { className: "h-5 bg-bg-sunken rounded w-3/4" }),
370
+ /* @__PURE__ */ s("div", {
369
371
  className: "flex gap-3",
370
- children: [/* @__PURE__ */ a("div", { className: "h-10 w-10 bg-bg-sunken rounded-full" }), /* @__PURE__ */ o("div", {
372
+ children: [/* @__PURE__ */ o("div", { className: "h-10 w-10 bg-bg-sunken rounded-full" }), /* @__PURE__ */ s("div", {
371
373
  className: "flex-1 space-y-2",
372
- children: [/* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-1/2" }), /* @__PURE__ */ a("div", { className: "h-3 bg-bg-sunken rounded w-1/3" })]
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" })]
373
375
  })]
374
376
  }),
375
- /* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-full" }),
376
- /* @__PURE__ */ a("div", { className: "h-4 bg-bg-sunken rounded w-5/6" }),
377
- /* @__PURE__ */ o("div", {
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
380
  className: "grid grid-cols-2 gap-2 mt-4",
379
381
  children: [
380
- /* @__PURE__ */ a("div", { className: "h-3 bg-bg-sunken rounded" }),
381
- /* @__PURE__ */ a("div", { className: "h-3 bg-bg-sunken rounded" }),
382
- /* @__PURE__ */ a("div", { className: "h-3 bg-bg-sunken rounded" }),
383
- /* @__PURE__ */ a("div", { className: "h-3 bg-bg-sunken rounded" })
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" })
384
386
  ]
385
387
  })
386
388
  ]
387
389
  })
388
- }) : m || v ? /* @__PURE__ */ a("div", {
390
+ }) : h || b ? /* @__PURE__ */ o("div", {
389
391
  className: "flex items-center justify-center h-full p-4",
390
- children: /* @__PURE__ */ o("div", {
392
+ children: /* @__PURE__ */ s("div", {
391
393
  className: "text-center max-w-sm",
392
394
  children: [
393
- /* @__PURE__ */ a("div", {
395
+ /* @__PURE__ */ o("div", {
394
396
  className: "w-12 h-12 mx-auto mb-3 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",
395
- children: /* @__PURE__ */ a("svg", {
397
+ children: /* @__PURE__ */ o("svg", {
396
398
  className: "w-6 h-6 text-red-600 dark:text-red-400",
397
399
  fill: "none",
398
400
  viewBox: "0 0 24 24",
399
401
  stroke: "currentColor",
400
- children: /* @__PURE__ */ a("path", {
402
+ children: /* @__PURE__ */ o("path", {
401
403
  strokeLinecap: "round",
402
404
  strokeLinejoin: "round",
403
405
  strokeWidth: 2,
@@ -405,39 +407,39 @@ var d = new s.HostConfig({
405
407
  })
406
408
  })
407
409
  }),
408
- /* @__PURE__ */ a("p", {
410
+ /* @__PURE__ */ o("p", {
409
411
  className: "font-medium text-status-error-text",
410
- children: "Error rendering card"
412
+ children: _("bigconsole.widget.renderer.adaptiveCard.errorRendering", "Error rendering card")
411
413
  }),
412
- /* @__PURE__ */ a("p", {
414
+ /* @__PURE__ */ o("p", {
413
415
  className: "text-sm text-secondary mt-1",
414
- children: m || v
416
+ children: h || b
415
417
  }),
416
- S.length > 0 && /* @__PURE__ */ o("div", {
418
+ w.length > 0 && /* @__PURE__ */ s("div", {
417
419
  className: "mt-3 p-2 bg-yellow-50 dark:bg-yellow-900/20 rounded text-left",
418
- children: [/* @__PURE__ */ a("p", {
420
+ children: [/* @__PURE__ */ o("p", {
419
421
  className: "text-xs font-medium text-yellow-700 dark:text-yellow-400 mb-1",
420
- children: "Template Warnings:"
421
- }), S.map((e, t) => /* @__PURE__ */ a("p", {
422
+ children: _("bigconsole.widget.renderer.adaptiveCard.templateWarnings", "Template Warnings:")
423
+ }), w.map((e, t) => /* @__PURE__ */ o("p", {
422
424
  className: "text-xs text-yellow-600 dark:text-yellow-300",
423
425
  children: e
424
426
  }, t))]
425
427
  })
426
428
  ]
427
429
  })
428
- }) : !u && !l ? /* @__PURE__ */ a("div", {
430
+ }) : !d && !u ? /* @__PURE__ */ o("div", {
429
431
  className: "flex items-center justify-center h-full p-4 animate-in fade-in duration-200",
430
- children: /* @__PURE__ */ o("div", {
432
+ children: /* @__PURE__ */ s("div", {
431
433
  className: "text-center max-w-sm",
432
434
  children: [
433
- /* @__PURE__ */ a("div", {
435
+ /* @__PURE__ */ o("div", {
434
436
  className: "w-12 h-12 mx-auto mb-3 rounded-full bg-bg-sunken flex items-center justify-center",
435
- children: /* @__PURE__ */ a("svg", {
437
+ children: /* @__PURE__ */ o("svg", {
436
438
  className: "w-6 h-6 text-text-secondary",
437
439
  fill: "none",
438
440
  viewBox: "0 0 24 24",
439
441
  stroke: "currentColor",
440
- children: /* @__PURE__ */ a("path", {
442
+ children: /* @__PURE__ */ o("path", {
441
443
  strokeLinecap: "round",
442
444
  strokeLinejoin: "round",
443
445
  strokeWidth: 2,
@@ -445,27 +447,27 @@ var d = new s.HostConfig({
445
447
  })
446
448
  })
447
449
  }),
448
- /* @__PURE__ */ a("p", {
450
+ /* @__PURE__ */ o("p", {
449
451
  className: "font-medium text-secondary",
450
- children: "No content"
452
+ children: _("bigconsole.widget.renderer.adaptiveCard.noContent", "No content")
451
453
  }),
452
- /* @__PURE__ */ a("p", {
454
+ /* @__PURE__ */ o("p", {
453
455
  className: "text-sm text-text-secondary mt-1",
454
- children: "Configure a template or provide data to display an Adaptive Card"
456
+ children: _("bigconsole.widget.renderer.adaptiveCard.noContentHint", "Configure a template or provide data to display an Adaptive Card")
455
457
  })
456
458
  ]
457
459
  })
458
- }) : /* @__PURE__ */ a("div", {
459
- ref: g,
460
+ }) : /* @__PURE__ */ o("div", {
461
+ ref: v,
460
462
  className: "adaptive-card-wrapper h-full overflow-auto",
461
463
  style: { "--ac-font-family": "Inter, system-ui, -apple-system, sans-serif" }
462
464
  });
463
- }), m = "adaptive-card-global-styles";
464
- if (typeof document < "u" && !document.getElementById(m)) {
465
+ }), h = "adaptive-card-global-styles";
466
+ if (typeof document < "u" && !document.getElementById(h)) {
465
467
  let e = document.createElement("style");
466
- e.id = m, 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);
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);
467
469
  }
468
470
  //#endregion
469
- export { p as default };
471
+ export { m as default };
470
472
 
471
473
  //# sourceMappingURL=AdaptiveCardRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdaptiveCardRenderer.js","names":[],"sources":["../../../../src/bigconsole/renderers/adapters/AdaptiveCardRenderer.tsx"],"sourcesContent":["/**\n * Adaptive Card Renderer (v2.1)\n *\n * Renders widgets using the official Microsoft Adaptive Cards SDK.\n * Based on patterns from https://github.com/microsoft/AdaptiveCards\n *\n * Supports full template binding with data context including:\n * - Nested object access: ${creator.name}\n * - Array iteration with $data\n * - Conditional rendering with $when\n * - Date formatting: {{DATE(${field},SHORT)}}\n * - All Adaptive Card elements and actions\n * - Markdown rendering in TextBlocks\n *\n * @see https://adaptivecards.io/\n */\n\nimport React, { memo, useEffect, useRef, useCallback, useState } from 'react';\nimport * as AdaptiveCards from 'adaptivecards';\nimport type { RendererProps } from '../types/renderer';\n\n// Type for the templating module\ntype ACDataModule = typeof import('adaptivecards-templating');\n\n// ============================================================================\n// Fallback Template Expansion (when adaptivecards-templating fails)\n// ============================================================================\n\n/**\n * Simple template expansion fallback.\n * Handles basic ${property}, ${object.property} syntax, and $data iteration.\n * Used when adaptivecards-templating library fails to load.\n */\nfunction expandTemplateFallback(\n template: unknown,\n data: Record<string, unknown>,\n rootData?: Record<string, unknown>\n): unknown {\n // Keep reference to root data for nested expansions\n const root = rootData || data;\n\n if (typeof template === 'string') {\n // Replace ${property} patterns\n return template.replace(/\\$\\{([^}]+)\\}/g, (match, path) => {\n const trimmedPath = path.trim();\n // Try current data first, then root data\n let value = getNestedValue(data, trimmedPath);\n if (value === undefined && root !== data) {\n value = getNestedValue(root, trimmedPath);\n }\n return value !== undefined ? String(value) : match;\n });\n }\n\n if (Array.isArray(template)) {\n return template.flatMap((item) => {\n const expanded = expandTemplateFallback(item, data, root);\n return Array.isArray(expanded) ? expanded : [expanded];\n });\n }\n\n if (template && typeof template === 'object') {\n const templateObj = template as Record<string, unknown>;\n\n // Handle $data iteration\n if ('$data' in templateObj) {\n const dataPath = templateObj.$data;\n let arrayData: unknown[] = [];\n\n if (typeof dataPath === 'string') {\n // Extract array path from ${arrayName} pattern\n const match = dataPath.match(/^\\$\\{([^}]+)\\}$/);\n if (match) {\n const arrValue = getNestedValue(data, match[1].trim()) || getNestedValue(root, match[1].trim());\n if (Array.isArray(arrValue)) {\n arrayData = arrValue;\n }\n }\n } else if (Array.isArray(dataPath)) {\n arrayData = dataPath;\n }\n\n if (arrayData.length > 0) {\n // Create a copy of template without $data for each array item\n const templateWithoutData = Object.fromEntries(Object.entries(templateObj).filter(([key]) => key !== '$data'));\n return arrayData.map((item) => {\n const itemData =\n typeof item === 'object' && item !== null ? (item as Record<string, unknown>) : { value: item };\n // Merge item data with root data for nested references\n const mergedData = { ...root, ...itemData };\n return expandTemplateFallback(templateWithoutData, mergedData, root);\n });\n }\n }\n\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(templateObj)) {\n if (key === '$data') continue; // Already handled above\n if (key === '$when') continue; // Skip conditional rendering in fallback\n result[key] = expandTemplateFallback(value, data, root);\n }\n return result;\n }\n\n return template;\n}\n\n/**\n * Get nested property value from object using dot notation.\n * e.g., getNestedValue({a: {b: 1}}, 'a.b') => 1\n */\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) return undefined;\n if (typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n\n// ============================================================================\n// Markdown Processing Setup (from official adaptivecards-react)\n// ============================================================================\n\n/**\n * Simple markdown processor for Adaptive Cards.\n * Handles basic markdown syntax: **bold**, *italic*, [links](url), `code`\n */\nconst processMarkdown = (text: string): string => {\n if (!text) return '';\n\n const html = text\n // Escape HTML first\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n // Bold: **text** or __text__\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/__(.+?)__/g, '<strong>$1</strong>')\n // Italic: *text* or _text_\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n .replace(/_(.+?)_/g, '<em>$1</em>')\n // Code: `code`\n .replace(\n /`(.+?)`/g,\n '<code style=\"background:#f3f4f6;padding:0.125rem 0.25rem;border-radius:0.25rem;font-family:monospace;\">$1</code>'\n )\n // Links: [text](url)\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"color:#2563eb;text-decoration:underline;\">$1</a>'\n )\n // Line breaks\n .replace(/\\n/g, '<br/>');\n\n return html;\n};\n\n// Set up global markdown processor for Adaptive Cards\nif (!AdaptiveCards.AdaptiveCard.onProcessMarkdown) {\n AdaptiveCards.AdaptiveCard.onProcessMarkdown = (text, result) => {\n result.outputHtml = processMarkdown(text);\n result.didProcess = true;\n };\n}\n\n// ============================================================================\n// Host Config - Customize Adaptive Card appearance\n// ============================================================================\n\nconst hostConfig = new AdaptiveCards.HostConfig({\n fontFamily: 'Inter, system-ui, -apple-system, sans-serif',\n containerStyles: {\n default: {\n backgroundColor: '#ffffff',\n foregroundColors: {\n default: {\n default: '#1f2937',\n subtle: '#6b7280',\n },\n accent: {\n default: '#2563eb',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#dc2626',\n subtle: '#ef4444',\n },\n good: {\n default: '#16a34a',\n subtle: '#22c55e',\n },\n warning: {\n default: '#d97706',\n subtle: '#f59e0b',\n },\n light: {\n default: '#9ca3af',\n subtle: '#d1d5db',\n },\n dark: {\n default: '#111827',\n subtle: '#374151',\n },\n },\n },\n emphasis: {\n backgroundColor: '#f3f4f6',\n foregroundColors: {\n default: {\n default: '#1f2937',\n subtle: '#6b7280',\n },\n accent: {\n default: '#2563eb',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#dc2626',\n subtle: '#ef4444',\n },\n good: {\n default: '#16a34a',\n subtle: '#22c55e',\n },\n warning: {\n default: '#d97706',\n subtle: '#f59e0b',\n },\n light: {\n default: '#9ca3af',\n subtle: '#d1d5db',\n },\n dark: {\n default: '#111827',\n subtle: '#374151',\n },\n },\n },\n },\n spacing: {\n small: 4,\n default: 8,\n medium: 12,\n large: 16,\n extraLarge: 24,\n padding: 16,\n },\n separator: {\n lineThickness: 1,\n lineColor: '#e5e7eb',\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160,\n },\n actions: {\n maxActions: 5,\n spacing: AdaptiveCards.Spacing.Default,\n buttonSpacing: 8,\n showCard: {\n actionMode: AdaptiveCards.ShowCardActionMode.Inline,\n inlineTopMargin: 12,\n },\n actionsOrientation: AdaptiveCards.Orientation.Horizontal,\n actionAlignment: AdaptiveCards.ActionAlignment.Left,\n },\n adaptiveCard: {\n allowCustomStyle: true,\n },\n textBlock: {\n headingLevel: 2,\n },\n factSet: {\n title: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: true,\n weight: AdaptiveCards.TextWeight.Bolder,\n wrap: true,\n },\n value: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: false,\n weight: AdaptiveCards.TextWeight.Default,\n wrap: true,\n },\n spacing: 8,\n },\n});\n\n// Dark mode host config - duplicating base config with dark overrides\nconst darkHostConfig = new AdaptiveCards.HostConfig({\n fontFamily: 'Inter, system-ui, -apple-system, sans-serif',\n spacing: {\n small: 4,\n default: 8,\n medium: 12,\n large: 16,\n extraLarge: 24,\n padding: 16,\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160,\n },\n actions: {\n maxActions: 5,\n spacing: AdaptiveCards.Spacing.Default,\n buttonSpacing: 8,\n showCard: {\n actionMode: AdaptiveCards.ShowCardActionMode.Inline,\n inlineTopMargin: 12,\n },\n actionsOrientation: AdaptiveCards.Orientation.Horizontal,\n actionAlignment: AdaptiveCards.ActionAlignment.Left,\n },\n adaptiveCard: {\n allowCustomStyle: true,\n },\n textBlock: {\n headingLevel: 2,\n },\n factSet: {\n title: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: true,\n weight: AdaptiveCards.TextWeight.Bolder,\n wrap: true,\n },\n value: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: false,\n weight: AdaptiveCards.TextWeight.Default,\n wrap: true,\n },\n spacing: 8,\n },\n containerStyles: {\n default: {\n backgroundColor: '#111827',\n foregroundColors: {\n default: {\n default: '#f9fafb',\n subtle: '#9ca3af',\n },\n accent: {\n default: '#60a5fa',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#f87171',\n subtle: '#ef4444',\n },\n good: {\n default: '#4ade80',\n subtle: '#22c55e',\n },\n warning: {\n default: '#fbbf24',\n subtle: '#f59e0b',\n },\n light: {\n default: '#d1d5db',\n subtle: '#9ca3af',\n },\n dark: {\n default: '#f9fafb',\n subtle: '#e5e7eb',\n },\n },\n },\n emphasis: {\n backgroundColor: '#1f2937',\n foregroundColors: {\n default: {\n default: '#f9fafb',\n subtle: '#9ca3af',\n },\n accent: {\n default: '#60a5fa',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#f87171',\n subtle: '#ef4444',\n },\n good: {\n default: '#4ade80',\n subtle: '#22c55e',\n },\n warning: {\n default: '#fbbf24',\n subtle: '#f59e0b',\n },\n light: {\n default: '#d1d5db',\n subtle: '#9ca3af',\n },\n dark: {\n default: '#f9fafb',\n subtle: '#e5e7eb',\n },\n },\n },\n },\n separator: {\n lineThickness: 1,\n lineColor: '#374151',\n },\n});\n\n// ============================================================================\n// Main Renderer Component\n// ============================================================================\n\nexport const AdaptiveCardRenderer: React.FC<RendererProps> = memo(function AdaptiveCardRenderer({\n widget,\n data,\n template,\n isLoading,\n error,\n onAction,\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const cardRef = useRef<AdaptiveCards.AdaptiveCard | null>(null);\n const [renderError, setRenderError] = useState<string | null>(null);\n const [isDarkMode, setIsDarkMode] = useState(false);\n const [templateWarnings, setTemplateWarnings] = useState<string[]>([]);\n const [acDataModule, setAcDataModule] = useState<ACDataModule | null>(null);\n const [templatingError, setTemplatingError] = useState<string | null>(null);\n\n // Load adaptivecards-templating dynamically to avoid Node.js polyfill issues\n useEffect(() => {\n let mounted = true;\n\n import('adaptivecards-templating')\n .then((module) => {\n if (mounted) {\n setAcDataModule(module);\n }\n })\n .catch((err) => {\n if (mounted) {\n setTemplatingError(err.message || 'Failed to load templating library');\n }\n });\n\n return () => {\n mounted = false;\n };\n }, []);\n\n // Detect dark mode\n useEffect(() => {\n const checkDarkMode = () => {\n setIsDarkMode(document.documentElement.classList.contains('dark'));\n };\n checkDarkMode();\n\n // Watch for changes\n const observer = new MutationObserver(checkDarkMode);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return () => observer.disconnect();\n }, []);\n\n // Handle action execution\n const handleAction = useCallback(\n (action: AdaptiveCards.Action) => {\n if (action instanceof AdaptiveCards.OpenUrlAction) {\n // Open URL in new tab\n if (action.url) {\n window.open(action.url, '_blank', 'noopener,noreferrer');\n }\n } else if (action instanceof AdaptiveCards.SubmitAction) {\n // Call onAction callback with action data\n if (onAction) {\n onAction(action.title || 'submit', (action.data as Record<string, unknown>) || {});\n }\n } else if (action instanceof AdaptiveCards.ExecuteAction) {\n // Call onAction callback with verb and data\n if (onAction) {\n onAction(action.verb || 'execute', (action.data as Record<string, unknown>) || {});\n }\n } else if (action instanceof AdaptiveCards.ShowCardAction) {\n // ShowCard is handled inline by the SDK\n } else {\n }\n },\n [onAction]\n );\n\n // Render the Adaptive Card\n useEffect(() => {\n if (!containerRef.current) return;\n if (isLoading) return;\n\n // Clear previous content safely\n containerRef.current.innerHTML = '';\n setRenderError(null);\n setTemplateWarnings([]);\n\n // Debug logging\n\n try {\n let cardPayload: object | null = null;\n let warnings: string[] = [];\n\n // Determine the card payload\n if (template) {\n // We have a template - use templating engine if available\n const templateObj = typeof template === 'string' ? JSON.parse(template) : template;\n\n if (acDataModule) {\n try {\n // Create template instance using dynamically loaded module\n const cardTemplate = new acDataModule.Template(templateObj);\n\n // Create evaluation context with data\n // Supports $root for data, $host for host application context\n const context = {\n $root: data || {},\n $host: {\n widgetId: widget?.id,\n widgetTitle: widget?.title,\n theme: isDarkMode ? 'dark' : 'light',\n },\n };\n\n // Expand template with data\n cardPayload = cardTemplate.expand(context);\n\n // Capture any template expansion warnings\n warnings = cardTemplate.getLastTemplateExpansionWarnings();\n if (warnings.length > 0) {\n setTemplateWarnings(warnings);\n }\n } catch (templatingErr) {\n // Templating library threw an error - use fallback\n cardPayload = expandTemplateFallback(templateObj, (data || {}) as Record<string, unknown>) as object;\n warnings.push('Using simplified template expansion (some features may not work)');\n setTemplateWarnings(warnings);\n }\n } else {\n // Templating not available - use fallback expansion\n cardPayload = expandTemplateFallback(templateObj, (data || {}) as Record<string, unknown>) as object;\n if (templatingError) {\n warnings.push(`Using fallback expansion: ${templatingError}`);\n setTemplateWarnings(warnings);\n }\n }\n } else if (data && typeof data === 'object' && 'type' in data && data.type === 'AdaptiveCard') {\n // Data is already an Adaptive Card\n cardPayload = data;\n } else if (data && typeof data === 'object' && 'body' in data) {\n // Data has body property - treat as Adaptive Card\n cardPayload = {\n type: 'AdaptiveCard',\n version: '1.6',\n ...data,\n };\n }\n\n if (!cardPayload) {\n setRenderError('No template or valid Adaptive Card data provided');\n return;\n }\n\n // Create or reuse Adaptive Card instance\n if (!cardRef.current) {\n cardRef.current = new AdaptiveCards.AdaptiveCard();\n }\n const adaptiveCard = cardRef.current;\n\n // Set host config based on theme\n adaptiveCard.hostConfig = isDarkMode ? darkHostConfig : hostConfig;\n\n // Set action handler\n adaptiveCard.onExecuteAction = handleAction;\n\n // Parse the card payload\n adaptiveCard.parse(cardPayload);\n\n // Render to HTML element\n const renderedCard = adaptiveCard.render();\n\n if (renderedCard) {\n // Apply additional styling\n renderedCard.style.height = '100%';\n renderedCard.style.overflow = 'auto';\n\n // Add class for styling consistency\n renderedCard.classList.add('adaptive-card-container');\n\n // Append to container\n containerRef.current.appendChild(renderedCard);\n } else {\n setRenderError('Failed to render Adaptive Card');\n }\n } catch (e) {\n setRenderError((e as Error).message || 'Unknown error rendering card');\n }\n }, [template, data, widget, isLoading, isDarkMode, handleAction, acDataModule, templatingError]);\n\n // Loading state\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center h-full p-4 animate-in fade-in duration-200\">\n <div className=\"animate-pulse space-y-3 w-full\">\n <div className=\"h-5 bg-bg-sunken rounded w-3/4\" />\n <div className=\"flex gap-3\">\n <div className=\"h-10 w-10 bg-bg-sunken rounded-full\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 bg-bg-sunken rounded w-1/2\" />\n <div className=\"h-3 bg-bg-sunken rounded w-1/3\" />\n </div>\n </div>\n <div className=\"h-4 bg-bg-sunken rounded w-full\" />\n <div className=\"h-4 bg-bg-sunken rounded w-5/6\" />\n <div className=\"grid grid-cols-2 gap-2 mt-4\">\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n </div>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error || renderError) {\n return (\n <div className=\"flex items-center justify-center h-full p-4\">\n <div className=\"text-center max-w-sm\">\n <div className=\"w-12 h-12 mx-auto mb-3 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center\">\n <svg\n className=\"w-6 h-6 text-red-600 dark:text-red-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n <p className=\"font-medium text-status-error-text\">Error rendering card</p>\n <p className=\"text-sm text-secondary mt-1\">{error || renderError}</p>\n {templateWarnings.length > 0 && (\n <div className=\"mt-3 p-2 bg-yellow-50 dark:bg-yellow-900/20 rounded text-left\">\n <p className=\"text-xs font-medium text-yellow-700 dark:text-yellow-400 mb-1\">Template Warnings:</p>\n {templateWarnings.map((warning, i) => (\n <p key={i} className=\"text-xs text-yellow-600 dark:text-yellow-300\">\n {warning}\n </p>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n // Empty state - no template or data\n if (!template && !data) {\n return (\n <div className=\"flex items-center justify-center h-full p-4 animate-in fade-in duration-200\">\n <div className=\"text-center max-w-sm\">\n <div className=\"w-12 h-12 mx-auto mb-3 rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg className=\"w-6 h-6 text-text-secondary\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z\"\n />\n </svg>\n </div>\n <p className=\"font-medium text-secondary\">No content</p>\n <p className=\"text-sm text-text-secondary mt-1\">\n Configure a template or provide data to display an Adaptive Card\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div\n ref={containerRef}\n className=\"adaptive-card-wrapper h-full overflow-auto\"\n style={{\n // CSS custom properties for further customization\n ['--ac-font-family' as string]: 'Inter, system-ui, -apple-system, sans-serif',\n }}\n />\n );\n});\n\n// ============================================================================\n// Global Styles for Adaptive Cards\n// ============================================================================\n\n// Inject global styles for Adaptive Cards\nconst styleId = 'adaptive-card-global-styles';\nif (typeof document !== 'undefined' && !document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.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 `;\n document.head.appendChild(style);\n}\n\nexport default AdaptiveCardRenderer;\n"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C,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD;MAAK,WAAU;MAA8B,MAAK;MAAO,SAAQ;MAAY,QAAO;gBAClF,kBAAC,QAAD;OACE,eAAc;OACd,gBAAe;OACf,aAAa;OACb,GAAE;OACF,CAAA;MACE,CAAA;KACF,CAAA;IACN,kBAAC,KAAD;KAAG,WAAU;eAA6B;KAAc,CAAA;IACxD,kBAAC,KAAD;KAAG,WAAU;eAAmC;KAE5C,CAAA;IACA;;EACF,CAAA,GAKR,kBAAC,OAAD;EACE,KAAK;EACL,WAAU;EACV,OAAO,EAEJ,oBAA+B,+CACjC;EACD,CAAA;EAEJ,EAOI,IAAU;AAChB,IAAI,OAAO,WAAa,OAAe,CAAC,SAAS,eAAe,EAAQ,EAAE;CACxE,IAAM,IAAQ,SAAS,cAAc,QAAQ;AAsG7C,CArGA,EAAM,KAAK,GACX,EAAM,cAAc,2xEAoGpB,SAAS,KAAK,YAAY,EAAM"}
1
+ {"version":3,"file":"AdaptiveCardRenderer.js","names":[],"sources":["../../../../src/bigconsole/renderers/adapters/AdaptiveCardRenderer.tsx"],"sourcesContent":["/**\n * Adaptive Card Renderer (v2.1)\n *\n * Renders widgets using the official Microsoft Adaptive Cards SDK.\n * Based on patterns from https://github.com/microsoft/AdaptiveCards\n *\n * Supports full template binding with data context including:\n * - Nested object access: ${creator.name}\n * - Array iteration with $data\n * - Conditional rendering with $when\n * - Date formatting: {{DATE(${field},SHORT)}}\n * - All Adaptive Card elements and actions\n * - Markdown rendering in TextBlocks\n *\n * @see https://adaptivecards.io/\n */\n\nimport React, { memo, useEffect, useRef, useCallback, useState } from 'react';\nimport * as AdaptiveCards from 'adaptivecards';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport type { RendererProps } from '../types/renderer';\n\n// Type for the templating module\ntype ACDataModule = typeof import('adaptivecards-templating');\n\n// ============================================================================\n// Fallback Template Expansion (when adaptivecards-templating fails)\n// ============================================================================\n\n/**\n * Simple template expansion fallback.\n * Handles basic ${property}, ${object.property} syntax, and $data iteration.\n * Used when adaptivecards-templating library fails to load.\n */\nfunction expandTemplateFallback(\n template: unknown,\n data: Record<string, unknown>,\n rootData?: Record<string, unknown>\n): unknown {\n // Keep reference to root data for nested expansions\n const root = rootData || data;\n\n if (typeof template === 'string') {\n // Replace ${property} patterns\n return template.replace(/\\$\\{([^}]+)\\}/g, (match, path) => {\n const trimmedPath = path.trim();\n // Try current data first, then root data\n let value = getNestedValue(data, trimmedPath);\n if (value === undefined && root !== data) {\n value = getNestedValue(root, trimmedPath);\n }\n return value !== undefined ? String(value) : match;\n });\n }\n\n if (Array.isArray(template)) {\n return template.flatMap((item) => {\n const expanded = expandTemplateFallback(item, data, root);\n return Array.isArray(expanded) ? expanded : [expanded];\n });\n }\n\n if (template && typeof template === 'object') {\n const templateObj = template as Record<string, unknown>;\n\n // Handle $data iteration\n if ('$data' in templateObj) {\n const dataPath = templateObj.$data;\n let arrayData: unknown[] = [];\n\n if (typeof dataPath === 'string') {\n // Extract array path from ${arrayName} pattern\n const match = dataPath.match(/^\\$\\{([^}]+)\\}$/);\n if (match) {\n const arrValue = getNestedValue(data, match[1].trim()) || getNestedValue(root, match[1].trim());\n if (Array.isArray(arrValue)) {\n arrayData = arrValue;\n }\n }\n } else if (Array.isArray(dataPath)) {\n arrayData = dataPath;\n }\n\n if (arrayData.length > 0) {\n // Create a copy of template without $data for each array item\n const templateWithoutData = Object.fromEntries(Object.entries(templateObj).filter(([key]) => key !== '$data'));\n return arrayData.map((item) => {\n const itemData =\n typeof item === 'object' && item !== null ? (item as Record<string, unknown>) : { value: item };\n // Merge item data with root data for nested references\n const mergedData = { ...root, ...itemData };\n return expandTemplateFallback(templateWithoutData, mergedData, root);\n });\n }\n }\n\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(templateObj)) {\n if (key === '$data') continue; // Already handled above\n if (key === '$when') continue; // Skip conditional rendering in fallback\n result[key] = expandTemplateFallback(value, data, root);\n }\n return result;\n }\n\n return template;\n}\n\n/**\n * Get nested property value from object using dot notation.\n * e.g., getNestedValue({a: {b: 1}}, 'a.b') => 1\n */\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) return undefined;\n if (typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n\n// ============================================================================\n// Markdown Processing Setup (from official adaptivecards-react)\n// ============================================================================\n\n/**\n * Simple markdown processor for Adaptive Cards.\n * Handles basic markdown syntax: **bold**, *italic*, [links](url), `code`\n */\nconst processMarkdown = (text: string): string => {\n if (!text) return '';\n\n const html = text\n // Escape HTML first\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n // Bold: **text** or __text__\n .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/__(.+?)__/g, '<strong>$1</strong>')\n // Italic: *text* or _text_\n .replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n .replace(/_(.+?)_/g, '<em>$1</em>')\n // Code: `code`\n .replace(\n /`(.+?)`/g,\n '<code style=\"background:#f3f4f6;padding:0.125rem 0.25rem;border-radius:0.25rem;font-family:monospace;\">$1</code>'\n )\n // Links: [text](url)\n .replace(\n /\\[(.+?)\\]\\((.+?)\\)/g,\n '<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"color:#2563eb;text-decoration:underline;\">$1</a>'\n )\n // Line breaks\n .replace(/\\n/g, '<br/>');\n\n return html;\n};\n\n// Set up global markdown processor for Adaptive Cards\nif (!AdaptiveCards.AdaptiveCard.onProcessMarkdown) {\n AdaptiveCards.AdaptiveCard.onProcessMarkdown = (text, result) => {\n result.outputHtml = processMarkdown(text);\n result.didProcess = true;\n };\n}\n\n// ============================================================================\n// Host Config - Customize Adaptive Card appearance\n// ============================================================================\n\nconst hostConfig = new AdaptiveCards.HostConfig({\n fontFamily: 'Inter, system-ui, -apple-system, sans-serif',\n containerStyles: {\n default: {\n backgroundColor: '#ffffff',\n foregroundColors: {\n default: {\n default: '#1f2937',\n subtle: '#6b7280',\n },\n accent: {\n default: '#2563eb',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#dc2626',\n subtle: '#ef4444',\n },\n good: {\n default: '#16a34a',\n subtle: '#22c55e',\n },\n warning: {\n default: '#d97706',\n subtle: '#f59e0b',\n },\n light: {\n default: '#9ca3af',\n subtle: '#d1d5db',\n },\n dark: {\n default: '#111827',\n subtle: '#374151',\n },\n },\n },\n emphasis: {\n backgroundColor: '#f3f4f6',\n foregroundColors: {\n default: {\n default: '#1f2937',\n subtle: '#6b7280',\n },\n accent: {\n default: '#2563eb',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#dc2626',\n subtle: '#ef4444',\n },\n good: {\n default: '#16a34a',\n subtle: '#22c55e',\n },\n warning: {\n default: '#d97706',\n subtle: '#f59e0b',\n },\n light: {\n default: '#9ca3af',\n subtle: '#d1d5db',\n },\n dark: {\n default: '#111827',\n subtle: '#374151',\n },\n },\n },\n },\n spacing: {\n small: 4,\n default: 8,\n medium: 12,\n large: 16,\n extraLarge: 24,\n padding: 16,\n },\n separator: {\n lineThickness: 1,\n lineColor: '#e5e7eb',\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160,\n },\n actions: {\n maxActions: 5,\n spacing: AdaptiveCards.Spacing.Default,\n buttonSpacing: 8,\n showCard: {\n actionMode: AdaptiveCards.ShowCardActionMode.Inline,\n inlineTopMargin: 12,\n },\n actionsOrientation: AdaptiveCards.Orientation.Horizontal,\n actionAlignment: AdaptiveCards.ActionAlignment.Left,\n },\n adaptiveCard: {\n allowCustomStyle: true,\n },\n textBlock: {\n headingLevel: 2,\n },\n factSet: {\n title: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: true,\n weight: AdaptiveCards.TextWeight.Bolder,\n wrap: true,\n },\n value: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: false,\n weight: AdaptiveCards.TextWeight.Default,\n wrap: true,\n },\n spacing: 8,\n },\n});\n\n// Dark mode host config - duplicating base config with dark overrides\nconst darkHostConfig = new AdaptiveCards.HostConfig({\n fontFamily: 'Inter, system-ui, -apple-system, sans-serif',\n spacing: {\n small: 4,\n default: 8,\n medium: 12,\n large: 16,\n extraLarge: 24,\n padding: 16,\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160,\n },\n actions: {\n maxActions: 5,\n spacing: AdaptiveCards.Spacing.Default,\n buttonSpacing: 8,\n showCard: {\n actionMode: AdaptiveCards.ShowCardActionMode.Inline,\n inlineTopMargin: 12,\n },\n actionsOrientation: AdaptiveCards.Orientation.Horizontal,\n actionAlignment: AdaptiveCards.ActionAlignment.Left,\n },\n adaptiveCard: {\n allowCustomStyle: true,\n },\n textBlock: {\n headingLevel: 2,\n },\n factSet: {\n title: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: true,\n weight: AdaptiveCards.TextWeight.Bolder,\n wrap: true,\n },\n value: {\n color: AdaptiveCards.TextColor.Default,\n size: AdaptiveCards.TextSize.Default,\n isSubtle: false,\n weight: AdaptiveCards.TextWeight.Default,\n wrap: true,\n },\n spacing: 8,\n },\n containerStyles: {\n default: {\n backgroundColor: '#111827',\n foregroundColors: {\n default: {\n default: '#f9fafb',\n subtle: '#9ca3af',\n },\n accent: {\n default: '#60a5fa',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#f87171',\n subtle: '#ef4444',\n },\n good: {\n default: '#4ade80',\n subtle: '#22c55e',\n },\n warning: {\n default: '#fbbf24',\n subtle: '#f59e0b',\n },\n light: {\n default: '#d1d5db',\n subtle: '#9ca3af',\n },\n dark: {\n default: '#f9fafb',\n subtle: '#e5e7eb',\n },\n },\n },\n emphasis: {\n backgroundColor: '#1f2937',\n foregroundColors: {\n default: {\n default: '#f9fafb',\n subtle: '#9ca3af',\n },\n accent: {\n default: '#60a5fa',\n subtle: '#3b82f6',\n },\n attention: {\n default: '#f87171',\n subtle: '#ef4444',\n },\n good: {\n default: '#4ade80',\n subtle: '#22c55e',\n },\n warning: {\n default: '#fbbf24',\n subtle: '#f59e0b',\n },\n light: {\n default: '#d1d5db',\n subtle: '#9ca3af',\n },\n dark: {\n default: '#f9fafb',\n subtle: '#e5e7eb',\n },\n },\n },\n },\n separator: {\n lineThickness: 1,\n lineColor: '#374151',\n },\n});\n\n// ============================================================================\n// Main Renderer Component\n// ============================================================================\n\nexport const AdaptiveCardRenderer: React.FC<RendererProps> = memo(function AdaptiveCardRenderer({\n widget,\n data,\n template,\n isLoading,\n error,\n onAction,\n}) {\n const { t } = useI18n();\n const containerRef = useRef<HTMLDivElement>(null);\n const cardRef = useRef<AdaptiveCards.AdaptiveCard | null>(null);\n const [renderError, setRenderError] = useState<string | null>(null);\n const [isDarkMode, setIsDarkMode] = useState(false);\n const [templateWarnings, setTemplateWarnings] = useState<string[]>([]);\n const [acDataModule, setAcDataModule] = useState<ACDataModule | null>(null);\n const [templatingError, setTemplatingError] = useState<string | null>(null);\n\n // Load adaptivecards-templating dynamically to avoid Node.js polyfill issues\n useEffect(() => {\n let mounted = true;\n\n import('adaptivecards-templating')\n .then((module) => {\n if (mounted) {\n setAcDataModule(module);\n }\n })\n .catch((err) => {\n if (mounted) {\n setTemplatingError(\n err.message ||\n t('bigconsole.widget.renderer.adaptiveCard.templatingLoadFailed', 'Failed to load templating library')\n );\n }\n });\n\n return () => {\n mounted = false;\n };\n }, [t]);\n\n // Detect dark mode\n useEffect(() => {\n const checkDarkMode = () => {\n setIsDarkMode(document.documentElement.classList.contains('dark'));\n };\n checkDarkMode();\n\n // Watch for changes\n const observer = new MutationObserver(checkDarkMode);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return () => observer.disconnect();\n }, []);\n\n // Handle action execution\n const handleAction = useCallback(\n (action: AdaptiveCards.Action) => {\n if (action instanceof AdaptiveCards.OpenUrlAction) {\n // Open URL in new tab\n if (action.url) {\n window.open(action.url, '_blank', 'noopener,noreferrer');\n }\n } else if (action instanceof AdaptiveCards.SubmitAction) {\n // Call onAction callback with action data\n if (onAction) {\n onAction(action.title || 'submit', (action.data as Record<string, unknown>) || {});\n }\n } else if (action instanceof AdaptiveCards.ExecuteAction) {\n // Call onAction callback with verb and data\n if (onAction) {\n onAction(action.verb || 'execute', (action.data as Record<string, unknown>) || {});\n }\n } else if (action instanceof AdaptiveCards.ShowCardAction) {\n // ShowCard is handled inline by the SDK\n } else {\n }\n },\n [onAction]\n );\n\n // Render the Adaptive Card\n useEffect(() => {\n if (!containerRef.current) return;\n if (isLoading) return;\n\n // Clear previous content safely\n containerRef.current.innerHTML = '';\n setRenderError(null);\n setTemplateWarnings([]);\n\n // Debug logging\n\n try {\n let cardPayload: object | null = null;\n let warnings: string[] = [];\n\n // Determine the card payload\n if (template) {\n // We have a template - use templating engine if available\n const templateObj = typeof template === 'string' ? JSON.parse(template) : template;\n\n if (acDataModule) {\n try {\n // Create template instance using dynamically loaded module\n const cardTemplate = new acDataModule.Template(templateObj);\n\n // Create evaluation context with data\n // Supports $root for data, $host for host application context\n const context = {\n $root: data || {},\n $host: {\n widgetId: widget?.id,\n widgetTitle: widget?.title,\n theme: isDarkMode ? 'dark' : 'light',\n },\n };\n\n // Expand template with data\n cardPayload = cardTemplate.expand(context);\n\n // Capture any template expansion warnings\n warnings = cardTemplate.getLastTemplateExpansionWarnings();\n if (warnings.length > 0) {\n setTemplateWarnings(warnings);\n }\n } catch (templatingErr) {\n // Templating library threw an error - use fallback\n cardPayload = expandTemplateFallback(templateObj, (data || {}) as Record<string, unknown>) as object;\n warnings.push(\n t(\n 'bigconsole.widget.renderer.adaptiveCard.simplifiedExpansion',\n 'Using simplified template expansion (some features may not work)'\n )\n );\n setTemplateWarnings(warnings);\n }\n } else {\n // Templating not available - use fallback expansion\n cardPayload = expandTemplateFallback(templateObj, (data || {}) as Record<string, unknown>) as object;\n if (templatingError) {\n warnings.push(\n t('bigconsole.widget.renderer.adaptiveCard.fallbackExpansion', 'Using fallback expansion: {{error}}', {\n error: templatingError ?? '',\n })\n );\n setTemplateWarnings(warnings);\n }\n }\n } else if (data && typeof data === 'object' && 'type' in data && data.type === 'AdaptiveCard') {\n // Data is already an Adaptive Card\n cardPayload = data;\n } else if (data && typeof data === 'object' && 'body' in data) {\n // Data has body property - treat as Adaptive Card\n cardPayload = {\n type: 'AdaptiveCard',\n version: '1.6',\n ...data,\n };\n }\n\n if (!cardPayload) {\n setRenderError(\n t('bigconsole.widget.renderer.adaptiveCard.noValidData', 'No template or valid Adaptive Card data provided')\n );\n return;\n }\n\n // Create or reuse Adaptive Card instance\n if (!cardRef.current) {\n cardRef.current = new AdaptiveCards.AdaptiveCard();\n }\n const adaptiveCard = cardRef.current;\n\n // Set host config based on theme\n adaptiveCard.hostConfig = isDarkMode ? darkHostConfig : hostConfig;\n\n // Set action handler\n adaptiveCard.onExecuteAction = handleAction;\n\n // Parse the card payload\n adaptiveCard.parse(cardPayload);\n\n // Render to HTML element\n const renderedCard = adaptiveCard.render();\n\n if (renderedCard) {\n // Apply additional styling\n renderedCard.style.height = '100%';\n renderedCard.style.overflow = 'auto';\n\n // Add class for styling consistency\n renderedCard.classList.add('adaptive-card-container');\n\n // Append to container\n containerRef.current.appendChild(renderedCard);\n } else {\n setRenderError(t('bigconsole.widget.renderer.adaptiveCard.renderFailed', 'Failed to render Adaptive Card'));\n }\n } catch (e) {\n setRenderError(\n (e as Error).message ||\n t('bigconsole.widget.renderer.adaptiveCard.unknownError', 'Unknown error rendering card')\n );\n }\n }, [template, data, widget, isLoading, isDarkMode, handleAction, acDataModule, templatingError, t]);\n\n // Loading state\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center h-full p-4 animate-in fade-in duration-200\">\n <div className=\"animate-pulse space-y-3 w-full\">\n <div className=\"h-5 bg-bg-sunken rounded w-3/4\" />\n <div className=\"flex gap-3\">\n <div className=\"h-10 w-10 bg-bg-sunken rounded-full\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 bg-bg-sunken rounded w-1/2\" />\n <div className=\"h-3 bg-bg-sunken rounded w-1/3\" />\n </div>\n </div>\n <div className=\"h-4 bg-bg-sunken rounded w-full\" />\n <div className=\"h-4 bg-bg-sunken rounded w-5/6\" />\n <div className=\"grid grid-cols-2 gap-2 mt-4\">\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n <div className=\"h-3 bg-bg-sunken rounded\" />\n </div>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error || renderError) {\n return (\n <div className=\"flex items-center justify-center h-full p-4\">\n <div className=\"text-center max-w-sm\">\n <div className=\"w-12 h-12 mx-auto mb-3 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center\">\n <svg\n className=\"w-6 h-6 text-red-600 dark:text-red-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n <p className=\"font-medium text-status-error-text\">\n {t('bigconsole.widget.renderer.adaptiveCard.errorRendering', 'Error rendering card')}\n </p>\n <p className=\"text-sm text-secondary mt-1\">{error || renderError}</p>\n {templateWarnings.length > 0 && (\n <div className=\"mt-3 p-2 bg-yellow-50 dark:bg-yellow-900/20 rounded text-left\">\n <p className=\"text-xs font-medium text-yellow-700 dark:text-yellow-400 mb-1\">\n {t('bigconsole.widget.renderer.adaptiveCard.templateWarnings', 'Template Warnings:')}\n </p>\n {templateWarnings.map((warning, i) => (\n <p key={i} className=\"text-xs text-yellow-600 dark:text-yellow-300\">\n {warning}\n </p>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n // Empty state - no template or data\n if (!template && !data) {\n return (\n <div className=\"flex items-center justify-center h-full p-4 animate-in fade-in duration-200\">\n <div className=\"text-center max-w-sm\">\n <div className=\"w-12 h-12 mx-auto mb-3 rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg className=\"w-6 h-6 text-text-secondary\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z\"\n />\n </svg>\n </div>\n <p className=\"font-medium text-secondary\">\n {t('bigconsole.widget.renderer.adaptiveCard.noContent', 'No content')}\n </p>\n <p className=\"text-sm text-text-secondary mt-1\">\n {t(\n 'bigconsole.widget.renderer.adaptiveCard.noContentHint',\n 'Configure a template or provide data to display an Adaptive Card'\n )}\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div\n ref={containerRef}\n className=\"adaptive-card-wrapper h-full overflow-auto\"\n style={{\n // CSS custom properties for further customization\n ['--ac-font-family' as string]: 'Inter, system-ui, -apple-system, sans-serif',\n }}\n />\n );\n});\n\n// ============================================================================\n// Global Styles for Adaptive Cards\n// ============================================================================\n\n// Inject global styles for Adaptive Cards\nconst styleId = 'adaptive-card-global-styles';\nif (typeof document !== 'undefined' && !document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.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 `;\n document.head.appendChild(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