@burdenoff/microfe-bigconsole 2026.1011.10 → 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,42 +1,51 @@
1
- import e from "../hooks/useWidgetOperations.js";
2
- import t from "../hooks/useDataSinkOperations.js";
3
- import n from "../hooks/useParserOperations.js";
1
+ import { useBigConsole as e } from "../context/BigConsoleContext.js";
2
+ import "../context/index.js";
3
+ import t from "../hooks/useWidgetOperations.js";
4
+ import n from "../hooks/useDataSinkOperations.js";
5
+ import r from "../hooks/useParserOperations.js";
4
6
  import "../hooks/index.js";
5
- import { selectActiveProposalSinks as r } from "./proposalSource.js";
6
- import i from "./CustomWidgetProposalPanel.js";
7
- import { memo as a, useCallback as o, useMemo as s } from "react";
8
- import { Sheet as c, SheetContent as l, SheetDescription as u, SheetHeader as d, SheetTitle as f } from "@burdenoff/fe-libs/ui";
9
- import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ import { selectActiveProposalSinks as i } from "./proposalSource.js";
8
+ import a from "./CustomWidgetProposalPanel.js";
9
+ import { loadDirectProposalPreview as o } from "./proposalPreview.js";
10
+ import { memo as s, useCallback as c, useMemo as l } from "react";
11
+ import { Sheet as u, SheetContent as d, SheetDescription as f, SheetHeader as p, SheetTitle as m } from "@burdenoff/fe-libs/ui";
12
+ import { useApolloClient as h } from "@apollo/client/react";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
15
  //#region src/bigconsole/customWidget/CustomWidgetBuilderSheet.tsx
12
- var g = {
16
+ var y = {
13
17
  x: 0,
14
18
  y: 0,
15
19
  width: 6,
16
20
  height: 4
17
- }, _ = "default", v = a(function({ isOpen: a, onClose: v, dashboardId: y, pageId: b, source: x }) {
18
- let { t: S } = p(), { dataSinks: C } = t({ skipFetch: !a }), { createWidget: w } = e(b, y, { skipFetch: !0 }), T = y === _, { parsers: E, executeParser: D } = n({
19
- consoleId: y,
20
- skipFetch: !a
21
- }), { parsers: O } = n({
22
- consoleId: _,
23
- skipFetch: !a || T
24
- }), k = s(() => r(C), [C]), A = s(() => {
25
- let e = new Set(E.map((e) => e.id));
26
- return [...E, ...O.filter((t) => !e.has(t.id))].map((e) => ({
21
+ }, b = "default", x = s(function({ isOpen: s, onClose: x, dashboardId: S, pageId: C, source: w }) {
22
+ let { t: T } = v(), E = h(), { workspaceId: D } = e(), { dataSinks: O } = n({ skipFetch: !s }), { createWidget: k } = t(C, S, { skipFetch: !0 }), A = S === b, { parsers: j, executeParser: M } = r({
23
+ consoleId: S,
24
+ skipFetch: !s
25
+ }), { parsers: N } = r({
26
+ consoleId: b,
27
+ skipFetch: !s || A
28
+ }), P = l(() => i(O), [O]), F = l(() => {
29
+ let e = new Set(j.map((e) => e.id));
30
+ return [...j, ...N.filter((t) => !e.has(t.id))].map((e) => ({
27
31
  id: e.id,
28
32
  name: e.name,
29
33
  inputSinkKey: e.inputSinkKey
30
34
  }));
31
- }, [E, O]), j = o(async (e) => {
32
- if (!e.binding.parserId) return;
33
- let t = await D(e.binding.parserId);
34
- if (!t || !t.success) throw Error(t?.error || S("bigconsole.widget.customWidget.error.couldNotResolveBinding", "Could not resolve the binding."));
35
+ }, [j, N]), I = c(async (e) => {
36
+ if (!e.binding.parserId) return o(E, e.binding, D);
37
+ let t = await M(e.binding.parserId);
38
+ if (!t || !t.success) throw Error(t?.error || T("bigconsole.widget.customWidget.error.couldNotResolveBinding", "Could not resolve the binding."));
35
39
  return t.output;
36
- }, [D, S]), M = o(async (e) => {
37
- if (!await w({
38
- pageId: b,
39
- dashboardId: y,
40
+ }, [
41
+ E,
42
+ M,
43
+ T,
44
+ D
45
+ ]), L = c(async (e) => {
46
+ if (!await k({
47
+ pageId: C,
48
+ dashboardId: S,
40
49
  type: e.widgetType,
41
50
  title: e.presentation.title,
42
51
  description: e.presentation.description,
@@ -49,18 +58,18 @@ var g = {
49
58
  sourcePrompt: e.sourcePrompt,
50
59
  proposalVersion: e.version
51
60
  },
52
- position: { ...g }
53
- })) throw Error(S("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
61
+ position: { ...y }
62
+ })) throw Error(T("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
54
63
  }, [
55
- w,
56
- b,
57
- y,
58
- S
64
+ k,
65
+ C,
66
+ S,
67
+ T
59
68
  ]);
60
- return /* @__PURE__ */ m(c, {
61
- open: a,
62
- onOpenChange: (e) => !e && v(),
63
- children: /* @__PURE__ */ h(l, {
69
+ return /* @__PURE__ */ g(u, {
70
+ open: s,
71
+ onOpenChange: (e) => !e && x(),
72
+ children: /* @__PURE__ */ _(d, {
64
73
  style: {
65
74
  width: "min(480px, 100vw)",
66
75
  maxWidth: "100vw",
@@ -68,30 +77,30 @@ var g = {
68
77
  display: "flex",
69
78
  flexDirection: "column"
70
79
  },
71
- children: [/* @__PURE__ */ h(d, {
80
+ children: [/* @__PURE__ */ _(p, {
72
81
  style: {
73
82
  padding: "var(--space-cardPadding)",
74
83
  borderBottom: "1px solid var(--color-border-subtle)",
75
84
  backgroundColor: "var(--color-bg-surface)",
76
85
  flexShrink: 0
77
86
  },
78
- children: [/* @__PURE__ */ m(f, { children: S("bigconsole.widget.customWidget.sheet.title", "AI custom widget") }), /* @__PURE__ */ m(u, { children: S("bigconsole.widget.customWidget.sheet.description", "Describe a widget, review the proposal, then approve it onto the dashboard.") })]
79
- }), /* @__PURE__ */ m("div", {
87
+ children: [/* @__PURE__ */ g(m, { children: T("bigconsole.widget.customWidget.sheet.title", "AI custom widget") }), /* @__PURE__ */ g(f, { children: T("bigconsole.widget.customWidget.sheet.description", "Describe a widget, review the proposal, then approve it onto the dashboard.") })]
88
+ }), /* @__PURE__ */ g("div", {
80
89
  style: {
81
90
  flex: 1,
82
91
  minHeight: 0
83
92
  },
84
- children: /* @__PURE__ */ m(i, {
85
- sinks: k,
86
- parsers: A,
87
- resolvePreviewData: j,
88
- onApprove: M,
89
- onClose: v,
90
- source: x
93
+ children: /* @__PURE__ */ g(a, {
94
+ sinks: P,
95
+ parsers: F,
96
+ resolvePreviewData: I,
97
+ onApprove: L,
98
+ onClose: x,
99
+ source: w
91
100
  })
92
101
  })]
93
102
  })
94
103
  });
95
104
  });
96
105
  //#endregion
97
- export { v as default };
106
+ export { x as default };
@@ -7,8 +7,8 @@ import { localProposalSource as ne } from "./proposalSource.js";
7
7
  import { memo as a, useCallback as o, useEffect as re, useMemo as s, useState as c } from "react";
8
8
  import { AlertTriangle as l, Check as u, Loader2 as d, RefreshCw as ie, Sparkles as ae, X as oe } from "lucide-react";
9
9
  import { Button as f, Input as p, Label as m, Textarea as se } from "@burdenoff/fe-libs/ui";
10
- import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
+ import { Fragment as ce, jsx as h, jsxs as g } from "react/jsx-runtime";
11
+ import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  //#region src/bigconsole/customWidget/CustomWidgetProposalPanel.tsx
13
13
  var v = "w-full", y = {
14
14
  loading: "neutral",
@@ -61,10 +61,10 @@ function S(e) {
61
61
  return 0;
62
62
  }
63
63
  var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T, onClose: E, source: D = ne }) {
64
- let { t: O } = ce(), k = s(() => ({
64
+ let { t: O } = _(), k = s(() => ({
65
65
  loading: {
66
66
  title: O("bigconsole.widget.customWidget.preview.loading.title", "Building preview…"),
67
- body: O("bigconsole.widget.customWidget.preview.loading.body", "Running the parser against the selected DataSink.")
67
+ body: O("bigconsole.widget.customWidget.preview.loading.body", "Reading the selected data binding.")
68
68
  },
69
69
  valid: {
70
70
  title: O("bigconsole.widget.customWidget.preview.valid.title", "Preview"),
@@ -72,7 +72,7 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
72
72
  },
73
73
  "no-data": {
74
74
  title: O("bigconsole.widget.customWidget.preview.noData.title", "No data returned"),
75
- body: O("bigconsole.widget.customWidget.preview.noData.body", "The binding is valid but the parser returned no rows. The widget will render empty until the sink has data.")
75
+ body: O("bigconsole.widget.customWidget.preview.noData.body", "The binding is valid but the data source returned no rows. The widget will render empty until the sink has data.")
76
76
  },
77
77
  "field-mismatch": {
78
78
  title: O("bigconsole.widget.customWidget.preview.fieldMismatch.title", "Field mismatch"),
@@ -143,7 +143,7 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
143
143
  }, []), de = o(() => {
144
144
  M(null), B(void 0), W(!1), R(null);
145
145
  }, []), Z = o(async () => {
146
- if (!(!j || !J.canApprove)) {
146
+ if (!(!j || !J.canApprove || V || U)) {
147
147
  I(!0), R(null);
148
148
  try {
149
149
  await T(j), E();
@@ -156,47 +156,49 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
156
156
  }, [
157
157
  j,
158
158
  J.canApprove,
159
+ V,
160
+ U,
159
161
  T,
160
162
  E,
161
163
  O
162
164
  ]), Q = J.issues.filter((e) => e.severity === "error"), $ = J.issues.filter((e) => e.severity === "warning");
163
- return /* @__PURE__ */ g("section", {
165
+ return /* @__PURE__ */ h("section", {
164
166
  "data-testid": "custom-widget-proposal-panel",
165
167
  "aria-label": O("bigconsole.widget.customWidget.panel.ariaLabel", "AI custom widget builder"),
166
168
  className: "flex h-full w-full min-w-0 flex-col overflow-y-auto p-4",
167
- children: /* @__PURE__ */ _(t, { children: [/* @__PURE__ */ g(e, {
169
+ children: /* @__PURE__ */ g(t, { children: [/* @__PURE__ */ h(e, {
168
170
  title: O("bigconsole.widget.customWidget.prompt.label", "Describe the widget you need"),
169
171
  description: "Plain English. The assistant proposes a typed widget you can edit before anything is saved.",
170
- icon: /* @__PURE__ */ g(ae, {
172
+ icon: /* @__PURE__ */ h(ae, {
171
173
  className: "size-4",
172
174
  "aria-hidden": "true"
173
175
  }),
174
- actions: /* @__PURE__ */ _("div", {
176
+ actions: /* @__PURE__ */ g("div", {
175
177
  className: "flex flex-wrap gap-2",
176
- children: [/* @__PURE__ */ _(f, {
178
+ children: [/* @__PURE__ */ g(f, {
177
179
  "data-testid": "custom-widget-generate",
178
180
  onClick: ue,
179
181
  disabled: !A.trim() || N,
180
- children: [N ? /* @__PURE__ */ g(d, {
182
+ children: [N ? /* @__PURE__ */ h(d, {
181
183
  className: "mr-2 size-4 animate-spin",
182
184
  "aria-hidden": "true"
183
185
  }) : null, j ? O("bigconsole.widget.customWidget.action.regenerate", "Regenerate") : O("bigconsole.widget.customWidget.action.generateProposal", "Generate proposal")]
184
- }), j ? /* @__PURE__ */ _(f, {
186
+ }), j ? /* @__PURE__ */ g(f, {
185
187
  variant: "outline",
186
188
  "data-testid": "custom-widget-reject",
187
189
  onClick: de,
188
- children: [/* @__PURE__ */ g(oe, {
190
+ children: [/* @__PURE__ */ h(oe, {
189
191
  className: "mr-1 size-4",
190
192
  "aria-hidden": "true"
191
193
  }), O("bigconsole.widget.customWidget.action.reject", "Reject")]
192
194
  }) : null]
193
195
  }),
194
- children: /* @__PURE__ */ _("div", {
196
+ children: /* @__PURE__ */ g("div", {
195
197
  className: "flex flex-col gap-2",
196
- children: [/* @__PURE__ */ g(m, {
198
+ children: [/* @__PURE__ */ h(m, {
197
199
  htmlFor: "custom-widget-prompt",
198
200
  children: "What should it show?"
199
- }), /* @__PURE__ */ g(se, {
201
+ }), /* @__PURE__ */ h(se, {
200
202
  id: "custom-widget-prompt",
201
203
  "data-testid": "custom-widget-prompt",
202
204
  value: A,
@@ -205,95 +207,95 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
205
207
  rows: 3
206
208
  })]
207
209
  })
208
- }), j ? /* @__PURE__ */ _(h, { children: [
209
- /* @__PURE__ */ _(e, {
210
+ }), j ? /* @__PURE__ */ g(ce, { children: [
211
+ /* @__PURE__ */ g(e, {
210
212
  emphasis: "primary",
211
213
  tone: y[Y],
212
214
  title: k[Y].title,
213
- description: "Rendered by the real widget renderer against the real parser output — what you approve is what you get.",
214
- meta: /* @__PURE__ */ g("span", {
215
+ description: j.binding.parserId ? O("bigconsole.widget.customWidget.preview.parserDescription", "Rendered using the saved parser output.") : O("bigconsole.widget.customWidget.preview.sourceDescription", "Rendered using up to 50 source rows. Full data may differ."),
216
+ meta: /* @__PURE__ */ h("span", {
215
217
  "data-testid": "custom-widget-preview-state",
216
218
  "data-state": Y,
217
219
  className: "rounded-pill bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
218
220
  children: Y
219
221
  }),
220
- children: [/* @__PURE__ */ g("div", {
222
+ children: [/* @__PURE__ */ h("div", {
221
223
  "data-testid": "custom-widget-preview",
222
224
  className: "min-h-[220px] min-w-0 rounded-card border border-[var(--color-border-subtle)] bg-bg-surface p-2",
223
- children: Y === "loading" ? /* @__PURE__ */ _("div", {
225
+ children: Y === "loading" ? /* @__PURE__ */ g("div", {
224
226
  className: "flex h-[200px] items-center justify-center text-text-secondary",
225
- children: [/* @__PURE__ */ g(d, {
227
+ children: [/* @__PURE__ */ h(d, {
226
228
  className: "mr-2 size-4 animate-spin",
227
229
  "aria-hidden": "true"
228
- }), /* @__PURE__ */ g("span", {
230
+ }), /* @__PURE__ */ h("span", {
229
231
  className: "text-sm",
230
232
  children: k.loading.body
231
233
  })]
232
- }) : Y === "valid" ? /* @__PURE__ */ g("div", {
234
+ }) : Y === "valid" ? /* @__PURE__ */ h("div", {
233
235
  className: "h-[200px]",
234
- children: /* @__PURE__ */ g(n, {
236
+ children: /* @__PURE__ */ h(n, {
235
237
  widgetId: `preview-${j.id}`,
236
- children: /* @__PURE__ */ g(ee, {
238
+ children: /* @__PURE__ */ h(ee, {
237
239
  widget: b(j, O("bigconsole.widget.customWidget.untitledWidget", "Untitled widget")),
238
240
  data: z
239
241
  })
240
242
  })
241
- }) : /* @__PURE__ */ _("div", {
243
+ }) : /* @__PURE__ */ g("div", {
242
244
  className: "flex h-[200px] flex-col items-center justify-center gap-2 px-4 text-center",
243
245
  children: [
244
- /* @__PURE__ */ g(l, {
246
+ /* @__PURE__ */ h(l, {
245
247
  className: "size-5 text-[var(--color-status-warning-text)]",
246
248
  "aria-hidden": "true"
247
249
  }),
248
- /* @__PURE__ */ g("p", {
250
+ /* @__PURE__ */ h("p", {
249
251
  className: "text-sm text-text-secondary",
250
252
  children: k[Y].body
251
253
  }),
252
- Y === "access-error" ? /* @__PURE__ */ _(f, {
254
+ Y === "access-error" ? /* @__PURE__ */ g(f, {
253
255
  size: "sm",
254
256
  variant: "outline",
255
257
  onClick: () => X((e) => ({ ...e })),
256
- children: [/* @__PURE__ */ g(ie, {
258
+ children: [/* @__PURE__ */ h(ie, {
257
259
  className: "mr-1 size-3.5",
258
260
  "aria-hidden": "true"
259
261
  }), O("bigconsole.widget.customWidget.action.retry", "Retry")]
260
262
  }) : null
261
263
  ]
262
264
  })
263
- }), j.rationale ? /* @__PURE__ */ g("p", {
265
+ }), j.rationale ? /* @__PURE__ */ h("p", {
264
266
  className: "mt-2 text-xs text-text-secondary",
265
267
  "data-testid": "custom-widget-rationale",
266
268
  children: j.rationale
267
269
  }) : null]
268
270
  }),
269
- Q.length > 0 || $.length > 0 ? /* @__PURE__ */ g(e, {
271
+ Q.length > 0 || $.length > 0 ? /* @__PURE__ */ h(e, {
270
272
  tone: Q.length > 0 ? "danger" : "warning",
271
273
  padding: "compact",
272
274
  headingLevel: 3,
273
275
  title: Q.length > 0 ? `${Q.length} ${Q.length === 1 ? "problem" : "problems"} to fix before approving` : `${$.length} ${$.length === 1 ? "warning" : "warnings"}`,
274
- children: /* @__PURE__ */ g("ul", {
276
+ children: /* @__PURE__ */ h("ul", {
275
277
  "data-testid": "custom-widget-issues",
276
278
  className: "flex min-w-0 flex-col gap-1",
277
- children: [...Q, ...$].map((e) => /* @__PURE__ */ g("li", {
279
+ children: [...Q, ...$].map((e) => /* @__PURE__ */ h("li", {
278
280
  "data-severity": e.severity,
279
281
  className: `break-words text-xs ${e.severity === "error" ? "text-[var(--color-status-error-text)]" : "text-[var(--color-status-warning-text)]"}`,
280
282
  children: e.message
281
283
  }, `${e.code}-${e.path ?? ""}`))
282
284
  })
283
285
  }) : null,
284
- /* @__PURE__ */ g(e, {
286
+ /* @__PURE__ */ h(e, {
285
287
  title: O("bigconsole.widget.customWidget.proposal.heading", "Proposal"),
286
288
  description: "Every field is editable — the assistant proposes, you dispose.",
287
289
  "data-testid": "custom-widget-proposal-fields",
288
- children: /* @__PURE__ */ _("div", {
290
+ children: /* @__PURE__ */ g("div", {
289
291
  className: "flex flex-col gap-3",
290
292
  children: [
291
- /* @__PURE__ */ _("div", {
293
+ /* @__PURE__ */ g("div", {
292
294
  className: "flex flex-col gap-1",
293
- children: [/* @__PURE__ */ g(m, {
295
+ children: [/* @__PURE__ */ h(m, {
294
296
  htmlFor: "custom-widget-title",
295
297
  children: O("bigconsole.widget.customWidget.field.title", "Title")
296
- }), /* @__PURE__ */ g(p, {
298
+ }), /* @__PURE__ */ h(p, {
297
299
  id: "custom-widget-title",
298
300
  "data-testid": "custom-widget-title",
299
301
  className: v,
@@ -307,12 +309,12 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
307
309
  }))
308
310
  })]
309
311
  }),
310
- /* @__PURE__ */ _("div", {
312
+ /* @__PURE__ */ g("div", {
311
313
  className: "flex flex-col gap-1",
312
- children: [/* @__PURE__ */ g(m, {
314
+ children: [/* @__PURE__ */ h(m, {
313
315
  htmlFor: "custom-widget-type",
314
316
  children: O("bigconsole.widget.customWidget.field.widgetType", "Widget type")
315
- }), /* @__PURE__ */ g("select", {
317
+ }), /* @__PURE__ */ h("select", {
316
318
  id: "custom-widget-type",
317
319
  "data-testid": "custom-widget-type",
318
320
  value: j.widgetType,
@@ -321,18 +323,18 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
321
323
  widgetType: e.target.value
322
324
  })),
323
325
  className: "w-full rounded-md border border-[var(--color-border-default)] bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
324
- children: te.map((e) => /* @__PURE__ */ g("option", {
326
+ children: te.map((e) => /* @__PURE__ */ h("option", {
325
327
  value: e,
326
328
  children: e
327
329
  }, e))
328
330
  })]
329
331
  }),
330
- /* @__PURE__ */ _("div", {
332
+ /* @__PURE__ */ g("div", {
331
333
  className: "flex flex-col gap-1",
332
- children: [/* @__PURE__ */ g(m, {
334
+ children: [/* @__PURE__ */ h(m, {
333
335
  htmlFor: "custom-widget-sink",
334
336
  children: O("bigconsole.widget.customWidget.field.dataSink", "DataSink")
335
- }), /* @__PURE__ */ _("select", {
337
+ }), /* @__PURE__ */ g("select", {
336
338
  id: "custom-widget-sink",
337
339
  "data-testid": "custom-widget-sink",
338
340
  value: j.binding.dataSinkId,
@@ -348,21 +350,21 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
348
350
  }));
349
351
  },
350
352
  className: "w-full rounded-md border border-[var(--color-border-default)] bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
351
- children: [/* @__PURE__ */ g("option", {
353
+ children: [/* @__PURE__ */ h("option", {
352
354
  value: "",
353
355
  children: O("bigconsole.widget.customWidget.field.selectDataSink", "Select a DataSink…")
354
- }), a.map((e) => /* @__PURE__ */ g("option", {
356
+ }), a.map((e) => /* @__PURE__ */ h("option", {
355
357
  value: e.id,
356
358
  children: e.name || e.key
357
359
  }, e.id))]
358
360
  })]
359
361
  }),
360
- /* @__PURE__ */ _("div", {
362
+ /* @__PURE__ */ g("div", {
361
363
  className: "flex flex-col gap-1",
362
- children: [/* @__PURE__ */ g(m, {
364
+ children: [/* @__PURE__ */ h(m, {
363
365
  htmlFor: "custom-widget-parser",
364
366
  children: O("bigconsole.widget.customWidget.field.parser", "Parser")
365
- }), /* @__PURE__ */ _("select", {
367
+ }), /* @__PURE__ */ g("select", {
366
368
  id: "custom-widget-parser",
367
369
  "data-testid": "custom-widget-parser",
368
370
  value: j.binding.parserId ?? "",
@@ -378,29 +380,29 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
378
380
  }));
379
381
  },
380
382
  className: "w-full rounded-md border border-[var(--color-border-default)] bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
381
- children: [/* @__PURE__ */ g("option", {
383
+ children: [/* @__PURE__ */ h("option", {
382
384
  value: "",
383
385
  children: O("bigconsole.widget.customWidget.field.noParser", "No parser")
384
- }), C.map((e) => /* @__PURE__ */ g("option", {
386
+ }), C.map((e) => /* @__PURE__ */ h("option", {
385
387
  value: e.id,
386
388
  children: e.name
387
389
  }, e.id))]
388
390
  })]
389
391
  }),
390
- Object.keys(j.fieldMapping).length > 0 ? /* @__PURE__ */ _("fieldset", {
392
+ Object.keys(j.fieldMapping).length > 0 ? /* @__PURE__ */ g("fieldset", {
391
393
  className: "flex flex-col gap-2",
392
394
  "data-testid": "custom-widget-field-mapping",
393
395
  children: [
394
- /* @__PURE__ */ g("legend", {
396
+ /* @__PURE__ */ h("legend", {
395
397
  className: "text-sm font-medium text-text-primary",
396
398
  children: O("bigconsole.widget.customWidget.fieldMapping.legend", "Field mapping")
397
399
  }),
398
- Object.entries(j.fieldMapping).map(([e, t]) => /* @__PURE__ */ _("div", {
400
+ Object.entries(j.fieldMapping).map(([e, t]) => /* @__PURE__ */ g("div", {
399
401
  className: "flex flex-col gap-1",
400
- children: [/* @__PURE__ */ g(m, {
402
+ children: [/* @__PURE__ */ h(m, {
401
403
  htmlFor: `custom-widget-field-${e}`,
402
404
  children: e
403
- }), /* @__PURE__ */ g(p, {
405
+ }), /* @__PURE__ */ h(p, {
404
406
  id: `custom-widget-field-${e}`,
405
407
  "data-testid": `custom-widget-field-${e}`,
406
408
  value: t,
@@ -413,7 +415,7 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
413
415
  }))
414
416
  })]
415
417
  }, e)),
416
- q?.length ? /* @__PURE__ */ g("p", {
418
+ q?.length ? /* @__PURE__ */ h("p", {
417
419
  className: "break-words text-xs text-text-secondary",
418
420
  children: O("bigconsole.widget.customWidget.fieldMapping.available", "Available: {{fields}}", { fields: q.join(", ") })
419
421
  }) : null
@@ -422,44 +424,44 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
422
424
  ]
423
425
  })
424
426
  }),
425
- L ? /* @__PURE__ */ g(e, {
427
+ L ? /* @__PURE__ */ h(e, {
426
428
  tone: "danger",
427
429
  padding: "compact",
428
430
  headingLevel: 3,
429
431
  title: "Could not add the widget",
430
- children: /* @__PURE__ */ g("p", {
432
+ children: /* @__PURE__ */ h("p", {
431
433
  role: "alert",
432
434
  className: "break-words text-xs text-[var(--color-status-error-text)]",
433
435
  "data-testid": "custom-widget-approve-error",
434
436
  children: L
435
437
  })
436
438
  }) : null,
437
- /* @__PURE__ */ _("div", {
439
+ /* @__PURE__ */ g("div", {
438
440
  className: "flex flex-wrap gap-2 border-t border-[var(--color-border-subtle)] pt-3",
439
- children: [/* @__PURE__ */ _(f, {
441
+ children: [/* @__PURE__ */ g(f, {
440
442
  "data-testid": "custom-widget-approve",
441
443
  onClick: Z,
442
- disabled: !J.canApprove || F,
443
- children: [F ? /* @__PURE__ */ g(d, {
444
+ disabled: !J.canApprove || V || U || F,
445
+ children: [F ? /* @__PURE__ */ h(d, {
444
446
  className: "mr-2 size-4 animate-spin",
445
447
  "aria-hidden": "true"
446
- }) : /* @__PURE__ */ g(u, {
448
+ }) : /* @__PURE__ */ h(u, {
447
449
  className: "mr-1 size-4",
448
450
  "aria-hidden": "true"
449
451
  }), O("bigconsole.widget.customWidget.action.approveAndAdd", "Approve & add to dashboard")]
450
- }), /* @__PURE__ */ g(f, {
452
+ }), /* @__PURE__ */ h(f, {
451
453
  variant: "outline",
452
454
  onClick: E,
453
455
  "data-testid": "custom-widget-cancel",
454
456
  children: O("bigconsole.widget.customWidget.action.cancel", "Cancel")
455
457
  })]
456
458
  })
457
- ] }) : /* @__PURE__ */ g(e, {
459
+ ] }) : /* @__PURE__ */ h(e, {
458
460
  emphasis: "muted",
459
461
  padding: "compact",
460
462
  title: "No proposal yet",
461
463
  headingLevel: 3,
462
- children: /* @__PURE__ */ g("p", {
464
+ children: /* @__PURE__ */ h("p", {
463
465
  className: "text-sm text-text-secondary",
464
466
  "data-testid": "custom-widget-empty",
465
467
  children: O("bigconsole.widget.customWidget.empty", "No proposal yet. Describe a widget and the assistant will propose one for you to review — nothing is added to the dashboard until you approve it.")
@@ -0,0 +1,5 @@
1
+ import { ApolloClient } from '@apollo/client';
2
+ import { ProposalBinding } from './proposalContract';
3
+
4
+ /** Read a bounded current-workspace sink sample; missing access is never reported as empty data. */
5
+ export declare function loadDirectProposalPreview(client: Pick<ApolloClient, 'query'>, binding: ProposalBinding, workspaceId: string | undefined): Promise<Record<string, unknown> | null | undefined>;
@@ -0,0 +1,31 @@
1
+ import { GetDataSinkDataDocument as e, GetDataSinkDocument as t } from "../../generated/wspace-operations.js";
2
+ //#region src/bigconsole/customWidget/proposalPreview.ts
3
+ async function n(n, r, i) {
4
+ if (!i) throw Error("Select a workspace before previewing a data source");
5
+ let a = {
6
+ requiredWorkspaceAuth: !0,
7
+ requiredWorkspaceId: i,
8
+ queryDeduplication: !1
9
+ }, o = (await n.query({
10
+ query: t,
11
+ variables: { id: r.dataSinkId },
12
+ fetchPolicy: "no-cache",
13
+ context: a
14
+ })).data?.getDataSink;
15
+ if (!o || o.id !== r.dataSinkId || o.workspaceId !== i || o.isActive === !1 || o.deletedAt) throw Error("The selected data source is unavailable");
16
+ let s = (await n.query({
17
+ query: e,
18
+ variables: {
19
+ id: r.dataSinkId,
20
+ dataPath: r.dataPath,
21
+ limit: 50,
22
+ offset: 0
23
+ },
24
+ fetchPolicy: "no-cache",
25
+ context: a
26
+ })).data?.getDataSinkData;
27
+ if (!s) throw Error("Could not read the selected data source");
28
+ return r.dataPath ? s.extracted : s.raw;
29
+ }
30
+ //#endregion
31
+ export { n as loadDirectProposalPreview };
@@ -7,25 +7,6 @@ export type AlertChannel = BigConsoleDataSinkAlertChannelsQuery['dataSinkAlertCh
7
7
  export type AlertExecution = BigConsoleDataSinkAlertExecutionsQuery['dataSinkAlertExecutions'][number];
8
8
  export type AlertPreview = BigConsolePreviewDataSinkAlertQuery['previewDataSinkAlert'];
9
9
  export declare const alertErrorMessage: (error: unknown) => string;
10
- /**
11
- * "This data sink is not here": the client's own check (`getDataSink` answers
12
- * `null`, or a sink from another workspace) and the server's codes for it.
13
- */
14
- export declare const ALERT_SINK_NOT_FOUND = "DATASINK_NOT_FOUND";
15
- type Translate = (key: string, fallback: string) => string;
16
- /**
17
- * What the alerts page says when the data sink could not be loaded
18
- * (BOFF-8060 i18n B3). The server's English never wins over a keyed string:
19
- *
20
- * - not found (or nothing recorded) → `bigconsole.alerts.notFound`;
21
- * - a coded failure → `bigconsole.errors.<CODE>`, the catalog the rest of
22
- * BigConsole localizes backend errors with;
23
- * - only an uncoded failure falls back to its raw message, which has no key.
24
- */
25
- export declare function describeAlertLoadFailure(t: Translate, failure: {
26
- error: string | null;
27
- errorCode: string | null;
28
- }): string;
29
10
  /** Every read and write uses the selected workspace; late requests cannot populate a new owner. */
30
11
  export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean): {
31
12
  owner: string;
@@ -62,7 +43,6 @@ export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean):
62
43
  }> | null;
63
44
  } | null | undefined>;
64
45
  reloadChannels: () => Promise<void>;
65
- reloadSinkThenChannels: () => Promise<void>;
66
46
  save: (alert: DataSinkAlertInput, expectedVersion: number) => Promise<{
67
47
  __typename?: "DataSink";
68
48
  id: string;
@@ -161,8 +141,5 @@ export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean):
161
141
  channels: AlertChannel[];
162
142
  loading: boolean;
163
143
  error: string | null;
164
- /** The first GraphQL `extensions.code` behind `error`, or the client's own not-found marker. */
165
- errorCode: string | null;
166
144
  channelError: string | null;
167
145
  };
168
- export {};