react-cheminfo 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/lib/about/ui/AboutBuildDetails.d.ts +15 -0
- package/lib/about/ui/AboutBuildDetails.d.ts.map +1 -0
- package/lib/about/ui/AboutBuildDetails.js +17 -0
- package/lib/about/ui/AboutBuildDetails.js.map +1 -0
- package/lib/about/ui/AboutPage.d.ts +8 -0
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +12 -3
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/AboutSignIn.d.ts +33 -0
- package/lib/about/ui/AboutSignIn.d.ts.map +1 -0
- package/lib/about/ui/AboutSignIn.js +28 -0
- package/lib/about/ui/AboutSignIn.js.map +1 -0
- package/lib/about/ui/AboutVersion.d.ts +4 -2
- package/lib/about/ui/AboutVersion.d.ts.map +1 -1
- package/lib/about/ui/AboutVersion.js +21 -3
- package/lib/about/ui/AboutVersion.js.map +1 -1
- package/lib/about/ui/index.d.ts +2 -2
- package/lib/about/ui/index.d.ts.map +1 -1
- package/lib/about/ui/index.js +1 -1
- package/lib/about/ui/index.js.map +1 -1
- package/lib/chrome/ui/NavEntry.d.ts +16 -0
- package/lib/chrome/ui/NavEntry.d.ts.map +1 -0
- package/lib/chrome/ui/NavEntry.js +27 -0
- package/lib/chrome/ui/NavEntry.js.map +1 -0
- package/lib/chrome/ui/SiteHeader.d.ts +11 -4
- package/lib/chrome/ui/SiteHeader.d.ts.map +1 -1
- package/lib/chrome/ui/SiteHeader.js +4 -26
- package/lib/chrome/ui/SiteHeader.js.map +1 -1
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +11 -3
- package/lib/locales/en.json +11 -3
- package/lib/locales/es.json +11 -3
- package/lib/locales/fr.json +11 -3
- package/lib/locales/it.json +11 -3
- package/lib/moleculesSources/core/index.d.ts +3 -0
- package/lib/moleculesSources/core/index.d.ts.map +1 -0
- package/lib/moleculesSources/core/index.js +2 -0
- package/lib/moleculesSources/core/index.js.map +1 -0
- package/lib/moleculesSources/core/moleculesSources.d.ts +55 -0
- package/lib/moleculesSources/core/moleculesSources.d.ts.map +1 -0
- package/lib/moleculesSources/core/moleculesSources.js +63 -0
- package/lib/moleculesSources/core/moleculesSources.js.map +1 -0
- package/lib/moleculesSources/ui/MoleculesSourceBadge.d.ts +18 -0
- package/lib/moleculesSources/ui/MoleculesSourceBadge.d.ts.map +1 -0
- package/lib/moleculesSources/ui/MoleculesSourceBadge.js +22 -0
- package/lib/moleculesSources/ui/MoleculesSourceBadge.js.map +1 -0
- package/lib/moleculesSources/ui/SourceBadge.d.ts +57 -0
- package/lib/moleculesSources/ui/SourceBadge.d.ts.map +1 -0
- package/lib/moleculesSources/ui/SourceBadge.js +29 -0
- package/lib/moleculesSources/ui/SourceBadge.js.map +1 -0
- package/lib/moleculesSources/ui/index.d.ts +7 -0
- package/lib/moleculesSources/ui/index.d.ts.map +1 -0
- package/lib/moleculesSources/ui/index.js +4 -0
- package/lib/moleculesSources/ui/index.js.map +1 -0
- package/lib/moleculesSources/ui/useSourceLooks.d.ts +24 -0
- package/lib/moleculesSources/ui/useSourceLooks.d.ts.map +1 -0
- package/lib/moleculesSources/ui/useSourceLooks.js +53 -0
- package/lib/moleculesSources/ui/useSourceLooks.js.map +1 -0
- package/lib/moleculesToken/core/index.d.ts +1 -0
- package/lib/moleculesToken/core/index.d.ts.map +1 -1
- package/lib/moleculesToken/core/index.js +1 -0
- package/lib/moleculesToken/core/index.js.map +1 -1
- package/lib/moleculesToken/core/tokenFix.d.ts +18 -0
- package/lib/moleculesToken/core/tokenFix.d.ts.map +1 -0
- package/lib/moleculesToken/core/tokenFix.js +27 -0
- package/lib/moleculesToken/core/tokenFix.js.map +1 -0
- package/lib/moleculesToken/ui/MoleculesTokenFix.d.ts +22 -0
- package/lib/moleculesToken/ui/MoleculesTokenFix.d.ts.map +1 -0
- package/lib/moleculesToken/ui/MoleculesTokenFix.js +35 -0
- package/lib/moleculesToken/ui/MoleculesTokenFix.js.map +1 -0
- package/lib/moleculesToken/ui/MoleculesTokenTable.d.ts +6 -1
- package/lib/moleculesToken/ui/MoleculesTokenTable.d.ts.map +1 -1
- package/lib/moleculesToken/ui/MoleculesTokenTable.js +7 -75
- package/lib/moleculesToken/ui/MoleculesTokenTable.js.map +1 -1
- package/lib/moleculesToken/ui/index.d.ts +2 -0
- package/lib/moleculesToken/ui/index.d.ts.map +1 -1
- package/lib/moleculesToken/ui/index.js +1 -0
- package/lib/moleculesToken/ui/index.js.map +1 -1
- package/lib/moleculesToken/ui/tokenDetails.d.ts +13 -0
- package/lib/moleculesToken/ui/tokenDetails.d.ts.map +1 -0
- package/lib/moleculesToken/ui/tokenDetails.js +73 -0
- package/lib/moleculesToken/ui/tokenDetails.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +1 -1
- package/src/about/ui/AboutBuildDetails.tsx +45 -0
- package/src/about/ui/AboutPage.tsx +27 -13
- package/src/about/ui/AboutSignIn.tsx +63 -0
- package/src/about/ui/AboutVersion.tsx +27 -9
- package/src/about/ui/index.ts +2 -2
- package/src/chrome/ui/NavEntry.tsx +41 -0
- package/src/chrome/ui/SiteHeader.tsx +15 -41
- package/src/core.ts +1 -0
- package/src/locales/de.json +11 -3
- package/src/locales/en.json +11 -3
- package/src/locales/es.json +11 -3
- package/src/locales/fr.json +11 -3
- package/src/locales/it.json +11 -3
- package/src/moleculesSources/core/index.ts +11 -0
- package/src/moleculesSources/core/moleculesSources.ts +102 -0
- package/src/moleculesSources/ui/MoleculesSourceBadge.tsx +44 -0
- package/src/moleculesSources/ui/SourceBadge.tsx +117 -0
- package/src/moleculesSources/ui/index.ts +6 -0
- package/src/moleculesSources/ui/useSourceLooks.ts +70 -0
- package/src/moleculesToken/core/index.ts +1 -0
- package/src/moleculesToken/core/tokenFix.ts +37 -0
- package/src/moleculesToken/ui/MoleculesTokenFix.tsx +95 -0
- package/src/moleculesToken/ui/MoleculesTokenTable.tsx +20 -94
- package/src/moleculesToken/ui/index.ts +2 -0
- package/src/moleculesToken/ui/tokenDetails.tsx +91 -0
- package/src/ui.ts +1 -0
- package/styles/chrome.css +159 -0
- package/lib/about/ui/AboutBuild.d.ts +0 -18
- package/lib/about/ui/AboutBuild.d.ts.map +0 -1
- package/lib/about/ui/AboutBuild.js +0 -37
- package/lib/about/ui/AboutBuild.js.map +0 -1
- package/src/about/ui/AboutBuild.tsx +0 -54
package/styles/chrome.css
CHANGED
|
@@ -354,6 +354,144 @@ button {
|
|
|
354
354
|
font-size: 0.75rem;
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
/* ── Where a molecule comes from ─────────────────────────────────────────── */
|
|
358
|
+
|
|
359
|
+
/* A source's own colour, softened: a pale tint behind the name and the hue
|
|
360
|
+
darkened for the text, so a row of badges stays calm whatever colours the
|
|
361
|
+
sources chose. The colour is set inline from what molecules publishes. */
|
|
362
|
+
.source-badge {
|
|
363
|
+
--source: var(--brand);
|
|
364
|
+
|
|
365
|
+
display: inline-flex;
|
|
366
|
+
align-items: baseline;
|
|
367
|
+
padding: calc(0.1rem - 1px) calc(0.55rem - 1px);
|
|
368
|
+
border: 1px solid color-mix(in oklab, var(--source) 28%, white);
|
|
369
|
+
border-radius: 999px;
|
|
370
|
+
background: color-mix(in oklab, var(--source) 12%, white);
|
|
371
|
+
color: color-mix(in oklab, var(--source) 55%, var(--text));
|
|
372
|
+
/* Never lighter than an ink, so a pale colour a source chose stays readable. */
|
|
373
|
+
color: oklch(from var(--source) min(l, 0.45) c h);
|
|
374
|
+
font-size: 0.8125rem;
|
|
375
|
+
font-weight: 600;
|
|
376
|
+
gap: 0.35rem;
|
|
377
|
+
line-height: 1.5;
|
|
378
|
+
text-decoration: none;
|
|
379
|
+
white-space: nowrap;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/* A source with no look of its own. */
|
|
383
|
+
.source-badge--neutral {
|
|
384
|
+
--source: var(--text-muted);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
a.source-badge:hover {
|
|
388
|
+
background: color-mix(in oklab, var(--source) 20%, white);
|
|
389
|
+
text-decoration: none;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* The logo sits on a white chip of its own, so it reads on any badge colour. */
|
|
393
|
+
.source-badge__logo {
|
|
394
|
+
display: inline-flex;
|
|
395
|
+
width: 1.1rem;
|
|
396
|
+
height: 1.1rem;
|
|
397
|
+
flex: none;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
align-self: center;
|
|
401
|
+
border-radius: 50%;
|
|
402
|
+
margin-left: -0.35rem;
|
|
403
|
+
background: var(--surface);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.source-badge__logo img {
|
|
407
|
+
display: block;
|
|
408
|
+
max-width: 0.8rem;
|
|
409
|
+
max-height: 0.8rem;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.source-badge__id {
|
|
413
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
414
|
+
font-weight: 500;
|
|
415
|
+
opacity: 0.9;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.source-badge__count {
|
|
419
|
+
font-weight: 500;
|
|
420
|
+
opacity: 0.75;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.source-badge--compact {
|
|
424
|
+
padding: 0 calc(0.45rem - 1px);
|
|
425
|
+
font-size: 0.6875rem;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.source-badge--compact .source-badge__logo {
|
|
429
|
+
width: 0.95rem;
|
|
430
|
+
height: 0.95rem;
|
|
431
|
+
margin-left: -0.3rem;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.source-badge--compact .source-badge__logo img {
|
|
435
|
+
max-width: 0.7rem;
|
|
436
|
+
max-height: 0.7rem;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/* What a release's badge leaves to its hover: a header, then the commit and the
|
|
440
|
+
instant as a label/value grid. The values are what a report quotes, so they
|
|
441
|
+
never wrap and their digits line up. */
|
|
442
|
+
.build-tooltip .bp6-popover-content {
|
|
443
|
+
width: auto;
|
|
444
|
+
padding: 6px 10px;
|
|
445
|
+
font-size: 12px;
|
|
446
|
+
line-height: 1.4;
|
|
447
|
+
white-space: nowrap;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.build-tooltip__header {
|
|
451
|
+
padding-bottom: 4px;
|
|
452
|
+
border-bottom: 1px solid var(--border);
|
|
453
|
+
margin-bottom: 4px;
|
|
454
|
+
font-size: 13px;
|
|
455
|
+
font-weight: 700;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.build-tooltip__rows {
|
|
459
|
+
display: grid;
|
|
460
|
+
margin: 0;
|
|
461
|
+
column-gap: 16px;
|
|
462
|
+
grid-template-columns: auto auto;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.build-tooltip__rows dt {
|
|
466
|
+
color: var(--text-muted);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.build-tooltip__rows dd {
|
|
470
|
+
margin: 0;
|
|
471
|
+
font-variant-numeric: tabular-nums;
|
|
472
|
+
font-weight: 600;
|
|
473
|
+
text-align: right;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/* Signing in starts on the About, under the build badge: quiet at rest, in the
|
|
477
|
+
type of the badge beside it, and a link only to whoever looks for one. */
|
|
478
|
+
.about-sign-in {
|
|
479
|
+
padding: 0;
|
|
480
|
+
border: 0;
|
|
481
|
+
background: none;
|
|
482
|
+
color: var(--text-muted);
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
font-family: inherit;
|
|
485
|
+
font-size: 13px;
|
|
486
|
+
text-decoration: none;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.about-sign-in:hover,
|
|
490
|
+
.about-sign-in:focus-visible {
|
|
491
|
+
color: var(--accent);
|
|
492
|
+
text-decoration: underline;
|
|
493
|
+
}
|
|
494
|
+
|
|
357
495
|
/* The share dialog: the ready-made links above, the options and the page they
|
|
358
496
|
write side by side, and the three things one does with the link in the
|
|
359
497
|
footer, never scrolled away. */
|
|
@@ -772,6 +910,27 @@ button {
|
|
|
772
910
|
white-space: nowrap;
|
|
773
911
|
}
|
|
774
912
|
|
|
913
|
+
.molecules-tokens__fix {
|
|
914
|
+
margin-bottom: 0.75rem;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.molecules-tokens__fix ol {
|
|
918
|
+
padding-left: 1.25rem;
|
|
919
|
+
margin: 0.25rem 0 0;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.molecules-tokens__fix li + li {
|
|
923
|
+
margin-top: 0.6rem;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.molecules-tokens__fix p {
|
|
927
|
+
margin: 0 0 0.25rem;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.molecules-tokens__fix p + p {
|
|
931
|
+
margin-top: 0.4rem;
|
|
932
|
+
}
|
|
933
|
+
|
|
775
934
|
/* ── A narrow bar ────────────────────────────────────────────────────────── */
|
|
776
935
|
|
|
777
936
|
/* The menu the pages fold into, drawn only once they no longer fit. */
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
3
|
-
export interface AboutBuildProps {
|
|
4
|
-
/** What the build published about itself. */
|
|
5
|
-
build: BuildInfo;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* The one line that says when the build a visitor has open was made.
|
|
9
|
-
*
|
|
10
|
-
* A report of something going wrong is worth answering only when we know what
|
|
11
|
-
* was running. The version itself is in the hero, where a reader is asked to
|
|
12
|
-
* quote it from; this line carries the rest, so a report can name the exact
|
|
13
|
-
* build the problem was seen on.
|
|
14
|
-
* @param props - See {@link AboutBuildProps}.
|
|
15
|
-
* @returns The line.
|
|
16
|
-
*/
|
|
17
|
-
export declare function AboutBuild(props: AboutBuildProps): ReactElement;
|
|
18
|
-
//# sourceMappingURL=AboutBuild.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AboutBuild.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutBuild.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAqB/D"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { formatBuiltAt, shortCommit } from "../../build/core/buildInfo.js";
|
|
3
|
-
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
-
/**
|
|
5
|
-
* The one line that says when the build a visitor has open was made.
|
|
6
|
-
*
|
|
7
|
-
* A report of something going wrong is worth answering only when we know what
|
|
8
|
-
* was running. The version itself is in the hero, where a reader is asked to
|
|
9
|
-
* quote it from; this line carries the rest, so a report can name the exact
|
|
10
|
-
* build the problem was seen on.
|
|
11
|
-
* @param props - See {@link AboutBuildProps}.
|
|
12
|
-
* @returns The line.
|
|
13
|
-
*/
|
|
14
|
-
export function AboutBuild(props) {
|
|
15
|
-
const { build } = props;
|
|
16
|
-
const t = useChromeT();
|
|
17
|
-
const builtAt = formatBuiltAt(build.builtAt);
|
|
18
|
-
if (build.commit === undefined) {
|
|
19
|
-
return _jsx("p", { style: PARAGRAPH_STYLE, children: t('about.built', { builtAt }) });
|
|
20
|
-
}
|
|
21
|
-
// The commit sits inside a sentence whose word order is the translator's,
|
|
22
|
-
// so the message names where it goes and is split there.
|
|
23
|
-
const [before = '', after = ''] = t('about.builtFromCommit', {
|
|
24
|
-
builtAt,
|
|
25
|
-
}).split('{commit}');
|
|
26
|
-
return (_jsxs("p", { style: PARAGRAPH_STYLE, children: [before, _jsx("code", { style: CODE_STYLE, children: shortCommit(build.commit) }), after] }));
|
|
27
|
-
}
|
|
28
|
-
const PARAGRAPH_STYLE = {
|
|
29
|
-
margin: 0,
|
|
30
|
-
color: 'var(--text-muted)',
|
|
31
|
-
fontSize: 13,
|
|
32
|
-
};
|
|
33
|
-
const CODE_STYLE = {
|
|
34
|
-
fontFamily: 'var(--font-mono, ui-monospace, monospace)',
|
|
35
|
-
fontSize: 13,
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=AboutBuild.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AboutBuild.js","sourceRoot":"","sources":["../../../src/about/ui/AboutBuild.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOnD;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,YAAG,KAAK,EAAE,eAAe,YAAG,CAAC,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAK,CAAC;IACxE,CAAC;IAED,0EAA0E;IAC1E,yDAAyD;IACzD,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE;QAC3D,OAAO;KACR,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAErB,OAAO,CACL,aAAG,KAAK,EAAE,eAAe,aACtB,MAAM,EACP,eAAM,KAAK,EAAE,UAAU,YAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,GAAQ,EAC1D,KAAK,IACJ,CACL,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,EAAE;CACoB,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;CACoB,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
4
|
-
import { formatBuiltAt, shortCommit } from '../../build/core/buildInfo.ts';
|
|
5
|
-
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
6
|
-
|
|
7
|
-
export interface AboutBuildProps {
|
|
8
|
-
/** What the build published about itself. */
|
|
9
|
-
build: BuildInfo;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The one line that says when the build a visitor has open was made.
|
|
14
|
-
*
|
|
15
|
-
* A report of something going wrong is worth answering only when we know what
|
|
16
|
-
* was running. The version itself is in the hero, where a reader is asked to
|
|
17
|
-
* quote it from; this line carries the rest, so a report can name the exact
|
|
18
|
-
* build the problem was seen on.
|
|
19
|
-
* @param props - See {@link AboutBuildProps}.
|
|
20
|
-
* @returns The line.
|
|
21
|
-
*/
|
|
22
|
-
export function AboutBuild(props: AboutBuildProps): ReactElement {
|
|
23
|
-
const { build } = props;
|
|
24
|
-
const t = useChromeT();
|
|
25
|
-
const builtAt = formatBuiltAt(build.builtAt);
|
|
26
|
-
if (build.commit === undefined) {
|
|
27
|
-
return <p style={PARAGRAPH_STYLE}>{t('about.built', { builtAt })}</p>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// The commit sits inside a sentence whose word order is the translator's,
|
|
31
|
-
// so the message names where it goes and is split there.
|
|
32
|
-
const [before = '', after = ''] = t('about.builtFromCommit', {
|
|
33
|
-
builtAt,
|
|
34
|
-
}).split('{commit}');
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<p style={PARAGRAPH_STYLE}>
|
|
38
|
-
{before}
|
|
39
|
-
<code style={CODE_STYLE}>{shortCommit(build.commit)}</code>
|
|
40
|
-
{after}
|
|
41
|
-
</p>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const PARAGRAPH_STYLE = {
|
|
46
|
-
margin: 0,
|
|
47
|
-
color: 'var(--text-muted)',
|
|
48
|
-
fontSize: 13,
|
|
49
|
-
} as const satisfies CSSProperties;
|
|
50
|
-
|
|
51
|
-
const CODE_STYLE = {
|
|
52
|
-
fontFamily: 'var(--font-mono, ui-monospace, monospace)',
|
|
53
|
-
fontSize: 13,
|
|
54
|
-
} as const satisfies CSSProperties;
|