@burdenoff/microfe-bigconsole 2026.1124.4 → 2026.1124.6

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,82 +1,87 @@
1
- import { useBigConsole as e } from "../../context/BigConsoleContext.js";
2
- import { useTr as t } from "../../../shared/hooks/useTr.js";
1
+ import { useTr as e } from "../../../shared/hooks/useTr.js";
2
+ import { useBigConsole as t } from "../../context/BigConsoleContext.js";
3
3
  import "../../context/index.js";
4
4
  import { useFleetConfirm as n } from "../../hooks/useFleetConfirm.js";
5
5
  import { useFleetWidgetActions as r } from "../../hooks/useFleetWidgetActions.js";
6
6
  import { useOwnerBoundRun as i } from "../../hooks/useOwnerBoundRun.js";
7
- import { restoreNoticeText as a } from "../../utils/fleetNotices.js";
8
- import { createContext as o, useCallback as s, useContext as c, useLayoutEffect as l, useMemo as u, useRef as d } from "react";
9
- import { jsx as f } from "react/jsx-runtime";
10
- import { toast as p } from "sonner";
7
+ import { graphQLErrorDetails as a } from "../../utils/backendError.js";
8
+ import { restoreNoticeText as o } from "../../utils/fleetNotices.js";
9
+ import { createContext as s, useCallback as c, useContext as l, useLayoutEffect as u, useMemo as d, useRef as f } from "react";
10
+ import { jsx as p } from "react/jsx-runtime";
11
+ import { toast as m } from "sonner";
11
12
  // src/bigconsole/components/fleet/FleetWidgetActions.tsx
12
- var m = o(null);
13
- function h() {
14
- return c(m);
13
+ var h = s(null);
14
+ function g() {
15
+ return l(h);
15
16
  }
16
- var g = (e, t) => e instanceof Error && e.message ? e.message : t, _ = () => {}, v = ({ dashboardId: o, isActiveCopy: c, masterName: h, lock: v, onBoardChanged: y, onChanged: b, children: x }) => {
17
- let S = t(), { workspaceId: C, currentUser: w } = e(), T = `${C ?? ""}:${w?.id ?? ""}:${o}`, E = r(), D = n(), O = d(c);
18
- l(() => {
19
- O.current = c;
20
- }, [c]);
21
- let k = s(async () => {
22
- await y?.(), b?.();
23
- }, [y, b]), { acting: A, begin: j, run: M } = i(T, k, _, v), N = A || E.busy, P = s((e) => {
24
- for (let t of e) p.warning(a(S, t));
25
- }, [S]), F = s(async (e) => {
26
- if (N) return;
27
- let t = j();
28
- await D(S("bigconsole.fleet.widget.restoreTitle", "Restore to the master's version?"), S("bigconsole.fleet.widget.restoreConfirm", "\"{{title}}\" goes back to the master's version. Your changes to it are lost. Where it sits on the board is kept.", { title: e.title }), S("bigconsole.fleet.widget.restoreOk", "Restore")) && t() && O.current && await M(() => E.restoreWidget(e.id), (t) => {
29
- p.success(S("bigconsole.fleet.widget.restored", "\"{{title}}\" is back to the master's version.", { title: e.title })), P(t);
30
- }, (e) => p.error(g(e, S("bigconsole.fleet.error.widgetRestore", "The widget could not be restored."))));
17
+ var _ = (e, t) => e instanceof Error && e.message ? e.message : t, v = () => {}, y = ({ dashboardId: s, isActiveCopy: l, masterName: g, lock: y, onBoardChanged: b, onChanged: x, children: S }) => {
18
+ let C = e(), { workspaceId: w, currentUser: T } = t(), E = `${w ?? ""}:${T?.id ?? ""}:${s}`, D = r(), O = n(), k = f(l);
19
+ u(() => {
20
+ k.current = l;
21
+ }, [l]);
22
+ let A = c(async () => {
23
+ await b?.(), x?.();
24
+ }, [b, x]), { acting: j, begin: M, run: N } = i(E, A, v, y), P = j || D.busy, F = c((e) => {
25
+ for (let t of e) m.warning(o(C, t));
26
+ }, [C]), I = c((e, t) => {
27
+ a(e).length > 0 || m.error(_(e, t));
28
+ }, []), L = c(async (e) => {
29
+ if (P) return;
30
+ let t = M();
31
+ await O(C("bigconsole.fleet.widget.restoreTitle", "Restore to the master's version?"), C("bigconsole.fleet.widget.restoreConfirm", "\"{{title}}\" goes back to the master's version. Your changes to it are lost. Where it sits on the board is kept.", { title: e.title }), C("bigconsole.fleet.widget.restoreOk", "Restore")) && t() && k.current && await N(() => D.restoreWidget(e.id), (t) => {
32
+ m.success(C("bigconsole.fleet.widget.restored", "\"{{title}}\" is back to the master's version.", { title: e.title })), F(t);
33
+ }, (e) => I(e, C("bigconsole.fleet.error.widgetRestore", "The widget could not be restored.")));
31
34
  }, [
32
- E,
33
- j,
34
- N,
35
35
  D,
36
36
  M,
37
37
  P,
38
- S
39
- ]), I = s(async (e) => {
40
- if (N) return;
41
- let t = j(), n = h ? `"${h}"` : S("bigconsole.fleet.widget.theMaster", "the master");
42
- await D(S("bigconsole.fleet.widget.promoteTitle", "Promote to the master?"), S("bigconsole.fleet.widget.promoteConfirm", "\"{{title}}\" is added to {{master}}, and this board's widget follows it from now on. The master's other copies get it with the next push.", {
38
+ O,
39
+ N,
40
+ I,
41
+ F,
42
+ C
43
+ ]), R = c(async (e) => {
44
+ if (P) return;
45
+ let t = M(), n = g ? `"${g}"` : C("bigconsole.fleet.widget.theMaster", "the master");
46
+ await O(C("bigconsole.fleet.widget.promoteTitle", "Promote to the master?"), C("bigconsole.fleet.widget.promoteConfirm", "\"{{title}}\" is added to {{master}}, and this board's widget follows it from now on. The master's other copies get it with the next push.", {
43
47
  title: e.title,
44
48
  master: n
45
- }), S("bigconsole.fleet.widget.promoteOk", "Promote")) && t() && O.current && await M(() => E.promoteWidget(e.id), (t) => {
46
- p.success(S("bigconsole.fleet.widget.promoted", "\"{{title}}\" is now on {{master}}.", {
49
+ }), C("bigconsole.fleet.widget.promoteOk", "Promote")) && t() && k.current && await N(() => D.promoteWidget(e.id), (t) => {
50
+ m.success(C("bigconsole.fleet.widget.promoted", "\"{{title}}\" is now on {{master}}.", {
47
51
  title: e.title,
48
52
  master: n
49
- })), P(t);
50
- }, (e) => p.error(g(e, S("bigconsole.fleet.error.widgetPromote", "The widget could not be promoted."))));
53
+ })), F(t);
54
+ }, (e) => I(e, C("bigconsole.fleet.error.widgetPromote", "The widget could not be promoted.")));
51
55
  }, [
52
- E,
53
- j,
54
- N,
55
56
  D,
56
- h,
57
57
  M,
58
58
  P,
59
- S
60
- ]), L = S("bigconsole.fleet.widget.restore", "Restore to master's version"), R = S("bigconsole.fleet.widget.promote", "Promote to master"), z = u(() => ({
61
- isActiveCopy: c,
62
- busy: N,
59
+ O,
60
+ g,
61
+ N,
62
+ I,
63
+ F,
64
+ C
65
+ ]), z = C("bigconsole.fleet.widget.restore", "Restore to master's version"), B = C("bigconsole.fleet.widget.promote", "Promote to master"), V = d(() => ({
66
+ isActiveCopy: l,
67
+ busy: P,
63
68
  labels: {
64
- restore: L,
65
- promote: R
69
+ restore: z,
70
+ promote: B
66
71
  },
67
- restore: F,
68
- promote: I
72
+ restore: L,
73
+ promote: R
69
74
  }), [
70
- c,
71
- N,
75
+ l,
76
+ P,
77
+ z,
78
+ B,
72
79
  L,
73
- R,
74
- F,
75
- I
80
+ R
76
81
  ]);
77
- return /* @__PURE__ */ f(m.Provider, {
78
- value: z,
79
- children: x
82
+ return /* @__PURE__ */ p(h.Provider, {
83
+ value: V,
84
+ children: S
80
85
  });
81
86
  };
82
- export { v as FleetWidgetActionsProvider, h as useFleetWidgetMenu };
87
+ export { y as FleetWidgetActionsProvider, g as useFleetWidgetMenu };