@burdenoff/microfe-bigconsole 2026.1124.8 → 2026.1124.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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Detaching the copies of a master one after another, for "Stop being a master" (BOFF-15410). A master cannot stop
3
+ * being one while copies follow it, and detaching a copy is the server's to allow (who may write that copy), so
4
+ * each is tried on its own: one that cannot be detached is reported and the others go on. The loop stops at once
5
+ * when the person has left the board it is acting for.
6
+ */
7
+ export interface DetachFailure {
8
+ id: string;
9
+ name: string;
10
+ message: string;
11
+ }
12
+ export interface DetachCopiesResult {
13
+ detached: string[];
14
+ failed: DetachFailure[];
15
+ /** The loop was cut short because the person left the board: the copies after it were not tried. */
16
+ stopped: boolean;
17
+ }
18
+ export declare function detachCopies(copies: ReadonlyArray<{
19
+ id: string;
20
+ name: string;
21
+ }>, detach: (id: string) => Promise<void>, stillHere: () => boolean): Promise<DetachCopiesResult>;
22
+ /**
23
+ * Whether it is worth asking the server to let the board stop being a master: every copy the panel knows was
24
+ * detached. Copies the panel cannot see are for the server to count, so they are not part of this.
25
+ */
26
+ export declare function canStopBeingMaster(result: DetachCopiesResult): boolean;
@@ -0,0 +1,28 @@
1
+ // src/bigconsole/utils/fleetDetachCopies.ts
2
+ async function e(e, t, n) {
3
+ let r = {
4
+ detached: [],
5
+ failed: [],
6
+ stopped: !1
7
+ };
8
+ for (let i of e) {
9
+ if (!n()) {
10
+ r.stopped = !0;
11
+ break;
12
+ }
13
+ try {
14
+ await t(i.id), r.detached.push(i.id);
15
+ } catch (e) {
16
+ r.failed.push({
17
+ id: i.id,
18
+ name: i.name,
19
+ message: e instanceof Error ? e.message : ""
20
+ });
21
+ }
22
+ }
23
+ return !r.stopped && !n() && (r.stopped = !0), r;
24
+ }
25
+ function t(e) {
26
+ return !e.stopped && e.failed.length === 0;
27
+ }
28
+ export { t as canStopBeingMaster, e as detachCopies };
@@ -0,0 +1,56 @@
1
+ import { FleetLink } from './fleetTree';
2
+ export interface DragBoardState {
3
+ /** The caller may edit boards. */
4
+ canUpdate: boolean;
5
+ /** The links are known: while they load, or when they failed to, whether a board follows one is not. */
6
+ linksReady: boolean;
7
+ /** A fleet action is running: a drop must not start a second one. */
8
+ busy: boolean;
9
+ /** The board's owner is asked to accept a link: the board answers it, it is not linked. */
10
+ awaitingAnswer: boolean;
11
+ }
12
+ /**
13
+ * A board can be picked up when the caller may edit it and nothing is running. That includes a board that already
14
+ * follows a master: dropping it answers where it stands instead of the drag being refused without a word.
15
+ */
16
+ export declare function canPickUp(board: DragBoardState): boolean;
17
+ /** What dropping a board on another comes to. */
18
+ export type DropOutcome =
19
+ /** It follows nothing: it can be linked (after asking). */
20
+ {
21
+ kind: 'link';
22
+ }
23
+ /** It already follows the board it was dropped on. */
24
+ | {
25
+ kind: 'alreadyFollowsTarget';
26
+ }
27
+ /** It has already asked to follow the board it was dropped on, and waits for its owner. */
28
+ | {
29
+ kind: 'pendingToTarget';
30
+ }
31
+ /** It follows another board (`masterId` is null when that board cannot be read): detach it first. */
32
+ | {
33
+ kind: 'followsOther';
34
+ masterId: string | null;
35
+ }
36
+ /** It has asked to follow another board and waits for its owner. */
37
+ | {
38
+ kind: 'pendingOther';
39
+ masterId: string | null;
40
+ };
41
+ /**
42
+ * What a drop of `dragged` on `targetId` does. A board follows at most one master, so a board that already follows
43
+ * or waits is not moved by a drop: it is told where it stands.
44
+ */
45
+ export declare function dropOutcome(dragged: {
46
+ id: string;
47
+ follows: {
48
+ active: boolean;
49
+ pending: boolean;
50
+ };
51
+ }, targetId: string, links: readonly FleetLink[]): DropOutcome;
52
+ /**
53
+ * Whether `draggedId` can be dropped on `targetId`: not on itself, and not on a board that follows it (directly
54
+ * or through others), which would make a loop.
55
+ */
56
+ export declare function canDropOn(draggedId: string, targetId: string, links: readonly FleetLink[]): boolean;
@@ -0,0 +1,26 @@
1
+ import { ancestorIds as e, descendantIds as t, pendingMasterId as n } from "./fleetTree.js";
2
+ // src/bigconsole/utils/fleetDrag.ts
3
+ function r(e) {
4
+ return e.canUpdate && e.linksReady && !e.busy && !e.awaitingAnswer;
5
+ }
6
+ function i(t, r, i) {
7
+ if (t.follows.active) {
8
+ let n = e(t.id, i).at(-1) ?? null;
9
+ return n === r ? { kind: "alreadyFollowsTarget" } : {
10
+ kind: "followsOther",
11
+ masterId: n
12
+ };
13
+ }
14
+ if (t.follows.pending) {
15
+ let e = n(t.id, i);
16
+ return e === r ? { kind: "pendingToTarget" } : {
17
+ kind: "pendingOther",
18
+ masterId: e
19
+ };
20
+ }
21
+ return { kind: "link" };
22
+ }
23
+ function a(e, n, r) {
24
+ return e !== n && !t(e, r).has(n);
25
+ }
26
+ export { a as canDropOn, r as canPickUp, i as dropOutcome };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1124.8",
3
+ "version": "2026.1124.10",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "repository": {
6
6
  "type": "git",