react-cheminfo 0.40.1 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/check-deploy.mjs +3 -1
- package/lib/deploy/core/buildGate.d.ts +18 -0
- package/lib/deploy/core/buildGate.d.ts.map +1 -0
- package/lib/deploy/core/buildGate.js +115 -0
- package/lib/deploy/core/buildGate.js.map +1 -0
- package/lib/deploy/core/checkDeploy.d.ts +2 -1
- package/lib/deploy/core/checkDeploy.d.ts.map +1 -1
- package/lib/deploy/core/checkDeploy.js +4 -1
- package/lib/deploy/core/checkDeploy.js.map +1 -1
- package/lib/deploy/core/index.d.ts +1 -0
- package/lib/deploy/core/index.d.ts.map +1 -1
- package/lib/deploy/core/index.js +1 -0
- package/lib/deploy/core/index.js.map +1 -1
- package/lib/deploy/core/publishedImage.d.ts.map +1 -1
- package/lib/deploy/core/publishedImage.js +5 -1
- package/lib/deploy/core/publishedImage.js.map +1 -1
- package/lib/deploy/core/types.d.ts +1 -1
- package/lib/deploy/core/types.d.ts.map +1 -1
- package/lib/deploy/core/types.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts +1 -1
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +12 -11
- package/lib/periodic/ui/ElementCell.js.map +1 -1
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +25 -8
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +3 -2
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/periodic/ui/unit.d.ts +41 -0
- package/lib/periodic/ui/unit.d.ts.map +1 -0
- package/lib/periodic/ui/unit.js +45 -0
- package/lib/periodic/ui/unit.js.map +1 -0
- package/lib/share/ui/SharePartRow.d.ts.map +1 -1
- package/lib/share/ui/SharePartRow.js +2 -1
- package/lib/share/ui/SharePartRow.js.map +1 -1
- package/package.json +1 -1
- package/src/deploy/core/buildGate.ts +122 -0
- package/src/deploy/core/checkDeploy.ts +5 -1
- package/src/deploy/core/index.ts +1 -0
- package/src/deploy/core/publishedImage.ts +5 -1
- package/src/deploy/core/types.ts +5 -1
- package/src/periodic/ui/ElementCell.tsx +14 -12
- package/src/periodic/ui/PeriodicTable.tsx +25 -8
- package/src/periodic/ui/PeriodicTableChrome.tsx +4 -2
- package/src/periodic/ui/unit.ts +48 -0
- package/src/share/ui/SharePartRow.tsx +6 -1
- package/styles/chrome.css +15 -6
package/bin/check-deploy.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* nothing publishes or that carries no selectable tag, a page the browser keeps across a deploy and then cannot
|
|
6
6
|
* run, an `IMAGE_NAME` naming a package this repository never publishes, an
|
|
7
7
|
* `env_file` that fails on a checkout with no `.env` yet, a service with no
|
|
8
|
-
* health probe to read, an `.env.example` that hides a mode
|
|
8
|
+
* health probe to read, an `.env.example` that hides a mode, a `build` that
|
|
9
|
+
* bundles before the tests have run.
|
|
9
10
|
*
|
|
10
11
|
* Wire it as an npm script, next to check-tokens:
|
|
11
12
|
* "check-deploy": "cheminfo-check-deploy"
|
|
@@ -75,6 +76,7 @@ for (const path of [
|
|
|
75
76
|
...expected,
|
|
76
77
|
'.env.example',
|
|
77
78
|
'.gitignore',
|
|
79
|
+
'package.json',
|
|
78
80
|
'Dockerfile',
|
|
79
81
|
PAGE_CACHE_CONFIG,
|
|
80
82
|
NGINX_CONFIG,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DeployProblem } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Report a repository that can bundle, and so publish, code nothing tested.
|
|
4
|
+
*
|
|
5
|
+
* A bundle is what gets published, so `npm run build` is the gate: the unit and
|
|
6
|
+
* static checks, then the browser suite, then `build-only`, which is the pure
|
|
7
|
+
* bundle. The split is what makes the gate possible at all — three callers need
|
|
8
|
+
* the bundle without the suites, and the image build is one of them: it has no
|
|
9
|
+
* browser, and a source build on a deploy host must not re-run a suite CI
|
|
10
|
+
* already ran. A Dockerfile left on `npm run build` therefore either dies in
|
|
11
|
+
* the container or, worse, the `build` it calls was never a gate and the image
|
|
12
|
+
* carries untested code to the registry. Neither is visible until a deploy.
|
|
13
|
+
* @param packageJson - The repository's root `package.json`, unparsed.
|
|
14
|
+
* @param dockerfile - Its Dockerfile, when it has one.
|
|
15
|
+
* @param problems - Where each problem found is appended.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readBuildGate(packageJson: string | undefined, dockerfile: string | undefined, problems: DeployProblem[]): void;
|
|
18
|
+
//# sourceMappingURL=buildGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildGate.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/buildGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,aAAa,EAAE,GACxB,IAAI,CAkDN"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report a repository that can bundle, and so publish, code nothing tested.
|
|
3
|
+
*
|
|
4
|
+
* A bundle is what gets published, so `npm run build` is the gate: the unit and
|
|
5
|
+
* static checks, then the browser suite, then `build-only`, which is the pure
|
|
6
|
+
* bundle. The split is what makes the gate possible at all — three callers need
|
|
7
|
+
* the bundle without the suites, and the image build is one of them: it has no
|
|
8
|
+
* browser, and a source build on a deploy host must not re-run a suite CI
|
|
9
|
+
* already ran. A Dockerfile left on `npm run build` therefore either dies in
|
|
10
|
+
* the container or, worse, the `build` it calls was never a gate and the image
|
|
11
|
+
* carries untested code to the registry. Neither is visible until a deploy.
|
|
12
|
+
* @param packageJson - The repository's root `package.json`, unparsed.
|
|
13
|
+
* @param dockerfile - Its Dockerfile, when it has one.
|
|
14
|
+
* @param problems - Where each problem found is appended.
|
|
15
|
+
*/
|
|
16
|
+
export function readBuildGate(packageJson, dockerfile, problems) {
|
|
17
|
+
if (packageJson === undefined)
|
|
18
|
+
return;
|
|
19
|
+
const scripts = parseScripts(packageJson);
|
|
20
|
+
if (scripts === undefined)
|
|
21
|
+
return;
|
|
22
|
+
const build = scripts.build;
|
|
23
|
+
if (build !== undefined && !/\bnpm run test\b/.test(build)) {
|
|
24
|
+
problems.push({
|
|
25
|
+
file: 'package.json',
|
|
26
|
+
line: lineOf(packageJson, '"build"'),
|
|
27
|
+
kind: 'ungated-build',
|
|
28
|
+
message: 'build writes a bundle without running the tests, so a broken site can be published',
|
|
29
|
+
hint: 'build: "npm run test && npm run test-e2e && npm run build-only", with the bundle in build-only',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (build !== undefined && scripts['build-only'] === undefined) {
|
|
33
|
+
problems.push({
|
|
34
|
+
file: 'package.json',
|
|
35
|
+
line: lineOf(packageJson, '"build"'),
|
|
36
|
+
kind: 'missing-build-only',
|
|
37
|
+
message: 'there is no build-only, so nothing can bundle without the gate',
|
|
38
|
+
hint: 'move the bundle to build-only and leave build as the gate in front of it',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const test = scripts.test;
|
|
42
|
+
if (test !== undefined && /\bnpm run test-e2e\b/.test(test)) {
|
|
43
|
+
problems.push({
|
|
44
|
+
file: 'package.json',
|
|
45
|
+
line: lineOf(packageJson, '"test"'),
|
|
46
|
+
kind: 'test-runs-e2e',
|
|
47
|
+
message: 'test runs the browser suite, which build runs next: it runs twice and a failure does not say which gate it came from',
|
|
48
|
+
hint: 'leave test-e2e out of test; build is "npm run test && npm run test-e2e && npm run build-only"',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (dockerfile === undefined)
|
|
52
|
+
return;
|
|
53
|
+
const line = gatedBuildLine(dockerfile);
|
|
54
|
+
if (line !== undefined) {
|
|
55
|
+
problems.push({
|
|
56
|
+
file: 'Dockerfile',
|
|
57
|
+
line,
|
|
58
|
+
kind: 'gated-image-build',
|
|
59
|
+
message: 'the image build runs the gated build, which has no browser to run the browser suite in',
|
|
60
|
+
hint: 'RUN npm run build-only — the image builds what CI tested, it does not test again',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The line running the repository's own gated `build`, if the Dockerfile has
|
|
66
|
+
* one. A workspace build (`-w frontend`) is a different script and stays pure.
|
|
67
|
+
* @param dockerfile - The Dockerfile text.
|
|
68
|
+
* @returns Its line number, counting from 1, or undefined.
|
|
69
|
+
*/
|
|
70
|
+
function gatedBuildLine(dockerfile) {
|
|
71
|
+
const lines = dockerfile.split('\n');
|
|
72
|
+
for (const [index, text] of lines.entries()) {
|
|
73
|
+
if (!/^\s*RUN\s.*\bnpm run build\b/.test(text))
|
|
74
|
+
continue;
|
|
75
|
+
if (/\bnpm run build[\w:-]/.test(text))
|
|
76
|
+
continue;
|
|
77
|
+
if (/(?:-w|--workspace)[\s=]/.test(text))
|
|
78
|
+
continue;
|
|
79
|
+
return index + 1;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The scripts block of a `package.json`.
|
|
85
|
+
* @param text - The file, unparsed.
|
|
86
|
+
* @returns Its scripts, or undefined when the file is not readable as one.
|
|
87
|
+
*/
|
|
88
|
+
function parseScripts(text) {
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(text);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
97
|
+
return undefined;
|
|
98
|
+
const scripts = parsed.scripts;
|
|
99
|
+
if (typeof scripts !== 'object' || scripts === null)
|
|
100
|
+
return {};
|
|
101
|
+
return scripts;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Where a report should point, so the reader lands on the script itself.
|
|
105
|
+
* @param text - The file to search.
|
|
106
|
+
* @param needle - The key to find.
|
|
107
|
+
* @returns Its line, counting from 1, or 0 when it is not there.
|
|
108
|
+
*/
|
|
109
|
+
function lineOf(text, needle) {
|
|
110
|
+
const at = text.indexOf(needle);
|
|
111
|
+
if (at === -1)
|
|
112
|
+
return 0;
|
|
113
|
+
return text.slice(0, at).split('\n').length;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=buildGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildGate.js","sourceRoot":"","sources":["../../../src/deploy/core/buildGate.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAC3B,WAA+B,EAC/B,UAA8B,EAC9B,QAAyB;IAEzB,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO;IACtC,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO;IAElC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3D,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC;YACpC,IAAI,EAAE,eAAe;YACrB,OAAO,EACL,oFAAoF;YACtF,IAAI,EAAE,gGAAgG;SACvG,CAAC,CAAC;IACL,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,SAAS,EAAE,CAAC;QAC/D,QAAQ,CAAC,IA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,IAAI,CAAC,IAAI,CAAC;YAAE,SAAS;QACnD,OAAO,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACpE,MAAM,OAAO,GAAI,MAAgC,CAAC,OAAO,CAAC;IAC1D,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC/D,OAAO,OAAkB,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,MAAc;IAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,KAAK,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC"}
|
|
@@ -8,7 +8,8 @@ import type { CheckDeployOptions, DeployFile, DeployProblem } from './types.ts';
|
|
|
8
8
|
* reports it healthy. So a repository has to hand it a selectable tag on every
|
|
9
9
|
* image we build, an `IMAGE_NAME` that names the package our own workflow
|
|
10
10
|
* publishes, a compose file that parses on a checkout with no `.env` yet, and a
|
|
11
|
-
* health probe to read
|
|
11
|
+
* health probe to read, and a `build` that cannot write a bundle until the
|
|
12
|
+
* tests have passed. It also has to publish that image in the first place:
|
|
12
13
|
* with no `latest` to pull the script builds from source on the deploy host,
|
|
13
14
|
* and the install that follows must survive a blip in the registry. It also has to hand the browser a page the browser will
|
|
14
15
|
* not keep, or the next deploy leaves returning visitors on a blank one. Each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkDeploy.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/checkDeploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkDeploy.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/checkDeploy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,aAAa,EAAE,CAoEjB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readBuildGate } from "./buildGate.js";
|
|
1
2
|
import { readComposeFile } from "./composeFile.js";
|
|
2
3
|
import { readEnvExample } from "./envExample.js";
|
|
3
4
|
import { readPageCache } from "./pageCache.js";
|
|
@@ -12,7 +13,8 @@ import { DEPLOY_COMPOSE_FILES } from "./types.js";
|
|
|
12
13
|
* reports it healthy. So a repository has to hand it a selectable tag on every
|
|
13
14
|
* image we build, an `IMAGE_NAME` that names the package our own workflow
|
|
14
15
|
* publishes, a compose file that parses on a checkout with no `.env` yet, and a
|
|
15
|
-
* health probe to read
|
|
16
|
+
* health probe to read, and a `build` that cannot write a bundle until the
|
|
17
|
+
* tests have passed. It also has to publish that image in the first place:
|
|
16
18
|
* with no `latest` to pull the script builds from source on the deploy host,
|
|
17
19
|
* and the install that follows must survive a blip in the registry. It also has to hand the browser a page the browser will
|
|
18
20
|
* not keep, or the next deploy leaves returning visitors on a blank one. Each
|
|
@@ -70,6 +72,7 @@ export function findDeployProblems(files, options = {}) {
|
|
|
70
72
|
readPageCache(dockerfile, byPath, problems);
|
|
71
73
|
readInstallRetries(dockerfile, problems);
|
|
72
74
|
}
|
|
75
|
+
readBuildGate(byPath.get('package.json'), dockerfile, problems);
|
|
73
76
|
readPublishedImage(byPath.get(DOCKER_IMAGE_WORKFLOW), problems);
|
|
74
77
|
const gitignore = byPath.get('.gitignore');
|
|
75
78
|
if (gitignore === undefined || !/^\s*\/?\.deploy\/?\s*$/m.test(gitignore)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkDeploy.js","sourceRoot":"","sources":["../../../src/deploy/core/checkDeploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"checkDeploy.js","sourceRoot":"","sources":["../../../src/deploy/core/checkDeploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA4B,EAC5B,UAA8B,EAAE;IAEhC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,IA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ACP,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,8CAA8C;YACvD,IAAI,EAAE,kFAAkF;SACzF,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC5C,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAEhE,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEhE,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC3C,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1E,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EACL,8EAA8E;YAChF,IAAI,EAAE,kCAAkC;SACzC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { readBuildGate } from './buildGate.ts';
|
|
1
2
|
export { findDeployProblems } from './checkDeploy.ts';
|
|
2
3
|
export type { CheckDeployOptions, DeployFile, DeployProblem, DeployProblemKind, } from './types.ts';
|
|
3
4
|
export { NGINX_CONFIG, PAGE_CACHE_CONFIG } from './pageCache.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/deploy/core/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { readBuildGate } from "./buildGate.js";
|
|
1
2
|
export { findDeployProblems } from "./checkDeploy.js";
|
|
2
3
|
export { NGINX_CONFIG, PAGE_CACHE_CONFIG } from "./pageCache.js";
|
|
3
4
|
export { DOCKER_IMAGE_WORKFLOW, readInstallRetries, readPublishedImage, } from "./publishedImage.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deploy/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deploy/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishedImage.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/publishedImage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,uCAAuC,CAAC;AAS1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,aAAa,EAAE,GACxB,IAAI,
|
|
1
|
+
{"version":3,"file":"publishedImage.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/publishedImage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,uCAAuC,CAAC;AAS1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,aAAa,EAAE,GACxB,IAAI,CAyCN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,aAAa,EAAE,GACxB,IAAI,CAsBN"}
|
|
@@ -42,7 +42,11 @@ export function readPublishedImage(workflow, problems) {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
const value = match.groups.value ?? '';
|
|
45
|
-
|
|
45
|
+
// Either guard keeps a branch name out: `event_name == 'push'` fires only for
|
|
46
|
+
// the tag push, and `ref_type == 'tag'` only when the ref is one. What is
|
|
47
|
+
// refused is the bare ref, which a manual run hands over as a branch.
|
|
48
|
+
const guarded = value.includes('event_name') || value.includes('ref_type');
|
|
49
|
+
if (value.includes('github.ref_name') && !guarded) {
|
|
46
50
|
problems.push({
|
|
47
51
|
file: DOCKER_IMAGE_WORKFLOW,
|
|
48
52
|
line: lineOf(workflow, TAG_VERSION),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishedImage.js","sourceRoot":"","sources":["../../../src/deploy/core/publishedImage.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,oCAAoC,CAAC;AAE1E,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,OAAO,GAAG,sBAAsB,CAAC;AACvC,MAAM,OAAO,GAAG,yCAAyC,CAAC;AAC1D,MAAM,KAAK,GAAG,cAAc,CAAC;AAC7B,4EAA4E;AAC5E,MAAM,OAAO,GAAG,8DAA8D,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAA4B,EAC5B,QAAyB;IAEzB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,QAAQ,CAAC,IAAI,CAAC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KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,+DAA+D;QAC/D,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAC1C,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,KAAK,GAAG,CAAC;gBACf,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EACL,sGAAsG;gBACxG,IAAI,EAAE,iGAAiG;aACxG,CAAC,CAAC;YACH,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,OAAe;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AACvD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** What a repository got wrong against the deployment contract. */
|
|
2
|
-
export type DeployProblemKind = 'missing-compose' | 'invalid-compose' | 'unpinned-image' | 'missing-build' | 'wrong-image-name' | 'required-env-file' | 'floating-sidecar' | 'missing-healthcheck' | 'missing-env-example' | 'missing-deploy-ignore' | 'cacheable-page' | 'unpublishable-image' | 'brittle-install';
|
|
2
|
+
export type DeployProblemKind = 'missing-compose' | 'invalid-compose' | 'unpinned-image' | 'missing-build' | 'wrong-image-name' | 'required-env-file' | 'floating-sidecar' | 'missing-healthcheck' | 'missing-env-example' | 'missing-deploy-ignore' | 'cacheable-page' | 'unpublishable-image' | 'brittle-install' | 'ungated-build' | 'missing-build-only' | 'test-runs-e2e' | 'gated-image-build';
|
|
3
3
|
/** One way a repository would fail, or silently mis-deploy, on the server. */
|
|
4
4
|
export interface DeployProblem {
|
|
5
5
|
/** The file it was found in, named as the caller named it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,uBAAuB,GACvB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/deploy/core/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,uBAAuB,GACvB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,GACjB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,mBAAmB,CAAC;AAExB,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAIjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/deploy/core/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/deploy/core/types.ts"],"names":[],"mappings":"AAqFA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,cAAc;IACd,sBAAsB;IACtB,0BAA0B;CAC3B,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* A cell is a real `<button>`, so Tab reaches it, Enter and Space activate it,
|
|
6
6
|
* and a screen reader reads the element's name rather than its symbol.
|
|
7
7
|
*
|
|
8
|
-
* Everything written in it is
|
|
8
|
+
* Everything written in it is a share of the table's width, so a cell shows
|
|
9
9
|
* the same proportions at 280px beside a chart and across a lecture-hall
|
|
10
10
|
* screen — the table a class reads is the same drawing, larger.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementCell.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/ElementCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ElementCell.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/ElementCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAK9D,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA6EjE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
import { UNIT, ofWidth } from "./unit.js";
|
|
4
5
|
/**
|
|
5
6
|
* A single element of the table.
|
|
6
7
|
* @param props - See {@link ElementCellProps}.
|
|
@@ -35,8 +36,8 @@ export function ElementCell(props) {
|
|
|
35
36
|
outlineColor: swatch.foreground,
|
|
36
37
|
// Thick enough to be seen from the back of a room, and drawn inside
|
|
37
38
|
// the cell so a neighbour never covers it.
|
|
38
|
-
outlineWidth:
|
|
39
|
-
outlineOffset:
|
|
39
|
+
outlineWidth: `max(2px, ${ofWidth(0.3)})`,
|
|
40
|
+
outlineOffset: `max(-3px, ${ofWidth(-0.4)})`,
|
|
40
41
|
// The cell the pointer is on, for a class following a demonstration.
|
|
41
42
|
filter: isHovered ? 'brightness(1.08)' : undefined,
|
|
42
43
|
}, children: [_jsx("span", { style: numberStyle, children: atomicNumber }), _jsx("span", { style: {
|
|
@@ -54,7 +55,7 @@ export function ElementCell(props) {
|
|
|
54
55
|
* @returns A CSS length.
|
|
55
56
|
*/
|
|
56
57
|
function symbolFontSize(symbol) {
|
|
57
|
-
return fitted(symbolWidthInEm(symbol),
|
|
58
|
+
return fitted(symbolWidthInEm(symbol), SYMBOL_CAP, '0.5rem');
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* The size the third line takes so the whole of it is written.
|
|
@@ -66,7 +67,7 @@ function symbolFontSize(symbol) {
|
|
|
66
67
|
* @returns A CSS length.
|
|
67
68
|
*/
|
|
68
69
|
function detailFontSize(detail) {
|
|
69
|
-
return fitted(detailWidthInEm(detail),
|
|
70
|
+
return fitted(detailWidthInEm(detail), DETAIL_CAP, '0.25rem');
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* The largest size a string of the given width fits its cell at.
|
|
@@ -80,7 +81,7 @@ function detailFontSize(detail) {
|
|
|
80
81
|
* @returns A CSS length.
|
|
81
82
|
*/
|
|
82
83
|
function fitted(widthInEm, cap, floor) {
|
|
83
|
-
const room = `calc((${
|
|
84
|
+
const room = `calc((${UNIT} * ${String(CELL_SHARE)} - ${CELL_CHROME}) / ${widthInEm.toFixed(2)})`;
|
|
84
85
|
return `max(${floor}, min(${cap}, ${room}))`;
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
@@ -118,7 +119,7 @@ function detailWidthInEm(detail) {
|
|
|
118
119
|
/** What one tabular glyph advances, as a share of its own size. */
|
|
119
120
|
const TABULAR_EM = 0.6;
|
|
120
121
|
/** The size the symbol is written at wherever it fits, as a share of the table. */
|
|
121
|
-
const
|
|
122
|
+
const SYMBOL_CAP = ofWidth(2.4);
|
|
122
123
|
/**
|
|
123
124
|
* The tallest the third line is ever written, as a share of the table.
|
|
124
125
|
*
|
|
@@ -126,7 +127,7 @@ const SYMBOL_CQW = '2.4cqw';
|
|
|
126
127
|
* the value is what the table is being read for, and a value half the size of
|
|
127
128
|
* the symbol is the one thing on the cell a class cannot make out.
|
|
128
129
|
*/
|
|
129
|
-
const
|
|
130
|
+
const DETAIL_CAP = ofWidth(1.6);
|
|
130
131
|
/**
|
|
131
132
|
* The band at each end of a cell: the atomic number at the top, whatever the
|
|
132
133
|
* tool writes at the bottom.
|
|
@@ -135,9 +136,9 @@ const DETAIL_CQW = '1.6cqw';
|
|
|
135
136
|
* sit at the centre of the cell rather than near it — a bottom band wider than
|
|
136
137
|
* the top one by a third lifted every symbol in the table two pixels.
|
|
137
138
|
*/
|
|
138
|
-
const EDGE_BAND =
|
|
139
|
-
/** How wide one column is,
|
|
140
|
-
const
|
|
139
|
+
const EDGE_BAND = ofWidth(1.8);
|
|
140
|
+
/** How wide one column is, in per cent of the table's width. */
|
|
141
|
+
const CELL_SHARE = 4.85;
|
|
141
142
|
/** What the border and the padding of a cell take off that width. */
|
|
142
143
|
const CELL_CHROME = '4px';
|
|
143
144
|
/**
|
|
@@ -165,7 +166,7 @@ const cellStyle = {
|
|
|
165
166
|
};
|
|
166
167
|
const numberStyle = {
|
|
167
168
|
alignSelf: 'start',
|
|
168
|
-
fontSize:
|
|
169
|
+
fontSize: `max(0.33rem, ${ofWidth(1.1)})`,
|
|
169
170
|
fontVariantNumeric: 'tabular-nums',
|
|
170
171
|
justifySelf: 'start',
|
|
171
172
|
lineHeight: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementCell.js","sourceRoot":"","sources":["../../../src/periodic/ui/ElementCell.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElementCell.js","sourceRoot":"","sources":["../../../src/periodic/ui/ElementCell.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8C1C;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EACJ,SAAS,EACT,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,GAAG,EAAE,EACX,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,IAAI,EACjB,OAAO,GACR,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,iBACP,WAAW,MAAM,EAAE,iBACnB,MAA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nB,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,SAAS;IACxB,UAAU,EAAE,IAAI;CACgB,CAAC;AAEnC,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,QAAQ;IACnB,kBAAkB,EAAE,cAAc;IAClC,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ;CACY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodicTable.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAGV,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"PeriodicTable.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAGV,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAI9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBtD,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC;IAC9C;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC;IACnD;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAyFrE"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { useResizeObserver } from "../../hooks/ui/useResizeObserver.js";
|
|
3
4
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
5
|
import { categorySwatch } from "../core/categories.js";
|
|
5
6
|
import { COLUMN_COUNT, EMPTY_BLOCK, elementByArrowKey, placedElements, } from "../core/layout.js";
|
|
6
7
|
import { CategoryLegend } from "./CategoryLegend.js";
|
|
7
8
|
import { ElementCell } from "./ElementCell.js";
|
|
8
9
|
import { HeaderStrips, InnerTransitionMarkers, } from "./PeriodicTableChrome.js";
|
|
10
|
+
import { UNIT_PROPERTY, ofWidth, unitValue } from "./unit.js";
|
|
9
11
|
/**
|
|
10
12
|
* The 118 elements, laid out as the table.
|
|
11
13
|
* @param props - See {@link PeriodicTableProps}.
|
|
@@ -14,9 +16,21 @@ import { HeaderStrips, InnerTransitionMarkers, } from "./PeriodicTableChrome.js"
|
|
|
14
16
|
export function PeriodicTable(props) {
|
|
15
17
|
const { selected, onSelect, swatchOf = defaultSwatchOf, detailOf, nameOf = defaultNameOf, isIncluded, inset, headers = false, onSelectRange, legend = false, markers = true, keyboard = true, onHover, className, } = props;
|
|
16
18
|
const t = useChromeT();
|
|
19
|
+
const rootRef = useRef(null);
|
|
17
20
|
const gridRef = useRef(null);
|
|
18
21
|
const cameFromKeyRef = useRef(false);
|
|
19
22
|
const offset = headers ? 1 : 0;
|
|
23
|
+
// The drawing is read off this one number, so it is written straight onto
|
|
24
|
+
// the element rather than held as state: a window being dragged would
|
|
25
|
+
// otherwise re-render all 118 cells per frame, and the engine recomputes
|
|
26
|
+
// every length from the custom property on its own. A width of zero is a
|
|
27
|
+
// table in a tab nobody has opened; the last measurement stands until it is
|
|
28
|
+
// shown, and the observer fires again then.
|
|
29
|
+
useResizeObserver(rootRef, ({ width }) => {
|
|
30
|
+
if (width === 0)
|
|
31
|
+
return;
|
|
32
|
+
rootRef.current?.style.setProperty(UNIT_PROPERTY, unitValue(width));
|
|
33
|
+
});
|
|
20
34
|
useEffect(() => {
|
|
21
35
|
if (!cameFromKeyRef.current)
|
|
22
36
|
return;
|
|
@@ -35,7 +49,7 @@ export function PeriodicTable(props) {
|
|
|
35
49
|
cameFromKeyRef.current = true;
|
|
36
50
|
onSelect(next.symbol);
|
|
37
51
|
}
|
|
38
|
-
return (_jsxs("div", { className: className, style: rootStyle, children: [_jsxs("div", { ref: gridRef, role: "grid", "aria-label": t('periodic.table'), "data-testid": "periodic-table", style: gridStyle(headers), onKeyDown: handleKeyDown, children: [headers ? _jsx(HeaderStrips, { onSelectRange: onSelectRange }) : null, inset === undefined ? null : (_jsx("div", { style: insetStyle(offset), children: inset })), markers ? _jsx(InnerTransitionMarkers, { offset: offset }) : null, placedElements().map(({ element, cell }) => (_jsx(ElementCell, { atomicNumber: element.atomicNumber, symbol: element.symbol, name: nameOf(element), detail: detailOf?.(element), swatch: swatchOf(element), isSelected: element.symbol === selected, isIncluded: isIncluded?.(element), column: cell.column + offset, row: cell.row + offset, onSelect: onSelect ?? noop, onHover: onHover }, element.symbol)))] }), legend ? _jsx(CategoryLegend, {}) : null] }));
|
|
52
|
+
return (_jsxs("div", { ref: rootRef, className: className, style: rootStyle, children: [_jsxs("div", { ref: gridRef, role: "grid", "aria-label": t('periodic.table'), "data-testid": "periodic-table", style: gridStyle(headers), onKeyDown: handleKeyDown, children: [headers ? _jsx(HeaderStrips, { onSelectRange: onSelectRange }) : null, inset === undefined ? null : (_jsx("div", { style: insetStyle(offset), children: inset })), markers ? _jsx(InnerTransitionMarkers, { offset: offset }) : null, placedElements().map(({ element, cell }) => (_jsx(ElementCell, { atomicNumber: element.atomicNumber, symbol: element.symbol, name: nameOf(element), detail: detailOf?.(element), swatch: swatchOf(element), isSelected: element.symbol === selected, isIncluded: isIncluded?.(element), column: cell.column + offset, row: cell.row + offset, onSelect: onSelect ?? noop, onHover: onHover }, element.symbol)))] }), legend ? _jsx(CategoryLegend, {}) : null] }));
|
|
39
53
|
}
|
|
40
54
|
/**
|
|
41
55
|
* Where what the caller writes in the empty block is placed.
|
|
@@ -48,13 +62,13 @@ function insetStyle(offset) {
|
|
|
48
62
|
display: 'flex',
|
|
49
63
|
// A column of air on each side, so the writing reads as sitting in the
|
|
50
64
|
// block rather than as running into the cells beside it.
|
|
51
|
-
padding:
|
|
65
|
+
padding: `0 ${ofWidth(2.4)}`,
|
|
52
66
|
gridColumn: `${String(EMPTY_BLOCK.column + offset)} / span ${String(EMPTY_BLOCK.columnSpan)}`,
|
|
53
67
|
gridRow: `${String(EMPTY_BLOCK.row + offset)} / span ${String(EMPTY_BLOCK.rowSpan)}`,
|
|
54
68
|
// A share of the table, with a floor, exactly as a cell sizes its symbol:
|
|
55
69
|
// the block holds the same three rows at every width, so what is written
|
|
56
70
|
// in it has to shrink with them.
|
|
57
|
-
fontSize:
|
|
71
|
+
fontSize: `max(0.6rem, ${ofWidth(1.8)})`,
|
|
58
72
|
lineHeight: 1.35,
|
|
59
73
|
minWidth: 0,
|
|
60
74
|
overflow: 'hidden',
|
|
@@ -81,9 +95,9 @@ const MIN_WIDTH = 280;
|
|
|
81
95
|
* table: a cell keeps the band it writes a value in whether or not that table
|
|
82
96
|
* writes one.
|
|
83
97
|
*/
|
|
84
|
-
const ROW_HEIGHT =
|
|
98
|
+
const ROW_HEIGHT = ofWidth(6.8);
|
|
85
99
|
/** The band the two inner-transition series were lifted out across. */
|
|
86
|
-
const SERIES_GAP =
|
|
100
|
+
const SERIES_GAP = `max(6px, ${ofWidth(1.1)})`;
|
|
87
101
|
const rootStyle = {
|
|
88
102
|
display: 'flex',
|
|
89
103
|
flexDirection: 'column',
|
|
@@ -91,7 +105,10 @@ const rootStyle = {
|
|
|
91
105
|
minWidth: MIN_WIDTH,
|
|
92
106
|
// Everything inside — the height of a row as much as the type in a cell — is
|
|
93
107
|
// a share of this box rather than of the page, so the same table reads at
|
|
94
|
-
// 280px beside a chart and fills a lecture-hall screen at twice that.
|
|
108
|
+
// 280px beside a chart and fills a lecture-hall screen at twice that. The
|
|
109
|
+
// share is measured (see `unit.ts`); the container is what the `1cqw`
|
|
110
|
+
// fallback and a site's own `@container` rules are answered by, and it keeps
|
|
111
|
+
// this box's width independent of what is written inside it.
|
|
95
112
|
containerType: 'inline-size',
|
|
96
113
|
};
|
|
97
114
|
const baseGridStyle = {
|
|
@@ -118,8 +135,8 @@ function gridStyle(headers) {
|
|
|
118
135
|
}
|
|
119
136
|
return {
|
|
120
137
|
...baseGridStyle,
|
|
121
|
-
gridTemplateColumns: `max(14px, 2.
|
|
122
|
-
gridTemplateRows: `max(12px,
|
|
138
|
+
gridTemplateColumns: `max(14px, ${ofWidth(2.4)}) repeat(${String(COLUMN_COUNT)}, minmax(0, 1fr))`,
|
|
139
|
+
gridTemplateRows: `max(12px, ${ofWidth(2)}) ${rows}`,
|
|
123
140
|
};
|
|
124
141
|
}
|
|
125
142
|
//# sourceMappingURL=PeriodicTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodicTable.js","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTable.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,sBAAsB,GACvB,MAAM,0BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"PeriodicTable.js","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTable.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,sBAAsB,GACv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ACL,GAAG,aAAa;QAChB,mBAAmB,EAAE,aAAa,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,YAAY,CAAC,mBAAmB;QACjG,gBAAgB,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodicTableChrome.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTableChrome.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"PeriodicTableChrome.d.ts","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTableChrome.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,uCAAuC;AACvC,UAAU,iBAAiB;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC/C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAsDnE;AAED,iDAAiD;AACjD,UAAU,2BAA2B;IACnC,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,YAAY,CAmBd"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
3
3
|
import { TOKEN } from "../../tokens/core/familyTokens.js";
|
|
4
4
|
import { COLUMN_COUNT, INNER_TRANSITION_MARKERS, INNER_TRANSITION_ROWS, } from "../core/layout.js";
|
|
5
|
+
import { ofWidth } from "./unit.js";
|
|
5
6
|
/**
|
|
6
7
|
* The 1–18 strip along the top and the 1–7 strip down the left.
|
|
7
8
|
*
|
|
@@ -53,7 +54,7 @@ const headerStyle = {
|
|
|
53
54
|
alignItems: 'center',
|
|
54
55
|
color: TOKEN.textMuted,
|
|
55
56
|
display: 'flex',
|
|
56
|
-
fontSize:
|
|
57
|
+
fontSize: `max(0.45rem, ${ofWidth(1.35)})`,
|
|
57
58
|
justifyContent: 'center',
|
|
58
59
|
padding: 0,
|
|
59
60
|
};
|
|
@@ -69,7 +70,7 @@ const markerStyle = {
|
|
|
69
70
|
borderRadius: 3,
|
|
70
71
|
color: TOKEN.textMuted,
|
|
71
72
|
display: 'flex',
|
|
72
|
-
fontSize:
|
|
73
|
+
fontSize: `max(0.4rem, ${ofWidth(1.15)})`,
|
|
73
74
|
justifyContent: 'center',
|
|
74
75
|
};
|
|
75
76
|
//# sourceMappingURL=PeriodicTableChrome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodicTableChrome.js","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTableChrome.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"PeriodicTableChrome.js","sourceRoot":"","sources":["../../../src/periodic/ui/PeriodicTableChrome.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EACL,YAAY,EACZ,wBAA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