@burdenoff/microfe-bigconsole 2026.1118.7 → 2026.1118.8

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.
@@ -9,176 +9,189 @@ import "./SavedViewsDropdown/index.js";
9
9
  import { memo as a, useCallback as o } from "react";
10
10
  import { PermissionButton as s } from "@burdenoff/fe-libs/shared/components";
11
11
  import { usePermissions as c } from "@burdenoff/fe-libs/shared/providers/shell";
12
- import { Clipboard as l, Download as u, Eye as d, FileText as f, Image as p, Minus as m, PanelLeft as h, PanelLeftClose as g, Pencil as _, Plus as v, RotateCcw as y, Save as b, Share2 as x, Store as S } from "lucide-react";
13
- import { Button as C, Spinner as w, Tooltip as T, TooltipContent as E, TooltipProvider as D, TooltipTrigger as O } from "@burdenoff/fe-libs/ui";
14
- import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
12
+ import { Clipboard as l, ClipboardCheck as u, Download as d, Eye as f, FileText as p, Image as m, Minus as h, PanelLeft as g, PanelLeftClose as _, Pencil as v, Plus as y, RotateCcw as b, Save as x, Share2 as S, Store as C } from "lucide-react";
13
+ import { Button as w, Spinner as T, Tooltip as E, TooltipContent as D, TooltipProvider as O, TooltipTrigger as k } from "@burdenoff/fe-libs/ui";
14
+ import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
16
16
  // src/bigconsole/components/dashboard/DashboardToolbar.tsx
17
- var N = a(function({ dashboardId: a, title: N, onAddWidget: P, onTogglePalette: F, isPaletteOpen: I = !1, onPaste: L, onSave: R, isSaving: z = !1, onExport: B, onPublishTemplate: V, onExportImage: H, onExportPdf: U, isExportingImage: W = !1, onShare: G }) {
18
- let { hasPermission: K } = c(), { t: q } = k(), J = t((e) => e.viewMode === "edit"), Y = t((e) => e.toggleViewMode), X = t((e) => e.zoomLevel), Z = t((e) => e.setZoomLevel), Q = !!e((e) => e.clipboardWidgetId), $ = o(() => {
19
- Q && L && L();
20
- }, [Q, L]);
21
- return /* @__PURE__ */ j(D, { children: /* @__PURE__ */ M(n, {
17
+ var P = a(function({ dashboardId: a, title: P, onAddWidget: F, onTogglePalette: I, isPaletteOpen: L = !1, onPaste: R, onSave: z, isSaving: B = !1, onReview: V, onExport: H, onPublishTemplate: U, onExportImage: W, onExportPdf: G, isExportingImage: K = !1, onShare: q }) {
18
+ let { hasPermission: ee } = c(), { t: J } = A(), Y = t((e) => e.viewMode === "edit"), X = t((e) => e.toggleViewMode), Z = t((e) => e.zoomLevel), Q = t((e) => e.setZoomLevel), $ = !!e((e) => e.clipboardWidgetId), te = o(() => {
19
+ $ && R && R();
20
+ }, [$, R]);
21
+ return /* @__PURE__ */ M(O, { children: /* @__PURE__ */ N(n, {
22
22
  emphasis: "bare",
23
23
  padding: "none",
24
- "aria-label": N ? `Board toolbar — ${N}` : "Board toolbar",
24
+ "aria-label": P ? `Board toolbar — ${P}` : "Board toolbar",
25
25
  "data-testid": "dashboard-toolbar",
26
26
  className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-4 py-2",
27
27
  bodyClassName: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2",
28
28
  children: [
29
- /* @__PURE__ */ j("div", {
29
+ /* @__PURE__ */ M("div", {
30
30
  className: "flex min-w-0 items-center gap-4",
31
- children: a && /* @__PURE__ */ j(i, { dashboardId: a })
31
+ children: a && /* @__PURE__ */ M(i, { dashboardId: a })
32
32
  }),
33
- /* @__PURE__ */ M("div", {
33
+ /* @__PURE__ */ N("div", {
34
34
  role: "group",
35
35
  "aria-label": "Zoom",
36
36
  className: "flex min-w-0 items-center gap-1 border-l border-[var(--color-border-subtle)] pl-4",
37
37
  children: [
38
- /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
38
+ /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
39
39
  asChild: !0,
40
- children: /* @__PURE__ */ j(C, {
40
+ children: /* @__PURE__ */ M(w, {
41
41
  variant: "ghost",
42
42
  size: "icon-sm",
43
- onClick: () => Z(Math.max(50, X - 10)),
44
- disabled: X <= 50,
45
- children: /* @__PURE__ */ j(m, { className: "size-4" })
43
+ onClick: () => Q(Math.max(50, Z - 10)),
44
+ disabled: Z <= 50,
45
+ children: /* @__PURE__ */ M(h, { className: "size-4" })
46
46
  })
47
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.zoomOut", "Zoom out") })] }),
48
- /* @__PURE__ */ M("span", {
47
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.zoomOut", "Zoom out") })] }),
48
+ /* @__PURE__ */ N("span", {
49
49
  className: "text-sm text-text-secondary w-12 text-center",
50
- children: [X, "%"]
50
+ children: [Z, "%"]
51
51
  }),
52
- /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
52
+ /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
53
53
  asChild: !0,
54
- children: /* @__PURE__ */ j(C, {
54
+ children: /* @__PURE__ */ M(w, {
55
55
  variant: "ghost",
56
56
  size: "icon-sm",
57
- onClick: () => Z(Math.min(200, X + 10)),
58
- disabled: X >= 200,
59
- children: /* @__PURE__ */ j(v, { className: "size-4" })
57
+ onClick: () => Q(Math.min(200, Z + 10)),
58
+ disabled: Z >= 200,
59
+ children: /* @__PURE__ */ M(y, { className: "size-4" })
60
60
  })
61
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.zoomIn", "Zoom in") })] }),
62
- /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
61
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.zoomIn", "Zoom in") })] }),
62
+ /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
63
63
  asChild: !0,
64
- children: /* @__PURE__ */ M(C, {
64
+ children: /* @__PURE__ */ N(w, {
65
65
  variant: "ghost",
66
66
  size: "sm",
67
- onClick: () => Z(100),
68
- children: [/* @__PURE__ */ j(y, { className: "size-3.5 mr-1" }), q("bigconsole.dashboards.toolbar.reset", "Reset")]
67
+ onClick: () => Q(100),
68
+ children: [/* @__PURE__ */ M(b, { className: "size-3.5 mr-1" }), J("bigconsole.dashboards.toolbar.reset", "Reset")]
69
69
  })
70
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.resetZoomTooltip", "Reset zoom to 100%") })] })
70
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.resetZoomTooltip", "Reset zoom to 100%") })] })
71
71
  ]
72
72
  }),
73
- /* @__PURE__ */ M("div", {
73
+ /* @__PURE__ */ N("div", {
74
74
  role: "group",
75
75
  "aria-label": "Board actions",
76
76
  className: "flex min-w-0 flex-wrap items-center justify-end gap-2 border-l border-[var(--color-border-subtle)] pl-4",
77
77
  children: [
78
- J && /* @__PURE__ */ M(A, { children: [
79
- F && /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
78
+ Y && /* @__PURE__ */ N(j, { children: [
79
+ I && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
80
80
  asChild: !0,
81
- children: /* @__PURE__ */ M(C, {
82
- variant: I ? "secondary" : "outline",
81
+ children: /* @__PURE__ */ N(w, {
82
+ variant: L ? "secondary" : "outline",
83
83
  size: "sm",
84
- onClick: F,
85
- children: [j(I ? g : h, { className: "size-4" }), q("bigconsole.dashboards.toolbar.widgets", "Widgets")]
84
+ onClick: I,
85
+ children: [M(L ? _ : g, { className: "size-4" }), J("bigconsole.dashboards.toolbar.widgets", "Widgets")]
86
86
  })
87
- }), /* @__PURE__ */ j(E, { children: I ? q("bigconsole.dashboards.toolbar.hidePalette", "Hide widget palette") : q("bigconsole.dashboards.toolbar.showPalette", "Show widget palette for drag & drop") })] }),
88
- /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
87
+ }), /* @__PURE__ */ M(D, { children: L ? J("bigconsole.dashboards.toolbar.hidePalette", "Hide widget palette") : J("bigconsole.dashboards.toolbar.showPalette", "Show widget palette for drag & drop") })] }),
88
+ /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
89
89
  asChild: !0,
90
- children: /* @__PURE__ */ M(C, {
90
+ children: /* @__PURE__ */ N(w, {
91
91
  variant: "ghost",
92
92
  size: "sm",
93
- onClick: $,
94
- disabled: !Q,
95
- children: [/* @__PURE__ */ j(l, { className: "size-4" }), q("bigconsole.dashboards.toolbar.paste", "Paste")]
93
+ onClick: te,
94
+ disabled: !$,
95
+ children: [/* @__PURE__ */ M(l, { className: "size-4" }), J("bigconsole.dashboards.toolbar.paste", "Paste")]
96
96
  })
97
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.pasteTooltip", "Paste widget from clipboard") })] }),
98
- /* @__PURE__ */ j(s, {
97
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.pasteTooltip", "Paste widget from clipboard") })] }),
98
+ /* @__PURE__ */ M(s, {
99
99
  permission: r.WIDGET_CREATE,
100
100
  deniedBehavior: "hide",
101
- children: /* @__PURE__ */ M(C, {
101
+ children: /* @__PURE__ */ N(w, {
102
102
  size: "sm",
103
- onClick: P,
104
- children: [/* @__PURE__ */ j(v, { className: "size-4" }), q("bigconsole.dashboards.toolbar.addWidget", "Add Widget")]
103
+ onClick: F,
104
+ children: [/* @__PURE__ */ M(y, { className: "size-4" }), J("bigconsole.dashboards.toolbar.addWidget", "Add Widget")]
105
105
  })
106
106
  })
107
107
  ] }),
108
- /* @__PURE__ */ j(C, {
109
- variant: J ? "secondary" : "outline",
108
+ /* @__PURE__ */ M(w, {
109
+ variant: Y ? "secondary" : "outline",
110
110
  size: "sm",
111
- onClick: Y,
112
- children: J ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(d, { className: "size-4" }), q("bigconsole.dashboards.toolbar.preview", "Preview")] }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(_, { className: "size-4" }), q("bigconsole.dashboards.toolbar.edit", "Edit")] })
111
+ onClick: X,
112
+ children: Y ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(f, { className: "size-4" }), J("bigconsole.dashboards.toolbar.preview", "Preview")] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(v, { className: "size-4" }), J("bigconsole.dashboards.toolbar.edit", "Edit")] })
113
113
  }),
114
- R && /* @__PURE__ */ j(C, {
114
+ z && /* @__PURE__ */ M(w, {
115
115
  variant: "outline",
116
116
  size: "sm",
117
- onClick: R,
118
- disabled: z,
119
- children: z ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(w, { className: "size-4" }), q("bigconsole.dashboards.toolbar.saving", "Saving...")] }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(b, { className: "size-4" }), q("bigconsole.dashboards.toolbar.save", "Save")] })
117
+ onClick: z,
118
+ disabled: B,
119
+ children: B ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(T, { className: "size-4" }), J("bigconsole.dashboards.toolbar.saving", "Saving...")] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(x, { className: "size-4" }), J("bigconsole.dashboards.toolbar.save", "Save")] })
120
120
  }),
121
- G && /* @__PURE__ */ j(s, {
121
+ q && /* @__PURE__ */ M(s, {
122
122
  permission: r.DASHBOARD_SHARE,
123
123
  deniedBehavior: "hide",
124
- children: /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
124
+ children: /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
125
125
  asChild: !0,
126
- children: /* @__PURE__ */ M(C, {
126
+ children: /* @__PURE__ */ N(w, {
127
127
  variant: "outline",
128
128
  size: "sm",
129
- onClick: G,
130
- children: [/* @__PURE__ */ j(x, { className: "size-4" }), q("bigconsole.dashboards.toolbar.share", "Share")]
129
+ onClick: q,
130
+ children: [/* @__PURE__ */ M(S, { className: "size-4" }), J("bigconsole.dashboards.toolbar.share", "Share")]
131
131
  })
132
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.shareTooltip", "Share dashboard with others") })] })
132
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.shareTooltip", "Share dashboard with others") })] })
133
133
  }),
134
- V && /* @__PURE__ */ j(s, {
134
+ U && /* @__PURE__ */ M(s, {
135
135
  permission: r.DASHBOARD_PUBLISH,
136
136
  deniedBehavior: "hide",
137
- children: /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
137
+ children: /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
138
138
  asChild: !0,
139
- children: /* @__PURE__ */ M(C, {
139
+ children: /* @__PURE__ */ N(w, {
140
140
  variant: "outline",
141
141
  size: "sm",
142
- onClick: V,
143
- children: [/* @__PURE__ */ j(S, { className: "size-4" }), /* @__PURE__ */ j("span", {
142
+ onClick: U,
143
+ children: [/* @__PURE__ */ M(C, { className: "size-4" }), /* @__PURE__ */ M("span", {
144
144
  className: "hidden sm:inline",
145
- children: q("bigconsole.dashboards.toolbar.publish", "Publish")
145
+ children: J("bigconsole.dashboards.toolbar.publish", "Publish")
146
146
  })]
147
147
  })
148
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.publishTooltip", "Publish this dashboard as a reusable template") })] })
148
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.publishTooltip", "Publish this dashboard as a reusable template") })] })
149
149
  }),
150
- B && /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
150
+ V && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
151
151
  asChild: !0,
152
- children: /* @__PURE__ */ M(C, {
152
+ children: /* @__PURE__ */ N(w, {
153
153
  variant: "outline",
154
154
  size: "sm",
155
- onClick: B,
156
- children: [/* @__PURE__ */ j(u, { className: "size-4" }), q("bigconsole.dashboards.toolbar.export", "Export")]
155
+ onClick: V,
156
+ "data-testid": "dashboard-review-button",
157
+ children: [/* @__PURE__ */ M(u, { className: "size-4" }), /* @__PURE__ */ M("span", {
158
+ className: "hidden sm:inline",
159
+ children: J("bigconsole.dashboards.toolbar.review", "Review")
160
+ })]
157
161
  })
158
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.exportTooltip", "Export dashboard to JSON") })] }),
159
- H && /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
162
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.reviewTooltip", "Check charts for misleading axes, colour-only meaning and unclear titles") })] }),
163
+ H && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
160
164
  asChild: !0,
161
- children: /* @__PURE__ */ j(C, {
165
+ children: /* @__PURE__ */ N(w, {
162
166
  variant: "outline",
163
- size: "icon-sm",
167
+ size: "sm",
164
168
  onClick: H,
165
- disabled: W,
166
- children: j(W ? w : p, { className: "size-4" })
169
+ children: [/* @__PURE__ */ M(d, { className: "size-4" }), J("bigconsole.dashboards.toolbar.export", "Export")]
170
+ })
171
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportTooltip", "Export dashboard to JSON") })] }),
172
+ W && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
173
+ asChild: !0,
174
+ children: /* @__PURE__ */ M(w, {
175
+ variant: "outline",
176
+ size: "icon-sm",
177
+ onClick: W,
178
+ disabled: K,
179
+ children: M(K ? T : m, { className: "size-4" })
167
180
  })
168
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.exportPngTooltip", "Export board as PNG image") })] }),
169
- U && /* @__PURE__ */ M(T, { children: [/* @__PURE__ */ j(O, {
181
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportPngTooltip", "Export board as PNG image") })] }),
182
+ G && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
170
183
  asChild: !0,
171
- children: /* @__PURE__ */ j(C, {
184
+ children: /* @__PURE__ */ M(w, {
172
185
  variant: "outline",
173
186
  size: "icon-sm",
174
- onClick: U,
175
- disabled: W,
176
- children: /* @__PURE__ */ j(f, { className: "size-4" })
187
+ onClick: G,
188
+ disabled: K,
189
+ children: /* @__PURE__ */ M(p, { className: "size-4" })
177
190
  })
178
- }), /* @__PURE__ */ j(E, { children: q("bigconsole.dashboards.toolbar.exportPdfTooltip", "Export board as PDF") })] })
191
+ }), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportPdfTooltip", "Export board as PDF") })] })
179
192
  ]
180
193
  })
181
194
  ]
182
195
  }) });
183
196
  });
184
- export { N as DashboardToolbar, N as default };
197
+ export { P as DashboardToolbar, P as default };
@@ -21,3 +21,4 @@ export { WidgetPalette, type WidgetPaletteProps } from './WidgetPalette';
21
21
  export { DrilldownBreadcrumb } from './DrilldownBreadcrumb';
22
22
  export { BuilderCanvas, BuilderTopbar, DashboardEditorShell } from '../builder';
23
23
  export { PublishToStoreDialog } from './PublishToStoreDialog';
24
+ export { DashboardReviewDialog, type DashboardReviewDialogProps } from './DashboardReviewDialog';
@@ -25,4 +25,5 @@ import "./WidgetPalette.js";
25
25
  import { DrilldownBreadcrumb as r } from "./DrilldownBreadcrumb.js";
26
26
  import "../builder/index.js";
27
27
  import { PublishToStoreDialog as i } from "./PublishToStoreDialog.js";
28
- export { e as DashboardCanvas, r as DrilldownBreadcrumb, n as ExportDashboardDialog, t as LiveCanvasToggle, i as PublishToStoreDialog };
28
+ import { DashboardReviewDialog as a } from "./DashboardReviewDialog.js";
29
+ export { e as DashboardCanvas, a as DashboardReviewDialog, r as DrilldownBreadcrumb, n as ExportDashboardDialog, t as LiveCanvasToggle, i as PublishToStoreDialog };
@@ -1,17 +1,27 @@
1
1
  import { FC } from 'react';
2
- import { LintFix } from '../../utils/boardLint';
3
- import { GeneratedDashboardSpecLike } from '../../utils/consoleDefinition';
2
+ import { LintableBoard, LintFix } from '../../utils/boardLint';
4
3
  export interface BoardLintPanelProps {
5
- /** The generated proposal being reviewed. */
6
- spec: GeneratedDashboardSpecLike | null;
4
+ /** The board being reviewed: an AI-generated proposal or a saved dashboard. */
5
+ spec: LintableBoard | null;
7
6
  /**
8
- * Applies one fix as a refined copy of the draft and returns the new generation's id
9
- * (null when nothing was created, for example after a quota error). When omitted, findings are
10
- * listed without a "Fix it" action.
7
+ * Applies one fix and returns an id the host can use to undo it later: the refined copy's generation id
8
+ * for a draft, or an undo-history key for a saved dashboard (null when nothing was changed, for example
9
+ * after a quota error). When omitted, findings are listed without a "Fix it" action.
11
10
  */
12
11
  onApplyFix?: (fix: LintFix) => Promise<string | null>;
13
- /** Removes a refined copy created by `onApplyFix`. When omitted, no Undo link is shown. */
12
+ /** Reverts a change made by `onApplyFix`. When omitted, no Undo link is shown. */
14
13
  onUndoFix?: (generationId: string) => Promise<void>;
14
+ /**
15
+ * The board is a saved dashboard rather than a draft: fixes change the real widget, and a widget with
16
+ * no data connection is reported on its own instead of once for the whole board.
17
+ */
18
+ saved?: boolean;
19
+ /**
20
+ * Keep "Fix it" available after a fix, so several problems can be fixed in turn. The host must keep an
21
+ * undo history, because the panel only ever shows the latest change. Draft mode leaves this off: a
22
+ * second refined copy would replace the first one's id and strand it without an Undo.
23
+ */
24
+ repeatable?: boolean;
15
25
  /**
16
26
  * The refined copy already created for this draft. Pass it (with `onAppliedChange`) from a parent that
17
27
  * renders more than one panel for the same draft, so they share one "one copy at a time" guard and one Undo.
@@ -11,47 +11,47 @@ var h = {
11
11
  success: /* @__PURE__ */ p(c, { className: "size-4" }),
12
12
  info: /* @__PURE__ */ p(l, { className: "size-4" }),
13
13
  warning: /* @__PURE__ */ p(u, { className: "size-4" })
14
- }, g = i(function({ spec: i, onApplyFix: c, onUndoFix: l, applied: u, onAppliedChange: g }) {
15
- let { t: _ } = f(), v = o(() => i ? t(i, { draft: !0 }) : [], [i]), y = n(v), [b, x] = s(null), [S, C] = s(null), [w, T] = s(null), [E, D] = s(null), O = g !== void 0, k = O ? u ?? null : E, A = O ? g : D;
14
+ }, g = i(function({ spec: i, onApplyFix: c, onUndoFix: l, applied: u, onAppliedChange: g, saved: _ = !1, repeatable: v = !1 }) {
15
+ let { t: y } = f(), b = o(() => i ? t(i, { draft: !_ }) : [], [i]), x = n(b), [S, C] = s(null), [w, T] = s(null), [E, D] = s(null), [O, k] = s(null), A = g !== void 0, j = A ? u ?? null : O, M = A ? g : k, N = j !== null && !v;
16
16
  a(() => {
17
- x(null), T(null), O || D(null);
18
- }, [i, O]);
19
- let j = o(() => {
20
- let e = b === null ? void 0 : v[b];
17
+ C(null), D(null), A || k(null);
18
+ }, [i, A]);
19
+ let P = o(() => {
20
+ let e = S === null ? void 0 : b[S];
21
21
  return i && e ? r(i, e) : null;
22
22
  }, [
23
23
  i,
24
- b,
25
- v
26
- ]), M = async () => {
27
- if (j && c && !k) {
28
- C("apply"), T(null);
24
+ S,
25
+ b
26
+ ]), F = async () => {
27
+ if (P && c && !N) {
28
+ T("apply"), D(null);
29
29
  try {
30
- let e = await c(j);
31
- x(null), e && A({
30
+ let e = await c(P);
31
+ C(null), e && M({
32
32
  generationId: e,
33
- summary: j.summary
33
+ summary: P.summary
34
34
  });
35
35
  } catch (e) {
36
- T(e instanceof Error ? e.message : String(e));
36
+ D(e instanceof Error ? e.message : String(e));
37
37
  } finally {
38
- C(null);
38
+ T(null);
39
39
  }
40
40
  }
41
41
  };
42
42
  return i ? /* @__PURE__ */ m(e, {
43
43
  headingLevel: 3,
44
- tone: y,
44
+ tone: x,
45
45
  padding: "compact",
46
- icon: h[y],
47
- title: v.length === 0 ? _("bigconsole.analysis.boardLint.cleanTitle", "No chart-quality problems found") : _("bigconsole.analysis.boardLint.issuesTitle", "{{count}} chart-quality note{{plural}}", {
48
- count: v.length,
49
- plural: v.length === 1 ? "" : "s"
46
+ icon: h[x],
47
+ title: b.length === 0 ? y("bigconsole.analysis.boardLint.cleanTitle", "No chart-quality problems found") : y("bigconsole.analysis.boardLint.issuesTitle", "{{count}} chart-quality note{{plural}}", {
48
+ count: b.length,
49
+ plural: b.length === 1 ? "" : "s"
50
50
  }),
51
- description: _("bigconsole.analysis.boardLint.description", "A quick review of axes, colours and labels. These do not block creating the dashboard."),
51
+ description: _ ? y("bigconsole.analysis.boardLint.savedDescription", "A quick review of axes, colours and labels. These are suggestions; your dashboard keeps working as it is.") : y("bigconsole.analysis.boardLint.description", "A quick review of axes, colours and labels. These do not block creating the dashboard."),
52
52
  "data-testid": "board-lint",
53
53
  children: [
54
- k && /* @__PURE__ */ m("div", {
54
+ j && /* @__PURE__ */ m("div", {
55
55
  role: "status",
56
56
  "data-testid": "board-lint-applied",
57
57
  style: {
@@ -62,39 +62,39 @@ var h = {
62
62
  fontSize: "var(--font-size-body-sm)",
63
63
  color: "var(--color-text-primary)"
64
64
  },
65
- children: [/* @__PURE__ */ p("p", { children: _("bigconsole.analysis.boardLint.appliedNote", "Created a refined copy with this change: {{summary}} Your original draft is unchanged.", { summary: k.summary }) }), l && /* @__PURE__ */ p("div", {
65
+ children: [/* @__PURE__ */ p("p", { children: _ ? y("bigconsole.analysis.boardLint.savedAppliedNote", "Changed this dashboard: {{summary}} You can undo it.", { summary: j.summary }) : y("bigconsole.analysis.boardLint.appliedNote", "Created a refined copy with this change: {{summary}} Your original draft is unchanged.", { summary: j.summary }) }), l && /* @__PURE__ */ p("div", {
66
66
  style: { marginTop: "var(--space-controlGap)" },
67
67
  children: /* @__PURE__ */ p(d, {
68
68
  type: "button",
69
69
  size: "sm",
70
70
  variant: "outline",
71
71
  onClick: async () => {
72
- if (k && l) {
73
- C("undo"), T(null);
72
+ if (j && l) {
73
+ T("undo"), D(null);
74
74
  try {
75
- await l(k.generationId), A(null);
75
+ await l(j.generationId), M(null);
76
76
  } catch (e) {
77
- T(e instanceof Error ? e.message : String(e));
77
+ D(e instanceof Error ? e.message : String(e));
78
78
  } finally {
79
- C(null);
79
+ T(null);
80
80
  }
81
81
  }
82
82
  },
83
- disabled: S !== null,
83
+ disabled: w !== null,
84
84
  "data-testid": "board-lint-undo",
85
- children: S === "undo" ? _("bigconsole.analysis.boardLint.undoing", "Undoing…") : _("bigconsole.analysis.boardLint.undo", "Undo")
85
+ children: w === "undo" ? y("bigconsole.analysis.boardLint.undoing", "Undoing…") : y("bigconsole.analysis.boardLint.undo", "Undo")
86
86
  })
87
87
  })]
88
88
  }),
89
- w && b === null && /* @__PURE__ */ p("p", {
89
+ E && S === null && /* @__PURE__ */ p("p", {
90
90
  role: "alert",
91
91
  style: { color: "var(--color-status-danger-text, var(--color-text-primary))" },
92
- children: w
92
+ children: E
93
93
  }),
94
- v.length > 0 && /* @__PURE__ */ p("ul", {
94
+ b.length > 0 && /* @__PURE__ */ p("ul", {
95
95
  className: "space-y-2",
96
96
  "data-testid": "board-lint-findings",
97
- children: v.map((e, t) => /* @__PURE__ */ m("li", {
97
+ children: b.map((e, t) => /* @__PURE__ */ m("li", {
98
98
  "data-rule": e.ruleId,
99
99
  style: {
100
100
  padding: "var(--space-controlGap)",
@@ -105,22 +105,22 @@ var h = {
105
105
  color: "var(--color-text-primary)"
106
106
  },
107
107
  children: [
108
- _(`bigconsole.analysis.boardLint.rule.${e.ruleId}`, e.message),
109
- c && e.fixable && b !== t && !k && /* @__PURE__ */ p("div", {
108
+ y(`bigconsole.analysis.boardLint.rule.${e.ruleId}`, e.message),
109
+ c && e.fixable && S !== t && !N && /* @__PURE__ */ p("div", {
110
110
  style: { marginTop: "var(--space-controlGap)" },
111
111
  children: /* @__PURE__ */ p(d, {
112
112
  type: "button",
113
113
  size: "sm",
114
114
  variant: "outline",
115
115
  onClick: () => {
116
- T(null), x(t);
116
+ D(null), C(t);
117
117
  },
118
- disabled: S !== null,
118
+ disabled: w !== null,
119
119
  "data-testid": "board-lint-fix",
120
- children: _("bigconsole.analysis.boardLint.fixIt", "Fix it")
120
+ children: y("bigconsole.analysis.boardLint.fixIt", "Fix it")
121
121
  })
122
122
  }),
123
- b === t && j && /* @__PURE__ */ m("div", {
123
+ S === t && P && /* @__PURE__ */ m("div", {
124
124
  "data-testid": "board-lint-preview",
125
125
  style: {
126
126
  marginTop: "var(--space-controlGap)",
@@ -130,16 +130,16 @@ var h = {
130
130
  /* @__PURE__ */ m("p", { children: [
131
131
  /* @__PURE__ */ m("span", {
132
132
  style: { fontWeight: "var(--font-weight-semibold)" },
133
- children: [_("bigconsole.analysis.boardLint.previewLabel", "Proposed change"), ":"]
133
+ children: [y("bigconsole.analysis.boardLint.previewLabel", "Proposed change"), ":"]
134
134
  }),
135
135
  " ",
136
- j.summary
136
+ P.summary
137
137
  ] }),
138
- /* @__PURE__ */ p("p", { children: _("bigconsole.analysis.boardLint.previewNote", "This creates a refined copy of the draft. Your current draft stays as it is, and you can undo it.") }),
139
- w && /* @__PURE__ */ p("p", {
138
+ /* @__PURE__ */ p("p", { children: _ ? y("bigconsole.analysis.boardLint.savedPreviewNote", "This changes the widget on your dashboard. You can undo it right after.") : y("bigconsole.analysis.boardLint.previewNote", "This creates a refined copy of the draft. Your current draft stays as it is, and you can undo it.") }),
139
+ E && /* @__PURE__ */ p("p", {
140
140
  role: "alert",
141
141
  style: { color: "var(--color-status-danger-text, var(--color-text-primary))" },
142
- children: w
142
+ children: E
143
143
  }),
144
144
  /* @__PURE__ */ m("div", {
145
145
  className: "flex gap-2",
@@ -147,17 +147,17 @@ var h = {
147
147
  children: [/* @__PURE__ */ p(d, {
148
148
  type: "button",
149
149
  size: "sm",
150
- onClick: M,
151
- disabled: S !== null,
150
+ onClick: F,
151
+ disabled: w !== null,
152
152
  "data-testid": "board-lint-apply",
153
- children: S === "apply" ? _("bigconsole.analysis.boardLint.applying", "Creating…") : _("bigconsole.analysis.boardLint.apply", "Create refined draft")
153
+ children: w === "apply" ? _ ? y("bigconsole.analysis.boardLint.savedApplying", "Applying…") : y("bigconsole.analysis.boardLint.applying", "Creating…") : _ ? y("bigconsole.analysis.boardLint.savedApply", "Apply this change") : y("bigconsole.analysis.boardLint.apply", "Create refined draft")
154
154
  }), /* @__PURE__ */ p(d, {
155
155
  type: "button",
156
156
  size: "sm",
157
157
  variant: "outline",
158
- onClick: () => x(null),
159
- disabled: S !== null,
160
- children: _("bigconsole.analysis.boardLint.cancel", "Cancel")
158
+ onClick: () => C(null),
159
+ disabled: w !== null,
160
+ children: y("bigconsole.analysis.boardLint.cancel", "Cancel")
161
161
  })]
162
162
  })
163
163
  ]