@biolibs/bionet-panels 0.3.6 → 0.3.9
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/adviser.js +2 -2
- package/dist/adviser.js.map +1 -1
- package/dist/freezer.d.ts +7 -0
- package/dist/freezer.d.ts.map +1 -1
- package/dist/freezer.js +8 -1
- 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 +5 -1
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/strains.d.ts +8 -0
- package/dist/strains.d.ts.map +1 -0
- package/dist/strains.js +78 -0
- package/dist/strains.js.map +1 -0
- package/package.json +1 -1
- package/src/adviser.tsx +2 -2
- package/src/freezer.tsx +10 -1
- package/src/history.tsx +6 -2
- package/src/index.ts +2 -0
- package/src/strains.tsx +170 -0
package/dist/adviser.js
CHANGED
|
@@ -14,7 +14,7 @@ const TOOL_WORDS = {
|
|
|
14
14
|
lab_overview: "looked over the lab", list_parts: "read the list of parts", get_part: "read a part closely", list_tubes: "read the list of tubes",
|
|
15
15
|
list_runs: "read what has been done", list_proposals: "read what is proposed", find_cutters: "looked for enzymes that cut a part",
|
|
16
16
|
design_primers: "designed a pair of primers", work_out_pcr: "worked out a PCR", work_out_digest: "worked out a digest", work_out_ligation: "worked out a ligation",
|
|
17
|
-
search_ncbi: "searched NCBI", fetch_from_ncbi: "read a sequence from NCBI", add_part: "added a part", propose_pcr: "proposed a PCR", propose_digest: "proposed a digest", propose_ligation: "proposed a ligation", withdraw_proposal: "took a proposal back",
|
|
17
|
+
search_ncbi: "searched NCBI", fetch_from_ncbi: "read a sequence from NCBI", keep_from_ncbi: "kept a sequence from NCBI", add_part: "added a part", propose_pcr: "proposed a PCR", propose_digest: "proposed a digest", propose_ligation: "proposed a ligation", withdraw_proposal: "took a proposal back",
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* What the adviser did, in a few words.
|
|
@@ -47,7 +47,7 @@ export function Adviser({ door, onWatch }) {
|
|
|
47
47
|
setBusy(false);
|
|
48
48
|
} };
|
|
49
49
|
const theirs = hosting === null ? [] : lab.plans.filter((one) => one.by === hosting.key);
|
|
50
|
-
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "An adviser on this device" }), _jsx("p", { className: "small", children: "An adviser is a member with no hands: an agent that can read what the lab holds, work things out with the lab's own tools, add a part by its sequence, and propose a run for a person to carry out." }), _jsx("p", { className: "dim small", children: "It cannot say that anything was done, used or moved. That is not a setting here: its key has the role of adviser, and every device in the lab refuses anything else it writes. What it proposes is shown at the tool that would carry it out, with its reasons, and nothing happens until a person does it." }), hosting === null ? (_jsx("button", { type: "button", disabled: busy, onClick: () => void ask(() => act("hostAdviser")), children: "Host an adviser on this device" })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "keybox", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "The adviser's key" }), _jsx(Copy, { words: hosting.key, label: "Copy key" })] }), _jsx("code", { className: "wrap", children: hosting.key }), _jsxs("p", { className: "dim small", children: ["Fingerprint ", _jsx("code", { children: hosting.fingerprint }), ". It is a key of its own, kept on this device and apart from yours: what the adviser writes is signed with it and never with your key."] })] }), hosting.standing === "adviser" && _jsx("p", { className: "small good", role: "status", children: "It is in the lab as an adviser." }), hosting.standing === "removed" && _jsx("p", { className: "small trouble", role: "status", children: "It was removed from the lab. What it wrote until then is kept." }), (hosting.standing === "member" || hosting.standing === "keeper") && (_jsxs("p", { className: "small trouble", role: "status", children: ["This key is in the lab as a ", hosting.standing, ", which can do more than advise. Nothing is written with it from here until a keeper makes it an adviser."] })), hosting.standing === null && (lab.keeper ? (_jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsx("p", { className: "small", children: "It is not in the lab yet. Until it is, it can read and work things out, and propose nothing." }), _jsxs("label", { children: ["Call it", _jsx("input", { value: person, onChange: (event) => setPerson(event.target.value), maxLength: 200, "aria-label": "What to call the adviser" })] }), _jsx("button", { type: "button", disabled: person.trim() === "", onClick: () => void ask(() => act("addMember", { key: hosting.key, person: person.trim(), role: "adviser" })), children: "Let it into the lab as an adviser" })] })) : _jsx("p", { className: "small", children: "It is not in the lab yet. Only a keeper can let it in: send them the key above, to add as an adviser." }))] }))] }), hosting !== null && door !== undefined && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The way in" }), _jsx("p", { className: "small", children: "An agent reaches the adviser's tools through a door on this computer. It is shut until you open it, it cannot be reached from the network, and whoever comes through it needs a token that is kept sealed on this device." }), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", disabled: busy, onClick: () => void ask(() => door.turn(!door.on)), children: door.on ? "Shut the door" : "Open the door" }), _jsx("span", { className: door.on ? "small good" : "dim small", role: "status", children: door.on ? "Open, on this computer only." : "Shut. Nothing can reach the adviser." })] }), door.on && door.url !== null && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "keybox", children: [_jsx("div", { children: _jsx("span", { className: "label", children: "Where it is" }) }), _jsx("code", { className: "wrap", children: door.url })] }), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(async () => { await door.copy(); setCopied(true); setTimeout(() => setCopied(false), 2500); }), children: copied ? "Copied" : "Copy the command that connects Claude Code" }), door.renew !== undefined && _jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(() => door.renew()), children: "Make a new token" })] }), _jsx("p", { className: "dim small", children: "The command carries the token, so it goes to the clipboard and is not shown here. Paste it into a terminal once. A new token shuts the door and shuts out whatever had the old one." })] }))] })), hosting !== null && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "What it has done" }), theirs.length === 0 ? _jsx("p", { className: "dim small", children: "It has proposed nothing." }) : (_jsxs("p", { className: "small", children: ["It has proposed ", theirs.length, " ", theirs.length === 1 ? "run" : "runs", ": ", theirs.filter((one) => one.settled === null).length, " open,", " ", theirs.filter((one) => one.settled !== null && one.settled.run !== null).length, " carried out, ", theirs.filter((one) => one.settled !== null && one.settled.run === null).length, " set aside. Each is at its tool, under Proposed."] })), door?.seen !== undefined && door.seen.length > 0 && (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "When" }), _jsx("th", { children: "It" }), _jsx("th", {})] }) }), _jsx("tbody", { children: [...door.seen].reverse().slice(0, 12).map((one, at) => (_jsxs("tr", { children: [_jsx("td", { className: "dim", children: new Date(one.at).toLocaleTimeString() }), _jsx("td", { children: adviserDid(one.tool) }), _jsx("td", { children: one.ok ? "" : _jsx("span", { className: "badge", children: "could not" }) })] }, `${one.at} ${at}`))) })] })), onWatch !== undefined && (_jsxs("div", { className: "row", children: [_jsx("button", { type: "button", onClick: onWatch, children: "Watch it work" }), _jsx("span", { className: "dim small", children: "The lab, with the view going wherever the adviser is looking." })] })), _jsx("p", { className: "dim small", children: "Everything it writes is in History under its own name, like anybody's." })] }))] }));
|
|
50
|
+
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "An adviser on this device" }), _jsx("p", { className: "small", children: "An adviser is a member with no hands: an agent that can read what the lab holds, work things out with the lab's own tools, add a part by its sequence, and propose a run for a person to carry out." }), _jsx("p", { className: "dim small", children: "It cannot say that anything was done, used or moved, and it cannot change what you have marked on a part. That is not a setting here: its key has the role of adviser, and every device in the lab refuses anything else it writes. What it proposes is shown at the tool that would carry it out, with its reasons, and nothing happens until a person does it." }), hosting === null ? (_jsx("button", { type: "button", disabled: busy, onClick: () => void ask(() => act("hostAdviser")), children: "Host an adviser on this device" })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "keybox", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "The adviser's key" }), _jsx(Copy, { words: hosting.key, label: "Copy key" })] }), _jsx("code", { className: "wrap", children: hosting.key }), _jsxs("p", { className: "dim small", children: ["Fingerprint ", _jsx("code", { children: hosting.fingerprint }), ". It is a key of its own, kept on this device and apart from yours: what the adviser writes is signed with it and never with your key."] })] }), hosting.standing === "adviser" && _jsx("p", { className: "small good", role: "status", children: "It is in the lab as an adviser." }), hosting.standing === "removed" && _jsx("p", { className: "small trouble", role: "status", children: "It was removed from the lab. What it wrote until then is kept." }), (hosting.standing === "member" || hosting.standing === "keeper") && (_jsxs("p", { className: "small trouble", role: "status", children: ["This key is in the lab as a ", hosting.standing, ", which can do more than advise. Nothing is written with it from here until a keeper makes it an adviser."] })), hosting.standing === null && (lab.keeper ? (_jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsx("p", { className: "small", children: "It is not in the lab yet. Until it is, it can read and work things out, and propose nothing." }), _jsxs("label", { children: ["Call it", _jsx("input", { value: person, onChange: (event) => setPerson(event.target.value), maxLength: 200, "aria-label": "What to call the adviser" })] }), _jsx("button", { type: "button", disabled: person.trim() === "", onClick: () => void ask(() => act("addMember", { key: hosting.key, person: person.trim(), role: "adviser" })), children: "Let it into the lab as an adviser" })] })) : _jsx("p", { className: "small", children: "It is not in the lab yet. Only a keeper can let it in: send them the key above, to add as an adviser." }))] }))] }), hosting !== null && door !== undefined && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The way in" }), _jsx("p", { className: "small", children: "An agent reaches the adviser's tools through a door on this computer. It is shut until you open it, it cannot be reached from the network, and whoever comes through it needs a token that is kept sealed on this device." }), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", disabled: busy, onClick: () => void ask(() => door.turn(!door.on)), children: door.on ? "Shut the door" : "Open the door" }), _jsx("span", { className: door.on ? "small good" : "dim small", role: "status", children: door.on ? "Open, on this computer only." : "Shut. Nothing can reach the adviser." })] }), door.on && door.url !== null && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "keybox", children: [_jsx("div", { children: _jsx("span", { className: "label", children: "Where it is" }) }), _jsx("code", { className: "wrap", children: door.url })] }), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(async () => { await door.copy(); setCopied(true); setTimeout(() => setCopied(false), 2500); }), children: copied ? "Copied" : "Copy the command that connects Claude Code" }), door.renew !== undefined && _jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(() => door.renew()), children: "Make a new token" })] }), _jsx("p", { className: "dim small", children: "The command carries the token, so it goes to the clipboard and is not shown here. Paste it into a terminal once. A new token shuts the door and shuts out whatever had the old one." })] }))] })), hosting !== null && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "What it has done" }), theirs.length === 0 ? _jsx("p", { className: "dim small", children: "It has proposed nothing." }) : (_jsxs("p", { className: "small", children: ["It has proposed ", theirs.length, " ", theirs.length === 1 ? "run" : "runs", ": ", theirs.filter((one) => one.settled === null).length, " open,", " ", theirs.filter((one) => one.settled !== null && one.settled.run !== null).length, " carried out, ", theirs.filter((one) => one.settled !== null && one.settled.run === null).length, " set aside. Each is at its tool, under Proposed."] })), door?.seen !== undefined && door.seen.length > 0 && (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "When" }), _jsx("th", { children: "It" }), _jsx("th", {})] }) }), _jsx("tbody", { children: [...door.seen].reverse().slice(0, 12).map((one, at) => (_jsxs("tr", { children: [_jsx("td", { className: "dim", children: new Date(one.at).toLocaleTimeString() }), _jsx("td", { children: adviserDid(one.tool) }), _jsx("td", { children: one.ok ? "" : _jsx("span", { className: "badge", children: "could not" }) })] }, `${one.at} ${at}`))) })] })), onWatch !== undefined && (_jsxs("div", { className: "row", children: [_jsx("button", { type: "button", onClick: onWatch, children: "Watch it work" }), _jsx("span", { className: "dim small", children: "The lab, with the view going wherever the adviser is looking." })] })), _jsx("p", { className: "dim small", children: "Everything it writes is in History under its own name, like anybody's." })] }))] }));
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* What the adviser is doing, said over the lab while it is being watched.
|
package/dist/adviser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adviser.js","sourceRoot":"","sources":["../src/adviser.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA8BlC,MAAM,UAAU,GAAqC;IACnD,YAAY,EAAE,qBAAqB,EAAE,UAAU,EAAE,wBAAwB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,wBAAwB;IAChJ,SAAS,EAAE,yBAAyB,EAAE,cAAc,EAAE,uBAAuB,EAAE,YAAY,EAAE,oCAAoC;IACjI,cAAc,EAAE,4BAA4B,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB;IAClK,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,2BAA2B,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,sBAAsB;
|
|
1
|
+
{"version":3,"file":"adviser.js","sourceRoot":"","sources":["../src/adviser.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA8BlC,MAAM,UAAU,GAAqC;IACnD,YAAY,EAAE,qBAAqB,EAAE,UAAU,EAAE,wBAAwB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,wBAAwB;IAChJ,SAAS,EAAE,yBAAyB,EAAE,cAAc,EAAE,uBAAuB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,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,OAAE,gBAAM,SAAS,EAAC,WAAW,oBAAK,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAQ,IAAG,GACvK,EACJ,iBAAO,SAAS,EAAC,aAAa,aAAC,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAI,kBAAkB,EACnJ,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,qBAAe,IAClE,EACL,CAAC,SAAS,IAAI,YAAG,SAAS,EAAC,WAAW,+GAAmG,IAClI,CACX,CAAC;AACJ,CAAC"}
|
package/dist/freezer.d.ts
CHANGED
|
@@ -22,6 +22,13 @@ export declare function endsWords(part: {
|
|
|
22
22
|
* @returns Something like `7 µL`.
|
|
23
23
|
*/
|
|
24
24
|
export declare const amountOf: (item: Pick<ItemState, "amount" | "unit">) => string;
|
|
25
|
+
/**
|
|
26
|
+
* How long a part is, in the units of what it is made of.
|
|
27
|
+
*
|
|
28
|
+
* @param part - The part.
|
|
29
|
+
* @returns `1,712 bp` for DNA, `402 aa` for a protein.
|
|
30
|
+
*/
|
|
31
|
+
export declare const lengthOf: (part: Pick<PartState, "kind" | "length">) => string;
|
|
25
32
|
/**
|
|
26
33
|
* Where a tube came from, if a run made it.
|
|
27
34
|
*
|
package/dist/freezer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AAC5D,OAAO,KAAK,EAAE,O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I,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAK3G;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,KAAG,MAAsE,CAAC;AAE3I;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAG,MACe,CAAC;AAEpF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CASrH;AAED,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,+BAkCpD"}
|
package/dist/freezer.js
CHANGED
|
@@ -25,6 +25,13 @@ export function endsWords(part) {
|
|
|
25
25
|
* @returns Something like `7 µL`.
|
|
26
26
|
*/
|
|
27
27
|
export const amountOf = (item) => `${item.amount}${item.unit === null ? "" : ` ${item.unit}`}`;
|
|
28
|
+
/**
|
|
29
|
+
* How long a part is, in the units of what it is made of.
|
|
30
|
+
*
|
|
31
|
+
* @param part - The part.
|
|
32
|
+
* @returns `1,712 bp` for DNA, `402 aa` for a protein.
|
|
33
|
+
*/
|
|
34
|
+
export const lengthOf = (part) => `${part.length.toLocaleString("en-US")} ${part.kind === "protein" ? "aa" : "bp"}`;
|
|
28
35
|
/**
|
|
29
36
|
* Where a tube came from, if a run made it.
|
|
30
37
|
*
|
|
@@ -56,7 +63,7 @@ export function Freezer() {
|
|
|
56
63
|
export function PartCard({ part, items }) {
|
|
57
64
|
const act = useAct();
|
|
58
65
|
const live = items.filter((item) => !item.retired);
|
|
59
|
-
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
|
|
66
|
+
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: [lengthOf(part), part.kind === "protein" ? " · protein" : "", part.circular ? " · circular" : "", endsWords(part) === null ? "" : ` · ends ${endsWords(part)}`, " \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" })] })] }));
|
|
60
67
|
}
|
|
61
68
|
/** One tube: how much there is, and the ways to change that. */
|
|
62
69
|
export function ItemRow({ item }) {
|
package/dist/freezer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freezer.js","sourceRoot":"","sources":["../src/freezer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,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;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,IAAkE;IAC1F,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvB,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjI,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,C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,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"> & Partial<Pick<LabView, "places">>): string;
|
|
9
|
+
export declare function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster"> & Partial<Pick<LabView, "places" | "strains">>): 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":"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,
|
|
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,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAyDnK;AAED,qGAAqG;AACrG,wBAAgB,OAAO,CAAC,EAAE,KAAU,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,sCA4BzD"}
|
package/dist/history.js
CHANGED
|
@@ -14,9 +14,12 @@ import { slotName } from "@biolibs/bionet-space";
|
|
|
14
14
|
export function describeEntry(entry, lab) {
|
|
15
15
|
const op = entry.op;
|
|
16
16
|
const part = (checksum) => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
17
|
+
const strain = (id) => lab.strains?.find((one) => one.strain === id)?.name ?? "a strain";
|
|
17
18
|
const tube = (id) => {
|
|
18
19
|
const item = lab.items.find((one) => one.item === id);
|
|
19
|
-
|
|
20
|
+
if (item === undefined)
|
|
21
|
+
return "a tube";
|
|
22
|
+
return item.part === null ? `a culture of ${strain(item.strain)}` : `a tube of ${part(item.part)}`;
|
|
20
23
|
};
|
|
21
24
|
const unit = (id) => lab.items.find((one) => one.item === id)?.unit ?? "";
|
|
22
25
|
const who = (key) => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
@@ -28,6 +31,7 @@ export function describeEntry(entry, lab) {
|
|
|
28
31
|
case "roster.remove": return `removed ${who(op["key"])}`;
|
|
29
32
|
case "roster.role": return `made ${who(op["key"])} ${op["role"] === "adviser" ? "an" : "a"} ${String(op["role"])}`;
|
|
30
33
|
case "part.add": return `added the part ${String(op["name"])}`;
|
|
34
|
+
case "strain.add": return tidy(`added the strain ${String(op["name"])}, ${String(op["host"])}${Array.isArray(op["carries"]) && op["carries"].length > 0 ? `, carrying ${op["carries"].map(part).join(" and ")}` : ""}`);
|
|
31
35
|
case "part.annotate": return `marked ${Array.isArray(op["features"]) ? op["features"].length : 0} features on ${part(op["part"])}`;
|
|
32
36
|
case "part.offer": return op["available"] === true ? `put ${part(op["part"])} on offer` : `took ${part(op["part"])} off offer`;
|
|
33
37
|
case "item.add": return tidy(`added ${tube(op["item"])}, ${String(op["amount"])} ${String(op["unit"] ?? "")}`);
|
package/dist/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,GAA+F;IACzJ,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,IAAI,GAAG,CAAC,QAAiB,EAA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AAG,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,6 +16,7 @@
|
|
|
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
|
* - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
|
|
19
|
+
* - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
|
|
19
20
|
* - `parts.tsx` — the small pieces they are made of
|
|
20
21
|
* - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
|
|
21
22
|
*
|
|
@@ -27,6 +28,7 @@ export * from "./freezer.js";
|
|
|
27
28
|
export * from "./places.js";
|
|
28
29
|
export * from "./backup.js";
|
|
29
30
|
export * from "./people.js";
|
|
31
|
+
export * from "./strains.js";
|
|
30
32
|
export * from "./adviser.js";
|
|
31
33
|
export * from "./history.js";
|
|
32
34
|
export * from "./sharing.js";
|
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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
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
|
* - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
|
|
19
|
+
* - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
|
|
19
20
|
* - `parts.tsx` — the small pieces they are made of
|
|
20
21
|
* - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
|
|
21
22
|
*
|
|
@@ -27,6 +28,7 @@ export * from "./freezer.js";
|
|
|
27
28
|
export * from "./places.js";
|
|
28
29
|
export * from "./backup.js";
|
|
29
30
|
export * from "./people.js";
|
|
31
|
+
export * from "./strains.js";
|
|
30
32
|
export * from "./adviser.js";
|
|
31
33
|
export * from "./history.js";
|
|
32
34
|
export * from "./sharing.js";
|
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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** What a run that made a strain is called, for the lab's record. */
|
|
2
|
+
export declare const TRANSFORMATION = "transformation";
|
|
3
|
+
/**
|
|
4
|
+
* Every strain, its cultures, and what has been proposed for one. Draws nothing until the lab has
|
|
5
|
+
* arrived.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Strains(): import("react").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=strains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strains.d.ts","sourceRoot":"","sources":["../src/strains.tsx"],"names":[],"mappings":"AAgBA,qEAAqE;AACrE,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,OAAO,uCAkJtB"}
|
package/dist/strains.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The strains: what the lab keeps alive, and the cultures of each.
|
|
5
|
+
*
|
|
6
|
+
* A part is known by its sequence, so two labs that made the same molecule agree without ever
|
|
7
|
+
* having spoken. A strain is not like that and this panel says so where a person can read it: a
|
|
8
|
+
* strain is this lab's, made here from something, and the same plasmid put into the same published
|
|
9
|
+
* host twice is two strains. That is why one is added by hand rather than worked out.
|
|
10
|
+
*/
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
13
|
+
import { amountOf } from "./freezer.js";
|
|
14
|
+
import { Ask } from "./parts.js";
|
|
15
|
+
import { PutItem } from "./places.js";
|
|
16
|
+
/** What a run that made a strain is called, for the lab's record. */
|
|
17
|
+
export const TRANSFORMATION = "transformation";
|
|
18
|
+
/**
|
|
19
|
+
* Every strain, its cultures, and what has been proposed for one. Draws nothing until the lab has
|
|
20
|
+
* arrived.
|
|
21
|
+
*/
|
|
22
|
+
export function Strains() {
|
|
23
|
+
const state = useLab();
|
|
24
|
+
const act = useAct();
|
|
25
|
+
const [busy, setBusy] = useState(false);
|
|
26
|
+
const lab = state?.lab;
|
|
27
|
+
if (state === null || lab === null || lab === undefined)
|
|
28
|
+
return null;
|
|
29
|
+
const carried = (checksums) => checksums.map((one) => lab.parts.find((part) => part.checksum === one)?.name ?? "a part the lab no longer lists").join(", ");
|
|
30
|
+
const person = (key) => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
31
|
+
const tubeName = (item) => {
|
|
32
|
+
const held = lab.items.find((one) => one.item === item);
|
|
33
|
+
if (held === undefined)
|
|
34
|
+
return "a tube";
|
|
35
|
+
return held.part === null ? lab.strains.find((one) => one.strain === held.strain)?.name ?? "a culture"
|
|
36
|
+
: lab.parts.find((one) => one.checksum === held.part)?.name ?? "a part";
|
|
37
|
+
};
|
|
38
|
+
/** The proposals for a transformation, which have no bench of their own to be shown at. */
|
|
39
|
+
const proposed = lab.plans.filter((one) => one.settled === null && one.kind === TRANSFORMATION);
|
|
40
|
+
/** A transformation that was done and that no strain yet says it came out of. */
|
|
41
|
+
const awaiting = lab.runs.filter((one) => one.kind === TRANSFORMATION && one.outcome === "worked" && !lab.strains.some((each) => each.from === one.run));
|
|
42
|
+
/** What a run put in, and into what: the two things a strain made by it would carry and come from. */
|
|
43
|
+
const outOf = (run) => {
|
|
44
|
+
const held = (role) => lab.items.find((one) => one.item === run.inputs.find((each) => each.role === role)?.item);
|
|
45
|
+
const construct = held("construct");
|
|
46
|
+
const into = held("host");
|
|
47
|
+
const parent = into?.strain ?? null;
|
|
48
|
+
return { carries: construct?.part === null || construct?.part === undefined ? [] : [construct.part],
|
|
49
|
+
parent, host: lab.strains.find((one) => one.strain === parent)?.host ?? "" };
|
|
50
|
+
};
|
|
51
|
+
const ask = async (work) => { setBusy(true); try {
|
|
52
|
+
await work();
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setBusy(false);
|
|
56
|
+
} };
|
|
57
|
+
/** Record a proposed transformation as done, one way or the other, and settle the proposal with it. */
|
|
58
|
+
const done = (plan, outcome) => act("recordRun", {
|
|
59
|
+
kind: TRANSFORMATION, plan: plan.plan, outcome, note: plan.note,
|
|
60
|
+
inputs: plan.inputs.flatMap((one) => (one.item === undefined ? [] : [{ item: one.item, amount: one.amount, role: one.role }])),
|
|
61
|
+
});
|
|
62
|
+
return (_jsxs(_Fragment, { children: [proposed.length > 0 && (_jsxs("section", { className: "card proposed", children: [_jsx("h2", { children: "Proposed" }), _jsx("p", { className: "dim small", children: "A transformation is not run at a machine, so what is proposed for one is shown here. Carrying it out is yours. Whether it worked is whether anything grew, which only you can say; either way it used what it used." }), proposed.map((plan) => (_jsxs("article", { className: "plan", children: [_jsxs("p", { className: "small", children: [_jsx("strong", { children: person(plan.by) }), " proposes ", plan.inputs.map((one) => `${one.item === undefined ? carried([one.part]) : tubeName(one.item)} as ${one.role}`).join(", "), "."] }), plan.note !== null && _jsx("p", { className: "small why", children: plan.note }), plan.wanting.length > 0 && _jsxs("p", { className: "small attention", children: ["Since this was proposed, ", plan.wanting.map(tubeName).join(" and "), " has been retired or run short."] }), _jsxs("div", { className: "row tight", children: [_jsx("button", { type: "button", disabled: busy, onClick: () => void ask(() => done(plan, "worked")), children: "Colonies grew" }), _jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(() => done(plan, "failed")), children: "Nothing grew" }), _jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask(() => act("settlePlan", { plan: plan.plan })), children: "Set it aside" })] })] }, plan.plan)))] })), awaiting.map((run) => {
|
|
63
|
+
const { carries, parent, host } = outOf(run);
|
|
64
|
+
return (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "What came of it" }), _jsxs("p", { className: "small", children: ["A transformation was recorded", carries.length === 0 ? "" : _jsxs(_Fragment, { children: [" with ", carried(carries)] }), parent === null ? "" : _jsxs(_Fragment, { children: [" into ", lab.strains.find((one) => one.strain === parent).name] }), ", and nothing yet says what strain came out of it. Name it once you have colonies."] }), _jsxs(Ask, { onAsk: (data) => act("addStrain", {
|
|
65
|
+
name: String(data.get("name") ?? ""), host: String(data.get("host") ?? ""), carries, parent, from: run.run,
|
|
66
|
+
}), className: "stack", children: [_jsxs("label", { children: ["Call it", _jsx("input", { name: "name", required: true, maxLength: 200, defaultValue: `${lab.strains.find((one) => one.strain === parent)?.name ?? "a host"} ${carried(carries) || "transformant"}` })] }), _jsxs("label", { children: ["What it is", _jsx("input", { name: "host", required: true, maxLength: 200, defaultValue: host })] }), _jsx("button", { type: "submit", children: "That is what came of it" })] }), _jsxs("p", { className: "dim small", children: ["It will say it came from this run and from ", parent === null ? "nothing the lab keeps" : lab.strains.find((one) => one.strain === parent).name, ", so the whole way back is in the record."] })] }, run.run));
|
|
67
|
+
}), lab.strains.length === 0 ? _jsx("p", { className: "empty", children: "The lab keeps no strains yet. A strain is an organism with something put into it, and it is named here rather than worked out: two labs that put the same plasmid into the same host have two strains." }) : (lab.strains.map((strain) => {
|
|
68
|
+
const cultures = lab.items.filter((one) => one.strain === strain.strain && !one.retired);
|
|
69
|
+
const parent = lab.strains.find((one) => one.strain === strain.parent);
|
|
70
|
+
const run = lab.runs.find((one) => one.run === strain.from);
|
|
71
|
+
return (_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsx("h2", { children: strain.name }), _jsx("span", { className: "dim small", children: strain.host })] }), _jsxs("p", { className: "small", children: [strain.carries.length === 0 ? _jsx("span", { className: "dim", children: "Nothing has been put into it." }) : _jsxs(_Fragment, { children: ["Carries ", carried(strain.carries), "."] }), parent !== undefined && _jsxs(_Fragment, { children: [" Made from ", parent.name, "."] }), run !== undefined && _jsxs(_Fragment, { children: [" By a ", run.kind, " run."] })] }), typeof strain.fields["note"] === "string" && _jsx("p", { className: "small why", children: strain.fields["note"] }), cultures.length === 0 ? _jsx("p", { className: "dim small", children: "No cultures of it. Add one below when there is something growing." }) : (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Culture" }), _jsx("th", { children: "How much" }), _jsx("th", { children: "Where" }), _jsx("th", {})] }) }), _jsx("tbody", { children: cultures.map((one) => (_jsxs("tr", { children: [_jsxs("td", { children: [_jsx("code", { children: one.item.slice(0, 8) }), one.needsRecount && _jsx("span", { className: "badge", children: "needs counting" })] }), _jsx("td", { children: amountOf(one) }), _jsx("td", { children: _jsx(PutItem, { item: one }) }), _jsx("td", { children: _jsx("button", { type: "button", className: "plain", onClick: () => void act("retire", { item: one.item }), children: "retire" }) })] }, one.item))) })] })), _jsxs(Ask, { onAsk: (data) => act("addItem", { strain: strain.strain, amount: Number(String(data.get("amount") ?? "")), unit: String(data.get("unit") ?? "") }), className: "row", children: [_jsxs("label", { children: ["Add a culture", _jsx("input", { name: "amount", type: "number", min: 0, step: 1, defaultValue: 5, required: true, "aria-label": "How much" })] }), _jsxs("label", { children: ["of", _jsx("input", { name: "unit", defaultValue: "mL", maxLength: 20, "aria-label": "Unit" })] }), _jsx("button", { type: "submit", children: "Add" })] })] }, strain.strain));
|
|
72
|
+
})), _jsxs("section", { className: "card", children: [_jsx("h2", { children: "Add a strain" }), _jsx("p", { className: "dim small", children: "What organism it is, and what has been put into it. Adding one grows nothing: add a culture of it once there is something in a flask." }), _jsxs(Ask, { onAsk: (data) => act("addStrain", {
|
|
73
|
+
name: String(data.get("name") ?? ""), host: String(data.get("host") ?? ""),
|
|
74
|
+
carries: data.getAll("carries").map(String).filter((one) => one !== ""),
|
|
75
|
+
parent: String(data.get("parent") ?? "") === "" ? null : String(data.get("parent")),
|
|
76
|
+
}), className: "stack", children: [_jsxs("label", { children: ["Call it", _jsx("input", { name: "name", required: true, maxLength: 200, placeholder: "W303 pWren1-1" })] }), _jsxs("label", { children: ["What it is", _jsx("input", { name: "host", required: true, maxLength: 200, placeholder: "Saccharomyces cerevisiae W303" })] }), _jsxs("label", { children: ["It carries", _jsx("select", { name: "carries", multiple: true, size: Math.min(5, Math.max(2, lab.parts.length)), "aria-label": "What it carries", children: lab.parts.map((one) => _jsx("option", { value: one.checksum, children: one.name }, one.checksum)) })] }), _jsxs("label", { children: ["Made from", _jsxs("select", { name: "parent", "aria-label": "The strain it was made from", children: [_jsx("option", { value: "", children: "nothing the lab keeps" }), lab.strains.map((one) => _jsx("option", { value: one.strain, children: one.name }, one.strain))] })] }), _jsx("button", { type: "submit", children: "Add the strain" })] })] })] }));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=strains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strains.js","sourceRoot":"","sources":["../src/strains.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,OAAO;IACrB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QA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I,IAAxC,GAAG,CAAC,MAAM,CAAwC,CAAC,IACnF,IACH,EACR,iBAAQ,IAAI,EAAC,QAAQ,+BAAwB,IACzC,IACE,IACT,CACJ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/adviser.tsx
CHANGED
|
@@ -43,7 +43,7 @@ const TOOL_WORDS: Readonly<Record<string, string>> = {
|
|
|
43
43
|
lab_overview: "looked over the lab", list_parts: "read the list of parts", get_part: "read a part closely", list_tubes: "read the list of tubes",
|
|
44
44
|
list_runs: "read what has been done", list_proposals: "read what is proposed", find_cutters: "looked for enzymes that cut a part",
|
|
45
45
|
design_primers: "designed a pair of primers", work_out_pcr: "worked out a PCR", work_out_digest: "worked out a digest", work_out_ligation: "worked out a ligation",
|
|
46
|
-
search_ncbi: "searched NCBI", fetch_from_ncbi: "read a sequence from NCBI", add_part: "added a part", propose_pcr: "proposed a PCR", propose_digest: "proposed a digest", propose_ligation: "proposed a ligation", withdraw_proposal: "took a proposal back",
|
|
46
|
+
search_ncbi: "searched NCBI", fetch_from_ncbi: "read a sequence from NCBI", keep_from_ncbi: "kept a sequence from NCBI", add_part: "added a part", propose_pcr: "proposed a PCR", propose_digest: "proposed a digest", propose_ligation: "proposed a ligation", withdraw_proposal: "took a proposal back",
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -78,7 +78,7 @@ export function Adviser({ door, onWatch }: { door?: AdviserDoor; onWatch?: () =>
|
|
|
78
78
|
<section className="card">
|
|
79
79
|
<h2>An adviser on this device</h2>
|
|
80
80
|
<p className="small">An adviser is a member with no hands: an agent that can read what the lab holds, work things out with the lab's own tools, add a part by its sequence, and propose a run for a person to carry out.</p>
|
|
81
|
-
<p className="dim small">It cannot say that anything was done, used or moved. That is not a setting here: its key has the role of adviser, and every device in the lab refuses anything else it writes. What it proposes is shown at the tool that would carry it out, with its reasons, and nothing happens until a person does it.</p>
|
|
81
|
+
<p className="dim small">It cannot say that anything was done, used or moved, and it cannot change what you have marked on a part. That is not a setting here: its key has the role of adviser, and every device in the lab refuses anything else it writes. What it proposes is shown at the tool that would carry it out, with its reasons, and nothing happens until a person does it.</p>
|
|
82
82
|
{hosting === null ? (
|
|
83
83
|
<button type="button" disabled={busy} onClick={() => void ask(() => act("hostAdviser"))}>Host an adviser on this device</button>
|
|
84
84
|
) : (
|
package/src/freezer.tsx
CHANGED
|
@@ -31,6 +31,15 @@ export function endsWords(part: { sequence: string; ends?: { left: number; right
|
|
|
31
31
|
*/
|
|
32
32
|
export const amountOf = (item: Pick<ItemState, "amount" | "unit">): string => `${item.amount}${item.unit === null ? "" : ` ${item.unit}`}`;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* How long a part is, in the units of what it is made of.
|
|
36
|
+
*
|
|
37
|
+
* @param part - The part.
|
|
38
|
+
* @returns `1,712 bp` for DNA, `402 aa` for a protein.
|
|
39
|
+
*/
|
|
40
|
+
export const lengthOf = (part: Pick<PartState, "kind" | "length">): string =>
|
|
41
|
+
`${part.length.toLocaleString("en-US")} ${part.kind === "protein" ? "aa" : "bp"}`;
|
|
42
|
+
|
|
34
43
|
/**
|
|
35
44
|
* Where a tube came from, if a run made it.
|
|
36
45
|
*
|
|
@@ -82,7 +91,7 @@ export function PartCard({ part, items }: { part: PartState; items: ItemState[]
|
|
|
82
91
|
<div className="parthead">
|
|
83
92
|
<div>
|
|
84
93
|
<h2>{part.name}</h2>
|
|
85
|
-
<p className="dim small">{part.
|
|
94
|
+
<p className="dim small">{lengthOf(part)}{part.kind === "protein" ? " · protein" : ""}{part.circular ? " · circular" : ""}{endsWords(part) === null ? "" : ` · ends ${endsWords(part)}`} · <code>{part.checksum.slice(0, 26)}…</code></p>
|
|
86
95
|
</div>
|
|
87
96
|
<label className="check" title="Whether other labs are told this part can be asked for">
|
|
88
97
|
<input type="checkbox" checked={part.offered} onChange={(event) => void act("offer", { part: part.checksum, available: event.target.checked })} />
|
package/src/history.tsx
CHANGED
|
@@ -13,12 +13,15 @@ import { slotName } from "@biolibs/bionet-space";
|
|
|
13
13
|
* @param lab - The lab, to name the parts, tubes and people it refers to.
|
|
14
14
|
* @returns A phrase that follows the name of whoever made it, like `used 2 µL of a tube of f1`.
|
|
15
15
|
*/
|
|
16
|
-
export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster"> & Partial<Pick<LabView, "places">>): string {
|
|
16
|
+
export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "parts" | "items" | "roster"> & Partial<Pick<LabView, "places" | "strains">>): string {
|
|
17
17
|
const op = entry.op;
|
|
18
18
|
const part = (checksum: unknown): string => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
19
|
+
const strain = (id: unknown): string => lab.strains?.find((one) => one.strain === id)?.name ?? "a strain";
|
|
20
|
+
|
|
19
21
|
const tube = (id: unknown): string => {
|
|
20
22
|
const item = lab.items.find((one) => one.item === id);
|
|
21
|
-
|
|
23
|
+
if (item === undefined) return "a tube";
|
|
24
|
+
return item.part === null ? `a culture of ${strain(item.strain)}` : `a tube of ${part(item.part)}`;
|
|
22
25
|
};
|
|
23
26
|
const unit = (id: unknown): string => lab.items.find((one) => one.item === id)?.unit ?? "";
|
|
24
27
|
const who = (key: unknown): string => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
@@ -30,6 +33,7 @@ export function describeEntry(entry: Pick<EntryView, "op">, lab: Pick<LabView, "
|
|
|
30
33
|
case "roster.remove": return `removed ${who(op["key"])}`;
|
|
31
34
|
case "roster.role": return `made ${who(op["key"])} ${op["role"] === "adviser" ? "an" : "a"} ${String(op["role"])}`;
|
|
32
35
|
case "part.add": return `added the part ${String(op["name"])}`;
|
|
36
|
+
case "strain.add": return tidy(`added the strain ${String(op["name"])}, ${String(op["host"])}${Array.isArray(op["carries"]) && op["carries"].length > 0 ? `, carrying ${(op["carries"] as unknown[]).map(part).join(" and ")}` : ""}`);
|
|
33
37
|
case "part.annotate": return `marked ${Array.isArray(op["features"]) ? op["features"].length : 0} features on ${part(op["part"])}`;
|
|
34
38
|
case "part.offer": return op["available"] === true ? `put ${part(op["part"])} on offer` : `took ${part(op["part"])} off offer`;
|
|
35
39
|
case "item.add": return tidy(`added ${tube(op["item"])}, ${String(op["amount"])} ${String(op["unit"] ?? "")}`);
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
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
|
* - `adviser.tsx` — the adviser a device hosts: letting it in, and the door an agent reaches it by
|
|
19
|
+
* - `strains.tsx` — what the lab keeps alive: every strain, its cultures, and what is proposed for one
|
|
19
20
|
* - `parts.tsx` — the small pieces they are made of
|
|
20
21
|
* - `public.tsx` — a lab's public page: what it holds, and what it can see of another lab
|
|
21
22
|
*
|
|
@@ -27,6 +28,7 @@ export * from "./freezer.js";
|
|
|
27
28
|
export * from "./places.js";
|
|
28
29
|
export * from "./backup.js";
|
|
29
30
|
export * from "./people.js";
|
|
31
|
+
export * from "./strains.js";
|
|
30
32
|
export * from "./adviser.js";
|
|
31
33
|
export * from "./history.js";
|
|
32
34
|
export * from "./sharing.js";
|
package/src/strains.tsx
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The strains: what the lab keeps alive, and the cultures of each.
|
|
5
|
+
*
|
|
6
|
+
* A part is known by its sequence, so two labs that made the same molecule agree without ever
|
|
7
|
+
* having spoken. A strain is not like that and this panel says so where a person can read it: a
|
|
8
|
+
* strain is this lab's, made here from something, and the same plasmid put into the same published
|
|
9
|
+
* host twice is two strains. That is why one is added by hand rather than worked out.
|
|
10
|
+
*/
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
13
|
+
import { amountOf } from "./freezer.js";
|
|
14
|
+
import { Ask } from "./parts.js";
|
|
15
|
+
import { PutItem } from "./places.js";
|
|
16
|
+
|
|
17
|
+
/** What a run that made a strain is called, for the lab's record. */
|
|
18
|
+
export const TRANSFORMATION = "transformation";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Every strain, its cultures, and what has been proposed for one. Draws nothing until the lab has
|
|
22
|
+
* arrived.
|
|
23
|
+
*/
|
|
24
|
+
export function Strains() {
|
|
25
|
+
const state = useLab();
|
|
26
|
+
const act = useAct();
|
|
27
|
+
const [busy, setBusy] = useState(false);
|
|
28
|
+
const lab = state?.lab;
|
|
29
|
+
if (state === null || lab === null || lab === undefined) return null;
|
|
30
|
+
const carried = (checksums: readonly string[]): string =>
|
|
31
|
+
checksums.map((one) => lab.parts.find((part) => part.checksum === one)?.name ?? "a part the lab no longer lists").join(", ");
|
|
32
|
+
const person = (key: string): string => lab.roster.find((one) => one.key === key)?.person ?? "a device";
|
|
33
|
+
const tubeName = (item: string): string => {
|
|
34
|
+
const held = lab.items.find((one) => one.item === item);
|
|
35
|
+
if (held === undefined) return "a tube";
|
|
36
|
+
return held.part === null ? lab.strains.find((one) => one.strain === held.strain)?.name ?? "a culture"
|
|
37
|
+
: lab.parts.find((one) => one.checksum === held.part)?.name ?? "a part";
|
|
38
|
+
};
|
|
39
|
+
/** The proposals for a transformation, which have no bench of their own to be shown at. */
|
|
40
|
+
const proposed = lab.plans.filter((one) => one.settled === null && one.kind === TRANSFORMATION);
|
|
41
|
+
/** A transformation that was done and that no strain yet says it came out of. */
|
|
42
|
+
const awaiting = lab.runs.filter((one) => one.kind === TRANSFORMATION && one.outcome === "worked" && !lab.strains.some((each) => each.from === one.run));
|
|
43
|
+
/** What a run put in, and into what: the two things a strain made by it would carry and come from. */
|
|
44
|
+
const outOf = (run: (typeof lab.runs)[number]): { carries: string[]; parent: string | null; host: string } => {
|
|
45
|
+
const held = (role: string) => lab.items.find((one) => one.item === run.inputs.find((each) => each.role === role)?.item);
|
|
46
|
+
const construct = held("construct");
|
|
47
|
+
const into = held("host");
|
|
48
|
+
const parent = into?.strain ?? null;
|
|
49
|
+
return { carries: construct?.part === null || construct?.part === undefined ? [] : [construct.part],
|
|
50
|
+
parent, host: lab.strains.find((one) => one.strain === parent)?.host ?? "" };
|
|
51
|
+
};
|
|
52
|
+
const ask = async (work: () => Promise<unknown>): Promise<void> => { setBusy(true); try { await work(); } finally { setBusy(false); } };
|
|
53
|
+
/** Record a proposed transformation as done, one way or the other, and settle the proposal with it. */
|
|
54
|
+
const done = (plan: (typeof lab.plans)[number], outcome: "worked" | "failed"): Promise<unknown> =>
|
|
55
|
+
act("recordRun", {
|
|
56
|
+
kind: TRANSFORMATION, plan: plan.plan, outcome, note: plan.note,
|
|
57
|
+
inputs: plan.inputs.flatMap((one) => (one.item === undefined ? [] : [{ item: one.item, amount: one.amount, role: one.role }])),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
{proposed.length > 0 && (
|
|
63
|
+
<section className="card proposed">
|
|
64
|
+
<h2>Proposed</h2>
|
|
65
|
+
<p className="dim small">A transformation is not run at a machine, so what is proposed for one is shown here. Carrying it out is yours. Whether it worked is whether anything grew, which only you can say; either way it used what it used.</p>
|
|
66
|
+
{proposed.map((plan) => (
|
|
67
|
+
<article key={plan.plan} className="plan">
|
|
68
|
+
<p className="small"><strong>{person(plan.by)}</strong> proposes {plan.inputs.map((one) => `${one.item === undefined ? carried([one.part!]) : tubeName(one.item)} as ${one.role}`).join(", ")}.</p>
|
|
69
|
+
{plan.note !== null && <p className="small why">{plan.note}</p>}
|
|
70
|
+
{plan.wanting.length > 0 && <p className="small attention">Since this was proposed, {plan.wanting.map(tubeName).join(" and ")} has been retired or run short.</p>}
|
|
71
|
+
<div className="row tight">
|
|
72
|
+
{/* A transformation makes no molecule, so whether it worked is not something the
|
|
73
|
+
record can tell from what came out: it is whether anything grew, and only a
|
|
74
|
+
person knows that. Both answers take what it used, because it was done either way. */}
|
|
75
|
+
<button type="button" disabled={busy} onClick={() => void ask(() => done(plan, "worked"))}>Colonies grew</button>
|
|
76
|
+
<button type="button" className="quiet" disabled={busy} onClick={() => void ask(() => done(plan, "failed"))}>Nothing grew</button>
|
|
77
|
+
<button type="button" className="quiet" disabled={busy} onClick={() => void ask(() => act("settlePlan", { plan: plan.plan }))}>Set it aside</button>
|
|
78
|
+
</div>
|
|
79
|
+
</article>
|
|
80
|
+
))}
|
|
81
|
+
</section>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
{awaiting.map((run) => {
|
|
85
|
+
const { carries, parent, host } = outOf(run);
|
|
86
|
+
return (
|
|
87
|
+
<section className="card" key={run.run}>
|
|
88
|
+
<h2>What came of it</h2>
|
|
89
|
+
<p className="small">A transformation was recorded{carries.length === 0 ? "" : <> with {carried(carries)}</>}{parent === null ? "" : <> into {lab.strains.find((one) => one.strain === parent)!.name}</>}, and nothing yet says what strain came out of it. Name it once you have colonies.</p>
|
|
90
|
+
<Ask onAsk={(data) => act("addStrain", {
|
|
91
|
+
name: String(data.get("name") ?? ""), host: String(data.get("host") ?? ""), carries, parent, from: run.run,
|
|
92
|
+
})} className="stack">
|
|
93
|
+
<label>Call it<input name="name" required maxLength={200} defaultValue={`${lab.strains.find((one) => one.strain === parent)?.name ?? "a host"} ${carried(carries) || "transformant"}`} /></label>
|
|
94
|
+
<label>What it is<input name="host" required maxLength={200} defaultValue={host} /></label>
|
|
95
|
+
<button type="submit">That is what came of it</button>
|
|
96
|
+
</Ask>
|
|
97
|
+
<p className="dim small">It will say it came from this run and from {parent === null ? "nothing the lab keeps" : lab.strains.find((one) => one.strain === parent)!.name}, so the whole way back is in the record.</p>
|
|
98
|
+
</section>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
|
|
102
|
+
{lab.strains.length === 0 ? <p className="empty">The lab keeps no strains yet. A strain is an organism with something put into it, and it is named here rather than worked out: two labs that put the same plasmid into the same host have two strains.</p> : (
|
|
103
|
+
lab.strains.map((strain) => {
|
|
104
|
+
const cultures = lab.items.filter((one) => one.strain === strain.strain && !one.retired);
|
|
105
|
+
const parent = lab.strains.find((one) => one.strain === strain.parent);
|
|
106
|
+
const run = lab.runs.find((one) => one.run === strain.from);
|
|
107
|
+
return (
|
|
108
|
+
<section className="card" key={strain.strain}>
|
|
109
|
+
<div className="toolhead">
|
|
110
|
+
<h2>{strain.name}</h2>
|
|
111
|
+
<span className="dim small">{strain.host}</span>
|
|
112
|
+
</div>
|
|
113
|
+
<p className="small">
|
|
114
|
+
{strain.carries.length === 0 ? <span className="dim">Nothing has been put into it.</span> : <>Carries {carried(strain.carries)}.</>}
|
|
115
|
+
{parent !== undefined && <> Made from {parent.name}.</>}
|
|
116
|
+
{run !== undefined && <> By a {run.kind} run.</>}
|
|
117
|
+
</p>
|
|
118
|
+
{typeof strain.fields["note"] === "string" && <p className="small why">{strain.fields["note"]}</p>}
|
|
119
|
+
{cultures.length === 0 ? <p className="dim small">No cultures of it. Add one below when there is something growing.</p> : (
|
|
120
|
+
<table>
|
|
121
|
+
<thead><tr><th>Culture</th><th>How much</th><th>Where</th><th /></tr></thead>
|
|
122
|
+
<tbody>
|
|
123
|
+
{cultures.map((one) => (
|
|
124
|
+
<tr key={one.item}>
|
|
125
|
+
<td><code>{one.item.slice(0, 8)}</code>{one.needsRecount && <span className="badge">needs counting</span>}</td>
|
|
126
|
+
<td>{amountOf(one)}</td>
|
|
127
|
+
<td><PutItem item={one} /></td>
|
|
128
|
+
<td><button type="button" className="plain" onClick={() => void act("retire", { item: one.item })}>retire</button></td>
|
|
129
|
+
</tr>
|
|
130
|
+
))}
|
|
131
|
+
</tbody>
|
|
132
|
+
</table>
|
|
133
|
+
)}
|
|
134
|
+
<Ask onAsk={(data) => act("addItem", { strain: strain.strain, amount: Number(String(data.get("amount") ?? "")), unit: String(data.get("unit") ?? "") })} className="row">
|
|
135
|
+
<label>Add a culture<input name="amount" type="number" min={0} step={1} defaultValue={5} required aria-label="How much" /></label>
|
|
136
|
+
<label>of<input name="unit" defaultValue="mL" maxLength={20} aria-label="Unit" /></label>
|
|
137
|
+
<button type="submit">Add</button>
|
|
138
|
+
</Ask>
|
|
139
|
+
</section>
|
|
140
|
+
);
|
|
141
|
+
})
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
<section className="card">
|
|
145
|
+
<h2>Add a strain</h2>
|
|
146
|
+
<p className="dim small">What organism it is, and what has been put into it. Adding one grows nothing: add a culture of it once there is something in a flask.</p>
|
|
147
|
+
<Ask onAsk={(data) => act("addStrain", {
|
|
148
|
+
name: String(data.get("name") ?? ""), host: String(data.get("host") ?? ""),
|
|
149
|
+
carries: data.getAll("carries").map(String).filter((one) => one !== ""),
|
|
150
|
+
parent: String(data.get("parent") ?? "") === "" ? null : String(data.get("parent")),
|
|
151
|
+
})} className="stack">
|
|
152
|
+
<label>Call it<input name="name" required maxLength={200} placeholder="W303 pWren1-1" /></label>
|
|
153
|
+
<label>What it is<input name="host" required maxLength={200} placeholder="Saccharomyces cerevisiae W303" /></label>
|
|
154
|
+
<label>It carries
|
|
155
|
+
<select name="carries" multiple size={Math.min(5, Math.max(2, lab.parts.length))} aria-label="What it carries">
|
|
156
|
+
{lab.parts.map((one) => <option key={one.checksum} value={one.checksum}>{one.name}</option>)}
|
|
157
|
+
</select>
|
|
158
|
+
</label>
|
|
159
|
+
<label>Made from
|
|
160
|
+
<select name="parent" aria-label="The strain it was made from">
|
|
161
|
+
<option value="">nothing the lab keeps</option>
|
|
162
|
+
{lab.strains.map((one) => <option key={one.strain} value={one.strain}>{one.name}</option>)}
|
|
163
|
+
</select>
|
|
164
|
+
</label>
|
|
165
|
+
<button type="submit">Add the strain</button>
|
|
166
|
+
</Ask>
|
|
167
|
+
</section>
|
|
168
|
+
</>
|
|
169
|
+
);
|
|
170
|
+
}
|