@burdenoff/microfe-bigconsole 2026.1124.2 → 2026.1124.4

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 (33) hide show
  1. package/dist/bigconsole/components/fleet/FleetBindingsDialog.d.ts +19 -0
  2. package/dist/bigconsole/components/fleet/FleetBindingsDialog.js +287 -0
  3. package/dist/bigconsole/components/fleet/FleetChildrenPanel.d.ts +8 -0
  4. package/dist/bigconsole/components/fleet/FleetChildrenPanel.js +185 -156
  5. package/dist/bigconsole/components/fleet/FleetCopySection.d.ts +5 -0
  6. package/dist/bigconsole/components/fleet/FleetCopySection.js +115 -118
  7. package/dist/bigconsole/components/fleet/FleetWidgetActions.d.ts +36 -0
  8. package/dist/bigconsole/components/fleet/FleetWidgetActions.js +82 -0
  9. package/dist/bigconsole/components/widgets/WidgetMenu.js +146 -96
  10. package/dist/bigconsole/hooks/useFleetBindingActions.d.ts +23 -0
  11. package/dist/bigconsole/hooks/useFleetBindingActions.js +50 -0
  12. package/dist/bigconsole/hooks/useFleetBindings.d.ts +19 -0
  13. package/dist/bigconsole/hooks/useFleetBindings.js +140 -0
  14. package/dist/bigconsole/hooks/useFleetConfirm.d.ts +7 -0
  15. package/dist/bigconsole/hooks/useFleetConfirm.js +17 -0
  16. package/dist/bigconsole/hooks/useFleetWidgetActions.d.ts +10 -0
  17. package/dist/bigconsole/hooks/useFleetWidgetActions.js +41 -0
  18. package/dist/bigconsole/hooks/useOwnerBoundRun.d.ts +13 -18
  19. package/dist/bigconsole/hooks/useOwnerBoundRun.js +45 -30
  20. package/dist/bigconsole/hooks/useWidgetOperations.js +2 -0
  21. package/dist/bigconsole/pages/DashboardViewPage.js +303 -291
  22. package/dist/bigconsole/types/index.d.ts +4 -0
  23. package/dist/bigconsole/utils/fleetBindings.d.ts +49 -0
  24. package/dist/bigconsole/utils/fleetBindings.js +52 -0
  25. package/dist/bigconsole/utils/fleetNotices.d.ts +12 -0
  26. package/dist/bigconsole/utils/fleetNotices.js +5 -0
  27. package/dist/bigconsole/utils/fleetWidgetMenu.d.ts +20 -0
  28. package/dist/bigconsole/utils/fleetWidgetMenu.js +13 -0
  29. package/dist/generated/wspace-operations.d.ts +163 -0
  30. package/dist/generated/wspace-operations.js +935 -122
  31. package/dist/generated/wspace-types.d.ts +395 -9
  32. package/dist/generated/wspace-types.js +12 -10
  33. package/package.json +1 -1
@@ -4,53 +4,61 @@ import t from "../../hooks/useWidgetOperations.js";
4
4
  import "../../hooks/index.js";
5
5
  import { useAsOf as n } from "../../asof/AsOfProvider.js";
6
6
  import "../../asof/index.js";
7
- import { BIGCONSOLE_PERMISSIONS as r } from "../../../constants/permissions.js";
8
- import { memo as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
9
- import { usePermissions as l } from "@burdenoff/fe-libs/shared/providers/shell";
10
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
11
- import { createPortal as p } from "react-dom";
7
+ import { useFleetWidgetMenu as r } from "../fleet/FleetWidgetActions.js";
8
+ import { fleetMenuOffers as i } from "../../utils/fleetWidgetMenu.js";
9
+ import { BIGCONSOLE_PERMISSIONS as a } from "../../../constants/permissions.js";
10
+ import { memo as o, useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
11
+ import { usePermissions as d } from "@burdenoff/fe-libs/shared/providers/shell";
12
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
13
+ import { createPortal as h } from "react-dom";
12
14
  // src/bigconsole/components/widgets/WidgetMenu.tsx
13
- var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onExportPNG: _, onSpotOutliers: v, onReconcile: y }) {
14
- let [b, x] = c(!1), [S, C] = c(!1), [w, T] = c({
15
+ var g = o(function({ widget: o, isEditMode: g, onRefresh: _, onExportCSV: v, onExportPNG: y, onSpotOutliers: b, onReconcile: x }) {
16
+ let [S, C] = u(!1), [w, T] = u(!1), [E, D] = u({
15
17
  top: 0,
16
18
  left: 0
17
- }), E = s(null), D = s(null), { hasPermission: O } = l(), k = O(r.WIDGET_UPDATE), A = O(r.WIDGET_CREATE), j = O(r.WIDGET_DELETE), M = e((e) => e.selectWidget), N = e((e) => e.copyWidget), P = e((e) => e.cutWidget), F = e((e) => e.removeWidget), I = e((e) => e.openConfigPanel), { asOf: L } = n(), { duplicateWidget: R, deleteWidget: z, refreshWidgetData: B } = t(i.pageId, i.dashboardId, { skipFetch: !0 });
18
- o(() => {
19
+ }), O = l(null), k = l(null), { hasPermission: A } = d(), j = A(a.WIDGET_UPDATE), M = A(a.WIDGET_CREATE), N = A(a.WIDGET_DELETE), P = e((e) => e.selectWidget), F = e((e) => e.copyWidget), I = e((e) => e.cutWidget), L = e((e) => e.removeWidget), R = e((e) => e.openConfigPanel), { asOf: z } = n(), B = r(), V = B ? i(o, {
20
+ isActiveCopy: B.isActiveCopy,
21
+ inPastView: !!z
22
+ }) : {
23
+ restore: !1,
24
+ promote: !1
25
+ }, { duplicateWidget: H, deleteWidget: U, refreshWidgetData: W } = t(o.pageId, o.dashboardId, { skipFetch: !0 });
26
+ c(() => {
19
27
  let e = (e) => {
20
- E.current && !E.current.contains(e.target) && D.current && !D.current.contains(e.target) && x(!1);
28
+ O.current && !O.current.contains(e.target) && k.current && !k.current.contains(e.target) && C(!1);
21
29
  };
22
- return b && document.addEventListener("mousedown", e), () => {
30
+ return S && document.addEventListener("mousedown", e), () => {
23
31
  document.removeEventListener("mousedown", e);
24
32
  };
25
- }, [b]), o(() => {
33
+ }, [S]), c(() => {
26
34
  let e = (e) => {
27
- e.key === "Escape" && (x(!1), D.current?.focus());
35
+ e.key === "Escape" && (C(!1), k.current?.focus());
28
36
  };
29
- return b && document.addEventListener("keydown", e), () => {
37
+ return S && document.addEventListener("keydown", e), () => {
30
38
  document.removeEventListener("keydown", e);
31
39
  };
32
- }, [b]);
33
- let V = a((e) => {
34
- e.stopPropagation(), x((e) => {
35
- if (!e && D.current) {
36
- let e = D.current.getBoundingClientRect(), t = e.bottom + 4, n = e.right - 160;
37
- n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 320 > window.innerHeight - 10 && (t = e.top - 320 - 4, t < 10 && (t = 10)), T({
40
+ }, [S]);
41
+ let G = s((e) => {
42
+ e.stopPropagation(), C((e) => {
43
+ if (!e && k.current) {
44
+ let e = k.current.getBoundingClientRect(), t = e.bottom + 4, n = e.right - 160;
45
+ n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 380 > window.innerHeight - 10 && (t = e.top - 380 - 4, t < 10 && (t = 10)), D({
38
46
  top: t + window.scrollY,
39
47
  left: n + window.scrollX
40
48
  });
41
49
  }
42
50
  return !e;
43
51
  });
44
- }, []), H = [
52
+ }, []), K = [
45
53
  {
46
54
  id: "edit",
47
55
  label: "Edit Widget",
48
- icon: /* @__PURE__ */ d("svg", {
56
+ icon: /* @__PURE__ */ p("svg", {
49
57
  fill: "none",
50
58
  stroke: "currentColor",
51
59
  viewBox: "0 0 24 24",
52
60
  className: "w-4 h-4",
53
- children: /* @__PURE__ */ d("path", {
61
+ children: /* @__PURE__ */ p("path", {
54
62
  strokeLinecap: "round",
55
63
  strokeLinejoin: "round",
56
64
  strokeWidth: 2,
@@ -58,20 +66,20 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
58
66
  })
59
67
  }),
60
68
  action: () => {
61
- M(i.id), I(), x(!1);
69
+ P(o.id), R(), C(!1);
62
70
  },
63
- disabled: !m,
64
- permitted: k
71
+ disabled: !g,
72
+ permitted: j
65
73
  },
66
74
  {
67
75
  id: "refresh",
68
76
  label: "Refresh Data",
69
- icon: /* @__PURE__ */ d("svg", {
77
+ icon: /* @__PURE__ */ p("svg", {
70
78
  fill: "none",
71
79
  stroke: "currentColor",
72
80
  viewBox: "0 0 24 24",
73
81
  className: "w-4 h-4",
74
- children: /* @__PURE__ */ d("path", {
82
+ children: /* @__PURE__ */ p("path", {
75
83
  strokeLinecap: "round",
76
84
  strokeLinejoin: "round",
77
85
  strokeWidth: 2,
@@ -79,19 +87,19 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
79
87
  })
80
88
  }),
81
89
  action: async () => {
82
- x(!1), L || (h ? h() : await B(i.id));
90
+ C(!1), z || (_ ? _() : await W(o.id));
83
91
  },
84
- disabled: !!L
92
+ disabled: !!z
85
93
  },
86
94
  {
87
95
  id: "spotOutliers",
88
96
  label: "Spot outliers",
89
- icon: /* @__PURE__ */ d("svg", {
97
+ icon: /* @__PURE__ */ p("svg", {
90
98
  fill: "none",
91
99
  stroke: "currentColor",
92
100
  viewBox: "0 0 24 24",
93
101
  className: "w-4 h-4",
94
- children: /* @__PURE__ */ d("path", {
102
+ children: /* @__PURE__ */ p("path", {
95
103
  strokeLinecap: "round",
96
104
  strokeLinejoin: "round",
97
105
  strokeWidth: 2,
@@ -99,19 +107,19 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
99
107
  })
100
108
  }),
101
109
  action: () => {
102
- x(!1), v?.();
110
+ C(!1), b?.();
103
111
  },
104
- disabled: !v
112
+ disabled: !b
105
113
  },
106
- ...y ? [{
114
+ ...x ? [{
107
115
  id: "reconcile",
108
116
  label: "Reconcile",
109
- icon: /* @__PURE__ */ d("svg", {
117
+ icon: /* @__PURE__ */ p("svg", {
110
118
  fill: "none",
111
119
  stroke: "currentColor",
112
120
  viewBox: "0 0 24 24",
113
121
  className: "w-4 h-4",
114
- children: /* @__PURE__ */ d("path", {
122
+ children: /* @__PURE__ */ p("path", {
115
123
  strokeLinecap: "round",
116
124
  strokeLinejoin: "round",
117
125
  strokeWidth: 2,
@@ -119,18 +127,18 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
119
127
  })
120
128
  }),
121
129
  action: () => {
122
- x(!1), y();
130
+ C(!1), x();
123
131
  }
124
132
  }] : [],
125
133
  {
126
134
  id: "exportCSV",
127
135
  label: "Export CSV",
128
- icon: /* @__PURE__ */ d("svg", {
136
+ icon: /* @__PURE__ */ p("svg", {
129
137
  fill: "none",
130
138
  stroke: "currentColor",
131
139
  viewBox: "0 0 24 24",
132
140
  className: "w-4 h-4",
133
- children: /* @__PURE__ */ d("path", {
141
+ children: /* @__PURE__ */ p("path", {
134
142
  strokeLinecap: "round",
135
143
  strokeLinejoin: "round",
136
144
  strokeWidth: 2,
@@ -138,19 +146,19 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
138
146
  })
139
147
  }),
140
148
  action: () => {
141
- x(!1), g?.();
149
+ C(!1), v?.();
142
150
  },
143
- disabled: !g
151
+ disabled: !v
144
152
  },
145
153
  {
146
154
  id: "exportPNG",
147
155
  label: "Export PNG",
148
- icon: /* @__PURE__ */ d("svg", {
156
+ icon: /* @__PURE__ */ p("svg", {
149
157
  fill: "none",
150
158
  stroke: "currentColor",
151
159
  viewBox: "0 0 24 24",
152
160
  className: "w-4 h-4",
153
- children: /* @__PURE__ */ d("path", {
161
+ children: /* @__PURE__ */ p("path", {
154
162
  strokeLinecap: "round",
155
163
  strokeLinejoin: "round",
156
164
  strokeWidth: 2,
@@ -158,26 +166,26 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
158
166
  })
159
167
  }),
160
168
  action: () => {
161
- x(!1), _?.();
169
+ C(!1), y?.();
162
170
  },
163
- disabled: !_
171
+ disabled: !y
164
172
  },
165
173
  {
166
174
  id: "divider1",
167
175
  label: "",
168
- icon: /* @__PURE__ */ d(u, {}),
176
+ icon: /* @__PURE__ */ p(f, {}),
169
177
  action: () => {},
170
178
  divider: !0
171
179
  },
172
180
  {
173
181
  id: "copy",
174
182
  label: "Copy",
175
- icon: /* @__PURE__ */ d("svg", {
183
+ icon: /* @__PURE__ */ p("svg", {
176
184
  fill: "none",
177
185
  stroke: "currentColor",
178
186
  viewBox: "0 0 24 24",
179
187
  className: "w-4 h-4",
180
- children: /* @__PURE__ */ d("path", {
188
+ children: /* @__PURE__ */ p("path", {
181
189
  strokeLinecap: "round",
182
190
  strokeLinejoin: "round",
183
191
  strokeWidth: 2,
@@ -185,20 +193,20 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
185
193
  })
186
194
  }),
187
195
  action: () => {
188
- N(i.id), x(!1);
196
+ F(o.id), C(!1);
189
197
  },
190
- disabled: !m,
191
- permitted: A
198
+ disabled: !g,
199
+ permitted: M
192
200
  },
193
201
  {
194
202
  id: "cut",
195
203
  label: "Cut",
196
- icon: /* @__PURE__ */ d("svg", {
204
+ icon: /* @__PURE__ */ p("svg", {
197
205
  fill: "none",
198
206
  stroke: "currentColor",
199
207
  viewBox: "0 0 24 24",
200
208
  className: "w-4 h-4",
201
- children: /* @__PURE__ */ d("path", {
209
+ children: /* @__PURE__ */ p("path", {
202
210
  strokeLinecap: "round",
203
211
  strokeLinejoin: "round",
204
212
  strokeWidth: 2,
@@ -206,20 +214,20 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
206
214
  })
207
215
  }),
208
216
  action: () => {
209
- P(i.id), x(!1);
217
+ I(o.id), C(!1);
210
218
  },
211
- disabled: !m,
212
- permitted: A && k
219
+ disabled: !g,
220
+ permitted: M && j
213
221
  },
214
222
  {
215
223
  id: "duplicate",
216
224
  label: "Duplicate",
217
- icon: /* @__PURE__ */ d("svg", {
225
+ icon: /* @__PURE__ */ p("svg", {
218
226
  fill: "none",
219
227
  stroke: "currentColor",
220
228
  viewBox: "0 0 24 24",
221
229
  className: "w-4 h-4",
222
- children: /* @__PURE__ */ d("path", {
230
+ children: /* @__PURE__ */ p("path", {
223
231
  strokeLinecap: "round",
224
232
  strokeLinejoin: "round",
225
233
  strokeWidth: 2,
@@ -227,34 +235,76 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
227
235
  })
228
236
  }),
229
237
  action: async () => {
230
- x(!1);
238
+ C(!1);
231
239
  let e = {
232
- x: (i.positionX ?? 0) + 1,
233
- y: (i.positionY ?? 0) + 1,
234
- width: i.positionWidth ?? 4,
235
- height: i.positionHeight ?? 4
240
+ x: (o.positionX ?? 0) + 1,
241
+ y: (o.positionY ?? 0) + 1,
242
+ width: o.positionWidth ?? 4,
243
+ height: o.positionHeight ?? 4
236
244
  };
237
- await R(i.id, e, `${i.title} (Copy)`);
245
+ await H(o.id, e, `${o.title} (Copy)`);
238
246
  },
239
- disabled: !m,
240
- permitted: A
247
+ disabled: !g,
248
+ permitted: M
241
249
  },
250
+ ...B && V.restore ? [{
251
+ id: "fleetRestore",
252
+ label: B.labels.restore,
253
+ icon: /* @__PURE__ */ p("svg", {
254
+ fill: "none",
255
+ stroke: "currentColor",
256
+ viewBox: "0 0 24 24",
257
+ className: "w-4 h-4",
258
+ children: /* @__PURE__ */ p("path", {
259
+ strokeLinecap: "round",
260
+ strokeLinejoin: "round",
261
+ strokeWidth: 2,
262
+ d: "M3 10h10a5 5 0 010 10H9M3 10l4-4m-4 4l4 4"
263
+ })
264
+ }),
265
+ action: () => {
266
+ C(!1), B.restore(o);
267
+ },
268
+ disabled: B.busy,
269
+ permitted: j
270
+ }] : [],
271
+ ...B && V.promote ? [{
272
+ id: "fleetPromote",
273
+ label: B.labels.promote,
274
+ icon: /* @__PURE__ */ p("svg", {
275
+ fill: "none",
276
+ stroke: "currentColor",
277
+ viewBox: "0 0 24 24",
278
+ className: "w-4 h-4",
279
+ children: /* @__PURE__ */ p("path", {
280
+ strokeLinecap: "round",
281
+ strokeLinejoin: "round",
282
+ strokeWidth: 2,
283
+ d: "M5 15l7-7 7 7M12 8v13"
284
+ })
285
+ }),
286
+ action: () => {
287
+ C(!1), B.promote(o);
288
+ },
289
+ disabled: B.busy,
290
+ permitted: j
291
+ }] : [],
242
292
  {
243
293
  id: "divider2",
244
294
  label: "",
245
- icon: /* @__PURE__ */ d(u, {}),
295
+ icon: /* @__PURE__ */ p(f, {}),
246
296
  action: () => {},
247
297
  divider: !0
248
298
  },
249
299
  {
250
300
  id: "delete",
251
301
  label: "Delete",
252
- icon: /* @__PURE__ */ d("svg", {
302
+ icon: /* @__PURE__ */ p("svg", {
253
303
  fill: "none",
254
304
  stroke: "currentColor",
255
305
  viewBox: "0 0 24 24",
256
306
  className: "w-4 h-4",
257
- children: /* @__PURE__ */ d("path", {
307
+ children: /* @__PURE__ */ p("path", {
258
308
  strokeLinecap: "round",
259
309
  strokeLinejoin: "round",
260
310
  strokeWidth: 2,
@@ -263,58 +313,58 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
263
313
  }),
264
314
  action: async () => {
265
315
  if (window.confirm("Are you sure you want to delete this widget?")) {
266
- x(!1);
267
- let e = await z(i.id);
268
- i.savedQueryId ? C(!e) : e || F(i.id);
269
- } else x(!1);
316
+ C(!1);
317
+ let e = await U(o.id);
318
+ o.savedQueryId ? T(!e) : e || L(o.id);
319
+ } else C(!1);
270
320
  },
271
- disabled: !m,
321
+ disabled: !g,
272
322
  destructive: !0,
273
- permitted: j
323
+ permitted: N
274
324
  }
275
- ].filter((e) => e.permitted !== !1 && (!i.savedQueryId || m && e.id === "delete")), U = H.filter((e, t) => {
325
+ ].filter((e) => e.permitted !== !1 && (!o.savedQueryId || g && e.id === "delete" || e.id === "fleetRestore" || e.id === "fleetPromote")), q = K.filter((e, t) => {
276
326
  if (!e.divider) return !0;
277
- let n = H[t - 1], r = H[t + 1];
327
+ let n = K[t - 1], r = K[t + 1];
278
328
  return n !== void 0 && r !== void 0 && !n.divider && !r.divider;
279
329
  });
280
- return U.length ? /* @__PURE__ */ f("div", {
330
+ return q.length ? /* @__PURE__ */ m("div", {
281
331
  className: "relative",
282
332
  children: [
283
- S && /* @__PURE__ */ d("span", {
333
+ w && /* @__PURE__ */ p("span", {
284
334
  role: "alert",
285
335
  children: "Could not delete this widget."
286
336
  }),
287
- /* @__PURE__ */ d("button", {
288
- ref: D,
337
+ /* @__PURE__ */ p("button", {
338
+ ref: k,
289
339
  type: "button",
290
- onClick: V,
340
+ onClick: G,
291
341
  className: `
292
342
  p-1.5 rounded-md
293
343
  text-text-secondary
294
344
  hover:text-text-primary
295
345
  hover:bg-bg-sunken
296
346
  transition-colors
297
- ${b ? "bg-bg-sunken" : ""}
347
+ ${S ? "bg-bg-sunken" : ""}
298
348
  `,
299
349
  title: "Widget options",
300
350
  "aria-haspopup": "menu",
301
- "aria-expanded": b,
302
- children: /* @__PURE__ */ f("svg", {
351
+ "aria-expanded": S,
352
+ children: /* @__PURE__ */ m("svg", {
303
353
  className: "w-4 h-4",
304
354
  fill: "currentColor",
305
355
  viewBox: "0 0 24 24",
306
356
  children: [
307
- /* @__PURE__ */ d("circle", {
357
+ /* @__PURE__ */ p("circle", {
308
358
  cx: "12",
309
359
  cy: "5",
310
360
  r: "2"
311
361
  }),
312
- /* @__PURE__ */ d("circle", {
362
+ /* @__PURE__ */ p("circle", {
313
363
  cx: "12",
314
364
  cy: "12",
315
365
  r: "2"
316
366
  }),
317
- /* @__PURE__ */ d("circle", {
367
+ /* @__PURE__ */ p("circle", {
318
368
  cx: "12",
319
369
  cy: "19",
320
370
  r: "2"
@@ -322,18 +372,18 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
322
372
  ]
323
373
  })
324
374
  }),
325
- b && p(/* @__PURE__ */ d("div", {
326
- ref: E,
375
+ S && h(/* @__PURE__ */ p("div", {
376
+ ref: O,
327
377
  style: {
328
378
  position: "fixed",
329
- top: w.top,
330
- left: w.left,
379
+ top: E.top,
380
+ left: E.left,
331
381
  zIndex: 99999
332
382
  },
333
383
  className: "\n min-w-[160px]\n py-1\n bg-bg-surface\n border border-border-default\n rounded-lg shadow-lg\n ",
334
384
  role: "menu",
335
385
  "aria-orientation": "vertical",
336
- children: U.map((e) => e.divider ? /* @__PURE__ */ d("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ f("button", {
386
+ children: q.map((e) => e.divider ? /* @__PURE__ */ p("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ m("button", {
337
387
  type: "button",
338
388
  onClick: (t) => {
339
389
  t.stopPropagation(), e.action();
@@ -347,10 +397,10 @@ var m = i(function({ widget: i, isEditMode: m, onRefresh: h, onExportCSV: g, onE
347
397
  ${e.destructive ? "text-status-error-text hover:text-status-error-text" : "text-text-primary"}
348
398
  `,
349
399
  role: "menuitem",
350
- children: [e.icon, /* @__PURE__ */ d("span", { children: e.label })]
400
+ children: [e.icon, /* @__PURE__ */ p("span", { children: e.label })]
351
401
  }, e.id))
352
402
  }), document.body)
353
403
  ]
354
404
  }) : null;
355
405
  });
356
- export { m as WidgetMenu, m as default };
406
+ export { g as WidgetMenu, g as default };
@@ -0,0 +1,23 @@
1
+ import { BindingsInput } from '../utils/fleetBindings';
2
+ export type BindingCopyState = 'APPLIED' | 'UNCHANGED' | 'INCOMPATIBLE';
3
+ export interface BindingCopyResult {
4
+ dashboardId: string;
5
+ name: string | null;
6
+ state: BindingCopyState;
7
+ reasonCode: string | null;
8
+ reason: string | null;
9
+ widgetsRebound: number;
10
+ widgetsKeptLocal: number;
11
+ }
12
+ export interface BindingResult {
13
+ preview: boolean;
14
+ appliedCount: number;
15
+ copies: BindingCopyResult[];
16
+ }
17
+ interface UseFleetBindingActionsResult {
18
+ busy: boolean;
19
+ preview: (input: BindingsInput) => Promise<BindingResult>;
20
+ apply: (input: BindingsInput) => Promise<BindingResult>;
21
+ }
22
+ export declare function useFleetBindingActions(): UseFleetBindingActionsResult;
23
+ export {};
@@ -0,0 +1,50 @@
1
+ import { PreviewCopyBindingsDocument as e, SetCopyBindingsDocument as t } from "../../generated/wspace-operations.js";
2
+ import { useCallback as n, useState as r } from "react";
3
+ import { useApolloClient as i } from "@apollo/client/react";
4
+ // src/bigconsole/hooks/useFleetBindingActions.ts
5
+ var a = (e) => e === "APPLIED" ? "APPLIED" : e === "UNCHANGED" ? "UNCHANGED" : "INCOMPATIBLE", o = (e) => ({
6
+ preview: e.preview,
7
+ appliedCount: e.appliedCount,
8
+ copies: e.copies.map((e) => ({
9
+ dashboardId: e.dashboardId,
10
+ name: e.name ?? null,
11
+ state: a(e.state),
12
+ reasonCode: e.reasonCode ?? null,
13
+ reason: e.reason ?? null,
14
+ widgetsRebound: e.widgetsRebound,
15
+ widgetsKeptLocal: e.widgetsKeptLocal
16
+ }))
17
+ });
18
+ function s() {
19
+ let a = i(), [s, c] = r(!1), l = n(async (e) => {
20
+ c(!0);
21
+ try {
22
+ return await e();
23
+ } finally {
24
+ c(!1);
25
+ }
26
+ }, []);
27
+ return {
28
+ busy: s,
29
+ preview: n((t) => l(async () => {
30
+ let n = (await a.query({
31
+ query: e,
32
+ variables: { input: t },
33
+ fetchPolicy: "no-cache",
34
+ errorPolicy: "none"
35
+ })).data?.previewCopyBindings;
36
+ if (!n) throw Error("The preview could not be made.");
37
+ return o(n);
38
+ }), [a, l]),
39
+ apply: n((e) => l(async () => {
40
+ let n = (await a.mutate({
41
+ mutation: t,
42
+ variables: { input: e },
43
+ errorPolicy: "none"
44
+ })).data?.setCopyBindings;
45
+ if (!n) throw Error("The data sources could not be changed.");
46
+ return o(n);
47
+ }), [a, l])
48
+ };
49
+ }
50
+ export { s as useFleetBindingActions };
@@ -0,0 +1,19 @@
1
+ import { CopyBinding, MasterSources } from '../utils/fleetBindings';
2
+ export interface SinkChoice {
3
+ id: string;
4
+ name: string;
5
+ isActive: boolean;
6
+ }
7
+ /** One request for up to COPIES_PER_REQUEST copies: each is an alias of the same field. */
8
+ export declare const bindingsBatchDocument: (count: number) => import('graphql').DocumentNode;
9
+ interface UseFleetBindingsResult {
10
+ loading: boolean;
11
+ error: Error | null;
12
+ master: MasterSources;
13
+ sinks: ReadonlyMap<string, SinkChoice>;
14
+ sinksTruncated: boolean;
15
+ bindings: ReadonlyMap<string, readonly CopyBinding[]>;
16
+ refetch: () => Promise<void>;
17
+ }
18
+ export declare function useFleetBindings(masterId: string, copyIds: readonly string[], enabled: boolean): UseFleetBindingsResult;
19
+ export {};