@burdenoff/microfe-bigconsole 2026.1008.14 → 2026.1010.10

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.
@@ -1,167 +1,168 @@
1
1
  import { useBigConsoleNavigate as e } from "../../context/BigConsoleContext.js";
2
2
  import "../../context/index.js";
3
3
  import { PREVIEW_STEPS as t, useAssistantRunStore as n } from "../../assistant/assistantRunStore.js";
4
- import { useAssistantRunWorkspace as r } from "../../assistant/useAssistantRunWorkspace.js";
5
- import { Section as i } from "../common/Section.js";
4
+ import { useBigConsolePreviewControl as r } from "../../assistant/usePreviewControl.js";
5
+ import { useAssistantRunWorkspace as i } from "../../assistant/useAssistantRunWorkspace.js";
6
+ import { Section as a } from "../common/Section.js";
6
7
  import "../common/index.js";
7
- import { DOCK_CLEARANCE as a, PreviewMeta as o, STEP_LABEL as s, formatAgo as c, previewLabels as l } from "./previewShared.js";
8
- import { DashboardContent as u, DataSinkContent as d, ParserContent as f, WidgetsContent as p } from "./AiPreviewContent.js";
9
- import { useEffect as m, useRef as h, useState as g } from "react";
10
- import { ArrowUpRight as _, Loader2 as v, Sparkles as y, X as b } from "lucide-react";
11
- import { Button as x } from "@burdenoff/fe-libs/ui";
12
- import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
14
- import { AssistantEntityPreview as T } from "@burdenoff/fe-libs/shared/assistant";
8
+ import { DOCK_CLEARANCE as o, PreviewMeta as s, STEP_LABEL as c, formatAgo as l, previewLabels as u } from "./previewShared.js";
9
+ import { DashboardContent as d, DataSinkContent as f, ParserContent as p, WidgetsContent as m } from "./AiPreviewContent.js";
10
+ import { useEffect as h, useRef as g, useState as _ } from "react";
11
+ import { ArrowUpRight as v, Loader2 as y, Sparkles as b, X as x } from "lucide-react";
12
+ import { Button as S } from "@burdenoff/fe-libs/ui";
13
+ import { useI18n as C } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
15
+ import { AssistantEntityPreview as E } from "@burdenoff/fe-libs/shared/assistant";
15
16
  //#region src/bigconsole/components/preview/AiPreviewPanel.tsx
16
- function E({ children: e }) {
17
- return /* @__PURE__ */ C("div", {
17
+ function D({ children: e }) {
18
+ return /* @__PURE__ */ w("div", {
18
19
  className: "min-w-0 overflow-y-auto p-3",
19
20
  style: { maxHeight: "min(440px, 60vh)" },
20
21
  children: e
21
22
  });
22
23
  }
23
- function D({ onOpen: e }) {
24
- let { t } = S();
25
- return /* @__PURE__ */ w(x, {
24
+ function O({ onOpen: e }) {
25
+ let { t } = C();
26
+ return /* @__PURE__ */ T(S, {
26
27
  size: "sm",
27
28
  variant: "outline",
28
29
  onClick: e,
29
30
  "data-testid": "ai-preview-open-entity",
30
- children: [t("bigconsole.widget.aiPreview.open", "Open"), /* @__PURE__ */ C(_, { className: "ml-1 size-3.5" })]
31
+ children: [t("bigconsole.widget.aiPreview.open", "Open"), /* @__PURE__ */ w(v, { className: "ml-1 size-3.5" })]
31
32
  });
32
33
  }
33
- function O() {
34
- let { t: _ } = S();
35
- r();
36
- let O = e(), k = n((e) => e.isRunning), A = n((e) => e.previewOpen), j = n((e) => e.hasRun), M = n((e) => e.steps), N = n((e) => e.entityIds), P = n((e) => e.caption), F = n((e) => e.error), I = n((e) => e.updatedAt), L = n((e) => e.openPreview), R = n((e) => e.closePreview), z = n((e) => e.setRichMounted);
37
- m(() => (z(!0), () => {
38
- z(!1);
39
- }), [z]);
40
- let [B, V] = g(0), H = h(!1);
41
- if (m(() => {
42
- k && !H.current && V((e) => e + 1), H.current = k;
43
- }, [k]), !j) return null;
44
- if (!A) return /* @__PURE__ */ w("div", {
34
+ function k() {
35
+ let { t: v } = C();
36
+ i(), r();
37
+ let k = e(), A = n((e) => e.isRunning), j = n((e) => e.previewOpen), M = n((e) => e.hasRun), N = n((e) => e.steps), P = n((e) => e.entityIds), F = n((e) => e.caption), I = n((e) => e.error), L = n((e) => e.updatedAt), R = n((e) => e.openPreview), z = n((e) => e.closePreview), B = n((e) => e.setRichMounted);
38
+ h(() => (B(!0), () => {
39
+ B(!1);
40
+ }), [B]);
41
+ let [V, H] = _(0), U = g(!1);
42
+ if (h(() => {
43
+ A && !U.current && H((e) => e + 1), U.current = A;
44
+ }, [A]), !M) return null;
45
+ if (!j) return /* @__PURE__ */ T("div", {
45
46
  className: "flex flex-wrap items-center justify-end gap-control-gap px-4 pt-3 md:px-6",
46
- style: { marginRight: a },
47
- children: [/* @__PURE__ */ C("span", {
47
+ style: { marginRight: o },
48
+ children: [/* @__PURE__ */ w("span", {
48
49
  className: "text-xs text-text-muted",
49
- children: k ? _("bigconsole.widget.aiPreview.buildRunning", "AI build running") : _("bigconsole.widget.aiPreview.buildFinished", "AI build finished")
50
- }), /* @__PURE__ */ w(x, {
50
+ children: A ? v("bigconsole.widget.aiPreview.buildRunning", "AI build running") : v("bigconsole.widget.aiPreview.buildFinished", "AI build finished")
51
+ }), /* @__PURE__ */ T(S, {
51
52
  size: "sm",
52
53
  variant: "outline",
53
- onClick: L,
54
+ onClick: R,
54
55
  "data-testid": "ai-preview-open",
55
56
  children: [
56
- /* @__PURE__ */ C(y, { className: "mr-1.5 size-4" }),
57
- _("bigconsole.widget.aiPreview.previewButton", "Preview"),
58
- k ? /* @__PURE__ */ C(v, { className: "ml-1.5 size-3.5 animate-spin" }) : null
57
+ /* @__PURE__ */ w(b, { className: "mr-1.5 size-4" }),
58
+ v("bigconsole.widget.aiPreview.previewButton", "Preview"),
59
+ A ? /* @__PURE__ */ w(y, { className: "ml-1.5 size-3.5 animate-spin" }) : null
59
60
  ]
60
61
  })]
61
62
  });
62
- let U = N.dashboard, W = t.map((e) => ({
63
+ let W = P.dashboard, G = t.map((e) => ({
63
64
  id: e,
64
- label: _(s[e].key, s[e].fallback),
65
- status: M[e]
66
- })), G = [
65
+ label: v(c[e].key, c[e].fallback),
66
+ status: N[e]
67
+ })), K = [
67
68
  {
68
69
  id: "datasink",
69
- label: _("bigconsole.widget.aiPreview.tab.dataSink", "Data Sink"),
70
- render: () => /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C(i, {
70
+ label: v("bigconsole.widget.aiPreview.tab.dataSink", "Data Sink"),
71
+ render: () => /* @__PURE__ */ w(D, { children: /* @__PURE__ */ w(a, {
71
72
  emphasis: "standard",
72
73
  padding: "compact",
73
74
  headingLevel: 3,
74
- title: _("bigconsole.widget.aiPreview.dataSinkRows", "Data sink rows"),
75
- description: _("bigconsole.widget.aiPreview.dataSinkRowsHint", "The rows the assistant just landed, straight from the sink."),
76
- actions: N.datasink ? /* @__PURE__ */ C(D, { onOpen: () => O(`/datasinks/${N.datasink}`) }) : void 0,
77
- children: /* @__PURE__ */ C(d, {
78
- id: N.datasink,
79
- live: k
75
+ title: v("bigconsole.widget.aiPreview.dataSinkRows", "Data sink rows"),
76
+ description: v("bigconsole.widget.aiPreview.dataSinkRowsHint", "The rows the assistant just landed, straight from the sink."),
77
+ actions: P.datasink ? /* @__PURE__ */ w(O, { onOpen: () => k(`/datasinks/${P.datasink}`) }) : void 0,
78
+ children: /* @__PURE__ */ w(f, {
79
+ id: P.datasink,
80
+ live: A
80
81
  })
81
82
  }) })
82
83
  },
83
84
  {
84
85
  id: "dashboard",
85
- label: _("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
86
- render: () => /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C(i, {
86
+ label: v("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
87
+ render: () => /* @__PURE__ */ w(D, { children: /* @__PURE__ */ w(a, {
87
88
  emphasis: "standard",
88
89
  padding: "compact",
89
90
  headingLevel: 3,
90
- title: _("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
91
- description: _("bigconsole.widget.aiPreview.dashboardHint", "The live board, rendered exactly as the real page renders it."),
92
- actions: U ? /* @__PURE__ */ C(D, { onOpen: () => O(`/dashboards/${U}`) }) : void 0,
93
- children: /* @__PURE__ */ C(u, {
94
- dashboardId: U,
95
- live: k
91
+ title: v("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
92
+ description: v("bigconsole.widget.aiPreview.dashboardHint", "The live board, rendered exactly as the real page renders it."),
93
+ actions: W ? /* @__PURE__ */ w(O, { onOpen: () => k(`/dashboards/${W}`) }) : void 0,
94
+ children: /* @__PURE__ */ w(d, {
95
+ dashboardId: W,
96
+ live: A
96
97
  })
97
98
  }) })
98
99
  },
99
100
  {
100
101
  id: "parser",
101
- label: _("bigconsole.widget.aiPreview.tab.parser", "Parser"),
102
- render: () => /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C(i, {
102
+ label: v("bigconsole.widget.aiPreview.tab.parser", "Parser"),
103
+ render: () => /* @__PURE__ */ w(D, { children: /* @__PURE__ */ w(a, {
103
104
  emphasis: "standard",
104
105
  padding: "compact",
105
106
  headingLevel: 3,
106
- title: _("bigconsole.widget.aiPreview.parserOutput", "Parser output"),
107
- description: _("bigconsole.widget.aiPreview.parserOutputHint", "The rows after the parser's transform, so you can check the shape."),
108
- actions: N.parser ? /* @__PURE__ */ C(D, { onOpen: () => O(`/parsers/${N.parser}`) }) : void 0,
109
- children: /* @__PURE__ */ C(f, {
110
- parserId: N.parser,
111
- live: k
107
+ title: v("bigconsole.widget.aiPreview.parserOutput", "Parser output"),
108
+ description: v("bigconsole.widget.aiPreview.parserOutputHint", "The rows after the parser's transform, so you can check the shape."),
109
+ actions: P.parser ? /* @__PURE__ */ w(O, { onOpen: () => k(`/parsers/${P.parser}`) }) : void 0,
110
+ children: /* @__PURE__ */ w(p, {
111
+ parserId: P.parser,
112
+ live: A
112
113
  })
113
114
  }) })
114
115
  },
115
116
  {
116
117
  id: "widget",
117
- label: _("bigconsole.widget.aiPreview.tab.widget", "Widget"),
118
- render: () => /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C(i, {
118
+ label: v("bigconsole.widget.aiPreview.tab.widget", "Widget"),
119
+ render: () => /* @__PURE__ */ w(D, { children: /* @__PURE__ */ w(a, {
119
120
  emphasis: "standard",
120
121
  padding: "compact",
121
122
  headingLevel: 3,
122
- title: _("bigconsole.widget.aiPreview.widgets", "Widgets"),
123
- description: _("bigconsole.widget.aiPreview.widgetsHint", "Every widget on the new dashboard, rendered live."),
124
- actions: U ? /* @__PURE__ */ C(D, { onOpen: () => O(`/dashboards/${U}`) }) : void 0,
125
- children: /* @__PURE__ */ C(p, {
126
- dashboardId: U,
127
- live: k
123
+ title: v("bigconsole.widget.aiPreview.widgets", "Widgets"),
124
+ description: v("bigconsole.widget.aiPreview.widgetsHint", "Every widget on the new dashboard, rendered live."),
125
+ actions: W ? /* @__PURE__ */ w(O, { onOpen: () => k(`/dashboards/${W}`) }) : void 0,
126
+ children: /* @__PURE__ */ w(m, {
127
+ dashboardId: W,
128
+ live: A
128
129
  })
129
130
  }) })
130
131
  }
131
132
  ];
132
- return /* @__PURE__ */ w("div", {
133
+ return /* @__PURE__ */ T("div", {
133
134
  "data-testid": "ai-preview-panel",
134
- style: { paddingRight: a },
135
+ style: { paddingRight: o },
135
136
  className: "mx-4 mt-3 min-w-0 md:mx-6",
136
- children: [/* @__PURE__ */ C("h2", {
137
+ children: [/* @__PURE__ */ w("h2", {
137
138
  className: "sr-only",
138
- children: _("bigconsole.widget.aiPreview.title", "AI Preview")
139
- }), /* @__PURE__ */ C(T, {
140
- title: _("bigconsole.widget.aiPreview.title", "AI Preview"),
141
- runKey: String(B),
142
- steps: W,
143
- tabs: G,
139
+ children: v("bigconsole.widget.aiPreview.title", "AI Preview")
140
+ }), /* @__PURE__ */ w(E, {
141
+ title: v("bigconsole.widget.aiPreview.title", "AI Preview"),
142
+ runKey: String(V),
143
+ steps: G,
144
+ tabs: K,
144
145
  follow: "produced",
145
- caption: k ? P || _("bigconsole.widget.aiPreview.working", "Working…") : _("bigconsole.widget.aiPreview.done", "Done"),
146
- error: F,
147
- meta: /* @__PURE__ */ C(o, {
148
- state: k ? "running" : F ? "stopped" : "idle",
149
- stateLabel: k ? _("bigconsole.widget.aiPreview.live", "Live") : F ? _("bigconsole.widget.aiPreview.stopped", "Stopped") : null,
150
- updatedLabel: _("bigconsole.widget.aiPreview.updated", "updated"),
151
- updatedAt: I,
152
- ago: (e) => c(e, _)
146
+ caption: A ? F || v("bigconsole.widget.aiPreview.working", "Working…") : v("bigconsole.widget.aiPreview.done", "Done"),
147
+ error: I,
148
+ meta: /* @__PURE__ */ w(s, {
149
+ state: A ? "running" : I ? "stopped" : "idle",
150
+ stateLabel: A ? v("bigconsole.widget.aiPreview.live", "Live") : I ? v("bigconsole.widget.aiPreview.stopped", "Stopped") : null,
151
+ updatedLabel: v("bigconsole.widget.aiPreview.updated", "updated"),
152
+ updatedAt: L,
153
+ ago: (e) => l(e, v)
153
154
  }),
154
- headerActions: /* @__PURE__ */ C(x, {
155
+ headerActions: /* @__PURE__ */ w(S, {
155
156
  size: "sm",
156
157
  variant: "ghost",
157
- onClick: R,
158
- "aria-label": _("bigconsole.widget.aiPreview.closeAriaLabel", "Close preview"),
158
+ onClick: z,
159
+ "aria-label": v("bigconsole.widget.aiPreview.closeAriaLabel", "Close preview"),
159
160
  "data-testid": "ai-preview-close",
160
- children: /* @__PURE__ */ C(b, { className: "size-4" })
161
+ children: /* @__PURE__ */ w(x, { className: "size-4" })
161
162
  }),
162
- labels: l(_)
163
+ labels: u(v)
163
164
  })]
164
165
  });
165
166
  }
166
167
  //#endregion
167
- export { O as AiPreviewPanel };
168
+ export { k as AiPreviewPanel };