@burdenoff/microfe-bigconsole 2026.1124.9 → 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.
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.js +1 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.d.ts +4 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.js +49 -35
- package/dist/bigconsole/components/fleet/FleetChildrenPanel.js +270 -186
- package/dist/bigconsole/hooks/useBoardDragLink.d.ts +2 -0
- package/dist/bigconsole/hooks/useBoardDragLink.js +9 -9
- package/dist/bigconsole/pages/DashboardsPage.js +422 -364
- package/dist/bigconsole/utils/fleetDetachCopies.d.ts +26 -0
- package/dist/bigconsole/utils/fleetDetachCopies.js +28 -0
- package/dist/bigconsole/utils/fleetDrag.d.ts +39 -3
- package/dist/bigconsole/utils/fleetDrag.js +23 -6
- package/package.json +1 -1
|
@@ -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 };
|
|
@@ -6,13 +6,49 @@ export interface DragBoardState {
|
|
|
6
6
|
linksReady: boolean;
|
|
7
7
|
/** A fleet action is running: a drop must not start a second one. */
|
|
8
8
|
busy: boolean;
|
|
9
|
-
/** The board follows a master, or has asked to. */
|
|
10
|
-
follows: boolean;
|
|
11
9
|
/** The board's owner is asked to accept a link: the board answers it, it is not linked. */
|
|
12
10
|
awaitingAnswer: boolean;
|
|
13
11
|
}
|
|
14
|
-
/**
|
|
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
|
+
*/
|
|
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;
|
|
16
52
|
/**
|
|
17
53
|
* Whether `draggedId` can be dropped on `targetId`: not on itself, and not on a board that follows it (directly
|
|
18
54
|
* or through others), which would make a loop.
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ancestorIds as e, descendantIds as t, pendingMasterId as n } from "./fleetTree.js";
|
|
2
2
|
// src/bigconsole/utils/fleetDrag.ts
|
|
3
|
-
function
|
|
4
|
-
return e.canUpdate && e.linksReady && !e.busy && !e.
|
|
3
|
+
function r(e) {
|
|
4
|
+
return e.canUpdate && e.linksReady && !e.busy && !e.awaitingAnswer;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
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" };
|
|
8
22
|
}
|
|
9
|
-
|
|
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 };
|