@burdenoff/microfe-bigconsole 2026.1124.1 → 2026.1124.2

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.
@@ -2,6 +2,10 @@ import { FC } from 'react';
2
2
  export interface FleetChildrenPanelProps {
3
3
  dashboardId: string;
4
4
  dashboardName: string;
5
+ /** The board this one follows, when it follows one and its name can be read. */
6
+ masterName?: string | null;
7
+ /** Called after an action changed this board's widgets (a flag answered, the board restored). */
8
+ onBoardChanged?: () => Promise<unknown> | void;
5
9
  onClose: () => void;
6
10
  onOpenBoard: (dashboardId: string) => void;
7
11
  }
@@ -3,17 +3,19 @@ import { BIGCONSOLE_PERMISSIONS as t } from "../../../constants/permissions.js";
3
3
  import { useTr as n } from "../../../shared/hooks/useTr.js";
4
4
  import "../../context/index.js";
5
5
  import { useFleetChildren as r } from "../../hooks/useFleetChildren.js";
6
- import { useFleetMasterActions as i } from "../../hooks/useFleetMasterActions.js";
7
- import { pushIsEmpty as a } from "../../utils/fleetPush.js";
8
- import { CreateLinkedCopyDialog as o } from "./CreateLinkedCopyDialog.js";
9
- import { FleetPushResultTable as s } from "./FleetPushResultTable.js";
10
- import { memo as c, useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
11
- import { PermissionButton as p } from "@burdenoff/fe-libs/shared/components";
12
- import { Network as m, X as h } from "lucide-react";
13
- import { Button as g, Spinner as _ } from "@burdenoff/fe-libs/ui";
14
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
6
+ import { useActionLock as i, useOwnerBoundRun as a } from "../../hooks/useOwnerBoundRun.js";
7
+ import { useFleetMasterActions as o } from "../../hooks/useFleetMasterActions.js";
8
+ import { pushIsEmpty as s } from "../../utils/fleetPush.js";
9
+ import { CreateLinkedCopyDialog as c } from "./CreateLinkedCopyDialog.js";
10
+ import { FleetCopySection as l } from "./FleetCopySection.js";
11
+ import { FleetPushResultTable as u } from "./FleetPushResultTable.js";
12
+ import { memo as d, useCallback as f, useState as p } from "react";
13
+ import { PermissionButton as m } from "@burdenoff/fe-libs/shared/components";
14
+ import { Network as h, X as g } from "lucide-react";
15
+ import { Button as _, Spinner as v } from "@burdenoff/fe-libs/ui";
16
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
15
17
  // src/bigconsole/components/fleet/FleetChildrenPanel.tsx
16
- var x = {
18
+ var S = {
17
19
  display: "inline-flex",
18
20
  alignItems: "center",
19
21
  padding: "2px 8px",
@@ -24,121 +26,103 @@ var x = {
24
26
  textTransform: "uppercase",
25
27
  letterSpacing: "0.02em",
26
28
  whiteSpace: "nowrap"
27
- }, S = {
28
- ...x,
29
+ }, C = {
30
+ ...S,
29
31
  backgroundColor: "var(--color-status-warning-bgSubtle)",
30
32
  color: "var(--color-status-warning-text)"
31
- }, C = (e, t) => e instanceof Error && e.message ? e.message : t, w = c(function({ dashboardId: c, dashboardName: w, onClose: T, onOpenBoard: E }) {
32
- let D = n(), { workspaceId: O, currentUser: k } = e(), A = `${O ?? ""}:${k?.id ?? ""}:${c}`, { loading: j, error: M, isMaster: N, summary: P, refetch: F } = r(c, !0), I = i(), [L, R] = f({ phase: "idle" }), [z, B] = f(!1), [V, H] = f(null), [U, W] = f(null), [G, K] = f(!1), q = I.busy || G, J = d(A);
33
- u(() => {
34
- J.current !== A && (J.current = A, R({ phase: "idle" }), B(!1), H(null), W(null), K(!1));
35
- }, [A]);
36
- let Y = l(async (e, t, n) => {
37
- let r = J.current, i = () => J.current !== r;
38
- K(!0);
39
- try {
40
- let r;
41
- try {
42
- r = await e();
43
- } catch (e) {
44
- i() || n(e);
45
- return;
46
- }
47
- if (i()) return;
48
- t(r), await F();
49
- } finally {
50
- i() || K(!1);
51
- }
52
- }, [F]), X = l(() => (W(null), Y(() => I.setAsMaster(c), () => W({
33
+ }, w = (e, t) => e instanceof Error && e.message ? e.message : t, T = d(function({ dashboardId: d, dashboardName: T, masterName: E = null, onBoardChanged: ee, onClose: D, onOpenBoard: O }) {
34
+ let k = n(), { workspaceId: A, currentUser: j } = e(), M = `${A ?? ""}:${j?.id ?? ""}:${d}`, { loading: N, error: P, isMaster: F, linkStatus: I, summary: L, refetch: R } = r(d, !0), z = o(), [B, V] = p({ phase: "idle" }), [H, U] = p(!1), [W, G] = p(null), [K, q] = p(null), J = i(), Y = f(() => {
35
+ V({ phase: "idle" }), U(!1), G(null), q(null);
36
+ }, []), { acting: X, run: Z } = a(M, R, Y, J), Q = z.busy || X, te = f(() => (q(null), Z(() => z.setAsMaster(d), () => q({
53
37
  tone: "ok",
54
- text: D("bigconsole.fleet.children.nowMaster", "This board is now a master.")
55
- }), (e) => W({
38
+ text: k("bigconsole.fleet.children.nowMaster", "This board is now a master.")
39
+ }), (e) => q({
56
40
  tone: "error",
57
- text: C(e, D("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
41
+ text: w(e, k("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
58
42
  }))), [
59
- I,
60
- c,
61
- Y,
62
- D
63
- ]), Z = l(() => (W(null), Y(() => I.unsetAsMaster(c), () => W({
43
+ z,
44
+ d,
45
+ Z,
46
+ k
47
+ ]), ne = f(() => (q(null), Z(() => z.unsetAsMaster(d), () => q({
64
48
  tone: "ok",
65
- text: D("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
66
- }), (e) => W({
49
+ text: k("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
50
+ }), (e) => q({
67
51
  tone: "error",
68
- text: C(e, D("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
52
+ text: w(e, k("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
69
53
  }))), [
70
- I,
71
- c,
72
- Y,
73
- D
74
- ]), Q = l((e) => (H(null), Y(() => I.createLinkedCopy(c, e), () => {
75
- B(!1), W({
54
+ z,
55
+ d,
56
+ Z,
57
+ k
58
+ ]), re = f((e) => (G(null), Z(() => z.createLinkedCopy(d, e), () => {
59
+ U(!1), q({
76
60
  tone: "ok",
77
- text: D("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
61
+ text: k("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
78
62
  });
79
- }, (e) => H(C(e, D("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
80
- I,
81
- c,
82
- Y,
83
- D
84
- ]), $ = l((e) => (W(null), Y(() => I.previewPush(c, e), (t) => R({
63
+ }, (e) => G(w(e, k("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
64
+ z,
65
+ d,
66
+ Z,
67
+ k
68
+ ]), $ = f((e) => (q(null), Z(() => z.previewPush(d, e), (t) => V({
85
69
  phase: "preview",
86
70
  scope: e,
87
71
  result: t
88
- }), (e) => W({
72
+ }), (e) => q({
89
73
  tone: "error",
90
- text: C(e, D("bigconsole.fleet.error.preview", "The preview could not be made."))
74
+ text: w(e, k("bigconsole.fleet.error.preview", "The preview could not be made."))
91
75
  }))), [
92
- I,
93
- c,
94
- Y,
95
- D
96
- ]), ee = l((e) => (W(null), Y(() => I.push(c, e), (e) => R({
76
+ z,
77
+ d,
78
+ Z,
79
+ k
80
+ ]), ie = f((e) => (q(null), Z(() => z.push(d, e), (e) => V({
97
81
  phase: "done",
98
82
  result: e
99
- }), (e) => W({
83
+ }), (e) => q({
100
84
  tone: "error",
101
- text: C(e, D("bigconsole.fleet.error.push", "The push could not be made."))
85
+ text: w(e, k("bigconsole.fleet.error.push", "The push could not be made."))
102
86
  }))), [
103
- I,
104
- c,
105
- Y,
106
- D
107
- ]), te = (e) => /* @__PURE__ */ b("span", {
87
+ z,
88
+ d,
89
+ Z,
90
+ k
91
+ ]), ae = (e) => /* @__PURE__ */ x("span", {
108
92
  className: "flex flex-wrap items-center gap-1",
109
93
  children: [
110
- e.status === "PENDING" && /* @__PURE__ */ y("span", {
94
+ e.status === "PENDING" && /* @__PURE__ */ b("span", {
111
95
  "data-testid": "fleet-child-pending",
112
- style: S,
113
- children: D("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
96
+ style: C,
97
+ children: k("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
114
98
  }),
115
- e.behindMaster && /* @__PURE__ */ y("span", {
99
+ e.behindMaster && /* @__PURE__ */ b("span", {
116
100
  "data-testid": "fleet-child-behind",
117
- style: S,
118
- children: e.missingWidgetCount ? D("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : D("bigconsole.fleet.children.behind", "Behind the master")
101
+ style: C,
102
+ children: e.missingWidgetCount ? k("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : k("bigconsole.fleet.children.behind", "Behind the master")
119
103
  }),
120
- e.openFlagCount > 0 && /* @__PURE__ */ y("span", {
104
+ e.openFlagCount > 0 && /* @__PURE__ */ b("span", {
121
105
  "data-testid": "fleet-child-flags",
122
- style: S,
123
- children: D("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
106
+ style: C,
107
+ children: k("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
124
108
  }),
125
- e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ y("span", {
109
+ e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ b("span", {
126
110
  style: {
127
- ...x,
111
+ ...S,
128
112
  color: "var(--color-status-success-text)"
129
113
  },
130
- children: D("bigconsole.fleet.children.inSync", "In sync")
114
+ children: k("bigconsole.fleet.children.inSync", "In sync")
131
115
  })
132
116
  ]
133
117
  });
134
- return /* @__PURE__ */ b("section", {
135
- "aria-label": D("bigconsole.fleet.children.title", "Children"),
118
+ return /* @__PURE__ */ x("section", {
119
+ "aria-label": k("bigconsole.fleet.children.title", "Children"),
136
120
  "data-testid": "fleet-children-panel",
137
121
  className: "flex flex-col gap-form-gap",
138
122
  children: [
139
- /* @__PURE__ */ b("div", {
123
+ /* @__PURE__ */ x("div", {
140
124
  className: "flex items-center justify-between gap-form-gap",
141
- children: [/* @__PURE__ */ b("h2", {
125
+ children: [/* @__PURE__ */ x("h2", {
142
126
  className: "flex items-center gap-2",
143
127
  style: {
144
128
  margin: 0,
@@ -146,111 +130,117 @@ var x = {
146
130
  fontSize: "var(--font-size-body)",
147
131
  fontWeight: "var(--font-weight-semibold)"
148
132
  },
149
- children: [/* @__PURE__ */ y(m, {
133
+ children: [/* @__PURE__ */ b(h, {
150
134
  "aria-hidden": "true",
151
135
  style: {
152
136
  height: "var(--size-icon-sm)",
153
137
  width: "var(--size-icon-sm)"
154
138
  }
155
- }), D("bigconsole.fleet.children.title", "Children")]
156
- }), /* @__PURE__ */ y(g, {
139
+ }), k("bigconsole.fleet.children.title", "Children")]
140
+ }), /* @__PURE__ */ b(_, {
157
141
  variant: "ghost",
158
142
  size: "sm",
159
- onClick: T,
160
- "aria-label": D("bigconsole.fleet.children.close", "Close the Children panel"),
161
- title: D("bigconsole.fleet.children.close", "Close the Children panel"),
143
+ onClick: D,
144
+ "aria-label": k("bigconsole.fleet.children.close", "Close the Children panel"),
145
+ title: k("bigconsole.fleet.children.close", "Close the Children panel"),
162
146
  "data-testid": "fleet-children-close",
163
- children: /* @__PURE__ */ y(h, { style: {
147
+ children: /* @__PURE__ */ b(g, { style: {
164
148
  height: "var(--size-icon-sm)",
165
149
  width: "var(--size-icon-sm)"
166
150
  } })
167
151
  })]
168
152
  }),
169
- U && /* @__PURE__ */ y("p", {
170
- role: U.tone === "error" ? "alert" : "status",
153
+ K && /* @__PURE__ */ b("p", {
154
+ role: K.tone === "error" ? "alert" : "status",
171
155
  "data-testid": "fleet-children-message",
172
156
  style: {
173
157
  margin: 0,
174
- color: U.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
158
+ color: K.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
175
159
  fontSize: "var(--font-size-body-sm)"
176
160
  },
177
- children: U.text
161
+ children: K.text
178
162
  }),
179
- j && !P && !N && /* @__PURE__ */ b("div", {
163
+ N && !L && !F && /* @__PURE__ */ x("div", {
180
164
  className: "flex items-center gap-2",
181
165
  style: { color: "var(--color-text-secondary)" },
182
- children: [/* @__PURE__ */ y(_, { style: {
166
+ children: [/* @__PURE__ */ b(v, { style: {
183
167
  height: "var(--size-icon-sm)",
184
168
  width: "var(--size-icon-sm)"
185
- } }), D("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
169
+ } }), k("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
186
170
  }),
187
- !j && M && /* @__PURE__ */ y("p", {
171
+ !N && P && /* @__PURE__ */ b("p", {
188
172
  role: "alert",
189
173
  style: {
190
174
  margin: 0,
191
175
  color: "var(--color-status-error-text)"
192
176
  },
193
- children: D("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
177
+ children: k("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
194
178
  }),
195
- !j && !M && !N && /* @__PURE__ */ b("div", {
179
+ !N && !P && I === "ACTIVE" && /* @__PURE__ */ b(l, {
180
+ dashboardId: d,
181
+ masterName: E,
182
+ onBoardChanged: ee,
183
+ lock: J
184
+ }),
185
+ !N && !P && !F && /* @__PURE__ */ x("div", {
196
186
  className: "flex flex-col gap-form-gap",
197
187
  "data-testid": "fleet-children-not-master",
198
- children: [/* @__PURE__ */ y("p", {
188
+ children: [/* @__PURE__ */ b("p", {
199
189
  style: {
200
190
  margin: 0,
201
191
  color: "var(--color-text-secondary)",
202
192
  fontSize: "var(--font-size-body-sm)"
203
193
  },
204
- children: D("bigconsole.fleet.children.notMaster", "Other boards can follow this one as linked copies once it is a master. Its own widgets stay as they are.")
205
- }), /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(p, {
194
+ children: k("bigconsole.fleet.children.notMaster", "Other boards can follow this one as linked copies once it is a master. Its own widgets stay as they are.")
195
+ }), /* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(m, {
206
196
  permission: t.DASHBOARD_UPDATE,
207
197
  deniedBehavior: "hide",
208
- children: /* @__PURE__ */ b(g, {
209
- onClick: X,
210
- disabled: q,
198
+ children: /* @__PURE__ */ x(_, {
199
+ onClick: te,
200
+ disabled: Q,
211
201
  "data-testid": "fleet-set-master",
212
- children: [q && /* @__PURE__ */ y(_, { style: {
202
+ children: [Q && /* @__PURE__ */ b(v, { style: {
213
203
  height: "var(--size-icon-sm)",
214
204
  width: "var(--size-icon-sm)"
215
- } }), D("bigconsole.fleet.children.setMaster", "Set as master")]
205
+ } }), k("bigconsole.fleet.children.setMaster", "Set as master")]
216
206
  })
217
207
  }) })]
218
208
  }),
219
- !M && N && P && /* @__PURE__ */ b(v, { children: [
220
- /* @__PURE__ */ b("p", {
209
+ !P && F && L && /* @__PURE__ */ x(y, { children: [
210
+ /* @__PURE__ */ x("p", {
221
211
  "data-testid": "fleet-children-counts",
222
212
  style: {
223
213
  margin: 0,
224
214
  color: "var(--color-text-secondary)",
225
215
  fontSize: "var(--font-size-body-sm)"
226
216
  },
227
- children: [D("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
228
- total: P.total,
229
- active: P.active,
230
- pending: P.pending,
231
- behind: P.behind
232
- }), P.hiddenCount > 0 && /* @__PURE__ */ b(v, { children: [" ", D("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: P.hiddenCount })] })]
217
+ children: [k("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
218
+ total: L.total,
219
+ active: L.active,
220
+ pending: L.pending,
221
+ behind: L.behind
222
+ }), L.hiddenCount > 0 && /* @__PURE__ */ x(y, { children: [" ", k("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: L.hiddenCount })] })]
233
223
  }),
234
- /* @__PURE__ */ b("ul", {
224
+ /* @__PURE__ */ x("ul", {
235
225
  className: "flex flex-col gap-1",
236
226
  style: {
237
227
  listStyle: "none",
238
228
  margin: 0,
239
229
  padding: 0
240
230
  },
241
- children: [P.children.length === 0 && P.total === 0 && /* @__PURE__ */ y("li", {
231
+ children: [L.children.length === 0 && L.total === 0 && /* @__PURE__ */ b("li", {
242
232
  style: {
243
233
  color: "var(--color-text-secondary)",
244
234
  fontSize: "var(--font-size-body-sm)"
245
235
  },
246
- children: D("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
247
- }), P.children.map((e) => /* @__PURE__ */ b("li", {
236
+ children: k("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
237
+ }), L.children.map((e) => /* @__PURE__ */ x("li", {
248
238
  "data-testid": "fleet-child",
249
239
  className: "flex items-center justify-between gap-form-gap rounded-input border px-3 py-2",
250
240
  style: { borderColor: "var(--color-border-subtle)" },
251
- children: [/* @__PURE__ */ y("button", {
241
+ children: [/* @__PURE__ */ b("button", {
252
242
  type: "button",
253
- onClick: () => E(e.dashboardId),
243
+ onClick: () => O(e.dashboardId),
254
244
  className: "min-w-0 truncate text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
255
245
  style: {
256
246
  color: "var(--color-text-primary)",
@@ -260,133 +250,133 @@ var x = {
260
250
  cursor: "pointer"
261
251
  },
262
252
  children: e.name
263
- }), te(e)]
253
+ }), ae(e)]
264
254
  }, e.dashboardId))]
265
255
  }),
266
- /* @__PURE__ */ b("div", {
256
+ /* @__PURE__ */ x("div", {
267
257
  className: "flex flex-wrap items-center gap-2",
268
258
  children: [
269
- /* @__PURE__ */ y(p, {
259
+ /* @__PURE__ */ b(m, {
270
260
  permission: t.DASHBOARD_CREATE,
271
261
  deniedBehavior: "hide",
272
- children: /* @__PURE__ */ y(g, {
262
+ children: /* @__PURE__ */ b(_, {
273
263
  variant: "outline",
274
264
  onClick: () => {
275
- H(null), B(!0);
265
+ G(null), U(!0);
276
266
  },
277
- disabled: q,
267
+ disabled: Q,
278
268
  "data-testid": "fleet-create-copy",
279
- children: D("bigconsole.fleet.children.createCopy", "Create linked copy…")
269
+ children: k("bigconsole.fleet.children.createCopy", "Create linked copy…")
280
270
  })
281
271
  }),
282
- /* @__PURE__ */ y(p, {
272
+ /* @__PURE__ */ b(m, {
283
273
  permission: t.DASHBOARD_UPDATE,
284
274
  deniedBehavior: "hide",
285
- children: /* @__PURE__ */ y(g, {
275
+ children: /* @__PURE__ */ b(_, {
286
276
  onClick: () => $("DIRECT_COPIES"),
287
- disabled: q || P.total === 0 || L.phase === "preview",
277
+ disabled: Q || L.total === 0 || B.phase === "preview",
288
278
  "data-testid": "fleet-push",
289
- children: D("bigconsole.fleet.children.push", "Push to copies…")
279
+ children: k("bigconsole.fleet.children.push", "Push to copies…")
290
280
  })
291
281
  }),
292
- /* @__PURE__ */ y(p, {
282
+ /* @__PURE__ */ b(m, {
293
283
  permission: t.DASHBOARD_UPDATE,
294
284
  deniedBehavior: "hide",
295
- children: /* @__PURE__ */ y(g, {
285
+ children: /* @__PURE__ */ b(_, {
296
286
  variant: "ghost",
297
- onClick: Z,
298
- disabled: q || P.total > 0,
299
- title: P.total > 0 ? D("bigconsole.fleet.children.unsetBlocked", "Detach or remove every copy first.") : void 0,
287
+ onClick: ne,
288
+ disabled: Q || L.total > 0,
289
+ title: L.total > 0 ? k("bigconsole.fleet.children.unsetBlocked", "Detach or remove every copy first.") : void 0,
300
290
  "data-testid": "fleet-unset-master",
301
- children: D("bigconsole.fleet.children.unsetMaster", "Stop being a master")
291
+ children: k("bigconsole.fleet.children.unsetMaster", "Stop being a master")
302
292
  })
303
293
  })
304
294
  ]
305
295
  })
306
296
  ] }),
307
- L.phase === "preview" && /* @__PURE__ */ b("div", {
297
+ B.phase === "preview" && /* @__PURE__ */ x("div", {
308
298
  className: "flex flex-col gap-form-gap rounded-input border p-3",
309
299
  style: { borderColor: "var(--color-border-subtle)" },
310
300
  "data-testid": "fleet-push-preview",
311
301
  children: [
312
- /* @__PURE__ */ y("strong", {
302
+ /* @__PURE__ */ b("strong", {
313
303
  style: { color: "var(--color-text-primary)" },
314
- children: D("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
304
+ children: k("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
315
305
  }),
316
- /* @__PURE__ */ y("div", {
306
+ /* @__PURE__ */ b("div", {
317
307
  role: "radiogroup",
318
- "aria-label": D("bigconsole.fleet.push.scopeLabel", "How far to push"),
308
+ "aria-label": k("bigconsole.fleet.push.scopeLabel", "How far to push"),
319
309
  className: "flex flex-wrap gap-2",
320
- children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ y("button", {
310
+ children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ b("button", {
321
311
  type: "button",
322
312
  role: "radio",
323
- "aria-checked": L.scope === e,
324
- disabled: q,
325
- onClick: () => L.scope !== e && $(e),
313
+ "aria-checked": B.scope === e,
314
+ disabled: Q,
315
+ onClick: () => B.scope !== e && $(e),
326
316
  className: "rounded-input border px-3 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
327
317
  style: {
328
- borderColor: L.scope === e ? "var(--color-action-primary-bg)" : "var(--color-border-subtle)",
329
- backgroundColor: L.scope === e ? "var(--color-bg-accentSubtle)" : void 0,
318
+ borderColor: B.scope === e ? "var(--color-action-primary-bg)" : "var(--color-border-subtle)",
319
+ backgroundColor: B.scope === e ? "var(--color-bg-accentSubtle)" : void 0,
330
320
  color: "var(--color-text-primary)"
331
321
  },
332
322
  "data-testid": `fleet-push-scope-${e}`,
333
- children: e === "DIRECT_COPIES" ? D("bigconsole.fleet.push.scopeDirect", "Direct copies") : D("bigconsole.fleet.push.scopeAll", "Copies of copies too")
323
+ children: e === "DIRECT_COPIES" ? k("bigconsole.fleet.push.scopeDirect", "Direct copies") : k("bigconsole.fleet.push.scopeAll", "Copies of copies too")
334
324
  }, e))
335
325
  }),
336
- /* @__PURE__ */ y(s, { result: L.result }),
337
- a(L.result) && /* @__PURE__ */ y("p", {
326
+ /* @__PURE__ */ b(u, { result: B.result }),
327
+ s(B.result) && /* @__PURE__ */ b("p", {
338
328
  style: {
339
329
  margin: 0,
340
330
  color: "var(--color-text-secondary)",
341
331
  fontSize: "var(--font-size-body-sm)"
342
332
  },
343
- children: D("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
333
+ children: k("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
344
334
  }),
345
- /* @__PURE__ */ b("div", {
335
+ /* @__PURE__ */ x("div", {
346
336
  className: "flex gap-2",
347
- children: [/* @__PURE__ */ b(g, {
348
- onClick: () => ee(L.scope),
349
- disabled: q || a(L.result),
337
+ children: [/* @__PURE__ */ x(_, {
338
+ onClick: () => ie(B.scope),
339
+ disabled: Q || s(B.result),
350
340
  "data-testid": "fleet-push-confirm",
351
- children: [q && /* @__PURE__ */ y(_, { style: {
341
+ children: [Q && /* @__PURE__ */ b(v, { style: {
352
342
  height: "var(--size-icon-sm)",
353
343
  width: "var(--size-icon-sm)"
354
- } }), D("bigconsole.fleet.push.confirm", "Push now")]
355
- }), /* @__PURE__ */ y(g, {
344
+ } }), k("bigconsole.fleet.push.confirm", "Push now")]
345
+ }), /* @__PURE__ */ b(_, {
356
346
  variant: "outline",
357
- onClick: () => R({ phase: "idle" }),
358
- disabled: q,
359
- children: D("bigconsole.fleet.link.cancel", "Cancel")
347
+ onClick: () => V({ phase: "idle" }),
348
+ disabled: Q,
349
+ children: k("bigconsole.fleet.link.cancel", "Cancel")
360
350
  })]
361
351
  })
362
352
  ]
363
353
  }),
364
- L.phase === "done" && /* @__PURE__ */ b("div", {
354
+ B.phase === "done" && /* @__PURE__ */ x("div", {
365
355
  className: "flex flex-col gap-form-gap rounded-input border p-3",
366
356
  style: { borderColor: "var(--color-border-subtle)" },
367
357
  "data-testid": "fleet-push-done",
368
358
  children: [
369
- /* @__PURE__ */ y("strong", {
359
+ /* @__PURE__ */ b("strong", {
370
360
  style: { color: "var(--color-text-primary)" },
371
- children: D("bigconsole.fleet.push.doneTitle", "Pushed")
361
+ children: k("bigconsole.fleet.push.doneTitle", "Pushed")
372
362
  }),
373
- /* @__PURE__ */ y(s, { result: L.result }),
374
- /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(g, {
363
+ /* @__PURE__ */ b(u, { result: B.result }),
364
+ /* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(_, {
375
365
  variant: "outline",
376
- onClick: () => R({ phase: "idle" }),
377
- children: D("bigconsole.fleet.push.done", "Done")
366
+ onClick: () => V({ phase: "idle" }),
367
+ children: k("bigconsole.fleet.push.done", "Done")
378
368
  }) })
379
369
  ]
380
370
  }),
381
- /* @__PURE__ */ y(o, {
382
- isOpen: z,
383
- masterName: w,
384
- busy: q,
385
- error: V,
386
- onClose: () => B(!1),
387
- onCreate: Q
371
+ /* @__PURE__ */ b(c, {
372
+ isOpen: H,
373
+ masterName: T,
374
+ busy: Q,
375
+ error: W,
376
+ onClose: () => U(!1),
377
+ onCreate: re
388
378
  })
389
379
  ]
390
380
  });
391
381
  });
392
- export { w as FleetChildrenPanel, w as default };
382
+ export { T as FleetChildrenPanel, T as default };
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { ActionLock } from '../../hooks/useOwnerBoundRun';
3
+ export interface FleetCopySectionProps {
4
+ dashboardId: string;
5
+ /** The board this one follows, when its name can be read. */
6
+ masterName: string | null;
7
+ /** Called after an action changed this board's widgets, so the canvas shows them without a reload. Awaited. */
8
+ onBoardChanged?: () => Promise<unknown> | void;
9
+ /** Shared with the master controls of the same panel, so one action holds the buttons of both. */
10
+ lock?: ActionLock;
11
+ }
12
+ export declare const FleetCopySection: FC<FleetCopySectionProps>;
13
+ export default FleetCopySection;