@biolibs/bionet-panels 0.2.0 → 0.3.1

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 @@
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,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;GAM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AAS,EAAC,OAAO,oBAAa,IAChD,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
package/dist/window.d.ts CHANGED
@@ -1,16 +1,39 @@
1
- /** The four things a member looks at. */
2
- export declare const TABS: readonly ["freezer", "people", "history", "sharing"];
1
+ /**
2
+ * A whole lab application, in one component.
3
+ *
4
+ * It holds no state of its own about the lab. It is told the lab as it stands, every time it
5
+ * changes, and draws it; a button asks for one thing to be done and waits to be told how the lab
6
+ * changed. So what is on screen is always what the signed logs say, and never what a form hoped.
7
+ *
8
+ * It walks a person through the three places they can be: nobody has said who is at this device,
9
+ * the device is in no lab, the device is waiting to be let into one — and then the lab itself.
10
+ */
11
+ import { type ReactNode } from "react";
12
+ /** The things a member looks at. */
13
+ export declare const TABS: readonly ["freezer", "places", "people", "history", "sharing"];
3
14
  /** One of them. */
4
15
  export type Tab = (typeof TABS)[number];
16
+ /** A view a host adds to the window beside its own, such as a drawing of the lab. */
17
+ export interface ExtraTab {
18
+ /** What tells it apart. */
19
+ id: string;
20
+ /** What its tab says. */
21
+ label: string;
22
+ /** What it shows. It is inside the lab's provider, so it may use the hooks. */
23
+ view: ReactNode;
24
+ }
5
25
  /**
6
26
  * The window.
7
27
  *
8
- * @param props - `tab` is which view to open on; `copy` puts words on the clipboard, for a host that
9
- * cannot use the browser's own way.
28
+ * @param props - `tab` is which view to open on; `copy` puts words on the clipboard and `save` hands
29
+ * over a file, for a host that cannot use the browser's own way; `extra` are views the host adds,
30
+ * shown after the window's own.
10
31
  */
11
- export declare function LabWindow({ tab: first, copy }: {
12
- tab?: Tab;
32
+ export declare function LabWindow({ tab: first, copy, save, extra }: {
33
+ tab?: Tab | string;
13
34
  copy?: (words: string) => Promise<void>;
35
+ save?: (name: string, text: string) => Promise<boolean | void>;
36
+ extra?: readonly ExtraTab[];
14
37
  }): import("react").JSX.Element;
15
38
  /** Asking who is at this device, before anything else. */
16
39
  export declare function Who(): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.tsx"],"names":[],"mappings":"AAoBA,yCAAyC;AACzC,eAAO,MAAM,IAAI,sDAAuD,CAAC;AAEzE,mBAAmB;AACnB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,GAAG,EAAE,KAAiB,EAAE,IAAI,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,+BAGjH;AA2CD,0DAA0D;AAC1D,wBAAgB,GAAG,gCAYlB;AAED,sCAAsC;AACtC,wBAAgB,KAAK,uCA0BpB;AAED,+CAA+C;AAC/C,wBAAgB,OAAO,uCAYtB"}
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUjD,oCAAoC;AACpC,eAAO,MAAM,IAAI,gEAAiE,CAAC;AAEnF,mBAAmB;AACnB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAExC,qFAAqF;AACrF,MAAM,WAAW,QAAQ;IACvB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,GAAG,EAAE,KAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAU,EAAE,EAAE;IAC5E,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC1J,+BAKA;AA+CD,0DAA0D;AAC1D,wBAAgB,GAAG,gCAYlB;AAED,sCAAsC;AACtC,wBAAgB,KAAK,uCA4BpB;AAED,+CAA+C;AAC/C,wBAAgB,OAAO,uCAYtB"}
package/dist/window.js CHANGED
@@ -15,21 +15,28 @@ import { Logo, Mark, useAct, useLab } from "@biolibs/bionet-react";
15
15
  import { Freezer } from "./freezer.js";
16
16
  import { History } from "./history.js";
17
17
  import { Ask, CopyContext, DeviceKey, SyncStatus, Trouble } from "./parts.js";
18
+ import { RestoreKey, RestoreLab, SaveContext } from "./backup.js";
18
19
  import { People } from "./people.js";
20
+ import { Places } from "./places.js";
19
21
  import { Sharing } from "./sharing.js";
20
- /** The four things a member looks at. */
21
- export const TABS = ["freezer", "people", "history", "sharing"];
22
+ /** The things a member looks at. */
23
+ export const TABS = ["freezer", "places", "people", "history", "sharing"];
22
24
  /**
23
25
  * The window.
24
26
  *
25
- * @param props - `tab` is which view to open on; `copy` puts words on the clipboard, for a host that
26
- * cannot use the browser's own way.
27
+ * @param props - `tab` is which view to open on; `copy` puts words on the clipboard and `save` hands
28
+ * over a file, for a host that cannot use the browser's own way; `extra` are views the host adds,
29
+ * shown after the window's own.
27
30
  */
28
- export function LabWindow({ tab: first = "freezer", copy }) {
29
- const window = _jsx(Body, { first: first });
30
- return _jsx("div", { className: "bionet", children: copy === undefined ? window : _jsx(CopyContext.Provider, { value: copy, children: window }) });
31
+ export function LabWindow({ tab: first = "freezer", copy, save, extra = [] }) {
32
+ let window = _jsx(Body, { first: first, extra: extra });
33
+ if (save !== undefined)
34
+ window = _jsx(SaveContext.Provider, { value: save, children: window });
35
+ if (copy !== undefined)
36
+ window = _jsx(CopyContext.Provider, { value: copy, children: window });
37
+ return _jsx("div", { className: "bionet", children: window });
31
38
  }
32
- function Body({ first }) {
39
+ function Body({ first, extra }) {
33
40
  const state = useLab();
34
41
  const [tab, setTab] = useState(first);
35
42
  if (state === null)
@@ -43,11 +50,12 @@ function Body({ first }) {
43
50
  const lab = state.lab;
44
51
  const label = {
45
52
  freezer: `Freezer · ${lab.items.filter((item) => !item.retired).length}`,
53
+ places: `Places · ${lab.places.filter((place) => !place.retired).length}`,
46
54
  people: `People · ${lab.roster.filter((key) => key.removed === null).length}`,
47
55
  history: `History · ${lab.entries.length}`,
48
56
  sharing: "Sharing",
49
57
  };
50
- return (_jsxs("div", { className: "shell", children: [_jsxs("header", { children: [_jsxs("div", { className: "title", children: [_jsx(Mark, { size: 34 }), _jsxs("div", { children: [_jsx("h1", { children: lab.name ?? "A lab" }), _jsxs("p", { className: "dim small", children: [state.device.person, " \u00B7 ", lab.keeper ? "keeper" : "member", " \u00B7 this device ", _jsx("code", { children: state.device.fingerprint })] })] })] }), _jsx(SyncStatus, { peer: state.peer })] }), _jsx("nav", { children: TABS.map((one) => _jsx("button", { type: "button", className: one === tab ? "tab on" : "tab", onClick: () => setTab(one), children: label[one] }, one)) }), _jsxs("main", { children: [_jsx(Trouble, {}), tab === "freezer" && _jsx(Freezer, {}), tab === "people" && _jsx(People, {}), tab === "history" && _jsx(History, {}), tab === "sharing" && _jsx(Sharing, {})] })] }));
58
+ return (_jsxs("div", { className: "shell", children: [_jsxs("header", { children: [_jsxs("div", { className: "title", children: [_jsx(Mark, { size: 34 }), _jsxs("div", { children: [_jsx("h1", { children: lab.name ?? "A lab" }), _jsxs("p", { className: "dim small", children: [state.device.person, " \u00B7 ", lab.keeper ? "keeper" : "member", " \u00B7 this device ", _jsx("code", { children: state.device.fingerprint })] })] })] }), _jsx(SyncStatus, { peer: state.peer })] }), _jsxs("nav", { children: [TABS.map((one) => _jsx("button", { type: "button", className: one === tab ? "tab on" : "tab", onClick: () => setTab(one), children: label[one] }, one)), extra.map((one) => _jsx("button", { type: "button", className: one.id === tab ? "tab on" : "tab", onClick: () => setTab(one.id), children: one.label }, one.id))] }), _jsxs("main", { children: [_jsx(Trouble, {}), tab === "freezer" && _jsx(Freezer, {}), tab === "places" && _jsx(Places, {}), tab === "people" && _jsx(People, {}), tab === "history" && _jsx(History, {}), tab === "sharing" && _jsx(Sharing, {}), extra.find((one) => one.id === tab)?.view] })] }));
51
59
  }
52
60
  /** Asking who is at this device, before anything else. */
53
61
  export function Who() {
@@ -60,7 +68,7 @@ export function NoLab() {
60
68
  const act = useAct();
61
69
  if (state === null)
62
70
  return null;
63
- return (_jsxs("div", { className: "pair", children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Found a lab" }), _jsx("p", { className: "dim", children: "You become its first keeper. It works on this device straight away, with or without a network." }), _jsxs(Ask, { onAsk: (data) => act("found", { name: String(data.get("name") ?? ""), peer: String(data.get("peer") ?? "") }), className: "stack", children: [_jsxs("label", { children: ["What is it called?", _jsx("input", { name: "name", placeholder: "The Wren Lab", required: true, maxLength: 200 })] }), _jsxs("label", { children: [_jsx("span", { children: "Its web peer, if it has one (optional)" }), _jsx("input", { name: "peer", placeholder: "wss://your-lab.example/sync" })] }), _jsx("button", { type: "submit", children: "Found the lab" })] })] }), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Join a lab" }), _jsx("p", { className: "dim", children: "Send a keeper this device's key, and paste the invitation they send back. The lab arrives once they have added you." }), _jsx(DeviceKey, { device: state.device }), _jsxs(Ask, { onAsk: (data) => act("join", String(data.get("invite") ?? "")), className: "stack", children: [_jsxs("label", { children: ["Invitation", _jsx("input", { name: "invite", placeholder: "wss://your-lab.example/sync#\u2026", required: true })] }), _jsx("button", { type: "submit", children: "Join" })] })] })] }));
71
+ return (_jsxs("div", { className: "pair", children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Found a lab" }), _jsx("p", { className: "dim", children: "You become its first keeper. It works on this device straight away, with or without a network." }), _jsxs(Ask, { onAsk: (data) => act("found", { name: String(data.get("name") ?? ""), peer: String(data.get("peer") ?? "") }), className: "stack", children: [_jsxs("label", { children: ["What is it called?", _jsx("input", { name: "name", placeholder: "The Wren Lab", required: true, maxLength: 200 })] }), _jsxs("label", { children: [_jsx("span", { children: "Its web peer, if it has one (optional)" }), _jsx("input", { name: "peer", placeholder: "wss://your-lab.example/sync" })] }), _jsx("button", { type: "submit", children: "Found the lab" })] })] }), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Join a lab" }), _jsx("p", { className: "dim", children: "Send a keeper this device's key, and paste the invitation they send back. The lab arrives once they have added you." }), _jsx(DeviceKey, { device: state.device }), _jsxs(Ask, { onAsk: (data) => act("join", String(data.get("invite") ?? "")), className: "stack", children: [_jsxs("label", { children: ["Invitation", _jsx("input", { name: "invite", placeholder: "wss://your-lab.example/sync#\u2026", required: true })] }), _jsx("button", { type: "submit", children: "Join" })] }), _jsx(RestoreKey, {}), _jsx(RestoreLab, {})] })] }));
64
72
  }
65
73
  /** Waiting for a keeper to add this device. */
66
74
  export function Waiting() {
@@ -1 +1 @@
1
- {"version":3,"file":"window.js","sourceRoot":"","sources":["../src/window.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;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C,EAAE,SAAS,EAAC,OAAO,aACpF,0CAAiB,gBAAO,IAAI,EAAC,QAAQ,EAAC,WAAW,EAAC,oCAA+B,EAAC,QAAQ,SAAG,IAAQ,EACrG,iBAAQ,IAAI,EAAC,QAAQ,qBAAc,IAC/B,EACN,KAAC,UAAU,KAAG,EACd,KAAC,UAAU,KAAG,IACN,IACN,CACP,CAAC;AACJ,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,OAAO;IACrB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,mBAAS,SAAS,EAAC,aAAa,aAC9B,gDAA6B,EAC7B,mLAA+J,EAC/J,KAAC,SAAS,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,EACnC,KAAC,UAAU,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAI,EAC/B,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,YAAG,SAAS,EAAC,WAAW,YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,GAAK,IACzE,CACX,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -3,12 +3,13 @@
3
3
  "url": "https://github.com/matthewlovestocode/biolibs/issues"
4
4
  },
5
5
  "dependencies": {
6
- "@biolibs/bionet": "^1.2.0",
7
- "@biolibs/bionet-client": "^0.1.0",
8
- "@biolibs/bionet-react": "^0.1.1",
6
+ "@biolibs/bionet": "^1.3.1",
7
+ "@biolibs/bionet-client": "^0.2.1",
8
+ "@biolibs/bionet-react": "^0.2.0",
9
+ "@biolibs/bionet-space": "^0.3.0",
9
10
  "@biolibs/opencloning": "^2.0.0"
10
11
  },
11
- "description": "The parts of a Bionet lab application, ready to place: the freezer, the people, the history, what other labs are shown, and a whole window that puts them together, in a light theme and a dark one",
12
+ "description": "The parts of a Bionet lab application, ready to place: the freezer, where things are kept, the people, the history, what other labs are shown, backing up, and a whole window that puts them together, in a light theme and a dark one",
12
13
  "engines": {
13
14
  "node": ">=20"
14
15
  },
@@ -53,5 +54,5 @@
53
54
  ],
54
55
  "type": "module",
55
56
  "types": "dist/index.d.ts",
56
- "version": "0.2.0"
57
+ "version": "0.3.1"
57
58
  }
package/panels.css CHANGED
@@ -59,3 +59,11 @@
59
59
  .bionet main.page { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 6rem; overflow: visible; font-size: 15px; line-height: 1.65 }
60
60
  .bionet main.page .title { margin-bottom: .6rem } .bionet main.page h1 { font-size: 1.6rem }
61
61
  .bionet main.page h2 { font-size: 1.1rem; margin: 2.4rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--bionet-rule) }
62
+ /* Places, where a tube is, and restoring a key. */
63
+ .bionet .where { display: grid; gap: .25rem }
64
+ .bionet .where select { max-width: 11rem }
65
+ .bionet .plainlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem }
66
+ .bionet details.restore { margin-top: .9rem }
67
+ .bionet details.restore summary { cursor: pointer; color: var(--bionet-dim) }
68
+ .bionet details.restore summary:hover { color: var(--bionet-ink) }
69
+ .bionet .origin { max-width: 14rem; margin-top: .15rem }
package/src/backup.tsx ADDED
@@ -0,0 +1,126 @@
1
+ "use client";
2
+
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
+ /**
9
+ * How to hand the person a file to keep. A host that cannot use the browser's own way supplies one,
10
+ * and may answer `false` if the person chose not to save it. The default offers it as a download.
11
+ */
12
+ export const SaveContext = createContext<(name: string, text: string) => Promise<boolean | void>>(async (name, text) => {
13
+ const link = document.createElement("a");
14
+ link.href = URL.createObjectURL(new Blob([text], { type: "application/json" }));
15
+ link.download = name;
16
+ link.click();
17
+ URL.revokeObjectURL(link.href);
18
+ });
19
+
20
+ /** Seal this device's key under a passphrase and hand it over as a file. */
21
+ export function BackUpKey() {
22
+ const state = useLab();
23
+ const act = useAct();
24
+ const save = useContext(SaveContext);
25
+ const [note, setNote] = useState<string | null>(null);
26
+ if (state === null) return null;
27
+ return (
28
+ <section className="card">
29
+ <h2>Back up this device's key</h2>
30
+ <p className="dim small">
31
+ 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
32
+ 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
33
+ this computer, and the passphrase somewhere that is not the file. Nothing here remembers the passphrase.
34
+ </p>
35
+ <Ask className="stack" onAsk={async (data) => {
36
+ setNote(null);
37
+ const [first, again] = [String(data.get("passphrase") ?? ""), String(data.get("again") ?? "")];
38
+ if (first !== again) { setNote("Those two passphrases are not the same."); return { ok: false }; }
39
+ const answer = await act("backUp", first);
40
+ if (!answer.ok) return answer;
41
+ const saved = await save(`bionet-key-${state.device.fingerprint}.json`, String(answer.result));
42
+ if (saved === false) { setNote("Not saved. Nothing has been written anywhere."); return { ok: false }; }
43
+ setNote("Sealed and saved. Keep it somewhere that is not this computer. Open it only on a new device, before that device joins a lab.");
44
+ return answer;
45
+ }}>
46
+ <label>Passphrase<input name="passphrase" type="password" required minLength={12} autoComplete="new-password" /></label>
47
+ <label>And again<input name="again" type="password" required minLength={12} autoComplete="new-password" /></label>
48
+ <button type="submit">Seal and save</button>
49
+ </Ask>
50
+ {note !== null && <p className="small" role="status">{note}</p>}
51
+ </section>
52
+ );
53
+ }
54
+
55
+ /** Take up a key from a backup, on a device that is not in a lab yet. */
56
+ export function RestoreKey() {
57
+ const act = useAct();
58
+ return (
59
+ <details className="restore">
60
+ <summary>Replacing a lost device? Restore its key</summary>
61
+ <p className="dim small">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.</p>
62
+ <Ask className="stack" onAsk={async (data) => {
63
+ const file = data.get("backup");
64
+ const backup = file instanceof File ? await file.text() : "";
65
+ return act("restore", { backup, passphrase: String(data.get("passphrase") ?? "") });
66
+ }}>
67
+ <label>Backup file<input name="backup" type="file" accept="application/json,.json" required /></label>
68
+ <label>Passphrase<input name="passphrase" type="password" required autoComplete="off" /></label>
69
+ <button type="submit" className="quiet">Restore key</button>
70
+ </Ask>
71
+ </details>
72
+ );
73
+ }
74
+
75
+ /** Write everything this device holds of the lab to a file. */
76
+ export function BackUpLab() {
77
+ const state = useLab();
78
+ const act = useAct();
79
+ const save = useContext(SaveContext);
80
+ const [note, setNote] = useState<string | null>(null);
81
+ const [busy, setBusy] = useState(false);
82
+ const lab = state?.lab;
83
+ if (state === null || lab === null || lab === undefined) return null;
84
+ return (
85
+ <section className="card">
86
+ <h2>Keep a copy of the lab</h2>
87
+ <p className="dim small">
88
+ The key says who you are; this is the lab itself: every change anybody has signed, {lab.entries.length} so far. With the key's backup
89
+ and this copy, the lab can be brought back on a new computer with nothing else to ask. It is not sealed: every change in it is
90
+ signed, so it cannot be altered without that showing, but whoever reads the file reads the lab. Make a new copy as the lab grows.
91
+ </p>
92
+ <button type="button" disabled={busy} onClick={() => {
93
+ setBusy(true);
94
+ setNote(null);
95
+ void (async () => {
96
+ const answer = await act("exportLab");
97
+ if (answer.ok) {
98
+ const name = (lab.name ?? "lab").replace(/[^A-Za-z0-9]+/g, "-").replace(/^-|-$/g, "").toLowerCase() || "lab";
99
+ const saved = await save(`bionet-lab-${name}-${new Date().toISOString().slice(0, 10)}.json`, String(answer.result));
100
+ setNote(saved === false ? "Not saved. Nothing has been written anywhere." : `Saved a copy holding ${lab.entries.length} ${lab.entries.length === 1 ? "change" : "changes"}.`);
101
+ }
102
+ setBusy(false);
103
+ })();
104
+ }}>Save a copy</button>
105
+ {note !== null && <p className="small" role="status">{note}</p>}
106
+ </section>
107
+ );
108
+ }
109
+
110
+ /** Bring a lab back from a copy, on a device that is in no lab. */
111
+ export function RestoreLab() {
112
+ const act = useAct();
113
+ return (
114
+ <details className="restore">
115
+ <summary>Have a copy of a lab? Bring it back</summary>
116
+ <p className="dim small">Choose a file saved with "Keep a copy of the lab". If this device signs with a key on that lab's roster — restore the key first — it carries on where the lab left off. If not, the lab can be read here and not changed.</p>
117
+ <Ask className="stack" onAsk={async (data) => {
118
+ const file = data.get("copy");
119
+ return act("importLab", file instanceof File ? await file.text() : "");
120
+ }}>
121
+ <label>Copy of the lab<input name="copy" type="file" accept="application/json,.json" required /></label>
122
+ <button type="submit" className="quiet">Bring it back</button>
123
+ </Ask>
124
+ </details>
125
+ );
126
+ }
package/src/freezer.tsx CHANGED
@@ -2,8 +2,10 @@
2
2
 
3
3
  /** The freezer: every part, its tubes, and what can be done to them. */
4
4
  import type { ItemState, PartState } from "@biolibs/bionet";
5
+ import type { LabView } from "@biolibs/bionet-client";
5
6
  import { useAct, useLab } from "@biolibs/bionet-react";
6
7
  import { Ask } from "./parts.js";
8
+ import { PutItem } from "./places.js";
7
9
 
8
10
  const whole = (data: FormData, name: string): number => Number(String(data.get(name) ?? "").trim());
9
11
 
@@ -15,6 +17,25 @@ const whole = (data: FormData, name: string): number => Number(String(data.get(n
15
17
  */
16
18
  export const amountOf = (item: Pick<ItemState, "amount" | "unit">): string => `${item.amount}${item.unit === null ? "" : ` ${item.unit}`}`;
17
19
 
20
+ /**
21
+ * Where a tube came from, if a run made it.
22
+ *
23
+ * @param item - The tube.
24
+ * @param lab - The lab's runs, items and parts.
25
+ * @returns Something like `made by a PCR from pWren-402, fwd-1 and rev-1`, or `null` for a tube
26
+ * that was simply added.
27
+ */
28
+ export function madeFrom(item: Pick<ItemState, "from">, lab: Pick<LabView, "runs" | "items" | "parts">): string | null {
29
+ const run = item.from === null ? undefined : lab.runs.find((one) => one.run === item.from);
30
+ if (run === undefined) return null;
31
+ const names = run.inputs.map((input) => {
32
+ const tube = lab.items.find((one) => one.item === input.item);
33
+ return lab.parts.find((part) => part.checksum === tube?.part)?.name ?? "a tube";
34
+ });
35
+ const from = names.length === 0 ? "" : ` from ${names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`}`;
36
+ return `made by ${run.kind === "pcr" ? "a PCR" : `a ${run.kind} run`}${from}`;
37
+ }
38
+
18
39
  /** Every part with its tubes, and a form to add a part. Draws nothing until the lab has arrived. */
19
40
  export function Freezer() {
20
41
  const lab = useLab()?.lab;
@@ -56,7 +77,7 @@ export function PartCard({ part, items }: { part: PartState; items: ItemState[]
56
77
  </div>
57
78
  {live.length === 0 ? <p className="dim small">No tubes of this.</p> : (
58
79
  <table>
59
- <thead><tr><th>Tube</th><th>Amount</th><th>Use or add</th><th>Count</th><th /></tr></thead>
80
+ <thead><tr><th>Tube</th><th>Amount</th><th>Where</th><th>Use or add</th><th>Count</th><th /></tr></thead>
60
81
  <tbody>{live.map((item) => <ItemRow key={item.item} item={item} />)}</tbody>
61
82
  </table>
62
83
  )}
@@ -72,13 +93,19 @@ export function PartCard({ part, items }: { part: PartState; items: ItemState[]
72
93
  /** One tube: how much there is, and the ways to change that. */
73
94
  export function ItemRow({ item }: { item: ItemState }) {
74
95
  const act = useAct();
96
+ const lab = useLab()?.lab;
97
+ const origin = lab === null || lab === undefined ? null : madeFrom(item, lab);
75
98
  return (
76
99
  <tr className={item.needsRecount ? "flagged" : undefined}>
77
- <td><code>{item.item.slice(0, 10)}…</code></td>
100
+ <td>
101
+ <code>{item.item.slice(0, 10)}…</code>
102
+ {origin !== null && <div className="dim small origin">{origin}</div>}
103
+ </td>
78
104
  <td>
79
105
  <strong>{amountOf(item)}</strong>
80
106
  {item.needsRecount && <span className="badge" title="The log has lost track of this tube: it went below zero, or two people counted it at once.">needs a count</span>}
81
107
  </td>
108
+ <td><PutItem item={item} /></td>
82
109
  <td>
83
110
  <div className="row tight">
84
111
  <button type="button" className="quiet" onClick={() => void act("adjust", { item: item.item, by: -1 })}>−1</button>
package/src/history.tsx CHANGED
@@ -4,6 +4,7 @@
4
4
  import { useState } from "react";
5
5
  import type { EntryView, LabView } from "@biolibs/bionet-client";
6
6
  import { useLab } from "@biolibs/bionet-react";
7
+ import { slotName } from "@biolibs/bionet-space";
7
8
 
8
9
  /**
9
10
  * What one change was, in words.
@@ -12,7 +13,7 @@ import { useLab } from "@biolibs/bionet-react";
12
13
  * @param lab - The lab, to name the parts, tubes and people it refers to.
13
14
  * @returns A phrase that follows the name of whoever made it, like `used 2 µL of a tube of f1`.
14
15
  */
15
- export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster">): string {
16
+ export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster"> & Partial<Pick<LabView, "places">>): string {
16
17
  const op = entry.op;
17
18
  const part = (checksum: unknown): string => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
18
19
  const tube = (id: unknown): string => {
@@ -21,6 +22,7 @@ export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "
21
22
  };
22
23
  const unit = (id: unknown): string => lab.items.find((one) => one.item === id)?.unit ?? "";
23
24
  const who = (key: unknown): string => lab.roster.find((one) => one.key === key)?.person ?? "a device";
25
+ const place = (id: unknown): string => lab.places?.find((one) => one.place === id)?.name ?? "a place";
24
26
  const tidy = (words: string): string => words.replace(/\s+/g, " ").trim();
25
27
  switch (op.type) {
26
28
  case "roster.found": return `founded ${String(op["name"])}`;
@@ -33,6 +35,27 @@ export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "
33
35
  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"])}`);
34
36
  case "item.recount": return tidy(`counted ${String(op["amount"])} ${unit(op["item"])} in ${tube(op["item"])}`);
35
37
  case "item.retire": return `retired ${tube(op["item"])}`;
38
+ case "place.add": return `added the ${String(op["kind"])} ${String(op["name"])}${op["parent"] === null ? "" : ` in ${place(op["parent"])}`}`;
39
+ case "place.move": return op["parent"] === null ? `took ${place(op["place"])} out of where it was` : `moved ${place(op["place"])} into ${place(op["parent"])}`;
40
+ case "place.stand": return op["standing"] === null ? `cleared where ${place(op["place"])} stands` : `said where ${place(op["place"])} stands`;
41
+ case "place.retire": return `retired ${place(op["place"])}`;
42
+ case "item.put": {
43
+ const slot = op["slot"] as { row: number; column: number } | null;
44
+ return op["place"] === null ? `took ${tube(op["item"])} out of where it was`
45
+ : `put ${tube(op["item"])} in ${place(op["place"])}${slot === null ? "" : `, ${slotName(slot)}`}`;
46
+ }
47
+ case "run.record": {
48
+ const made = Array.isArray(op["outputs"]) ? (op["outputs"] as { name?: unknown }[]) : [];
49
+ const at = op["instrument"] === null ? "" : ` at ${place(op["instrument"])}`;
50
+ if (op["kind"] === "digest") {
51
+ const settings = (typeof op["settings"] === "object" && op["settings"] !== null ? op["settings"] : {}) as Record<string, unknown>;
52
+ const cut = Array.isArray(op["inputs"]) ? tube((op["inputs"] as { item?: unknown }[])[0]?.item) : "a tube";
53
+ const enzymes = typeof settings["enzymes"] === "string" ? ` with ${settings["enzymes"].replace(/\+/g, " and ")}` : "";
54
+ return `digested ${cut}${enzymes}${at}: the gel ${op["outcome"] === "worked" ? "matched" : "did not match"}`;
55
+ }
56
+ const what = op["kind"] === "pcr" ? "a PCR" : `a ${String(op["kind"])} run`;
57
+ return op["outcome"] === "worked" ? `ran ${what}${at}, which made ${made.map((one) => String(one.name)).join(" and ") || "nothing"}` : `ran ${what}${at}, which did not work`;
58
+ }
36
59
  case "field.set": return `set ${String(op["field"])} to ${String(op["value"])}`;
37
60
  default: return `did something this version does not know (${op.type})`;
38
61
  }
package/src/index.ts CHANGED
@@ -23,6 +23,8 @@
23
23
  */
24
24
  export * from "./window.js";
25
25
  export * from "./freezer.js";
26
+ export * from "./places.js";
27
+ export * from "./backup.js";
26
28
  export * from "./people.js";
27
29
  export * from "./history.js";
28
30
  export * from "./sharing.js";
package/src/people.tsx CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  /** The people: who is in the lab, and letting somebody in. */
4
4
  import { useAct, useLab } from "@biolibs/bionet-react";
5
+ import { BackUpKey, BackUpLab } from "./backup.js";
5
6
  import { Ask, Copy } from "./parts.js";
6
7
 
7
8
  /** The roster, and for a keeper the way to add somebody. Draws nothing until the lab has arrived. */
@@ -47,6 +48,8 @@ export function People() {
47
48
  ) : <p className="dim small">Set the lab's web peer under Sharing to have an invitation to send.</p>}
48
49
  </section>
49
50
  ) : <p className="dim small">Only a keeper can change who is in the lab.</p>}
51
+ <BackUpKey />
52
+ <BackUpLab />
50
53
  </>
51
54
  );
52
55
  }