@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,6 +1,6 @@
1
1
  import { memo as e, useCallback as t, useEffect as n, useMemo 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";
2
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
4
4
  //#region src/bigconsole/components/widgets/table/TableConfig.tsx
5
5
  var c = [
6
6
  {
@@ -75,7 +75,7 @@ var c = [
75
75
  labelDefault: "Neutral"
76
76
  }
77
77
  ], u = "px-2 py-1 text-xs text-text-primary bg-bg-surface border border-border-default rounded-md focus:outline-none focus:ring-2 focus:ring-action-primary-bg", d = e(function({ config: e, onChange: d }) {
78
- let { t: f } = a(), [p, m] = i(r(() => (e.columns || []).map((e) => typeof e == "string" ? {
78
+ let { t: f } = s(), [p, m] = i(r(() => (e.columns || []).map((e) => typeof e == "string" ? {
79
79
  field: e,
80
80
  header: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " ")
81
81
  } : e), []));
@@ -146,66 +146,66 @@ var c = [
146
146
  }, []), C = t((e) => {
147
147
  m((t) => t.filter((t, n) => n !== e));
148
148
  }, []);
149
- return /* @__PURE__ */ s("div", {
149
+ return /* @__PURE__ */ o("div", {
150
150
  className: "min-w-0 space-y-form-gap",
151
151
  children: [
152
- /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
152
+ /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("label", {
153
153
  className: "block text-sm font-medium text-text-primary mb-1",
154
154
  children: f("bigconsole.widget.config.table.pageSize.label", "Page Size")
155
- }), /* @__PURE__ */ s("select", {
155
+ }), /* @__PURE__ */ o("select", {
156
156
  value: e.pageSize || 10,
157
157
  onChange: (e) => h("pageSize", Number(e.target.value)),
158
158
  className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
159
159
  children: [
160
- /* @__PURE__ */ o("option", {
160
+ /* @__PURE__ */ a("option", {
161
161
  value: 10,
162
162
  children: f("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 10 })
163
163
  }),
164
- /* @__PURE__ */ o("option", {
164
+ /* @__PURE__ */ a("option", {
165
165
  value: 25,
166
166
  children: f("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 25 })
167
167
  }),
168
- /* @__PURE__ */ o("option", {
168
+ /* @__PURE__ */ a("option", {
169
169
  value: 50,
170
170
  children: f("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 50 })
171
171
  }),
172
- /* @__PURE__ */ o("option", {
172
+ /* @__PURE__ */ a("option", {
173
173
  value: 100,
174
174
  children: f("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 100 })
175
175
  })
176
176
  ]
177
177
  })] }),
178
- /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("div", {
178
+ /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ o("div", {
179
179
  className: "flex items-center justify-between mb-2",
180
- children: [/* @__PURE__ */ o("label", {
180
+ children: [/* @__PURE__ */ a("label", {
181
181
  className: "text-sm font-medium text-text-primary",
182
182
  children: f("bigconsole.widget.config.table.columns.label", "Columns")
183
- }), /* @__PURE__ */ o("button", {
183
+ }), /* @__PURE__ */ a("button", {
184
184
  type: "button",
185
185
  onClick: S,
186
186
  className: "\n text-sm text-action-primary-bg\n hover:text-action-primary-bgHover\n ",
187
187
  children: f("bigconsole.widget.config.table.columns.add", "+ Add Column")
188
188
  })]
189
- }), /* @__PURE__ */ s("div", {
189
+ }), /* @__PURE__ */ o("div", {
190
190
  className: "space-y-3",
191
- children: [p.map((e, t) => /* @__PURE__ */ s("div", {
191
+ children: [p.map((e, t) => /* @__PURE__ */ o("div", {
192
192
  className: "\n p-3\n bg-bg-sunken\n rounded-md\n space-y-2\n ",
193
193
  children: [
194
- /* @__PURE__ */ s("div", {
194
+ /* @__PURE__ */ o("div", {
195
195
  className: "flex items-center justify-between",
196
- children: [/* @__PURE__ */ o("span", {
196
+ children: [/* @__PURE__ */ a("span", {
197
197
  className: "text-xs text-text-secondary",
198
198
  children: f("bigconsole.widget.config.table.columns.columnN", "Column {{index}}", { index: t + 1 })
199
- }), /* @__PURE__ */ o("button", {
199
+ }), /* @__PURE__ */ a("button", {
200
200
  type: "button",
201
201
  onClick: () => C(t),
202
202
  className: "text-status-error-text hover:text-status-error-text/80",
203
- children: /* @__PURE__ */ o("svg", {
203
+ children: /* @__PURE__ */ a("svg", {
204
204
  className: "w-4 h-4",
205
205
  fill: "none",
206
206
  stroke: "currentColor",
207
207
  viewBox: "0 0 24 24",
208
- children: /* @__PURE__ */ o("path", {
208
+ children: /* @__PURE__ */ a("path", {
209
209
  strokeLinecap: "round",
210
210
  strokeLinejoin: "round",
211
211
  strokeWidth: 2,
@@ -214,15 +214,15 @@ var c = [
214
214
  })
215
215
  })]
216
216
  }),
217
- /* @__PURE__ */ s("div", {
217
+ /* @__PURE__ */ o("div", {
218
218
  className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
219
- children: [/* @__PURE__ */ o("input", {
219
+ children: [/* @__PURE__ */ a("input", {
220
220
  type: "text",
221
221
  value: e.field || "",
222
222
  onChange: (e) => g(t, "field", e.target.value),
223
223
  placeholder: f("bigconsole.widget.config.table.column.fieldPlaceholder", "Field name"),
224
224
  className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
225
- }), /* @__PURE__ */ o("input", {
225
+ }), /* @__PURE__ */ a("input", {
226
226
  type: "text",
227
227
  value: e.header || "",
228
228
  onChange: (e) => g(t, "header", e.target.value),
@@ -230,120 +230,120 @@ var c = [
230
230
  className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
231
231
  })]
232
232
  }),
233
- /* @__PURE__ */ s("div", {
233
+ /* @__PURE__ */ o("div", {
234
234
  className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
235
- children: [/* @__PURE__ */ s("select", {
235
+ children: [/* @__PURE__ */ o("select", {
236
236
  value: e.format || "text",
237
237
  onChange: (e) => g(t, "format", e.target.value),
238
238
  className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
239
239
  children: [
240
- /* @__PURE__ */ o("option", {
240
+ /* @__PURE__ */ a("option", {
241
241
  value: "text",
242
242
  children: f("bigconsole.widget.config.table.format.text", "Text")
243
243
  }),
244
- /* @__PURE__ */ o("option", {
244
+ /* @__PURE__ */ a("option", {
245
245
  value: "number",
246
246
  children: f("bigconsole.widget.config.table.format.number", "Number")
247
247
  }),
248
- /* @__PURE__ */ o("option", {
248
+ /* @__PURE__ */ a("option", {
249
249
  value: "currency",
250
250
  children: f("bigconsole.widget.config.table.format.currency", "Currency")
251
251
  }),
252
- /* @__PURE__ */ o("option", {
252
+ /* @__PURE__ */ a("option", {
253
253
  value: "percentage",
254
254
  children: f("bigconsole.widget.config.table.format.percentage", "Percentage")
255
255
  }),
256
- /* @__PURE__ */ o("option", {
256
+ /* @__PURE__ */ a("option", {
257
257
  value: "date",
258
258
  children: f("bigconsole.widget.config.table.format.date", "Date")
259
259
  }),
260
- /* @__PURE__ */ o("option", {
260
+ /* @__PURE__ */ a("option", {
261
261
  value: "badge",
262
262
  children: f("bigconsole.widget.config.table.format.badge", "Badge")
263
263
  })
264
264
  ]
265
- }), /* @__PURE__ */ s("select", {
265
+ }), /* @__PURE__ */ o("select", {
266
266
  value: e.align || "left",
267
267
  onChange: (e) => g(t, "align", e.target.value),
268
268
  className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
269
269
  children: [
270
- /* @__PURE__ */ o("option", {
270
+ /* @__PURE__ */ a("option", {
271
271
  value: "left",
272
272
  children: f("bigconsole.widget.config.table.align.left", "Left")
273
273
  }),
274
- /* @__PURE__ */ o("option", {
274
+ /* @__PURE__ */ a("option", {
275
275
  value: "center",
276
276
  children: f("bigconsole.widget.config.table.align.center", "Center")
277
277
  }),
278
- /* @__PURE__ */ o("option", {
278
+ /* @__PURE__ */ a("option", {
279
279
  value: "right",
280
280
  children: f("bigconsole.widget.config.table.align.right", "Right")
281
281
  })
282
282
  ]
283
283
  })]
284
284
  }),
285
- /* @__PURE__ */ s("div", {
285
+ /* @__PURE__ */ o("div", {
286
286
  className: "pt-2 border-t border-border-default/60",
287
287
  children: [
288
- /* @__PURE__ */ s("div", {
288
+ /* @__PURE__ */ o("div", {
289
289
  className: "flex items-center justify-between mb-1",
290
- children: [/* @__PURE__ */ o("span", {
290
+ children: [/* @__PURE__ */ a("span", {
291
291
  className: "text-xs font-medium text-text-secondary",
292
292
  children: f("bigconsole.widget.config.table.conditionalFormatting.title", "Conditional formatting")
293
- }), /* @__PURE__ */ o("button", {
293
+ }), /* @__PURE__ */ a("button", {
294
294
  type: "button",
295
295
  onClick: () => v(t),
296
296
  className: "text-xs text-action-primary-bg hover:text-action-primary-bgHover",
297
297
  children: f("bigconsole.widget.config.table.conditionalFormatting.addRule", "+ Add rule")
298
298
  })]
299
299
  }),
300
- (e.conditionalRules?.length ?? 0) === 0 && /* @__PURE__ */ o("p", {
300
+ (e.conditionalRules?.length ?? 0) === 0 && /* @__PURE__ */ a("p", {
301
301
  className: "text-xs text-text-secondary",
302
302
  children: f("bigconsole.widget.config.table.conditionalFormatting.noRules", "No rules — cell shows its plain value.")
303
303
  }),
304
- /* @__PURE__ */ o("div", {
304
+ /* @__PURE__ */ a("div", {
305
305
  className: "space-y-2",
306
306
  children: (e.conditionalRules ?? []).map((e, n) => {
307
307
  let r = e.operator === "between" || e.operator === "outside", i = e.style?.bgColor ?? e.style?.textColor ?? "danger";
308
- return /* @__PURE__ */ s("div", {
308
+ return /* @__PURE__ */ o("div", {
309
309
  className: "p-2 bg-bg-surface rounded-md border border-border-default space-y-2",
310
- children: [/* @__PURE__ */ s("div", {
310
+ children: [/* @__PURE__ */ o("div", {
311
311
  className: "flex items-center gap-2",
312
312
  children: [
313
- /* @__PURE__ */ o("select", {
313
+ /* @__PURE__ */ a("select", {
314
314
  value: e.operator,
315
315
  onChange: (e) => y(t, n, { operator: e.target.value }),
316
316
  className: `${u} flex-1`,
317
- children: c.map((e) => /* @__PURE__ */ o("option", {
317
+ children: c.map((e) => /* @__PURE__ */ a("option", {
318
318
  value: e.value,
319
319
  children: f(e.labelKey, e.labelDefault)
320
320
  }, e.value))
321
321
  }),
322
- /* @__PURE__ */ o("input", {
322
+ /* @__PURE__ */ a("input", {
323
323
  type: "text",
324
324
  value: e.value ?? "",
325
325
  onChange: (e) => y(t, n, { value: e.target.value }),
326
326
  placeholder: f("bigconsole.widget.config.table.rule.valuePlaceholder", "value"),
327
327
  className: `${u} w-20`
328
328
  }),
329
- r && /* @__PURE__ */ o("input", {
329
+ r && /* @__PURE__ */ a("input", {
330
330
  type: "text",
331
331
  value: e.value2 ?? "",
332
332
  onChange: (e) => y(t, n, { value2: e.target.value }),
333
333
  placeholder: f("bigconsole.widget.config.table.rule.value2Placeholder", "and"),
334
334
  className: `${u} w-20`
335
335
  }),
336
- /* @__PURE__ */ o("button", {
336
+ /* @__PURE__ */ a("button", {
337
337
  type: "button",
338
338
  onClick: () => x(t, n),
339
339
  className: "text-status-error-text hover:text-status-error-text/80",
340
340
  "aria-label": f("bigconsole.widget.config.table.rule.remove", "Remove rule"),
341
- children: /* @__PURE__ */ o("svg", {
341
+ children: /* @__PURE__ */ a("svg", {
342
342
  className: "w-3.5 h-3.5",
343
343
  fill: "none",
344
344
  stroke: "currentColor",
345
345
  viewBox: "0 0 24 24",
346
- children: /* @__PURE__ */ o("path", {
346
+ children: /* @__PURE__ */ a("path", {
347
347
  strokeLinecap: "round",
348
348
  strokeLinejoin: "round",
349
349
  strokeWidth: 2,
@@ -352,19 +352,19 @@ var c = [
352
352
  })
353
353
  })
354
354
  ]
355
- }), /* @__PURE__ */ s("div", {
355
+ }), /* @__PURE__ */ o("div", {
356
356
  className: "flex items-center gap-2",
357
- children: [/* @__PURE__ */ o("select", {
357
+ children: [/* @__PURE__ */ a("select", {
358
358
  value: i,
359
359
  onChange: (e) => b(t, n, e.target.value),
360
360
  className: `${u} flex-1`,
361
- children: l.map((e) => /* @__PURE__ */ o("option", {
361
+ children: l.map((e) => /* @__PURE__ */ a("option", {
362
362
  value: e.value,
363
363
  children: f(e.labelKey, e.labelDefault)
364
364
  }, e.value))
365
- }), /* @__PURE__ */ s("label", {
365
+ }), /* @__PURE__ */ o("label", {
366
366
  className: "flex items-center gap-1 text-xs text-text-primary",
367
- children: [/* @__PURE__ */ o("input", {
367
+ children: [/* @__PURE__ */ a("input", {
368
368
  type: "checkbox",
369
369
  checked: e.style?.bold === !0,
370
370
  onChange: (r) => y(t, n, { style: {
@@ -381,76 +381,76 @@ var c = [
381
381
  ]
382
382
  })
383
383
  ]
384
- }, t)), p.length === 0 && /* @__PURE__ */ o("p", {
384
+ }, t)), p.length === 0 && /* @__PURE__ */ a("p", {
385
385
  className: "text-sm text-text-secondary text-center py-4",
386
386
  children: f("bigconsole.widget.config.table.columns.empty", "No columns configured. Columns will be auto-generated from data.")
387
387
  })]
388
388
  })] }),
389
- /* @__PURE__ */ s("div", {
389
+ /* @__PURE__ */ o("div", {
390
390
  role: "group",
391
391
  "aria-label": "Display options",
392
392
  className: "space-y-3 border-t border-[var(--color-border-subtle)] pt-form-gap",
393
393
  children: [
394
- /* @__PURE__ */ o("p", {
394
+ /* @__PURE__ */ a("p", {
395
395
  className: "text-xs font-bold uppercase tracking-wider text-text-secondary",
396
396
  children: "Display options"
397
397
  }),
398
- /* @__PURE__ */ s("label", {
398
+ /* @__PURE__ */ o("label", {
399
399
  className: "flex items-center gap-3",
400
- children: [/* @__PURE__ */ o("input", {
400
+ children: [/* @__PURE__ */ a("input", {
401
401
  type: "checkbox",
402
402
  checked: e.showSearch !== !1,
403
403
  onChange: (e) => h("showSearch", e.target.checked),
404
404
  className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
405
- }), /* @__PURE__ */ o("span", {
405
+ }), /* @__PURE__ */ a("span", {
406
406
  className: "text-sm text-text-primary",
407
407
  children: f("bigconsole.widget.config.table.showSearch", "Show search box")
408
408
  })]
409
409
  }),
410
- /* @__PURE__ */ s("label", {
410
+ /* @__PURE__ */ o("label", {
411
411
  className: "flex items-center gap-3",
412
- children: [/* @__PURE__ */ o("input", {
412
+ children: [/* @__PURE__ */ a("input", {
413
413
  type: "checkbox",
414
414
  checked: e.showPagination !== !1,
415
415
  onChange: (e) => h("showPagination", e.target.checked),
416
416
  className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
417
- }), /* @__PURE__ */ o("span", {
417
+ }), /* @__PURE__ */ a("span", {
418
418
  className: "text-sm text-text-primary",
419
419
  children: f("bigconsole.widget.config.table.showPagination", "Show pagination")
420
420
  })]
421
421
  }),
422
- /* @__PURE__ */ s("label", {
422
+ /* @__PURE__ */ o("label", {
423
423
  className: "flex items-center gap-3",
424
- children: [/* @__PURE__ */ o("input", {
424
+ children: [/* @__PURE__ */ a("input", {
425
425
  type: "checkbox",
426
426
  checked: e.showExport !== !1,
427
427
  onChange: (e) => h("showExport", e.target.checked),
428
428
  className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
429
- }), /* @__PURE__ */ o("span", {
429
+ }), /* @__PURE__ */ a("span", {
430
430
  className: "text-sm text-text-primary",
431
431
  children: f("bigconsole.widget.config.table.showExport", "Show export button")
432
432
  })]
433
433
  }),
434
- /* @__PURE__ */ s("label", {
434
+ /* @__PURE__ */ o("label", {
435
435
  className: "flex items-center gap-3",
436
- children: [/* @__PURE__ */ o("input", {
436
+ children: [/* @__PURE__ */ a("input", {
437
437
  type: "checkbox",
438
438
  checked: e.stickyHeader === !0,
439
439
  onChange: (e) => h("stickyHeader", e.target.checked),
440
440
  className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
441
- }), /* @__PURE__ */ o("span", {
441
+ }), /* @__PURE__ */ a("span", {
442
442
  className: "text-sm text-text-primary",
443
443
  children: f("bigconsole.widget.config.table.stickyHeader", "Sticky header")
444
444
  })]
445
445
  }),
446
- /* @__PURE__ */ s("label", {
446
+ /* @__PURE__ */ o("label", {
447
447
  className: "flex items-center gap-3",
448
- children: [/* @__PURE__ */ o("input", {
448
+ children: [/* @__PURE__ */ a("input", {
449
449
  type: "checkbox",
450
450
  checked: e.stripedRows === !0,
451
451
  onChange: (e) => h("stripedRows", e.target.checked),
452
452
  className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
453
- }), /* @__PURE__ */ o("span", {
453
+ }), /* @__PURE__ */ a("span", {
454
454
  className: "text-sm text-text-primary",
455
455
  children: f("bigconsole.widget.config.table.stripedRows", "Striped rows")
456
456
  })]
@@ -1,51 +1,134 @@
1
- import { resolveTextData as e } from "./textData.js";
2
- import { memo as t, useMemo as n } from "react";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
1
+ import { toSafeHref as e } from "../../../utils/safeUrl.js";
2
+ import { resolveTextData as t } from "./textData.js";
3
+ import { sanitizeWidgetHtml as n } from "../../../utils/sanitizeHtml.js";
4
+ import { memo as r, useMemo as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { Markdown as s } from "@burdenoff/fe-libs/shared/components/Markdown";
4
7
  //#region src/bigconsole/components/widgets/text-widget/TextWidget.tsx
5
- function a(e) {
6
- let t = e;
7
- return t = t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), t = t.replace(/^### (.+)$/gm, "<h3 class=\"text-base font-semibold text-text-primary mt-3 mb-1\">$1</h3>"), t = t.replace(/^## (.+)$/gm, "<h2 class=\"text-lg font-semibold text-text-primary mt-4 mb-2\">$1</h2>"), t = t.replace(/^# (.+)$/gm, "<h1 class=\"text-xl font-bold text-text-primary mt-4 mb-2\">$1</h1>"), t = t.replace(/\*\*(.+?)\*\*/g, "<strong class=\"font-semibold\">$1</strong>"), t = t.replace(/\*(.+?)\*/g, "<em>$1</em>"), t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, "<a href=\"$2\" class=\"text-action-primary-text hover:underline\" target=\"_blank\" rel=\"noopener\">$1</a>"), t = t.replace(/`([^`]+)`/g, "<code class=\"px-1 py-0.5 bg-bg-sunken rounded text-sm font-mono\">$1</code>"), t = t.replace(/^> (.+)$/gm, "<blockquote class=\"border-l-2 border-action-primary-bg pl-3 italic text-text-secondary my-2\">$1</blockquote>"), t = t.replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>"), t = t.replace(/(<li[^>]*>.*<\/li>\n?)+/g, "<ul class=\"my-2\">$&</ul>"), t = t.replace(/^\|(.+)\|$/gm, (e, t) => {
8
- let n = t.split("|").map((e) => e.trim());
9
- return n.some((e) => e.match(/^-+$/)) ? "" : `<tr>${n.map((e) => `<td class="border border-border-default px-2 py-1 text-sm">${e}</td>`).join("")}</tr>`;
10
- }), t = t.replace(/(<tr>.*<\/tr>\n?)+/g, "<table class=\"w-full border-collapse my-2\">$&</table>"), t = t.split("\n\n").map((e) => e.startsWith("<") ? e : `<p class="my-2 text-text-primary">${e}</p>`).join(""), t = t.replace(/\n/g, "<br/>"), t;
8
+ var c = {
9
+ allowMailto: !0,
10
+ allowRootRelative: !0,
11
+ allowFragment: !0
12
+ };
13
+ function l(e) {
14
+ return /^(?:https?|mailto):/i.test(e);
11
15
  }
12
- var o = {
16
+ function u({ href: t, children: n }) {
17
+ let r = e(t, c);
18
+ return r ? /* @__PURE__ */ a("a", {
19
+ href: r,
20
+ className: "text-action-primary-bg hover:underline",
21
+ target: l(r) ? "_blank" : void 0,
22
+ rel: "noopener noreferrer",
23
+ children: n
24
+ }) : /* @__PURE__ */ a("span", { children: n });
25
+ }
26
+ function d({ alt: e }) {
27
+ return e ? /* @__PURE__ */ a("span", {
28
+ className: "italic text-text-secondary",
29
+ children: e
30
+ }) : null;
31
+ }
32
+ var f = {
33
+ h1: ({ children: e }) => /* @__PURE__ */ a("h1", {
34
+ className: "text-xl font-bold text-text-primary mt-4 mb-2",
35
+ children: e
36
+ }),
37
+ h2: ({ children: e }) => /* @__PURE__ */ a("h2", {
38
+ className: "text-lg font-semibold text-text-primary mt-4 mb-2",
39
+ children: e
40
+ }),
41
+ h3: ({ children: e }) => /* @__PURE__ */ a("h3", {
42
+ className: "text-base font-semibold text-text-primary mt-3 mb-1",
43
+ children: e
44
+ }),
45
+ p: ({ children: e }) => /* @__PURE__ */ a("p", {
46
+ className: "my-2 text-text-primary whitespace-pre-line",
47
+ children: e
48
+ }),
49
+ strong: ({ children: e }) => /* @__PURE__ */ a("strong", {
50
+ className: "font-semibold",
51
+ children: e
52
+ }),
53
+ em: ({ children: e }) => /* @__PURE__ */ a("em", { children: e }),
54
+ code: ({ children: e }) => /* @__PURE__ */ a("code", {
55
+ className: "px-1 py-0.5 bg-bg-sunken rounded text-sm font-mono",
56
+ children: e
57
+ }),
58
+ pre: ({ children: e }) => /* @__PURE__ */ a("pre", {
59
+ className: "my-2 p-2 bg-bg-sunken rounded text-sm overflow-x-auto",
60
+ children: e
61
+ }),
62
+ blockquote: ({ children: e }) => /* @__PURE__ */ a("blockquote", {
63
+ className: "border-l-2 border-action-primary-bg pl-3 italic text-text-secondary my-2",
64
+ children: e
65
+ }),
66
+ ul: ({ children: e }) => /* @__PURE__ */ a("ul", {
67
+ className: "my-2 ml-4 list-disc",
68
+ children: e
69
+ }),
70
+ ol: ({ children: e }) => /* @__PURE__ */ a("ol", {
71
+ className: "my-2 ml-4 list-decimal",
72
+ children: e
73
+ }),
74
+ table: ({ children: e }) => /* @__PURE__ */ a("table", {
75
+ className: "w-full border-collapse my-2",
76
+ children: e
77
+ }),
78
+ th: ({ children: e }) => /* @__PURE__ */ a("th", {
79
+ className: "border border-border-default px-2 py-1 text-sm font-semibold text-left",
80
+ children: e
81
+ }),
82
+ td: ({ children: e }) => /* @__PURE__ */ a("td", {
83
+ className: "border border-border-default px-2 py-1 text-sm",
84
+ children: e
85
+ }),
86
+ a: u,
87
+ img: d
88
+ }, p = {
13
89
  left: "text-left",
14
90
  center: "text-center",
15
91
  right: "text-right",
16
92
  justify: "text-justify"
17
- }, s = t(function({ widget: t, data: s }) {
18
- let { content: c, format: l, alignment: u, hasContent: d } = n(() => e(t.config, s), [t.config, s]), f = n(() => c ? l === "markdown" ? { __html: a(c) } : l === "html" ? { __html: c } : null : null, [c, l]), p = o[u ?? "left"];
19
- return d ? l === "plain" ? /* @__PURE__ */ r("div", {
20
- className: `h-full p-4 overflow-auto ${p}`,
21
- children: /* @__PURE__ */ r("pre", {
22
- className: "text-sm text-text-primary whitespace-pre-wrap font-sans",
23
- children: c
93
+ }, m = r(function({ widget: e, data: r }) {
94
+ let { content: c, format: l, alignment: u, hasContent: d } = i(() => t(e.config, r), [e.config, r]), m = i(() => l === "html" && c ? { __html: n(c) } : null, [c, l]), h = p[u ?? "left"];
95
+ return d ? m ? /* @__PURE__ */ a("div", {
96
+ className: `h-full p-4 overflow-auto ${h}`,
97
+ children: /* @__PURE__ */ a("div", {
98
+ className: "prose prose-sm max-w-none text-text-primary",
99
+ dangerouslySetInnerHTML: m
24
100
  })
25
- }) : /* @__PURE__ */ r("div", {
26
- className: `h-full p-4 overflow-auto ${p}`,
27
- children: /* @__PURE__ */ r("div", {
101
+ }) : l === "markdown" ? /* @__PURE__ */ a("div", {
102
+ className: `h-full p-4 overflow-auto ${h}`,
103
+ children: /* @__PURE__ */ a(s, {
28
104
  className: "prose prose-sm max-w-none text-text-primary",
29
- dangerouslySetInnerHTML: f
105
+ components: f,
106
+ children: c ?? ""
107
+ })
108
+ }) : /* @__PURE__ */ a("div", {
109
+ className: `h-full p-4 overflow-auto ${h}`,
110
+ children: /* @__PURE__ */ a("pre", {
111
+ className: "text-sm text-text-primary whitespace-pre-wrap font-sans",
112
+ children: c
30
113
  })
31
- }) : /* @__PURE__ */ r("div", {
114
+ }) : /* @__PURE__ */ a("div", {
32
115
  className: "flex items-center justify-center h-full text-text-secondary text-sm",
33
- children: /* @__PURE__ */ i("div", {
116
+ children: /* @__PURE__ */ o("div", {
34
117
  className: "text-center",
35
- children: [/* @__PURE__ */ r("svg", {
118
+ children: [/* @__PURE__ */ a("svg", {
36
119
  className: "w-12 h-12 mx-auto mb-2 text-text-muted",
37
120
  fill: "none",
38
121
  stroke: "currentColor",
39
122
  viewBox: "0 0 24 24",
40
- children: /* @__PURE__ */ r("path", {
123
+ children: /* @__PURE__ */ a("path", {
41
124
  strokeLinecap: "round",
42
125
  strokeLinejoin: "round",
43
126
  strokeWidth: 1.5,
44
127
  d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
45
128
  })
46
- }), /* @__PURE__ */ r("p", { children: "No text content" })]
129
+ }), /* @__PURE__ */ a("p", { children: "No text content" })]
47
130
  })
48
131
  });
49
132
  });
50
133
  //#endregion
51
- export { s as default };
134
+ export { m as default };
@@ -25,7 +25,13 @@ export interface ResolvedTextData extends TextData {
25
25
  * - If `data` is a plain string it becomes `content`.
26
26
  * - If `data` is an object without a `content` key it is auto-formatted as
27
27
  * markdown so arbitrary parser output still renders.
28
+ * - `data.format` may switch to `plain` or `markdown`; it may select `html`
29
+ * only when `widgetConfig.format` is already `html`.
28
30
  * 2. Static `widgetConfig` fields (`content`, `format`, `alignment`).
29
31
  * 3. Safe defaults (`content: ''`, `format: 'markdown'`, `alignment: 'left'`).
32
+ *
33
+ * Resolution is idempotent: resolving an already-resolved result again with
34
+ * the same config yields the same format. HTML content is always sanitised by
35
+ * the renderer, whatever the format source.
30
36
  */
31
37
  export declare function resolveTextData(widgetConfig: Record<string, unknown> | undefined, rawData: unknown): ResolvedTextData;
@@ -32,11 +32,14 @@ function a(e) {
32
32
  return t.join("\n");
33
33
  }
34
34
  function o(e, t) {
35
- let o = e ?? {}, s = i(o.content), c = n(o.format) ? o.format : "markdown", l = r(o.alignment) ? o.alignment : "left";
35
+ return !n(e) || e === "html" && t !== "html" ? t : e;
36
+ }
37
+ function s(e, t) {
38
+ let s = e ?? {}, c = i(s.content), l = n(s.format) ? s.format : "markdown", u = r(s.alignment) ? s.alignment : "left";
36
39
  if (typeof t == "string") return {
37
40
  content: t,
38
- format: c,
39
- alignment: l,
41
+ format: l,
42
+ alignment: u,
40
43
  hasContent: t.length > 0
41
44
  };
42
45
  if (t && typeof t == "object" && !Array.isArray(t)) {
@@ -45,25 +48,25 @@ function o(e, t) {
45
48
  let t = i(e.content);
46
49
  return {
47
50
  content: t,
48
- format: n(e.format) ? e.format : c,
49
- alignment: r(e.alignment) ? e.alignment : l,
51
+ format: o(e.format, l),
52
+ alignment: r(e.alignment) ? e.alignment : u,
50
53
  hasContent: t.length > 0
51
54
  };
52
55
  }
53
- let o = a(e);
56
+ let n = a(e);
54
57
  return {
55
- content: o,
58
+ content: n,
56
59
  format: "markdown",
57
- alignment: l,
58
- hasContent: o.length > 0
60
+ alignment: u,
61
+ hasContent: n.length > 0
59
62
  };
60
63
  }
61
64
  return {
62
- content: s,
63
- format: c,
64
- alignment: l,
65
- hasContent: s.length > 0
65
+ content: c,
66
+ format: l,
67
+ alignment: u,
68
+ hasContent: c.length > 0
66
69
  };
67
70
  }
68
71
  //#endregion
69
- export { o as resolveTextData };
72
+ export { s as resolveTextData };