@biolibs/bionet-panels 0.1.0 → 0.3.0
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/README.md +46 -0
- package/dist/backup.d.ts +10 -0
- package/dist/backup.d.ts.map +1 -0
- package/dist/backup.js +50 -0
- package/dist/backup.js.map +1 -0
- package/dist/freezer.d.ts.map +1 -1
- package/dist/freezer.js +4 -2
- package/dist/freezer.js.map +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +12 -0
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +1 -0
- package/dist/parts.js.map +1 -1
- package/dist/people.d.ts.map +1 -1
- package/dist/people.js +3 -1
- package/dist/people.js.map +1 -1
- package/dist/places.d.ts +41 -0
- package/dist/places.d.ts.map +1 -0
- package/dist/places.js +96 -0
- package/dist/places.js.map +1 -0
- package/dist/public.d.ts +77 -0
- package/dist/public.d.ts.map +1 -0
- package/dist/public.js +73 -0
- package/dist/public.js.map +1 -0
- package/dist/sharing.d.ts.map +1 -1
- package/dist/sharing.js +1 -0
- package/dist/sharing.js.map +1 -1
- package/dist/window.d.ts +29 -6
- package/dist/window.d.ts.map +1 -1
- package/dist/window.js +19 -10
- package/dist/window.js.map +1 -1
- package/package.json +6 -4
- package/panels.css +13 -0
- package/src/backup.tsx +72 -0
- package/src/freezer.tsx +5 -1
- package/src/history.tsx +14 -1
- package/src/index.ts +7 -0
- package/src/parts.tsx +2 -0
- package/src/people.tsx +4 -0
- package/src/places.tsx +170 -0
- package/src/public.tsx +175 -0
- package/src/sharing.tsx +2 -0
- package/src/window.tsx +34 -10
package/README.md
CHANGED
|
@@ -46,6 +46,52 @@ used on its own inside one:
|
|
|
46
46
|
|
|
47
47
|
Every colour comes from `@biolibs/bionet-theme`, and no rule reaches outside `.bionet`.
|
|
48
48
|
|
|
49
|
+
## Places, and a view of your own
|
|
50
|
+
|
|
51
|
+
`Places` shows the tree of places and adds to it; each tube in `Freezer` says where it is and can be
|
|
52
|
+
put somewhere, by place and by position (`C4`). `BackUpKey` and `RestoreKey` seal the device's key to
|
|
53
|
+
a file and take one up again.
|
|
54
|
+
|
|
55
|
+
`LabWindow` takes views of the host's own, shown as tabs after its own:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<LabWindow extra={[{ id: "scene", label: "Lab", view: <MyDrawingOfTheLab /> }]} />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## A lab's public page
|
|
62
|
+
|
|
63
|
+
What a lab shows the world, and what it can see of another lab. These take what was fetched and
|
|
64
|
+
checked as plain values, so they can be drawn on a server:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { fetchInventory, originMatches, readInventory, verifyInventory } from "@biolibs/bionet";
|
|
68
|
+
import { Held, LabPage, PeerAnswered, PeerSilent } from "@biolibs/bionet-panels";
|
|
69
|
+
|
|
70
|
+
const mine = readInventory(published);
|
|
71
|
+
const checks = await verifyInventory(mine);
|
|
72
|
+
|
|
73
|
+
<LabPage name="The Wren Lab" note="A worked example, not a real freezer.">
|
|
74
|
+
<Held parts={mine.inventory.parts} checks={checks} origin={ORIGIN}
|
|
75
|
+
bound={originMatches(mine.inventory.lab.origin, ORIGIN)} />
|
|
76
|
+
<h2>What we can see of The Thistle Lab</h2>
|
|
77
|
+
<PeerAnswered found={await fetchInventory(PEER)} mine={mine.inventory.parts} />
|
|
78
|
+
</LabPage>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| Piece | Shows |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `LabPage` | The frame: the mark, the lab's name, a line about what it is |
|
|
84
|
+
| `Held` | What the lab holds, and what the signature over that list settles |
|
|
85
|
+
| `PeerAnswered` | Another lab that answered: what it has that this one does not, and what both have, by checksum |
|
|
86
|
+
| `PeerSilent` | Another lab that did not answer, said without accusing it |
|
|
87
|
+
| `PartsTable`, `WhatASignatureSettles` | The pieces those are made of |
|
|
88
|
+
|
|
89
|
+
They carry the wording as well as the markup. What a signature settles, and what it does not, has to
|
|
90
|
+
be said the same way on every lab's page.
|
|
91
|
+
|
|
92
|
+
Everything else in this package uses hooks and is marked `"use client"`, for frameworks that draw on
|
|
93
|
+
a server first.
|
|
94
|
+
|
|
49
95
|
## Testing
|
|
50
96
|
|
|
51
97
|
`test/panels.test.ts` renders each panel to text against a real lab, and checks that the stylesheet
|
package/dist/backup.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How to hand the person a file to keep. A host that cannot use the browser's own way supplies one.
|
|
3
|
+
* The default offers it as a download.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SaveContext: import("react").Context<(name: string, text: string) => Promise<void>>;
|
|
6
|
+
/** Seal this device's key under a passphrase and hand it over as a file. */
|
|
7
|
+
export declare function BackUpKey(): import("react").JSX.Element | null;
|
|
8
|
+
/** Take up a key from a backup, on a device that is not in a lab yet. */
|
|
9
|
+
export declare function RestoreKey(): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=backup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../src/backup.tsx"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAAwB,MAAM,QAAQ,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAMpF,CAAC;AAEH,4EAA4E;AAC5E,wBAAgB,SAAS,uCA+BxB;AAED,yEAAyE;AACzE,wBAAgB,UAAU,gCAiBzB"}
|
package/dist/backup.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/** Keeping this device's key somewhere else, and taking one up again on a new device. */
|
|
4
|
+
import { createContext, useContext, useState } from "react";
|
|
5
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
6
|
+
import { Ask } from "./parts.js";
|
|
7
|
+
/**
|
|
8
|
+
* How to hand the person a file to keep. A host that cannot use the browser's own way supplies one.
|
|
9
|
+
* The default offers it as a download.
|
|
10
|
+
*/
|
|
11
|
+
export const SaveContext = createContext(async (name, text) => {
|
|
12
|
+
const link = document.createElement("a");
|
|
13
|
+
link.href = URL.createObjectURL(new Blob([text], { type: "application/json" }));
|
|
14
|
+
link.download = name;
|
|
15
|
+
link.click();
|
|
16
|
+
URL.revokeObjectURL(link.href);
|
|
17
|
+
});
|
|
18
|
+
/** Seal this device's key under a passphrase and hand it over as a file. */
|
|
19
|
+
export function BackUpKey() {
|
|
20
|
+
const state = useLab();
|
|
21
|
+
const act = useAct();
|
|
22
|
+
const save = useContext(SaveContext);
|
|
23
|
+
const [note, setNote] = useState(null);
|
|
24
|
+
if (state === null)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Back up this device's key" }), _jsx("p", { className: "dim small", children: "Everything you sign is signed by a key that exists only on this computer. If the computer is lost, so is the key, and a lab with nobody else in it is lost with it. This writes the key to a file, sealed under a passphrase. Keep the file somewhere that is not this computer, and the passphrase somewhere that is not the file. Nothing here remembers the passphrase." }), _jsxs(Ask, { className: "stack", onAsk: async (data) => {
|
|
27
|
+
setNote(null);
|
|
28
|
+
const [first, again] = [String(data.get("passphrase") ?? ""), String(data.get("again") ?? "")];
|
|
29
|
+
if (first !== again) {
|
|
30
|
+
setNote("Those two passphrases are not the same.");
|
|
31
|
+
return { ok: false };
|
|
32
|
+
}
|
|
33
|
+
const answer = await act("backUp", first);
|
|
34
|
+
if (!answer.ok)
|
|
35
|
+
return answer;
|
|
36
|
+
await save(`bionet-key-${state.device.fingerprint}.json`, String(answer.result));
|
|
37
|
+
setNote("Sealed and handed over. Open it only on a new device, before that device joins a lab.");
|
|
38
|
+
return answer;
|
|
39
|
+
}, children: [_jsxs("label", { children: ["Passphrase", _jsx("input", { name: "passphrase", type: "password", required: true, minLength: 12, autoComplete: "new-password" })] }), _jsxs("label", { children: ["And again", _jsx("input", { name: "again", type: "password", required: true, minLength: 12, autoComplete: "new-password" })] }), _jsx("button", { type: "submit", children: "Seal and save" })] }), note !== null && _jsx("p", { className: "small", role: "status", children: note })] }));
|
|
40
|
+
}
|
|
41
|
+
/** Take up a key from a backup, on a device that is not in a lab yet. */
|
|
42
|
+
export function RestoreKey() {
|
|
43
|
+
const act = useAct();
|
|
44
|
+
return (_jsxs("details", { className: "restore", children: [_jsx("summary", { children: "Replacing a lost device? Restore its key" }), _jsx("p", { className: "dim small", children: "Choose the backup file and give its passphrase. This device then signs as the lost one did. Do this before joining, and only if the old device is really gone: one key on two devices writes two histories the lab cannot tell apart." }), _jsxs(Ask, { className: "stack", onAsk: async (data) => {
|
|
45
|
+
const file = data.get("backup");
|
|
46
|
+
const backup = file instanceof File ? await file.text() : "";
|
|
47
|
+
return act("restore", { backup, passphrase: String(data.get("passphrase") ?? "") });
|
|
48
|
+
}, children: [_jsxs("label", { children: ["Backup file", _jsx("input", { name: "backup", type: "file", accept: "application/json,.json", required: true })] }), _jsxs("label", { children: ["Passphrase", _jsx("input", { name: "passphrase", type: "password", required: true, autoComplete: "off" })] }), _jsx("button", { type: "submit", className: "quiet", children: "Restore key" })] })] }));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=backup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.js","sourceRoot":"","sources":["../src/backup.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAA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AAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;oBAChC,MAAM,MAAM,GAAG,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7D,OAAO,GAAG,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;gBACtF,CAAC,aACC,2CAAkB,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,wBAAwB,EAAC,QAAQ,SAAG,IAAQ,EACtG,0CAAiB,gBAAO,IAAI,EAAC,YAAY,EAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,QAAC,YAAY,EAAC,KAAK,GAAG,IAAQ,EAChG,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,4BAAqB,IACxD,IACE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/freezer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freezer.d.ts","sourceRoot":"","sources":["../src/freezer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"freezer.d.ts","sourceRoot":"","sources":["../src/freezer.tsx"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,KAAG,MAAsE,CAAC;AAE3I,oGAAoG;AACpG,wBAAgB,OAAO,uCAoBtB;AAED,8BAA8B;AAC9B,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,+BA4BhF;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,+BA6BpD"}
|
package/dist/freezer.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
3
4
|
import { Ask } from "./parts.js";
|
|
5
|
+
import { PutItem } from "./places.js";
|
|
4
6
|
const whole = (data, name) => Number(String(data.get(name) ?? "").trim());
|
|
5
7
|
/**
|
|
6
8
|
* How much of an item there is, with its unit.
|
|
@@ -21,11 +23,11 @@ export function Freezer() {
|
|
|
21
23
|
export function PartCard({ part, items }) {
|
|
22
24
|
const act = useAct();
|
|
23
25
|
const live = items.filter((item) => !item.retired);
|
|
24
|
-
return (_jsxs("section", { className: "card part", children: [_jsxs("div", { className: "parthead", children: [_jsxs("div", { children: [_jsx("h2", { children: part.name }), _jsxs("p", { className: "dim small", children: [part.length, " bp", part.circular ? " · circular" : "", " \u00B7 ", _jsxs("code", { children: [part.checksum.slice(0, 26), "\u2026"] })] })] }), _jsxs("label", { className: "check", title: "Whether other labs are told this part can be asked for", children: [_jsx("input", { type: "checkbox", checked: part.offered, onChange: (event) => void act("offer", { part: part.checksum, available: event.target.checked }) }), "On offer to other labs"] })] }), live.length === 0 ? _jsx("p", { className: "dim small", children: "No tubes of this." }) : (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Tube" }), _jsx("th", { children: "Amount" }), _jsx("th", { children: "Use or add" }), _jsx("th", { children: "Count" }), _jsx("th", {})] }) }), _jsx("tbody", { children: live.map((item) => _jsx(ItemRow, { item: item }, item.item)) })] })), _jsxs(Ask, { onAsk: (data) => act("addItem", { part: part.checksum, amount: whole(data, "amount"), unit: String(data.get("unit") ?? "") }), className: "row tight", children: [_jsx("input", { name: "amount", type: "number", min: 0, step: 1, placeholder: "Amount", required: true }), _jsx("input", { name: "unit", placeholder: "Unit, e.g. \u00B5L", maxLength: 20 }), _jsx("button", { type: "submit", className: "quiet", children: "Add a tube" })] })] }));
|
|
26
|
+
return (_jsxs("section", { className: "card part", children: [_jsxs("div", { className: "parthead", children: [_jsxs("div", { children: [_jsx("h2", { children: part.name }), _jsxs("p", { className: "dim small", children: [part.length, " bp", part.circular ? " · circular" : "", " \u00B7 ", _jsxs("code", { children: [part.checksum.slice(0, 26), "\u2026"] })] })] }), _jsxs("label", { className: "check", title: "Whether other labs are told this part can be asked for", children: [_jsx("input", { type: "checkbox", checked: part.offered, onChange: (event) => void act("offer", { part: part.checksum, available: event.target.checked }) }), "On offer to other labs"] })] }), live.length === 0 ? _jsx("p", { className: "dim small", children: "No tubes of this." }) : (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Tube" }), _jsx("th", { children: "Amount" }), _jsx("th", { children: "Where" }), _jsx("th", { children: "Use or add" }), _jsx("th", { children: "Count" }), _jsx("th", {})] }) }), _jsx("tbody", { children: live.map((item) => _jsx(ItemRow, { item: item }, item.item)) })] })), _jsxs(Ask, { onAsk: (data) => act("addItem", { part: part.checksum, amount: whole(data, "amount"), unit: String(data.get("unit") ?? "") }), className: "row tight", children: [_jsx("input", { name: "amount", type: "number", min: 0, step: 1, placeholder: "Amount", required: true }), _jsx("input", { name: "unit", placeholder: "Unit, e.g. \u00B5L", maxLength: 20 }), _jsx("button", { type: "submit", className: "quiet", children: "Add a tube" })] })] }));
|
|
25
27
|
}
|
|
26
28
|
/** One tube: how much there is, and the ways to change that. */
|
|
27
29
|
export function ItemRow({ item }) {
|
|
28
30
|
const act = useAct();
|
|
29
|
-
return (_jsxs("tr", { className: item.needsRecount ? "flagged" : undefined, children: [_jsx("td", { children: _jsxs("code", { children: [item.item.slice(0, 10), "\u2026"] }) }), _jsxs("td", { children: [_jsx("strong", { children: amountOf(item) }), item.needsRecount && _jsx("span", { className: "badge", title: "The log has lost track of this tube: it went below zero, or two people counted it at once.", children: "needs a count" })] }), _jsx("td", { children: _jsxs("div", { className: "row tight", children: [_jsx("button", { type: "button", className: "quiet", onClick: () => void act("adjust", { item: item.item, by: -1 }), children: "\u22121" }), _jsx("button", { type: "button", className: "quiet", onClick: () => void act("adjust", { item: item.item, by: 1 }), children: "+1" }), _jsxs(Ask, { onAsk: (data) => act("adjust", { item: item.item, by: whole(data, "by") }), className: "row tight", children: [_jsx("input", { name: "by", type: "number", step: 1, placeholder: "\u00B1", required: true, className: "num", "aria-label": "Change by" }), _jsx("button", { type: "submit", className: "quiet", children: "Apply" })] })] }) }), _jsx("td", { children: _jsxs(Ask, { onAsk: (data) => act("recount", { item: item.item, amount: whole(data, "amount") }), className: "row tight", children: [_jsx("input", { name: "amount", type: "number", min: 0, step: 1, placeholder: "There is", required: true, className: "num", "aria-label": "Amount there is" }), _jsx("button", { type: "submit", className: "quiet", children: "Set" })] }) }), _jsx("td", { children: _jsx("button", { type: "button", className: "plain", onClick: () => void act("retire", { item: item.item }), children: "retire" }) })] }));
|
|
31
|
+
return (_jsxs("tr", { className: item.needsRecount ? "flagged" : undefined, children: [_jsx("td", { children: _jsxs("code", { children: [item.item.slice(0, 10), "\u2026"] }) }), _jsxs("td", { children: [_jsx("strong", { children: amountOf(item) }), item.needsRecount && _jsx("span", { className: "badge", title: "The log has lost track of this tube: it went below zero, or two people counted it at once.", children: "needs a count" })] }), _jsx("td", { children: _jsx(PutItem, { item: item }) }), _jsx("td", { children: _jsxs("div", { className: "row tight", children: [_jsx("button", { type: "button", className: "quiet", onClick: () => void act("adjust", { item: item.item, by: -1 }), children: "\u22121" }), _jsx("button", { type: "button", className: "quiet", onClick: () => void act("adjust", { item: item.item, by: 1 }), children: "+1" }), _jsxs(Ask, { onAsk: (data) => act("adjust", { item: item.item, by: whole(data, "by") }), className: "row tight", children: [_jsx("input", { name: "by", type: "number", step: 1, placeholder: "\u00B1", required: true, className: "num", "aria-label": "Change by" }), _jsx("button", { type: "submit", className: "quiet", children: "Apply" })] })] }) }), _jsx("td", { children: _jsxs(Ask, { onAsk: (data) => act("recount", { item: item.item, amount: whole(data, "amount") }), className: "row tight", children: [_jsx("input", { name: "amount", type: "number", min: 0, step: 1, placeholder: "There is", required: true, className: "num", "aria-label": "Amount there is" }), _jsx("button", { type: "submit", className: "quiet", children: "Set" })] }) }), _jsx("td", { children: _jsx("button", { type: "button", className: "plain", onClick: () => void act("retire", { item: item.item }), children: "retire" }) })] }));
|
|
30
32
|
}
|
|
31
33
|
//# sourceMappingURL=freezer.js.map
|
package/dist/freezer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freezer.js","sourceRoot":"","sources":["../src/freezer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"freezer.js","sourceRoot":"","sources":["../src/freezer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,KAAK,GAAG,CAAC,IAAc,EAAE,IAAY,EAAU,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAEpG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAwC,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AAE3I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CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAC,WAAW,aAC7G,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAC,UAAU,EAAC,QAAQ,QAAC,SAAS,EAAC,KAAK,gBAAY,iBAAiB,GAAG,EACnI,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,oBAAa,IAChD,GACH,EACL,uBAAI,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,uBAAiB,GAAK,IACrH,CACN,CAAC;AACJ,CAAC"}
|
package/dist/history.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { EntryView, LabView } from "@biolibs/bionet-client";
|
|
|
6
6
|
* @param lab - The lab, to name the parts, tubes and people it refers to.
|
|
7
7
|
* @returns A phrase that follows the name of whoever made it, like `used 2 µL of a tube of f1`.
|
|
8
8
|
*/
|
|
9
|
-
export declare function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster">): string;
|
|
9
|
+
export declare function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster"> & Partial<Pick<LabView, "places">>): string;
|
|
10
10
|
/** Every change, newest first, with what became of each. Draws nothing until the lab has arrived. */
|
|
11
11
|
export declare function History({ first }: {
|
|
12
12
|
first?: number;
|
package/dist/history.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAIjE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,GAAG,MAAM,CAkCvJ;AAED,qGAAqG;AACrG,wBAAgB,OAAO,CAAC,EAAE,KAAU,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,sCA4BzD"}
|
package/dist/history.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
/** The history: every signed change, and what became of it. */
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import { useLab } from "@biolibs/bionet-react";
|
|
6
|
+
import { slotName } from "@biolibs/bionet-space";
|
|
5
7
|
/**
|
|
6
8
|
* What one change was, in words.
|
|
7
9
|
*
|
|
@@ -18,6 +20,7 @@ export function describeEntry(entry, lab) {
|
|
|
18
20
|
};
|
|
19
21
|
const unit = (id) => lab.items.find((one) => one.item === id)?.unit ?? "";
|
|
20
22
|
const who = (key) => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
23
|
+
const place = (id) => lab.places?.find((one) => one.place === id)?.name ?? "a place";
|
|
21
24
|
const tidy = (words) => words.replace(/\s+/g, " ").trim();
|
|
22
25
|
switch (op.type) {
|
|
23
26
|
case "roster.found": return `founded ${String(op["name"])}`;
|
|
@@ -30,6 +33,15 @@ export function describeEntry(entry, lab) {
|
|
|
30
33
|
case "item.adjust": return tidy(`${Number(op["by"]) < 0 ? "used" : "added"} ${Math.abs(Number(op["by"]))} ${unit(op["item"])} ${Number(op["by"]) < 0 ? "of" : "to"} ${tube(op["item"])}`);
|
|
31
34
|
case "item.recount": return tidy(`counted ${String(op["amount"])} ${unit(op["item"])} in ${tube(op["item"])}`);
|
|
32
35
|
case "item.retire": return `retired ${tube(op["item"])}`;
|
|
36
|
+
case "place.add": return `added the ${String(op["kind"])} ${String(op["name"])}${op["parent"] === null ? "" : ` in ${place(op["parent"])}`}`;
|
|
37
|
+
case "place.move": return op["parent"] === null ? `took ${place(op["place"])} out of where it was` : `moved ${place(op["place"])} into ${place(op["parent"])}`;
|
|
38
|
+
case "place.stand": return op["standing"] === null ? `cleared where ${place(op["place"])} stands` : `said where ${place(op["place"])} stands`;
|
|
39
|
+
case "place.retire": return `retired ${place(op["place"])}`;
|
|
40
|
+
case "item.put": {
|
|
41
|
+
const slot = op["slot"];
|
|
42
|
+
return op["place"] === null ? `took ${tube(op["item"])} out of where it was`
|
|
43
|
+
: `put ${tube(op["item"])} in ${place(op["place"])}${slot === null ? "" : `, ${slotName(slot)}`}`;
|
|
44
|
+
}
|
|
33
45
|
case "field.set": return `set ${String(op["field"])} to ${String(op["value"])}`;
|
|
34
46
|
default: return `did something this version does not know (${op.type})`;
|
|
35
47
|
}
|
package/dist/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+DAA+D;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAA4B,EAAE,GAAmF;IAC7I,MAAM,EAAE,GAAG,KAAK,CAA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C,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,SAAS,GAAM,EAClG,uBAAK,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,GAAM,EACpC,uBAAK,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,eAAM,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE,YAAG,KAAK,CAAC,MAAM,GAAQ,GAAM,KAJ1G,KAAK,CAAC,EAAE,CAKZ,CACN,CAAC,GACI,IACF,EACP,CAAC,GAAG,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,0BAAY,MAAM,CAAC,MAAM,IAAU,IACvI,CACX,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,11 +16,18 @@
|
|
|
16
16
|
* - `history.tsx` — every signed change, and what became of it
|
|
17
17
|
* - `sharing.tsx` — what other labs are shown, and the lab's web peer
|
|
18
18
|
* - `parts.tsx` — the small pieces they are made of
|
|
19
|
+
* - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
|
|
20
|
+
*
|
|
21
|
+
* Everything but `public.tsx` uses hooks and is marked `"use client"`, for frameworks that draw on a
|
|
22
|
+
* server first. The public page's pieces take plain values and can be drawn there.
|
|
19
23
|
*/
|
|
20
24
|
export * from "./window.js";
|
|
21
25
|
export * from "./freezer.js";
|
|
26
|
+
export * from "./places.js";
|
|
27
|
+
export * from "./backup.js";
|
|
22
28
|
export * from "./people.js";
|
|
23
29
|
export * from "./history.js";
|
|
24
30
|
export * from "./sharing.js";
|
|
25
31
|
export * from "./parts.js";
|
|
32
|
+
export * from "./public.js";
|
|
26
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,11 +16,18 @@
|
|
|
16
16
|
* - `history.tsx` — every signed change, and what became of it
|
|
17
17
|
* - `sharing.tsx` — what other labs are shown, and the lab's web peer
|
|
18
18
|
* - `parts.tsx` — the small pieces they are made of
|
|
19
|
+
* - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
|
|
20
|
+
*
|
|
21
|
+
* Everything but `public.tsx` uses hooks and is marked `"use client"`, for frameworks that draw on a
|
|
22
|
+
* server first. The public page's pieces take plain values and can be drawn there.
|
|
19
23
|
*/
|
|
20
24
|
export * from "./window.js";
|
|
21
25
|
export * from "./freezer.js";
|
|
26
|
+
export * from "./places.js";
|
|
27
|
+
export * from "./backup.js";
|
|
22
28
|
export * from "./people.js";
|
|
23
29
|
export * from "./history.js";
|
|
24
30
|
export * from "./sharing.js";
|
|
25
31
|
export * from "./parts.js";
|
|
32
|
+
export * from "./public.js";
|
|
26
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/parts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../src/parts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../src/parts.tsx"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,OAAO,EAAuD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGpE,oGAAoG;AACpG,eAAO,MAAM,WAAW,kCAAyB,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAkD,CAAC;AAE5H,qEAAqE;AACrE,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAWnJ;AAED,4DAA4D;AAC5D,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAQhF;AAED,qGAAqG;AACrG,wBAAgB,OAAO,uCAItB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAUhD;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,+BAOtD;AAED,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAAE,+BAQtE"}
|
package/dist/parts.js
CHANGED
package/dist/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../src/parts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../src/parts.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+CAA+C;AAC/C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,oGAAoG;AACpG,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAE5H,qEAAqE;AACrE,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAoG;IAClJ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,EAAE,KAAiC,EAAE,EAAE;QACzD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,KAAK,CAAC,IAAI,QAAQ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OAAO,kCAAyB,EAAA,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAC,UAAU,GAAG,IAAM,EACvG,eAAM,SAAS,EAAC,MAAM,YAAE,MAAM,CAAC,GAAG,GAAQ,EAC1C,aAAG,SAAS,EAAC,WAAW,6BAAa,yBAAO,MAAM,CAAC,WAAW,GAAQ,oFAAgF,IAClJ,CACP,CAAC;AACJ,CAAC"}
|
package/dist/people.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../src/people.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../src/people.tsx"],"names":[],"mappings":"AAOA,qGAAqG;AACrG,wBAAgB,MAAM,uCA6CrB"}
|
package/dist/people.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
/** The people: who is in the lab, and letting somebody in. */
|
|
3
4
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
5
|
+
import { BackUpKey } from "./backup.js";
|
|
4
6
|
import { Ask, Copy } from "./parts.js";
|
|
5
7
|
/** The roster, and for a keeper the way to add somebody. Draws nothing until the lab has arrived. */
|
|
6
8
|
export function People() {
|
|
@@ -9,6 +11,6 @@ export function People() {
|
|
|
9
11
|
const lab = state?.lab;
|
|
10
12
|
if (state === null || lab === null || lab === undefined)
|
|
11
13
|
return null;
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Who is in the lab" }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Person" }), _jsx("th", { children: "Role" }), _jsx("th", { children: "Device" }), _jsx("th", {})] }) }), _jsx("tbody", { children: lab.roster.map((one) => (_jsxs("tr", { className: one.removed === null ? undefined : "gone", children: [_jsxs("td", { children: [one.person, one.you && _jsx("span", { className: "badge calm", children: "this device" })] }), _jsx("td", { children: one.removed !== null ? "removed" : one.founder ? "keeper · founder" : one.role }), _jsx("td", { children: _jsx("code", { children: one.fingerprint }) }), _jsx("td", { children: one.removed !== null && _jsxs("span", { className: "dim small", children: ["log kept up to entry ", one.removed.cutoff + 1] }) })] }, one.key))) })] }), _jsx("p", { className: "dim small", children: "A device is known by its key. One person with two computers appears twice, once for each." })] }), lab.keeper ? (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Add somebody" }), _jsx("p", { className: "dim small", children: "Ask them for their device's key, add it here, and send them the invitation. Their app fills in once this change has reached the lab's peer." }), _jsxs(Ask, { onAsk: (data) => act("addMember", { key: String(data.get("key") ?? ""), person: String(data.get("person") ?? ""), role: String(data.get("role") ?? "member") }), className: "stack", children: [_jsxs("label", { children: ["Their device's key", _jsx("input", { name: "key", placeholder: "43 letters and digits", required: true, spellCheck: false })] }), _jsxs("label", { children: ["Their name", _jsx("input", { name: "person", required: true, maxLength: 200 })] }), _jsxs("label", { children: ["As", _jsxs("select", { name: "role", children: [_jsx("option", { value: "member", children: "a member, who can change the freezer" }), _jsx("option", { value: "keeper", children: "a keeper, who can also change who is in the lab" })] })] }), _jsx("button", { type: "submit", children: "Add to the lab" })] }), state.peer.invite !== null ? (_jsxs("div", { className: "keybox", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "Invitation to send them" }), _jsx(Copy, { words: state.peer.invite, label: "Copy invitation" })] }), _jsx("code", { className: "wrap", children: state.peer.invite })] })) : _jsx("p", { className: "dim small", children: "Set the lab's web peer under Sharing to have an invitation to send." })] })) : _jsx("p", { className: "dim small", children: "Only a keeper can change who is in the lab." })] }));
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Who is in the lab" }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Person" }), _jsx("th", { children: "Role" }), _jsx("th", { children: "Device" }), _jsx("th", {})] }) }), _jsx("tbody", { children: lab.roster.map((one) => (_jsxs("tr", { className: one.removed === null ? undefined : "gone", children: [_jsxs("td", { children: [one.person, one.you && _jsx("span", { className: "badge calm", children: "this device" })] }), _jsx("td", { children: one.removed !== null ? "removed" : one.founder ? "keeper · founder" : one.role }), _jsx("td", { children: _jsx("code", { children: one.fingerprint }) }), _jsx("td", { children: one.removed !== null && _jsxs("span", { className: "dim small", children: ["log kept up to entry ", one.removed.cutoff + 1] }) })] }, one.key))) })] }), _jsx("p", { className: "dim small", children: "A device is known by its key. One person with two computers appears twice, once for each." })] }), lab.keeper ? (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Add somebody" }), _jsx("p", { className: "dim small", children: "Ask them for their device's key, add it here, and send them the invitation. Their app fills in once this change has reached the lab's peer." }), _jsxs(Ask, { onAsk: (data) => act("addMember", { key: String(data.get("key") ?? ""), person: String(data.get("person") ?? ""), role: String(data.get("role") ?? "member") }), className: "stack", children: [_jsxs("label", { children: ["Their device's key", _jsx("input", { name: "key", placeholder: "43 letters and digits", required: true, spellCheck: false })] }), _jsxs("label", { children: ["Their name", _jsx("input", { name: "person", required: true, maxLength: 200 })] }), _jsxs("label", { children: ["As", _jsxs("select", { name: "role", children: [_jsx("option", { value: "member", children: "a member, who can change the freezer" }), _jsx("option", { value: "keeper", children: "a keeper, who can also change who is in the lab" })] })] }), _jsx("button", { type: "submit", children: "Add to the lab" })] }), state.peer.invite !== null ? (_jsxs("div", { className: "keybox", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "Invitation to send them" }), _jsx(Copy, { words: state.peer.invite, label: "Copy invitation" })] }), _jsx("code", { className: "wrap", children: state.peer.invite })] })) : _jsx("p", { className: "dim small", children: "Set the lab's web peer under Sharing to have an invitation to send." })] })) : _jsx("p", { className: "dim small", children: "Only a keeper can change who is in the lab." }), _jsx(BackUpKey, {})] }));
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=people.js.map
|
package/dist/people.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.js","sourceRoot":"","sources":["../src/people.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"people.js","sourceRoot":"","sources":["../src/people.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,8DAA8D;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,qGAAqG;AACrG,MAAM,UAAU,MAAM;IACpB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,KAAK,EAAE,GAAG,CAAC;IACvB,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrE,OAAO,CACL,8BACE,mBAAS,SAAS,EAAC,MAAM,aACvB,6CAA0B,EAC1B,4BACE,0BAAO,yBAAI,kCAAe,EAAA,gCAAa,EAAA,kCAAe,EAAA,cAAM,IAAK,GAAQ,EACzE,0BACG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACvB,cAAkB,SAAS,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,aACpE,yBAAK,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,eAAM,SAAS,EAAC,YAAY,4BAAmB,IAAM,EACjF,uBAAK,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,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,IACzC,EACL,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAC5B,eAAK,SAAS,EAAC,QAAQ,aACrB,0BAAK,eAAM,SAAS,EAAC,OAAO,wCAA+B,EAAA,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAC,iBAAiB,GAAG,IAAM,EAC3H,eAAM,SAAS,EAAC,MAAM,YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAQ,IAC7C,CACP,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,WAAW,oFAAwE,IAC5F,CACX,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,WAAW,4DAAgD,EAC5E,KAAC,SAAS,KAAG,IACZ,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/places.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** The places: where things are kept, which is inside which, and putting a tube somewhere. */
|
|
2
|
+
import type { ItemState, PlaceState } from "@biolibs/bionet";
|
|
3
|
+
/** The kinds of place offered when adding one. Any other kind a lab's log holds is shown as it is. */
|
|
4
|
+
export declare const PLACE_KINDS: readonly ["room", "freezer", "fridge", "shelf", "rack", "box", "bench", "instrument"];
|
|
5
|
+
/**
|
|
6
|
+
* Where a place is, said the way a person would: every place it is inside, then itself.
|
|
7
|
+
*
|
|
8
|
+
* @param places - The lab's places.
|
|
9
|
+
* @param id - The place.
|
|
10
|
+
* @returns Something like `Main lab › −80 › Shelf 2 › Box 7`, or `""` if the lab has no such place.
|
|
11
|
+
*/
|
|
12
|
+
export declare function placePath(places: readonly Pick<PlaceState, "place" | "name" | "parent">[], id: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Where an item is, in words.
|
|
15
|
+
*
|
|
16
|
+
* @param item - The item.
|
|
17
|
+
* @param places - The lab's places.
|
|
18
|
+
* @returns Something like `−80 › Box 7 · C4`, or `nowhere recorded`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function whereWords(item: Pick<ItemState, "where">, places: readonly Pick<PlaceState, "place" | "name" | "parent">[]): string;
|
|
21
|
+
/**
|
|
22
|
+
* The places in the order a tree is read: each one followed by what is inside it.
|
|
23
|
+
*
|
|
24
|
+
* @param places - The lab's places.
|
|
25
|
+
* @returns Each place still in use, with how deep it is.
|
|
26
|
+
*/
|
|
27
|
+
export declare function placeTree(places: readonly PlaceState[]): {
|
|
28
|
+
place: PlaceState;
|
|
29
|
+
depth: number;
|
|
30
|
+
}[];
|
|
31
|
+
/** Every place as a tree, what needs looking at, and a form to add a place. Draws nothing until the lab has arrived. */
|
|
32
|
+
export declare function Places(): import("react").JSX.Element | null;
|
|
33
|
+
/**
|
|
34
|
+
* Where one tube is, and a way to put it somewhere.
|
|
35
|
+
*
|
|
36
|
+
* @param props - `item` is the tube.
|
|
37
|
+
*/
|
|
38
|
+
export declare function PutItem({ item }: {
|
|
39
|
+
item: ItemState;
|
|
40
|
+
}): import("react").JSX.Element | null;
|
|
41
|
+
//# sourceMappingURL=places.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.d.ts","sourceRoot":"","sources":["../src/places.tsx"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7D,sGAAsG;AACtG,eAAO,MAAM,WAAW,uFAAwF,CAAC;AAEjH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAW9G;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,EAAE,GAAG,MAAM,CAInI;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAW/F;AAED,wHAAwH;AACxH,wBAAgB,MAAM,uCAwErB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,sCA0BpD"}
|
package/dist/places.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
4
|
+
import { slotFrom, slotName } from "@biolibs/bionet-space";
|
|
5
|
+
import { Ask } from "./parts.js";
|
|
6
|
+
/** The kinds of place offered when adding one. Any other kind a lab's log holds is shown as it is. */
|
|
7
|
+
export const PLACE_KINDS = ["room", "freezer", "fridge", "shelf", "rack", "box", "bench", "instrument"];
|
|
8
|
+
/**
|
|
9
|
+
* Where a place is, said the way a person would: every place it is inside, then itself.
|
|
10
|
+
*
|
|
11
|
+
* @param places - The lab's places.
|
|
12
|
+
* @param id - The place.
|
|
13
|
+
* @returns Something like `Main lab › −80 › Shelf 2 › Box 7`, or `""` if the lab has no such place.
|
|
14
|
+
*/
|
|
15
|
+
export function placePath(places, id) {
|
|
16
|
+
const names = [];
|
|
17
|
+
const passed = new Set();
|
|
18
|
+
for (let at = id; at !== null && !passed.has(at);) {
|
|
19
|
+
const one = places.find((each) => each.place === at);
|
|
20
|
+
if (one === undefined)
|
|
21
|
+
break;
|
|
22
|
+
passed.add(at);
|
|
23
|
+
names.unshift(one.name);
|
|
24
|
+
at = one.parent;
|
|
25
|
+
}
|
|
26
|
+
return names.join(" › ");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Where an item is, in words.
|
|
30
|
+
*
|
|
31
|
+
* @param item - The item.
|
|
32
|
+
* @param places - The lab's places.
|
|
33
|
+
* @returns Something like `−80 › Box 7 · C4`, or `nowhere recorded`.
|
|
34
|
+
*/
|
|
35
|
+
export function whereWords(item, places) {
|
|
36
|
+
if (item.where === null)
|
|
37
|
+
return "nowhere recorded";
|
|
38
|
+
const path = placePath(places, item.where.place) || "a place the lab no longer has";
|
|
39
|
+
return item.where.slot === null ? path : `${path} · ${slotName(item.where.slot)}`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The places in the order a tree is read: each one followed by what is inside it.
|
|
43
|
+
*
|
|
44
|
+
* @param places - The lab's places.
|
|
45
|
+
* @returns Each place still in use, with how deep it is.
|
|
46
|
+
*/
|
|
47
|
+
export function placeTree(places) {
|
|
48
|
+
const out = [];
|
|
49
|
+
const walk = (parent, depth) => {
|
|
50
|
+
for (const place of places) {
|
|
51
|
+
if (place.parent !== parent || place.retired)
|
|
52
|
+
continue;
|
|
53
|
+
out.push({ place, depth });
|
|
54
|
+
walk(place.place, depth + 1);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
walk(null, 0);
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/** Every place as a tree, what needs looking at, and a form to add a place. Draws nothing until the lab has arrived. */
|
|
61
|
+
export function Places() {
|
|
62
|
+
const lab = useLab()?.lab;
|
|
63
|
+
const act = useAct();
|
|
64
|
+
if (lab === null || lab === undefined)
|
|
65
|
+
return null;
|
|
66
|
+
const tree = placeTree(lab.places);
|
|
67
|
+
const live = lab.items.filter((item) => !item.retired);
|
|
68
|
+
const holding = (id) => live.filter((item) => item.where?.place === id).length;
|
|
69
|
+
return (_jsxs(_Fragment, { children: [lab.crowded.length > 0 && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Somebody needs to look" }), _jsx("p", { className: "dim small", children: "The lab has more than one tube recorded in each of these positions. Two people put them there without knowing of each other. Move whichever is not really there." }), _jsx("ul", { className: "plainlist", children: lab.crowded.map((one) => (_jsxs("li", { className: "flagged", children: [_jsxs("strong", { children: [placePath(lab.places, one.place), " \u00B7 ", slotName(one.slot)] }), " ", _jsxs("span", { className: "badge", children: [one.items.length, " tubes"] })] }, `${one.place} ${one.slot.row} ${one.slot.column}`))) })] })), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Where things are kept" }), tree.length === 0 ? _jsx("p", { className: "empty", children: "No places yet. Add the first below: a freezer, then the boxes in it." }) : (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Place" }), _jsx("th", { children: "Kind" }), _jsx("th", { children: "Positions" }), _jsx("th", { children: "Tubes here" }), _jsx("th", {})] }) }), _jsx("tbody", { children: tree.map(({ place, depth }) => (_jsxs("tr", { className: place.adrift ? "flagged" : undefined, children: [_jsxs("td", { style: { paddingLeft: `${0.6 + depth * 1.2}rem` }, children: [place.name, place.adrift && _jsx("span", { className: "badge", title: "Two people each moved this place and another into one another. Move one of them to settle it.", children: "needs moving" })] }), _jsx("td", { className: "dim", children: place.kind }), _jsx("td", { className: "dim", children: place.grid === null ? "" : `${place.grid.rows} × ${place.grid.columns}` }), _jsx("td", { children: holding(place.place) || "" }), _jsx("td", { children: _jsx("button", { type: "button", className: "plain", onClick: () => void act("retirePlace", { place: place.place }), children: "retire" }) })] }, place.place))) })] }))] }), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Add a place" }), _jsx("p", { className: "dim small", children: "A place is anything something is kept in or on. Only a box has positions; give it rows and columns and its tubes can be found by letter and number." }), _jsxs(Ask, { className: "stack", onAsk: (data) => {
|
|
70
|
+
const rows = Number(data.get("rows") ?? "");
|
|
71
|
+
const columns = Number(data.get("columns") ?? "");
|
|
72
|
+
const parent = String(data.get("parent") ?? "");
|
|
73
|
+
return act("addPlace", { kind: String(data.get("kind") ?? ""), name: String(data.get("name") ?? ""), parent: parent === "" ? null : parent,
|
|
74
|
+
grid: rows > 0 && columns > 0 ? { rows, columns } : null });
|
|
75
|
+
}, children: [_jsxs("label", { children: ["Kind", _jsx("select", { name: "kind", defaultValue: "box", children: PLACE_KINDS.map((kind) => _jsx("option", { value: kind, children: kind }, kind)) })] }), _jsxs("label", { children: ["Name", _jsx("input", { name: "name", placeholder: "Box 7", required: true, maxLength: 200 })] }), _jsxs("label", { children: ["Inside", _jsxs("select", { name: "parent", defaultValue: "", children: [_jsx("option", { value: "", children: "nothing" }), tree.map(({ place, depth }) => _jsxs("option", { value: place.place, children: [" ".repeat(depth), place.name] }, place.place))] })] }), _jsxs("div", { className: "row tight", children: [_jsx("input", { name: "rows", type: "number", min: 1, max: 100, step: 1, placeholder: "Rows", "aria-label": "Rows", className: "num" }), _jsx("input", { name: "columns", type: "number", min: 1, max: 100, step: 1, placeholder: "Columns", "aria-label": "Columns", className: "num" }), _jsx("span", { className: "dim small", children: "for a box" })] }), _jsx("button", { type: "submit", children: "Add place" })] })] })] }));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Where one tube is, and a way to put it somewhere.
|
|
79
|
+
*
|
|
80
|
+
* @param props - `item` is the tube.
|
|
81
|
+
*/
|
|
82
|
+
export function PutItem({ item }) {
|
|
83
|
+
const lab = useLab()?.lab;
|
|
84
|
+
const act = useAct();
|
|
85
|
+
if (lab === null || lab === undefined)
|
|
86
|
+
return null;
|
|
87
|
+
const tree = placeTree(lab.places);
|
|
88
|
+
return (_jsxs("div", { className: "where", children: [_jsx("span", { className: item.where === null ? "dim small" : "small", children: whereWords(item, lab.places) }), tree.length > 0 && (_jsxs(Ask, { className: "row tight", onAsk: async (data) => {
|
|
89
|
+
const place = String(data.get("place") ?? "");
|
|
90
|
+
const written = String(data.get("slot") ?? "").trim();
|
|
91
|
+
const slot = written === "" ? null : slotFrom(written);
|
|
92
|
+
// A position that is not written like one is sent as it is not: the lab refuses it and says why.
|
|
93
|
+
return act("putItem", { item: item.item, place: place === "" ? null : place, slot: written !== "" && slot === null ? { row: -1, column: -1 } : slot });
|
|
94
|
+
}, children: [_jsxs("select", { name: "place", defaultValue: item.where?.place ?? "", "aria-label": "Place", children: [_jsx("option", { value: "", children: "nowhere" }), tree.map(({ place, depth }) => _jsxs("option", { value: place.place, children: [" ".repeat(depth), place.name] }, place.place))] }), _jsx("input", { name: "slot", placeholder: "A1", "aria-label": "Position", className: "num", maxLength: 5 }), _jsx("button", { type: "submit", className: "quiet", children: "Put" })] }))] }));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=places.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.js","sourceRoot":"","sources":["../src/places.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,sGAAsG;AACtG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAU,CAAC;AAEjH;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,MAAgE,EAAE,EAAU;IACpG,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,IAAI,EAAE,GAAkB,EAAE,EAAE,EAAE,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC;QACjE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;QACrD,IAAI,GAAG,KAAK,SAAS;YAAE,MAAM;QAC7B,MAA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