react-cheminfo 0.59.0 → 0.61.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 +36 -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/server/siteFiles.d.ts +28 -0
- package/lib/server/siteFiles.d.ts.map +1 -0
- package/lib/server/siteFiles.js +57 -0
- package/lib/server/siteFiles.js.map +1 -0
- package/lib/server/staticSite.d.ts +42 -0
- package/lib/server/staticSite.d.ts.map +1 -0
- package/lib/server/staticSite.js +114 -0
- package/lib/server/staticSite.js.map +1 -0
- package/lib/server.d.ts +4 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/server.js +3 -0
- package/lib/server.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 +12 -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/server/siteFiles.ts +64 -0
- package/src/server/staticSite.ts +188 -0
- package/src/server.ts +7 -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/README.md
CHANGED
|
@@ -36,6 +36,7 @@ only when it drags a heavy dependency behind it.
|
|
|
36
36
|
| `react-cheminfo/ui` | every React component and hook — 60 value exports | React |
|
|
37
37
|
| `react-cheminfo/vite` | the prerender plugin and the OG card | nothing; React on the card |
|
|
38
38
|
| `react-cheminfo/pages` | the Cloudflare Pages analytics middleware | nothing |
|
|
39
|
+
| `react-cheminfo/server` | the prerendered build, served from Node | fastify, @fastify/static; Node only |
|
|
39
40
|
| `react-cheminfo/orbital` | the 3D atomic-orbital viewer | React, molstar |
|
|
40
41
|
| `react-cheminfo/molecule3d` | the 3D molecule viewer and its toolbar | React, molstar |
|
|
41
42
|
| `react-cheminfo/structure` | the structure editor and renderer | React, react-ocl, OCL |
|
|
@@ -111,7 +112,7 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
111
112
|
| **Infrared** | `loadIrSpectra`, `toIrSpectrum`, `pickBands`, `assignBands`, `BAND_ASSIGNMENTS`, `irSpectrumToJcamp`, `IR_MODE_RULES`, `nearestBandAt`, `planBandLabels`, `irReducer` (all `/ir`) | `IrEditor`, `IrChart`, `BandsPanel`, `SpectraPanel`, `MetadataPanel`, `useIrEditor` (all `/ir`) |
|
|
112
113
|
| **Spectra** | `FILTER_CATALOG`, `filterMenu`, `settingsProblems`, `normalizationFilters`, `addFilter`, `moveFilter`, `setFilterOption`, `principalComponentChoices`, `clampPrincipalComponents`, `EMPTY_SETTINGS` (all `/spectra`) | `SpectraSettingsEditor`, `FilterChainEditor`, `PrincipalComponentSelect` (all `/spectra`) |
|
|
113
114
|
| **About** | `resolveAbout`, `aboutProblems` | `AboutPage` |
|
|
114
|
-
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo` | `
|
|
115
|
+
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo` | `AboutVersion`, `cheminfoBuildInfo` (`/vite`) |
|
|
115
116
|
| **Slideshows** | `parseTalk`, `splitDemoLinks`, `slideActionForKey`, `parseTalkOrigin`, `buildTalkManifest` (all `/slides`) | `Slideshow`, `SlideView`, `TalkList`, `BackToSlides` (all `/slides`), `cheminfoTalks` (`/vite`) |
|
|
116
117
|
| **Token guard** | `findTokenViolations` | `cheminfo-check-tokens`, `cheminfo-check-messages`, `cheminfo-check-deploy` (the bins) |
|
|
117
118
|
| **Figures** | `chartScale`, `chartAxisScale`, `chartAxisTitle`, `chartShare`, `chartColumnExtent`, `chartBinCounts`, `chartSeriesColor`, `rowMatrix`, `stackedMatrix`, `emptiestCorner`, `placeOverlayCard`, `overlayMetrics` | `ChartFrame`, `ChartAxis`, `TrackedLineChart`, `OverlayBar`, `OverlaySelect`, `OverlaySegmented`, `OverlayToggle`, `OverlayNumber`, `OverlayLegend`, `OverlayCaption`, `OverlayReadout` |
|
|
@@ -1222,6 +1223,34 @@ view costs one invocation rather than one per asset:
|
|
|
1222
1223
|
{ "version": 1, "include": ["/*"], "exclude": ["/assets/*"] }
|
|
1223
1224
|
```
|
|
1224
1225
|
|
|
1226
|
+
### On a Node server, next to an API
|
|
1227
|
+
|
|
1228
|
+
A prerendered site can also be deployed as a server, with its API and its MCP
|
|
1229
|
+
tools beside the pages. `staticSite` from `react-cheminfo/server` serves the
|
|
1230
|
+
build by the rules the static hosts follow: `/titration` is `titration.html`
|
|
1231
|
+
with no redirect, an unknown address is `404.html` and never the home page,
|
|
1232
|
+
pages are revalidated on every visit and `assets/` is kept for a year, the
|
|
1233
|
+
`TRACKING_SCRIPT` snippet is in every page, and `/health` answers the deploy
|
|
1234
|
+
script. Only a file the build wrote is ever served.
|
|
1235
|
+
|
|
1236
|
+
```ts
|
|
1237
|
+
import { fastify } from 'fastify';
|
|
1238
|
+
import { staticSite } from 'react-cheminfo/server';
|
|
1239
|
+
|
|
1240
|
+
const app = fastify();
|
|
1241
|
+
// …the API under /v1/…
|
|
1242
|
+
await app.register(staticSite, {
|
|
1243
|
+
root: 'dist',
|
|
1244
|
+
trackingScript: process.env.TRACKING_SCRIPT,
|
|
1245
|
+
redirects: { '/precipitation': '/equilibrium' },
|
|
1246
|
+
});
|
|
1247
|
+
```
|
|
1248
|
+
|
|
1249
|
+
Addresses under `reserved` (default `['/v1/']`) are left to the API, which
|
|
1250
|
+
answers its own 404. Without a build, `staticSite` logs it and serves the API
|
|
1251
|
+
alone. `fastify` (5) and `@fastify/static` (10) are optional peers, installed
|
|
1252
|
+
by a site that has a server.
|
|
1253
|
+
|
|
1225
1254
|
## Saying which build is running
|
|
1226
1255
|
|
|
1227
1256
|
A report of something going wrong is worth answering only when we know what was
|
|
@@ -1229,6 +1258,11 @@ running, and a hand-written version in a source file is wrong by the next
|
|
|
1229
1258
|
release. So the build states it: `cheminfoBuildInfo` resolves the release, the
|
|
1230
1259
|
instant and the commit once, and the About page reads them.
|
|
1231
1260
|
|
|
1261
|
+
The About says it once, in the badge in the corner of its hero: `1.2.1 ·
|
|
1262
|
+
2026-09-16 09:41 UTC`, whose hover card lists the commit, the instant to the
|
|
1263
|
+
second and the `react-cheminfo` version. A site with no release yet shows its
|
|
1264
|
+
commit on the badge instead. Nothing further down the page repeats it.
|
|
1265
|
+
|
|
1232
1266
|
```ts
|
|
1233
1267
|
// vite.config.ts
|
|
1234
1268
|
import { cheminfoBuildInfo } from 'react-cheminfo/vite';
|
|
@@ -1247,7 +1281,7 @@ export const ABOUT: AboutContent = { siteId: 'smiles', build: BUILD_INFO, ... };
|
|
|
1247
1281
|
plugin fills it in during the build. So a Playwright spec or a unit test that
|
|
1248
1282
|
imports the same About record in plain Node still resolves it — a virtual
|
|
1249
1283
|
specifier does not, and the whole suite dies on the import — and a build without
|
|
1250
|
-
the plugin simply shows no build
|
|
1284
|
+
the plugin simply shows no build badge.
|
|
1251
1285
|
|
|
1252
1286
|
Where each value comes from:
|
|
1253
1287
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
3
|
+
/**
|
|
4
|
+
* What the badge of a release leaves to its hover: the commit it was built
|
|
5
|
+
* from, the instant to the second, and the chrome it was built against.
|
|
6
|
+
* @param props - The build and its released version.
|
|
7
|
+
* @param props.build - What the build published about itself.
|
|
8
|
+
* @param props.version - The release the badge names.
|
|
9
|
+
* @returns The card's contents.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AboutBuildDetails(props: {
|
|
12
|
+
build: BuildInfo;
|
|
13
|
+
version: string;
|
|
14
|
+
}): ReactElement;
|
|
15
|
+
//# sourceMappingURL=AboutBuildDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AboutBuildDetails.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutBuildDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,YAAY,CA2Bf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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
|
+
* What the badge of a release leaves to its hover: the commit it was built
|
|
6
|
+
* from, the instant to the second, and the chrome it was built against.
|
|
7
|
+
* @param props - The build and its released version.
|
|
8
|
+
* @param props.build - What the build published about itself.
|
|
9
|
+
* @param props.version - The release the badge names.
|
|
10
|
+
* @returns The card's contents.
|
|
11
|
+
*/
|
|
12
|
+
export function AboutBuildDetails(props) {
|
|
13
|
+
const { build, version } = props;
|
|
14
|
+
const t = useChromeT();
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "build-tooltip__header", children: t('about.buildVersion', { version }) }), _jsxs("dl", { className: "build-tooltip__rows", children: [_jsx("dt", { children: t('about.buildBuilt') }), _jsx("dd", { children: formatBuiltAt(build.builtAt) }), build.commit === undefined ? null : (_jsxs(_Fragment, { children: [_jsx("dt", { children: t('about.buildCommit') }), _jsx("dd", { children: shortCommit(build.commit) })] })), build.reactCheminfo === undefined ? null : (_jsxs(_Fragment, { children: [_jsx("dt", { children: "react-cheminfo" }), _jsx("dd", { children: build.reactCheminfo })] }))] })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=AboutBuildDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AboutBuildDetails.js","sourceRoot":"","sources":["../../../src/about/ui/AboutBuildDetails.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAGjC;IACC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IAEvB,OAAO,CACL,8BACE,cAAK,SAAS,EAAC,uBAAuB,YACnC,CAAC,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,CAAC,GACjC,EACN,cAAI,SAAS,EAAC,qBAAqB,aACjC,uBAAK,CAAC,CAAC,kBAAkB,CAAC,GAAM,EAChC,uBAAK,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,GAAM,EACtC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,8BACE,uBAAK,CAAC,CAAC,mBAAmB,CAAC,GAAM,EACjC,uBAAK,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,GAAM,IACnC,CACJ,EACA,KAAK,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1C,8BACE,0CAAuB,EACvB,uBAAK,KAAK,CAAC,aAAa,GAAM,IAC7B,CACJ,IACE,IACJ,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { AboutContent } from '../core/about.ts';
|
|
3
|
+
import type { AboutSignInProps } from './AboutSignIn.tsx';
|
|
3
4
|
export interface AboutPageProps {
|
|
4
5
|
/** What the site says about itself. */
|
|
5
6
|
content: AboutContent;
|
|
@@ -30,6 +31,13 @@ export interface AboutPageProps {
|
|
|
30
31
|
* @default undefined
|
|
31
32
|
*/
|
|
32
33
|
logo?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Where the people who run the site sign in, drawn under the build badge in
|
|
36
|
+
* the corner of the hero. A site passes it while nobody is signed in, and
|
|
37
|
+
* leaves it out once somebody is: the account is then in the bar.
|
|
38
|
+
* @default undefined — the site has no account to sign in to
|
|
39
|
+
*/
|
|
40
|
+
signIn?: AboutSignInProps;
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* The About page of a site of the family: what the tool is, who provides it,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA+E7D"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { buildLabel } from "../../build/core/buildInfo.js";
|
|
2
3
|
import { CreditsList } from "../../credits/ui/CreditsList.js";
|
|
3
4
|
import { Wordmark } from "../../ecosystem/ui/Wordmark.js";
|
|
4
5
|
import { SiteMark } from "../../ecosystem/ui/marks.js";
|
|
5
6
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
6
7
|
import { resolveAbout } from "../core/about.js";
|
|
7
|
-
import { AboutBuild } from "./AboutBuild.js";
|
|
8
8
|
import { AboutCitations } from "./AboutCitations.js";
|
|
9
9
|
import { AboutProvidedBy } from "./AboutProvidedBy.js";
|
|
10
10
|
import { AboutSection } from "./AboutSection.js";
|
|
11
|
+
import { AboutSignIn } from "./AboutSignIn.js";
|
|
11
12
|
import { AboutVersion } from "./AboutVersion.js";
|
|
12
13
|
/**
|
|
13
14
|
* The About page of a site of the family: what the tool is, who provides it,
|
|
@@ -22,13 +23,14 @@ import { AboutVersion } from "./AboutVersion.js";
|
|
|
22
23
|
* @throws {Error} When the record names a site or a credit that does not exist.
|
|
23
24
|
*/
|
|
24
25
|
export function AboutPage(props) {
|
|
25
|
-
const { content, className, children, logo, mark } = props;
|
|
26
|
+
const { content, className, children, logo, mark, signIn } = props;
|
|
26
27
|
const t = useChromeT();
|
|
27
28
|
const about = resolveAbout(content);
|
|
28
29
|
const site = about.site;
|
|
30
|
+
const hasCorner = buildLabel(about.build) !== undefined || signIn !== undefined;
|
|
29
31
|
return (_jsxs("div", { className: className === undefined ? 'about-page' : `about-page ${className}`, style: PAGE_STYLE, children: [_jsxs("header", { className: "about-hero", style: HERO_STYLE, children: [logo === undefined
|
|
30
32
|
? (mark ?? _jsx(SiteMark, { site: site, size: 56 }))
|
|
31
|
-
: null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: t.or(`site.${site.id}.tagline`, site.tagline) }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), _jsx(AboutVersion, { build: about.build })] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: t('about.providedBy'), className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: t('about.whatYouCanDo'), className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: t('about.builtOn'), className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: t('about.howToCite'), className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) }))
|
|
33
|
+
: null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: t.or(`site.${site.id}.tagline`, site.tagline) }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), hasCorner ? (_jsxs("div", { className: "about-corner", style: CORNER_STYLE, children: [_jsx(AboutVersion, { build: about.build }), signIn === undefined ? null : _jsx(AboutSignIn, { ...signIn })] })) : null] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: t('about.providedBy'), className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: t('about.whatYouCanDo'), className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: t('about.builtOn'), className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: t('about.howToCite'), className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) }))] }));
|
|
32
34
|
}
|
|
33
35
|
const PAGE_STYLE = {
|
|
34
36
|
display: 'flex',
|
|
@@ -52,6 +54,13 @@ const HERO_STYLE = {
|
|
|
52
54
|
gap: 16,
|
|
53
55
|
lineHeight: 1.55,
|
|
54
56
|
};
|
|
57
|
+
const CORNER_STYLE = {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flex: '0 0 auto',
|
|
60
|
+
flexDirection: 'column',
|
|
61
|
+
alignItems: 'flex-end',
|
|
62
|
+
gap: 2,
|
|
63
|
+
};
|
|
55
64
|
const NAME_STYLE = {
|
|
56
65
|
margin: 0,
|
|
57
66
|
fontSize: 26,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutPage.js","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAkC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA8B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE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,EAAE;CACyB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,CAAC;CACqB,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,yBAAyB;IACjC,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,gBAAgB;IAC5B,GAAG,EAAE,EAAE;IACP,UAAU,EAAE,IAAI;CACgB,CAAC;AAEnC,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,UAAU;IAChB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,UAAU;IACtB,GAAG,EAAE,CAAC;CAC0B,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;CACiB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC;AAEnC,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,EAAE;CACoB,CAAC;AAEnC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,CAAC,EAAmC,CAAC;AAElE,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,EAAE;CACiB,CAAC;AAEnC,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,CAAC;CACuB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export interface AboutSignInProps {
|
|
3
|
+
/**
|
|
4
|
+
* The address signing in happens at. Writing it keeps the entry a real link,
|
|
5
|
+
* so a middle click opens a tab.
|
|
6
|
+
* @default undefined
|
|
7
|
+
*/
|
|
8
|
+
href?: string;
|
|
9
|
+
/**
|
|
10
|
+
* What the site does when the entry is picked — route to that page, or open
|
|
11
|
+
* a credentials dialog for a site that has no page. A modified click is left
|
|
12
|
+
* to the browser.
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
onSignIn?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* What the entry reads, for a site whose accounts are for one kind of person.
|
|
18
|
+
* @default the chrome's own word for it, in the language of the page
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Where the people who run a site sign in: one quiet line under the build
|
|
24
|
+
* badge, in the corner of the About.
|
|
25
|
+
*
|
|
26
|
+
* A visitor has nothing to sign in to, so the bar carries no invitation; the
|
|
27
|
+
* About is the page the operators already know, and the corner is where they
|
|
28
|
+
* already look for the build they run.
|
|
29
|
+
* @param props - See {@link AboutSignInProps}.
|
|
30
|
+
* @returns The entry.
|
|
31
|
+
*/
|
|
32
|
+
export declare function AboutSignIn(props: AboutSignInProps): ReactElement;
|
|
33
|
+
//# sourceMappingURL=AboutSignIn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AboutSignIn.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutSignIn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA0BjE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isModifiedClick } from "../../chrome/ui/navItem.js";
|
|
3
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
/**
|
|
5
|
+
* Where the people who run a site sign in: one quiet line under the build
|
|
6
|
+
* badge, in the corner of the About.
|
|
7
|
+
*
|
|
8
|
+
* A visitor has nothing to sign in to, so the bar carries no invitation; the
|
|
9
|
+
* About is the page the operators already know, and the corner is where they
|
|
10
|
+
* already look for the build they run.
|
|
11
|
+
* @param props - See {@link AboutSignInProps}.
|
|
12
|
+
* @returns The entry.
|
|
13
|
+
*/
|
|
14
|
+
export function AboutSignIn(props) {
|
|
15
|
+
const { href, onSignIn, label } = props;
|
|
16
|
+
const t = useChromeT();
|
|
17
|
+
const text = label ?? t('account.signIn');
|
|
18
|
+
if (href === undefined) {
|
|
19
|
+
return (_jsx("button", { type: "button", className: "about-sign-in", onClick: onSignIn, children: text }));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx("a", { className: "about-sign-in", href: href, onClick: (event) => {
|
|
22
|
+
if (onSignIn === undefined || isModifiedClick(event))
|
|
23
|
+
return;
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
onSignIn();
|
|
26
|
+
}, children: text }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AboutSignIn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AboutSignIn.js","sourceRoot":"","sources":["../../../src/about/ui/AboutSignIn.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAuBnD;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAE1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,CACL,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,QAAQ,YAC9D,IAAI,GACE,CACV,CAAC;IACJ,CAAC;IAED,OAAO,CACL,YACE,SAAS,EAAC,eAAe,EACzB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,QAAQ,KAAK,SAAS,IAAI,eAAe,CAAC,KAAK,CAAC;gBAAE,OAAO;YAC7D,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,QAAQ,EAAE,CAAC;QACb,CAAC,YAEA,IAAI,GACH,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* A report of something going wrong is worth answering only when we know what
|
|
5
5
|
* was running, and that is the one thing an About page cannot say from a
|
|
6
6
|
* hand-written record. It sits at the top of the page rather than at the
|
|
7
|
-
* bottom because it is the one line a reader is asked to quote back
|
|
7
|
+
* bottom because it is the one line a reader is asked to quote back, and it is
|
|
8
|
+
* said once: nothing further down the page repeats it.
|
|
8
9
|
*/
|
|
9
10
|
import type { ReactElement } from 'react';
|
|
10
11
|
import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
@@ -14,7 +15,8 @@ export interface AboutVersionProps {
|
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* The build badge: the release a site is serving, or the commit it was built
|
|
17
|
-
* from while it has no release yet, and when it was made.
|
|
18
|
+
* from while it has no release yet, and when it was made. A release names its
|
|
19
|
+
* commit and the exact instant in the card its hover opens.
|
|
18
20
|
* @param props - See {@link AboutVersionProps}.
|
|
19
21
|
* @returns The badge, or `null` when the build says nothing worth showing.
|
|
20
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS/D,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CA8B1E"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Which build of a site a visitor has open, in the corner of its hero.
|
|
4
|
+
*
|
|
5
|
+
* A report of something going wrong is worth answering only when we know what
|
|
6
|
+
* was running, and that is the one thing an About page cannot say from a
|
|
7
|
+
* hand-written record. It sits at the top of the page rather than at the
|
|
8
|
+
* bottom because it is the one line a reader is asked to quote back, and it is
|
|
9
|
+
* said once: nothing further down the page repeats it.
|
|
10
|
+
*/
|
|
11
|
+
import { Tooltip } from '@blueprintjs/core';
|
|
12
|
+
import { buildLabel, buildStamp, releasedVersion, } from "../../build/core/buildInfo.js";
|
|
13
|
+
import { AboutBuildDetails } from "./AboutBuildDetails.js";
|
|
3
14
|
/**
|
|
4
15
|
* The build badge: the release a site is serving, or the commit it was built
|
|
5
|
-
* from while it has no release yet, and when it was made.
|
|
16
|
+
* from while it has no release yet, and when it was made. A release names its
|
|
17
|
+
* commit and the exact instant in the card its hover opens.
|
|
6
18
|
* @param props - See {@link AboutVersionProps}.
|
|
7
19
|
* @returns The badge, or `null` when the build says nothing worth showing.
|
|
8
20
|
*/
|
|
@@ -14,7 +26,13 @@ export function AboutVersion(props) {
|
|
|
14
26
|
// The instant belongs on the badge rather than in its hover: a version
|
|
15
27
|
// nobody can date says nothing about how old the page they read is.
|
|
16
28
|
const badge = `${label} · ${buildStamp(build.builtAt)}`;
|
|
17
|
-
|
|
29
|
+
const version = releasedVersion(build);
|
|
30
|
+
if (version === undefined) {
|
|
31
|
+
return (_jsx("span", { style: BADGE_STYLE, className: "about-version", children: badge }));
|
|
32
|
+
}
|
|
33
|
+
return (_jsx(Tooltip, { content: _jsx(AboutBuildDetails, { build: build, version: version }),
|
|
34
|
+
// To the left, so the card never covers the way to sign in under it.
|
|
35
|
+
placement: "left-start", popoverClassName: "help-tooltip build-tooltip", hoverOpenDelay: 150, children: _jsx("span", { style: BADGE_STYLE, className: "about-version", tabIndex: 0, children: badge }) }));
|
|
18
36
|
}
|
|
19
37
|
const BADGE_STYLE = {
|
|
20
38
|
flex: '0 0 auto',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,GAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAO5D;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5D,uEAAuE;IACvE,oEAAoE;IACpE,MAAM,KAAK,GAAG,GAAG,KAAK,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IACxD,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,CACL,eAAM,KAAK,EAAE,WAAW,EAAE,SAAS,EAAC,eAAe,YAChD,KAAK,GACD,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,OAAO,IACN,OAAO,EAAE,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI;QAC9D,qEAAqE;QACrE,SAAS,EAAC,YAAY,EACtB,gBAAgB,EAAC,4BAA4B,EAC7C,cAAc,EAAE,GAAG,YAEnB,eAAM,KAAK,EAAE,WAAW,EAAE,SAAS,EAAC,eAAe,EAAC,QAAQ,EAAE,CAAC,YAC5D,KAAK,GACD,GACC,CACX,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,QAAQ;CACY,CAAC"}
|
package/lib/about/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export type { AboutBuildProps } from './AboutBuild.tsx';
|
|
2
|
-
export { AboutBuild } from './AboutBuild.tsx';
|
|
3
1
|
export type { AboutVersionProps } from './AboutVersion.tsx';
|
|
4
2
|
export { AboutVersion } from './AboutVersion.tsx';
|
|
5
3
|
export type { AboutCitationsProps } from './AboutCitations.tsx';
|
|
@@ -10,4 +8,6 @@ export type { AboutProvidedByProps } from './AboutProvidedBy.tsx';
|
|
|
10
8
|
export { AboutProvidedBy } from './AboutProvidedBy.tsx';
|
|
11
9
|
export type { AboutSectionProps } from './AboutSection.tsx';
|
|
12
10
|
export { AboutSection } from './AboutSection.tsx';
|
|
11
|
+
export type { AboutSignInProps } from './AboutSignIn.tsx';
|
|
12
|
+
export { AboutSignIn } from './AboutSignIn.tsx';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/about/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/about/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/about/ui/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AboutBuild } from "./AboutBuild.js";
|
|
2
1
|
export { AboutVersion } from "./AboutVersion.js";
|
|
3
2
|
export { AboutCitations } from "./AboutCitations.js";
|
|
4
3
|
export { AboutPage } from "./AboutPage.js";
|
|
5
4
|
export { AboutProvidedBy } from "./AboutProvidedBy.js";
|
|
6
5
|
export { AboutSection } from "./AboutSection.js";
|
|
6
|
+
export { AboutSignIn } from "./AboutSignIn.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/about/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/about/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { NavItem } from './navItem.ts';
|
|
3
|
+
/**
|
|
4
|
+
* One page of the bar: a link, or the menu it opens when the entry folds pages
|
|
5
|
+
* of its own. A menu stands where its pages would, among them and not among the
|
|
6
|
+
* utilities, because picking one of them changes what the page shows.
|
|
7
|
+
* @param props - The entry and the page on show.
|
|
8
|
+
* @param props.item - The entry.
|
|
9
|
+
* @param props.activeId - The page on show.
|
|
10
|
+
* @returns The entry.
|
|
11
|
+
*/
|
|
12
|
+
export declare function NavEntry(props: {
|
|
13
|
+
item: NavItem;
|
|
14
|
+
activeId: string | undefined;
|
|
15
|
+
}): ReactElement;
|
|
16
|
+
//# sourceMappingURL=NavEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavEntry.d.ts","sourceRoot":"","sources":["../../../src/chrome/ui/NavEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GAAG,YAAY,CAef"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NavLink } from "./NavLink.js";
|
|
3
|
+
import { NavMenuButton } from "./NavMenuButton.js";
|
|
4
|
+
/**
|
|
5
|
+
* One page of the bar: a link, or the menu it opens when the entry folds pages
|
|
6
|
+
* of its own. A menu stands where its pages would, among them and not among the
|
|
7
|
+
* utilities, because picking one of them changes what the page shows.
|
|
8
|
+
* @param props - The entry and the page on show.
|
|
9
|
+
* @param props.item - The entry.
|
|
10
|
+
* @param props.activeId - The page on show.
|
|
11
|
+
* @returns The entry.
|
|
12
|
+
*/
|
|
13
|
+
export function NavEntry(props) {
|
|
14
|
+
const { item, activeId } = props;
|
|
15
|
+
if (item.items === undefined) {
|
|
16
|
+
return _jsx(NavLink, { item: item, active: item.id === activeId });
|
|
17
|
+
}
|
|
18
|
+
return (_jsx(NavMenuButton, { label: menuLabel(item), icon: typeof item.icon === 'string' ? item.icon : undefined, items: item.items, activeId: activeId, placement: "bottom-start" }));
|
|
19
|
+
}
|
|
20
|
+
// The trigger names itself to a screen reader, so an entry drawn as a glyph
|
|
21
|
+
// alone says what it opens through its title rather than through its id.
|
|
22
|
+
function menuLabel(item) {
|
|
23
|
+
if (typeof item.label === 'string')
|
|
24
|
+
return item.label;
|
|
25
|
+
return item.title ?? item.id;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=NavEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavEntry.js","sourceRoot":"","sources":["../../../src/chrome/ui/NavEntry.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAGpD;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,KAGxB;IACC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACjC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,QAAQ,GAAI,CAAC;IAC/D,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,EACtB,IAAI,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAC3D,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,cAAc,GACxB,CACH,CAAC;AACJ,CAAC;AAED,4EAA4E;AAC5E,yEAAyE;AACzE,SAAS,SAAS,CAAC,IAAa;IAC9B,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IACtD,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -28,13 +28,20 @@ export interface SiteHeaderProps {
|
|
|
28
28
|
*/
|
|
29
29
|
activeId?: string;
|
|
30
30
|
/**
|
|
31
|
-
* The utilities pushed to the right edge — About, Cite, Tools, the language
|
|
32
|
-
*
|
|
33
|
-
* arrive dressed as bar items, so a plain `nav-link` and a `CiteButton`
|
|
34
|
-
* alike beside each other.
|
|
31
|
+
* The utilities pushed to the right edge — About, Cite, Tools, the language;
|
|
32
|
+
* Share and the account have props of their own, so they always come last.
|
|
33
|
+
* They arrive dressed as bar items, so a plain `nav-link` and a `CiteButton`
|
|
34
|
+
* read alike beside each other.
|
|
35
35
|
* @default undefined
|
|
36
36
|
*/
|
|
37
37
|
actions?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Who is signed in, drawn at the extreme right, after Share — usually an
|
|
40
|
+
* `AccountButton`. A site passes it only while somebody is signed in: signing
|
|
41
|
+
* in starts on the About (`AboutPage`'s `signIn`), never in the bar.
|
|
42
|
+
* @default undefined
|
|
43
|
+
*/
|
|
44
|
+
account?: ReactNode;
|
|
38
45
|
/**
|
|
39
46
|
* The Share entry, which closes the utilities on every site, after the
|
|
40
47
|
* Contact entry. A site passes its own when it wraps the shared `ShareButton`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.d.ts","sourceRoot":"","sources":["../../../src/chrome/ui/SiteHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAQxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kDAAkD;IAClD,GAAG,EAAE,SAAS,OAAO,EAAE,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG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;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC;IAChE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,GAAG,IAAI,CAsFtE"}
|
|
@@ -7,7 +7,7 @@ import { Wordmark } from "../../ecosystem/ui/Wordmark.js";
|
|
|
7
7
|
import { SiteMark } from "../../ecosystem/ui/marks.js";
|
|
8
8
|
import { useLanguage } from "../../i18n/ui/useLanguage.js";
|
|
9
9
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
10
|
-
import {
|
|
10
|
+
import { NavEntry } from "./NavEntry.js";
|
|
11
11
|
import { NavMenuButton } from "./NavMenuButton.js";
|
|
12
12
|
import { isModifiedClick } from "./navItem.js";
|
|
13
13
|
/**
|
|
@@ -24,7 +24,7 @@ import { isModifiedClick } from "./navItem.js";
|
|
|
24
24
|
* @throws {Error} When neither `site` nor `siteId` is given.
|
|
25
25
|
*/
|
|
26
26
|
export function SiteHeader(props) {
|
|
27
|
-
const { siteId, site: record, mark, nav, activeId, actions, share, contact, renderNavItem, embedded = false, homeHref = '/', onHome, markSize = 28, width = 'page', pagesLabel, } = props;
|
|
27
|
+
const { siteId, site: record, mark, nav, activeId, actions, share, account, contact, renderNavItem, embedded = false, homeHref = '/', onHome, markSize = 28, width = 'page', pagesLabel, } = props;
|
|
28
28
|
const t = useChromeT();
|
|
29
29
|
const language = useLanguage();
|
|
30
30
|
if (embedded)
|
|
@@ -41,30 +41,8 @@ export function SiteHeader(props) {
|
|
|
41
41
|
onHome();
|
|
42
42
|
}, children: [mark ?? _jsx(SiteMark, { site: site, size: markSize }), _jsx(Wordmark, { site: site })] }), _jsx("nav", { className: "app-header-nav", children: nav.map((item) => (_jsx(Fragment, { children: renderNavItem === undefined ? (_jsx(NavEntry, { item: item, activeId: activeId })) : (renderNavItem(item, item.id === activeId)) }, item.id))) }), nav.length > 1 ? (_jsx("div", { className: "app-header-nav-menu", children: _jsx(NavMenuButton, { label: pagesLabel ?? t('chrome.pages'), icon: "menu", compact: true, items: nav, activeId: activeId }) })) : null, _jsx("span", { className: "spacer" }), actions === undefined &&
|
|
43
43
|
share === undefined &&
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* One page of the bar: a link, or the menu it opens when the entry folds pages
|
|
48
|
-
* of its own. A menu stands where its pages would, among them and not among the
|
|
49
|
-
* utilities, because picking one of them changes what the page shows.
|
|
50
|
-
* @param props - The entry and the page on show.
|
|
51
|
-
* @param props.item - The entry.
|
|
52
|
-
* @param props.activeId - The page on show.
|
|
53
|
-
* @returns The entry.
|
|
54
|
-
*/
|
|
55
|
-
function NavEntry(props) {
|
|
56
|
-
const { item, activeId } = props;
|
|
57
|
-
if (item.items === undefined) {
|
|
58
|
-
return _jsx(NavLink, { item: item, active: item.id === activeId });
|
|
59
|
-
}
|
|
60
|
-
return (_jsx(NavMenuButton, { label: menuLabel(item), icon: typeof item.icon === 'string' ? item.icon : undefined, items: item.items, activeId: activeId, placement: "bottom-start" }));
|
|
61
|
-
}
|
|
62
|
-
// The trigger names itself to a screen reader, so an entry drawn as a glyph
|
|
63
|
-
// alone says what it opens through its title rather than through its id.
|
|
64
|
-
function menuLabel(item) {
|
|
65
|
-
if (typeof item.label === 'string')
|
|
66
|
-
return item.label;
|
|
67
|
-
return item.title ?? item.id;
|
|
44
|
+
account === undefined &&
|
|
45
|
+
contactForm === '' ? null : (_jsxs("div", { className: "app-header-actions", children: [actions, contactForm === '' ? null : (_jsx(ContactButton, { siteId: site.id, formUrl: contactForm })), share, account] }))] }) }));
|
|
68
46
|
}
|
|
69
47
|
/** The two widths the bar's contents run at, as the classes that set them. */
|
|
70
48
|
const INNER_CLASS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.js","sourceRoot":"","sources":["../../../src/chrome/ui/SiteHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAoC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA8B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SiteHeader.js","sourceRoot":"","sources":["../../../src/chrome/ui/SiteHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAoC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAiC,CAAC;AA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AK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,eAAK,SAAS,EAAC,oBAAoB,aAChC,OAAO,EACP,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,KAAC,aAAa,IAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,GAAI,CACzD,EACA,KAAK,EACL,OAAO,IACJ,CACP,IACG,GACC,CACV,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,2CAA2C;CACzC,CAAC"}
|
package/lib/core.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './error/core/index.ts';
|
|
|
14
14
|
export * from './format/core/index.ts';
|
|
15
15
|
export * from './i18n/core/index.ts';
|
|
16
16
|
export * from './language/core/index.ts';
|
|
17
|
+
export * from './moleculesSources/core/index.ts';
|
|
17
18
|
export * from './moleculesToken/core/index.ts';
|
|
18
19
|
export * from './number/core/index.ts';
|
|
19
20
|
export * from './orbital/core/index.ts';
|
package/lib/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC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yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
package/lib/core.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./error/core/index.js";
|
|
|
14
14
|
export * from "./format/core/index.js";
|
|
15
15
|
export * from "./i18n/core/index.js";
|
|
16
16
|
export * from "./language/core/index.js";
|
|
17
|
+
export * from "./moleculesSources/core/index.js";
|
|
17
18
|
export * from "./moleculesToken/core/index.js";
|
|
18
19
|
export * from "./number/core/index.js";
|
|
19
20
|
export * from "./orbital/core/index.js";
|
package/lib/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,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