diff --git a/doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md b/doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md index afc91027da..76149b308b 100644 --- a/doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md +++ b/doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md @@ -1764,3 +1764,79 @@ machine, listed `fleet-queue-backup-export.service` as failed: last night's export of the queue store did not run, because its unit points into a lane's worktree that has been removed (#14302). A service on the laptop running out of a directory someone works in is what #13833 was. + +## 2026-11-24T13:34:00Z Feature: the app's look is the owner's to choose + +**Asked for.** "Implement a wide variety of themes", "multiple full +black OLED themes to choose from, high contrast, and settings to change +the font, along with a dozen or more fonts", "to change the spacing +around elements", and that "consistent UI elements are used throughout" +and it is "straightforward to implement new pages". + +**What was built.** A screen, More → Appearance, with three parts: +colours (33 themes: Slate and Paper as before, eight true black, three +high contrast, thirteen dark, seven light), typeface (22: three of the +device's own and nineteen the app carries, each under the SIL Open Font +License), and size and spacing (seven text sizes, five amounts of room, +four kinds of corner, movement on, off or as the device asks). The app +follows the system between a theme for light and a theme for dark, each +chosen, or wears one always. + +**How.** Each choice is one attribute on the root element. `look.js` +(a plain script in the page's head, after the style sheets) reads the +choices from the device and sets the attributes before anything is +drawn; `themes.css` has a block of thirteen colours per theme, and +`look.css` a rule per typeface and per step. Nothing writes a style, so +the content policy is untouched. A theme block put on any element +colours just that element, which is how the chooser shows every theme +at once without a second copy of any colour. + +The style sheet was already drawn from thirteen colour variables. What +it lacked was the same for everything else, so every padding, margin +and gap now goes by `--space`, every corner by `--round`, every hairline +by `--edge`, the text size by `--scale` and the typeface by `--font`; +the one rule with colours of its own (the badge on a tab) takes the +theme's. With every setting at its default the page is pixel for pixel +what it was. Tests refuse a rule that writes its own colour, a bare +pixel padding or a bare radius, which is what keeps one element looking +like the next as screens are added. + +**Decisions.** + +- _Kept on the device, not with the account._ A phone with an OLED + screen and a monitor want different things, and the choice has to be + there before the first read of anything. +- _Contrast is a rule, not a hope._ Every theme is held, by the WCAG + formula, to 7 to 1 for text and 4.5 to 1 for small print, the status + colours and the ink on each; the high-contrast ones to 15, 10 and 7, + with edges at 3 to 1. The well-known palettes are their makers' + colours with any that missed a rule moved toward white or black until + it met it. Paper's own edge colour measures 1.29 to 1 on the page; the + rule for an edge was set at 1.25 so that the look the app shipped with + is not changed by this. +- _True black means `#000000`._ The page and the panels of a true-black + theme are exactly that; a card is told from the page by its edge. +- _Typefaces are carried, and fetched only when used._ They are the + Latin files Fontsource publishes (npm), 19 families in 22 files, 870 + kB in all, with each licence beside them. A browser fetches a file + only when something is set in it; the service worker keeps what was + fetched. Opening the typeface chooser shows each as itself, which + fetches them all once. +- _One list of the app's files._ Adding the style sheets and typefaces + would have meant editing four lists (the laptop's service, the Worker, + its build, the service worker) that a test held together. + `public/files.json` is now the only one, read by all four; the service + worker reads it when installed and keeps what it marks as needed to + open. A new file for the app is one line. + +**Checked.** 594 tests. Thirty-four faults were planted one at a time +(a faint colour, a near-black called black, day and night swapped, a +choice not kept, a typeface missing from the list, the build shipping +less, a bare padding, and so on) and each was caught. In the real +Worker runtime the smoke run fetches all 31 files as the signed-in +owner and compares each with the file on disk (56 checks pass). On the +laptop, a copy of the branch was opened in Chromium at a phone's width +and driven: the default look is unchanged; choosing Black with Inter +gives a page whose background the browser reports as `rgb(0, 0, 0)` +and a bar colour of `#000000`; all 22 typeface files load; pressing a +theme, then "One theme", then another keeps and shows each. diff --git a/planning/roadmaps/pm-stack.md b/planning/roadmaps/pm-stack.md index 24dd189fd2..821263d6a4 100644 --- a/planning/roadmaps/pm-stack.md +++ b/planning/roadmaps/pm-stack.md @@ -28,6 +28,7 @@ The roadmap of record is this file and its siblings in `planning/roadmaps/`. The | What was finished, beside what is happening and what is next | shipped | A Done screen and a tile on Now: tasks the queue says are done, pull requests merged and issues closed, read by Cloudflare itself from the queue store and GitHub. | #13504 | | Ask a question, start work, or give a standing instruction | shipped | Ask says which it is; a question is answered and changes nothing, a standing instruction is recorded where every agent reads it, and each is filed and queued as that with no machine. | #13504 | | A machine's console runs main, from GitHub | shipped | The console on a machine runs from its own copy of main, fetched from GitHub and laid out a release per commit, not from a checkout the fleet works in; a release that does not come up is taken out again. | #13833 | +| The app looks the way its owner wants | shipped | #13504 | ## Next diff --git a/pm-stack/console/README.md b/pm-stack/console/README.md index 0c836b0902..fae4d857e8 100644 --- a/pm-stack/console/README.md +++ b/pm-stack/console/README.md @@ -225,6 +225,60 @@ drawn from the repository's own list with the latest run of each deploy workflow, so the edge answers it with no machine and the list changes with a merge. +### Appearance + +**More → Appearance** is where the app is made to look the way its owner +wants, on the device in hand: + +- **Colours.** 33 themes: the two the app always had (Slate and Paper), + eight **true black** ones whose page and panels are `#000000` (an OLED + screen leaves those pixels off), three **high contrast** ones (text at + 15 to 1 or more, heavier edges), and dark and light palettes many + people know from their editors. The app either follows the system + between a theme for light and a theme for dark, each of the owner's + choosing, or wears one theme always. +- **Typeface.** 22: the device's own sans, serif and fixed-width, and 19 + the app carries (`public/fonts/`, each under the SIL Open Font License, + its licence beside it in `public/fonts/licences/`). Among them are four + made to be easy to read (Atkinson Hyperlegible, Lexend, OpenDyslexic, + Comic Neue). A typeface is fetched when first shown and kept for when + there is no connection; the ones not chosen cost nothing. +- **Size and spacing.** Seven sizes of text, five amounts of room around + things, four kinds of corner, and whether anything moves. + +The choices are kept on the device (`localStorage`, key `pm.look`), not +with the account: a phone and a desk can each look their own way. They +are put on the page before it is first drawn. + +How it is made, for adding to it: + +- Each choice is **one attribute on the root element** (`data-theme`, + `data-font`, `data-size`, `data-space`, `data-corners`, `data-motion`), + put there by `public/look.js`. Nothing writes a style, so the page's + content policy stays `default-src 'self'`. +- **A new theme** is a block of thirteen colours in `public/themes.css` + and a line in `THEMES` in `public/look.js`. The tests hold every theme + to the contrast rules written at the top of `themes.css`, so one that + cannot be read does not merge. +- **A new typeface** is its file in `public/fonts/` with its licence, an + `@font-face` and a `[data-font]` rule in `public/look.css`, a line in + `FONTS`, and a line in `public/files.json`. +- The style sheet (`public/app.css`) is drawn entirely from those + settings: colours only through the theme's variables, padding, margins + and gaps through `--space`, corners through `--round`, edges through + `--edge`. A rule that writes its own colour or a bare pixel padding + fails a test. + +### The app's files + +`public/files.json` is the one list of the files the app is made of. The +laptop's service, the Worker, the Worker's build and the service worker +all go by it: **a new file for the app is one line there** (its path, +what it is served as, and when the service worker keeps a copy: +`installed` for what the page needs to open, `used` for what is fetched +on demand, such as a typeface). A file in `public/` that the list does +not name is not served. + ### With no connection The app opens and can be used with no connection, in a browser and in diff --git a/pm-stack/console/edge/build.mjs b/pm-stack/console/edge/build.mjs index f62e73fbb8..41e85d1fac 100644 --- a/pm-stack/console/edge/build.mjs +++ b/pm-stack/console/edge/build.mjs @@ -1,23 +1,34 @@ // Puts the app's files where the Worker serves them from: dist/console/ -// (the page, its script and style, its service worker) and dist/icons/ -// (the install icons, which live with the dashboard). -import { cpSync, mkdirSync, rmSync } from "node:fs"; -import { dirname, join } from "node:path"; +// (the page and every file public/files.json names: its scripts, style +// sheets, typefaces and service worker) and dist/icons/ (the install +// icons, which live with the dashboard). +// +// The list of files is not kept here: public/files.json is the one +// place a file of the app is named. +import { cpSync, mkdirSync, readFileSync, rmSync } from "node:fs"; +import { dirname, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -if (process.argv.length > 2) { - console.error("usage: node build.mjs (it takes no arguments)"); +const usage = "usage: node build.mjs [--out ] (the directory is emptied first; without one it is ./dist)"; +const args = process.argv.slice(2); +const here = dirname(fileURLToPath(import.meta.url)); +let dist = join(here, "dist"); +if (args.length === 2 && args[0] === "--out" && args[1] && !args[1].startsWith("-")) dist = resolve(args[1]); +else if (args.length > 0) { + console.error(usage); process.exit(2); } -const here = dirname(fileURLToPath(import.meta.url)); -const dist = join(here, "dist"); +const from = join(here, "..", "public"); +const app = JSON.parse(readFileSync(join(from, "files.json"), "utf8")); rmSync(dist, { recursive: true, force: true }); mkdirSync(join(dist, "console"), { recursive: true }); mkdirSync(join(dist, "icons"), { recursive: true }); -for (const name of ["index.html", "app.js", "outbox.js", "app.css", "icon.svg", "sw.js"]) { - cpSync(join(here, "..", "public", name), join(dist, "console", name)); +for (const name of [app.page, ...app.files.map((f) => f.path)]) { + const to = join(dist, "console", name); + mkdirSync(dirname(to), { recursive: true }); + cpSync(join(from, name), to); } for (const name of ["icon-192.png", "icon-512.png", "icon-maskable-512.png", "apple-touch-icon.png"]) { cpSync(join(here, "..", "..", "aggregator", "src", "assets", "icons", name), join(dist, "icons", name)); } -console.log(`built ${dist}`); +console.log(`built ${dist}: the page and ${app.files.length} files`); diff --git a/pm-stack/console/edge/src/edge.ts b/pm-stack/console/edge/src/edge.ts index c0b32f3760..4c7b7e9d75 100644 --- a/pm-stack/console/edge/src/edge.ts +++ b/pm-stack/console/edge/src/edge.ts @@ -85,6 +85,7 @@ import { contact, Push } from "../../src/push.ts"; import { goesBy, platformSettings, settingsDifferences, settingsThatDiffer } from "../../src/settings.ts"; import type { Store } from "../../src/store.ts"; import { timed, unread } from "../../src/timed.ts"; +import appFiles from "../../public/files.json"; /** A rank set twice ends at the last one: an older held rank never * runs when a newer rank for the same issue is done. Anything else @@ -201,13 +202,9 @@ const SELF_CHECK_EVERY_MS = 60 * 60_000; * usually passed, and a failure should not stand for an hour. */ const SELF_CHECK_AGAIN_MS = 5 * 60_000; const KEY_FETCH_EVERY_MS = 30_000; -const STATIC: Record = { - "app.js": "text/javascript; charset=utf-8", - "outbox.js": "text/javascript; charset=utf-8", - "app.css": "text/css; charset=utf-8", - "icon.svg": "image/svg+xml", - "sw.js": "text/javascript; charset=utf-8", -}; +/** The app's files and what each is served as: public/files.json is the + * one list of them, and this Worker's build ships exactly those. */ +const STATIC: Record = Object.fromEntries(appFiles.files.map((f) => [f.path, f.type])); const ACT_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/; /** How many actions done here under a name are remembered, for how * long, and how much of each answer is kept with it. A device offline diff --git a/pm-stack/console/public/app.css b/pm-stack/console/public/app.css index 0d7d8b463d..e473123275 100644 --- a/pm-stack/console/public/app.css +++ b/pm-stack/console/public/app.css @@ -16,8 +16,17 @@ --bad-ink: #1a0405; --tab-h: 62px; --top-h: 52px; - font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; - font-size: 16px; + /* How it looks beyond its colours, each set by an attribute on this + element (look.js puts them there; look.css has the steps): the + typeface, the size of the text, the room around things, how round + the corners are, and how heavy an edge is. */ + --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + --scale: 1; + --space: 1; + --round: 1; + --edge: 1px; + font-family: var(--font); + font-size: calc(16px * var(--scale)); line-height: 1.4; } @media (prefers-color-scheme: light) { @@ -77,12 +86,12 @@ a.button { position: fixed; inset: 0 0 auto 0; height: calc(var(--top-h) + env(safe-area-inset-top)); - padding: env(safe-area-inset-top) 12px 0 16px; + padding: env(safe-area-inset-top) calc(12px * var(--space)) 0 calc(16px * var(--space)); display: flex; align-items: center; - gap: 8px; + gap: calc(8px * var(--space)); background: var(--bg); - border-bottom: 1px solid var(--line); + border-bottom: var(--edge) solid var(--line); z-index: 5; } .top h1 { @@ -110,9 +119,9 @@ a.button { max-width: 760px; min-height: 44px; margin: 0 auto; - padding: 10px 16px; + padding: calc(10px * var(--space)) calc(16px * var(--space)); border: 0; - border-bottom: 1px solid var(--line); + border-bottom: var(--edge) solid var(--line); border-radius: 0; background: var(--panel-2); color: var(--text); @@ -126,7 +135,7 @@ a.button { main { max-width: 760px; margin: 0 auto; - padding: 12px; + padding: calc(12px * var(--space)); outline: none; } .tabs { @@ -136,7 +145,7 @@ main { padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--panel); - border-top: 1px solid var(--line); + border-top: var(--edge) solid var(--line); z-index: 5; } .tabs button { @@ -151,7 +160,7 @@ main { flex-direction: column; align-items: center; justify-content: center; - gap: 3px; + gap: calc(3px * var(--space)); min-height: 0; padding: 0; position: relative; @@ -174,11 +183,11 @@ main { left: calc(50% + 6px); min-width: 18px; padding: 0 5px; - border-radius: 9px; - /* White on the theme's own red is too faint in either theme; this - red carries white at 5.4 to 1. */ - background: #cf222e; - color: #fff; + border-radius: calc(9px * var(--round)); + /* The theme's own red and the ink made for it: every theme is held + to 4.5 to 1 between the two. */ + background: var(--bad); + color: var(--bad-ink); font-size: 0.68rem; font-weight: 700; line-height: 18px; @@ -199,7 +208,7 @@ main { justify-content: flex-start; padding-top: 12px; border-top: 0; - border-right: 1px solid var(--line); + border-right: var(--edge) solid var(--line); } .tabs button { flex: 0 0 72px; @@ -208,7 +217,7 @@ main { /* ---- pieces --------------------------------------------------------- */ h2 { - margin: 20px 4px 8px; + margin: calc(20px * var(--space)) calc(4px * var(--space)) calc(8px * var(--space)); font-size: 0.8rem; font-weight: 650; letter-spacing: 0.04em; @@ -216,24 +225,24 @@ h2 { color: var(--quiet); } h2:first-child { - margin-top: 4px; + margin-top: calc(4px * var(--space)); } h3 { - margin: 0 0 4px; + margin: 0 0 calc(4px * var(--space)); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; } p { - margin: 4px 0; + margin: calc(4px * var(--space)) 0; overflow-wrap: anywhere; } .card { background: var(--panel); - border: 1px solid var(--line); - border-radius: 12px; - padding: 12px 14px; - margin-bottom: 10px; + border: var(--edge) solid var(--line); + border-radius: calc(12px * var(--round)); + padding: calc(12px * var(--space)) calc(14px * var(--space)); + margin-bottom: calc(10px * var(--space)); } .card.flag { border-left: 4px solid var(--warn); @@ -246,10 +255,10 @@ p { font-size: 0.82rem; } .step { - margin-top: 8px; - padding: 8px 10px; + margin-top: calc(8px * var(--space)); + padding: calc(8px * var(--space)) calc(10px * var(--space)); background: var(--panel-2); - border-radius: 8px; + border-radius: calc(8px * var(--round)); font-size: 0.9rem; } .step b { @@ -258,7 +267,7 @@ p { letter-spacing: 0.04em; text-transform: uppercase; color: var(--quiet); - margin-bottom: 2px; + margin-bottom: calc(2px * var(--space)); } .why { color: var(--warn); @@ -267,26 +276,26 @@ p { color: var(--bad); } .empty { - padding: 28px 16px; + padding: calc(28px * var(--space)) calc(16px * var(--space)); text-align: center; color: var(--quiet); } .row { display: flex; flex-wrap: wrap; - gap: 8px; + gap: calc(8px * var(--space)); align-items: center; } .row.end { justify-content: flex-end; - margin-top: 10px; + margin-top: calc(10px * var(--space)); } .chip { display: inline-block; - padding: 1px 8px; - border-radius: 999px; + padding: 1px calc(8px * var(--space)); + border-radius: calc(999px * var(--round)); background: var(--panel-2); - border: 1px solid var(--line); + border: var(--edge) solid var(--line); font-size: 0.74rem; color: var(--quiet); white-space: nowrap; @@ -306,14 +315,14 @@ p { .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); - gap: 8px; - margin-bottom: 4px; + gap: calc(8px * var(--space)); + margin-bottom: calc(4px * var(--space)); } .stat { background: var(--panel); - border: 1px solid var(--line); - border-radius: 12px; - padding: 10px 2px; + border: var(--edge) solid var(--line); + border-radius: calc(12px * var(--round)); + padding: calc(10px * var(--space)) calc(2px * var(--space)); text-align: center; color: var(--text); min-height: 0; @@ -330,7 +339,7 @@ p { .num { flex: 0 0 26px; height: 26px; - border-radius: 13px; + border-radius: calc(13px * var(--round)); background: var(--panel-2); color: var(--quiet); font-size: 0.8rem; @@ -341,7 +350,7 @@ p { } .lead { display: flex; - gap: 10px; + gap: calc(10px * var(--space)); align-items: flex-start; } .lead > div { @@ -359,9 +368,9 @@ textarea { } button { min-height: 42px; - padding: 8px 14px; - border-radius: 10px; - border: 1px solid var(--accent); + padding: calc(8px * var(--space)) calc(14px * var(--space)); + border-radius: calc(10px * var(--round)); + border: var(--edge) solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; @@ -372,8 +381,8 @@ a.button { display: inline-flex; align-items: center; min-height: 42px; - padding: 8px 14px; - border-radius: 10px; + padding: calc(8px * var(--space)) calc(14px * var(--space)); + border-radius: calc(10px * var(--round)); background: var(--accent); color: var(--accent-ink); font-weight: 600; @@ -385,7 +394,7 @@ ul.plain { list-style: none; } ul.plain li { - padding: 6px 0; + padding: calc(6px * var(--space)) 0; color: var(--quiet); } ul.plain li b { @@ -404,7 +413,7 @@ button.danger { } button.small { min-height: 34px; - padding: 4px 10px; + padding: calc(4px * var(--space)) calc(10px * var(--space)); font-size: 0.85rem; } button.icon { @@ -425,9 +434,9 @@ input, textarea { width: 100%; min-height: 42px; - padding: 8px 10px; - border-radius: 10px; - border: 1px solid var(--line); + padding: calc(8px * var(--space)) calc(10px * var(--space)); + border-radius: calc(10px * var(--round)); + border: var(--edge) solid var(--line); background: var(--panel-2); } select.narrow { @@ -442,16 +451,16 @@ textarea { } .seg { display: flex; - gap: 6px; + gap: calc(6px * var(--space)); overflow-x: auto; - padding-bottom: 6px; - margin-bottom: 6px; + padding-bottom: calc(6px * var(--space)); + margin-bottom: calc(6px * var(--space)); } .seg button { flex: 0 0 auto; min-height: 36px; - padding: 4px 12px; - border-radius: 999px; + padding: calc(4px * var(--space)) calc(12px * var(--space)); + border-radius: calc(999px * var(--round)); background: var(--panel); border-color: var(--line); color: var(--text); @@ -463,12 +472,18 @@ textarea { border-color: var(--accent); color: var(--accent-ink); } +/* A row of choices that are all to be seen at once (the steps of a + setting): it wraps instead of scrolling off the side. */ +.seg.wrap { + flex-wrap: wrap; + overflow-x: visible; +} /* ---- questions ------------------------------------------------------ */ .options { display: grid; - gap: 8px; - margin-top: 10px; + gap: calc(8px * var(--space)); + margin-top: calc(10px * var(--space)); } .option { text-align: left; @@ -493,19 +508,19 @@ textarea { text-transform: uppercase; } details { - margin-top: 6px; + margin-top: calc(6px * var(--space)); } summary { cursor: pointer; color: var(--accent); font-size: 0.86rem; - padding: 6px 0; + padding: calc(6px * var(--space)) 0; } .set { display: flex; align-items: center; - gap: 8px; - margin: 18px 4px 8px; + gap: calc(8px * var(--space)); + margin: calc(18px * var(--space)) calc(4px * var(--space)) calc(8px * var(--space)); } .set h2 { margin: 0; @@ -519,9 +534,9 @@ summary { z-index: 2; } .bubble { - margin-top: 8px; - padding: 8px 10px; - border-radius: 10px; + margin-top: calc(8px * var(--space)); + padding: calc(8px * var(--space)) calc(10px * var(--space)); + border-radius: calc(10px * var(--round)); background: var(--panel-2); font-size: 0.92rem; white-space: pre-wrap; @@ -529,7 +544,7 @@ summary { } .bubble.you { background: transparent; - border: 1px solid var(--line); + border: var(--edge) solid var(--line); } .bubble b { display: block; @@ -547,33 +562,33 @@ summary { .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); - gap: 10px; + gap: calc(10px * var(--space)); } .tile { display: block; text-align: left; background: var(--panel); - border: 1px solid var(--line); - border-radius: 12px; - padding: 12px; + border: var(--edge) solid var(--line); + border-radius: calc(12px * var(--round)); + padding: calc(12px * var(--space)); color: var(--text); font-weight: 600; min-height: 74px; } .tile span { display: block; - margin-top: 4px; + margin-top: calc(4px * var(--space)); font-weight: 400; font-size: 0.8rem; color: var(--quiet); } .link { display: block; - padding: 12px 14px; + padding: calc(12px * var(--space)) calc(14px * var(--space)); background: var(--panel); - border: 1px solid var(--line); - border-radius: 12px; - margin-bottom: 8px; + border: var(--edge) solid var(--line); + border-radius: calc(12px * var(--round)); + margin-bottom: calc(8px * var(--space)); color: var(--text); } .link span { @@ -584,18 +599,18 @@ summary { /* A form in a dialog: a note, a change, a new item. */ dialog.sheet { width: min(560px, calc(100vw - 24px)); - border: 1px solid var(--line); - border-radius: 14px; + border: var(--edge) solid var(--line); + border-radius: calc(14px * var(--round)); background: var(--panel); color: var(--text); - padding: 16px; + padding: calc(16px * var(--space)); } dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); } dialog.sheet label { display: block; - margin: 10px 0 4px; + margin: calc(10px * var(--space)) 0 calc(4px * var(--space)); font-size: 0.86rem; color: var(--quiet); } @@ -609,19 +624,19 @@ dialog.sheet input[type="text"] { width: 100%; } .chip + .chip { - margin-left: 6px; + margin-left: calc(6px * var(--space)); } /* A list of runs, each a link to its page: a line tall enough to tap. */ .runs a { display: block; - padding: 6px 0; + padding: calc(6px * var(--space)) 0; font-size: 0.88rem; } pre { - margin: 8px 0 0; - padding: 10px; + margin: calc(8px * var(--space)) 0 0; + padding: calc(10px * var(--space)); background: var(--panel-2); - border-radius: 8px; + border-radius: calc(8px * var(--round)); font-size: 0.74rem; overflow-x: auto; white-space: pre-wrap; @@ -636,8 +651,8 @@ pre { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); max-width: 560px; margin: 0 auto; - padding: 12px 14px; - border-radius: 12px; + padding: calc(12px * var(--space)) calc(14px * var(--space)); + border-radius: calc(12px * var(--round)); background: var(--good); color: var(--good-ink); font-weight: 600; @@ -655,17 +670,17 @@ pre { } dialog { width: min(92vw, 520px); - border: 1px solid var(--line); - border-radius: 14px; + border: var(--edge) solid var(--line); + border-radius: calc(14px * var(--round)); background: var(--panel); color: var(--text); - padding: 16px; + padding: calc(16px * var(--space)); } dialog::backdrop { background: rgb(0 0 0 / 0.6); } dialog h2 { - margin: 0 0 6px; + margin: 0 0 calc(6px * var(--space)); font-size: 1.05rem; text-transform: none; letter-spacing: 0; @@ -673,13 +688,13 @@ dialog h2 { } dialog label { display: block; - margin: 10px 0 4px; + margin: calc(10px * var(--space)) 0 calc(4px * var(--space)); font-size: 0.85rem; color: var(--quiet); } .check { - padding: 8px 0; + padding: calc(8px * var(--space)) 0; flex-wrap: nowrap; } .check input { @@ -717,3 +732,106 @@ input[type="radio"] { height: 22px; padding: 0; } + +/* ---- appearance ----------------------------------------------------- */ +/* Choosing a theme: each choice is drawn in its own colours (the inner + swatch carries the theme's name, so themes.css colours just it), and + the button around it in the page's, so the chosen one is marked in a + colour that shows on the page whatever the choice looks like. */ +.picks { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); + gap: calc(8px * var(--space)); +} +.pick { + display: block; + padding: calc(6px * var(--space)); + text-align: left; + background: var(--panel); + border: var(--edge) solid var(--line); + border-radius: calc(12px * var(--round)); + color: var(--text); + font-weight: 500; +} +.pick[aria-pressed="true"] { + border-color: var(--accent); + box-shadow: 0 0 0 2px var(--accent); +} +.pick-name { + display: block; + margin-top: calc(6px * var(--space)); + font-size: 0.85rem; +} +.pick[aria-pressed="true"] .pick-name::before { + content: "✓ "; + color: var(--accent); + font-weight: 700; +} +.swatch { + display: block; + padding: calc(8px * var(--space)); + background: var(--bg); + color: var(--text); + border: var(--edge) solid var(--line); + border-radius: calc(8px * var(--round)); +} +.swatch-card { + display: flex; + align-items: baseline; + gap: calc(6px * var(--space)); + padding: calc(4px * var(--space)) calc(8px * var(--space)); + background: var(--panel); + border: var(--edge) solid var(--line); + border-radius: calc(6px * var(--round)); +} +.swatch-card b { + font-size: 1.05rem; +} +.swatch-card i { + font-style: normal; + font-size: 0.72rem; + color: var(--quiet); +} +.dots { + display: flex; + gap: calc(6px * var(--space)); + margin-top: calc(8px * var(--space)); +} +.dot { + width: 14px; + height: 14px; + border-radius: 999px; + background: var(--quiet); +} +.dot.accent { + background: var(--accent); +} +.dot.good { + background: var(--good); +} +.dot.warn { + background: var(--warn); +} +.dot.bad { + background: var(--bad); +} +/* Choosing a typeface: each choice is set in itself. */ +.option.face { + font-family: var(--font); +} +.option.face b { + display: block; + font-size: 1.1rem; + font-weight: 600; +} +.option.face span { + display: block; + font-size: 0.85rem; + font-weight: 400; + color: var(--quiet); +} +/* The sample the choices are seen on: its rows keep apart. */ +.sample .row { + margin-top: calc(10px * var(--space)); + flex-wrap: wrap; +} diff --git a/pm-stack/console/public/app.js b/pm-stack/console/public/app.js index 5c9ec01aca..cf221844da 100644 --- a/pm-stack/console/public/app.js +++ b/pm-stack/console/public/app.js @@ -1672,6 +1672,7 @@ function viewMore() { tile("more/machines", "Machines", "each machine, what only it can do, and what waits for one"), tile("more/platform", "Platform", "every Worker: what it does, whether it is in service, how it is deployed"), tile("more/device", "On this device", "what is kept here to send, and what it shows with no connection"), + Look ? tile("more/look", "Appearance", lookCounts()) : null, tile("more/releases", "Releases", "what is deployed, the Android app, and putting either out again"), ), ]; @@ -1698,6 +1699,163 @@ function viewMore() { return out; } +// ---- appearance ---------------------------------------------------------- +// How the app looks on this device: look.js holds the choices and puts +// them on the page; this is the screen they are made on. Every choice +// shows at once, on the whole app, so the app itself is the preview. + +const Look = globalThis.PMLook; +/** Choices this device would not keep (storage refused): they are held + * here so the screen still shows what the page is wearing. */ +let lookUnkept = null; +/** Which of the two the theme grid sets while the system is followed. */ +let lookSlot = null; + +const themeName = (id, look = Look) => look.THEMES.find((t) => t[0] === id)?.[1] ?? id; + +/** What is in effect, in a sentence: the theme shown, and why that one. */ +export function lookSaid(settings, systemDark, look = Look) { + const shown = look.themeFor(settings, systemDark); + if (!settings.follow) return `${themeName(shown, look)}, whatever the system is set to.`; + const [day, night] = [themeName(settings.day, look), themeName(settings.night, look)]; + return `Following the system: ${day} when it is light, ${night} when it is dark. It is ${systemDark ? "dark" : "light"} now, so ${themeName(shown, look)}.`; +} + +/** What choosing a theme changes: the one theme when the system is not + * followed, otherwise the theme for whichever of day and night is being + * set. */ +export function themeChange(settings, slot, id) { + if (!settings.follow) return { theme: id }; + return slot === "night" ? { night: id } : { day: id }; +} + +/** What the More screen says of this one. */ +export function lookCounts(look = Look) { + const black = look.THEMES.filter((t) => t[2] === "black").length; + return `${look.THEMES.length} themes (${black} true black), ${look.FONTS.length} typefaces, text size, spacing`; +} + +function viewLook(sub) { + if (!Look) return [empty("How the app looks could not be loaded on this device.")]; + const which = ["colours", "type", "layout"].includes(sub) ? sub : "colours"; + const s = lookUnkept || Look.current(); + const dark = Look.systemDark(); + const set = (change) => { + const r = Look.choose({ ...s, ...change }); + lookUnkept = r.kept ? null : r.settings; + if (!r.kept) toast("This device would not keep that: it lasts until the app is closed.", true); + draw(); + }; + const tab = (name, label) => h("button", { "aria-pressed": String(which === name), onclick: () => go(`more/look/${name}`) }, label); + const out = [h("div", { class: "seg wrap", role: "group", "aria-label": "What to change" }, tab("colours", "Colours"), tab("type", "Typeface"), tab("layout", "Size and spacing"))]; + const steps = (label, list, name) => + h( + "div", + { class: "seg wrap", role: "group", "aria-label": label }, + ...list.map(([id, said]) => h("button", { "aria-pressed": String(s[name] === id), onclick: () => set({ [name]: id }) }, said)), + ); + // Something of everything, to see a choice on: text, small print, the + // three status colours, and each kind of button. + const sample = () => + h( + "div", + { class: "card sample" }, + h("h3", {}, "What it looks like"), + h("p", {}, "The quick brown fox jumps over the lazy dog. 0123456789 Il1 O0 rn m."), + h("p", { class: "meta" }, "Small print, as under every card: #14286 merged 12 min ago by a pooled lane."), + h("div", { class: "row" }, h("span", { class: "chip good" }, "done"), h("span", { class: "chip warn" }, "waiting"), h("span", { class: "chip accent" }, "in progress"), h("span", { class: "chip" }, "queued")), + h("div", { class: "row" }, h("button", { type: "button" }, "Do it"), h("button", { type: "button", class: "ghost" }, "Not now"), h("button", { type: "button", class: "danger" }, "Remove")), + ); + + if (which === "colours") { + const slot = s.follow ? lookSlot || (dark ? "night" : "day") : null; + const chosen = s.follow ? (slot === "night" ? s.night : s.day) : s.theme; + const pressed = (on) => String(Boolean(on)); + out.push( + h( + "div", + { class: "seg wrap", role: "group", "aria-label": "Which theme is shown" }, + h("button", { "aria-pressed": pressed(s.follow), onclick: () => set({ follow: true }) }, "Follow the system"), + h("button", { "aria-pressed": pressed(!s.follow), onclick: () => set({ follow: false, theme: Look.themeFor(s, dark) }) }, "One theme"), + ), + h("p", { class: "meta" }, lookSaid(s, dark)), + ); + if (s.follow) { + const slotButton = (name, label) => + h( + "button", + { + "aria-pressed": pressed(slot === name), + onclick: () => { + lookSlot = name; + draw(); + }, + }, + label, + ); + out.push( + h("div", { class: "seg wrap", role: "group", "aria-label": "Which of the two to choose" }, slotButton("day", `When light: ${themeName(s.day)}`), slotButton("night", `When dark: ${themeName(s.night)}`)), + ); + } + for (const [group, title, note] of Look.THEME_GROUPS) { + out.push( + h("h2", {}, title), + note ? h("p", { class: "meta" }, note) : null, + h( + "div", + { class: "picks" }, + ...Look.THEMES.filter((t) => t[2] === group).map(([id, name]) => + h( + "button", + { class: "pick", "aria-pressed": pressed(chosen === id), onclick: () => set(themeChange(s, slot, id)) }, + // The theme's own colours, on this one element. + h( + "span", + { class: "swatch", "data-theme": id, "aria-hidden": "true" }, + h("span", { class: "swatch-card" }, h("b", {}, "Aa"), h("i", {}, "small print")), + h("span", { class: "dots" }, h("i", { class: "dot accent" }), h("i", { class: "dot good" }), h("i", { class: "dot warn" }), h("i", { class: "dot bad" })), + ), + h("span", { class: "pick-name" }, name), + ), + ), + ), + ); + } + } else if (which === "type") { + out.push(sample(), h("p", { class: "meta" }, "Each is shown as itself. The device's own cost nothing; the others are fetched when first shown and then kept here, so they work with no connection.")); + for (const [group, title] of Look.FONT_GROUPS) { + out.push( + h("h2", {}, title), + h( + "div", + { class: "options" }, + ...Look.FONTS.filter((f) => f[2] === group).map(([id, name, , note]) => + h("button", { class: "option face", "data-font": id, "aria-pressed": String(s.font === id), onclick: () => set({ font: id }) }, h("b", {}, name), h("span", {}, note)), + ), + ), + ); + } + } else { + out.push( + sample(), + h("h2", {}, "Text size"), + steps("Text size", Look.SIZES, "size"), + h("h2", {}, "Room around things"), + steps("Room around things", Look.SPACES, "space"), + h("h2", {}, "Corners"), + steps("Corners", Look.CORNERS, "corners"), + h("h2", {}, "Movement"), + steps("Movement", Look.MOTIONS, "motion"), + ); + } + out.push( + h("h2", {}, "This device"), + h("p", { class: "meta" }, "These choices are kept on this device only: a phone and a desk can each look their own way."), + h("div", { class: "row" }, h("button", { class: "ghost", onclick: () => set({ ...Look.DEFAULTS }) }, "Put it back how it came")), + ); + return out; +} + const NOTICE = { replies: "The fleet replied to something you asked", needs: "Something new needs you", @@ -3543,6 +3701,7 @@ const VIEWS = { "more/machines": ["Machines", viewMachines], "more/platform": ["Platform", viewPlatform], "more/device": ["On this device", viewDevice], + "more/look": ["Appearance", viewLook], "more/releases": ["Releases", viewReleases], "more/roadmap": ["Roadmap", viewRoadmap], "more/bugs": ["Bugs", viewBugs], diff --git a/pm-stack/console/public/files.json b/pm-stack/console/public/files.json new file mode 100644 index 0000000000..3b8d321fc7 --- /dev/null +++ b/pm-stack/console/public/files.json @@ -0,0 +1,161 @@ +{ + "about": "Every file the app is made of, named once. The laptop's service (src/server.ts) and the Worker (edge/src/edge.ts) serve exactly these, the Worker's build (edge/build.mjs) ships exactly these, and the service worker (public/sw.js) keeps them for when there is no connection. A new file for the app is a line here and nothing else. 'kept' says when the service worker keeps a copy: 'installed' is at once, so the app opens offline after one visit; 'used' is when the page first asks for it (a typeface nobody chose is never fetched); 'never' is the service worker itself, which the browser keeps.", + "page": "index.html", + "files": [ + { + "path": "app.js", + "type": "text/javascript; charset=utf-8", + "kept": "installed" + }, + { + "path": "outbox.js", + "type": "text/javascript; charset=utf-8", + "kept": "installed" + }, + { + "path": "look.js", + "type": "text/javascript; charset=utf-8", + "kept": "installed" + }, + { + "path": "app.css", + "type": "text/css; charset=utf-8", + "kept": "installed" + }, + { + "path": "themes.css", + "type": "text/css; charset=utf-8", + "kept": "installed" + }, + { + "path": "look.css", + "type": "text/css; charset=utf-8", + "kept": "installed" + }, + { + "path": "icon.svg", + "type": "image/svg+xml", + "kept": "installed" + }, + { + "path": "files.json", + "type": "application/json; charset=utf-8", + "kept": "installed" + }, + { + "path": "sw.js", + "type": "text/javascript; charset=utf-8", + "kept": "never" + }, + { + "path": "fonts/atkinson-hyperlegible-mono.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/atkinson-hyperlegible-next.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/bitter.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/comic-neue-400.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/comic-neue-700.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/figtree.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/fira-code.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/ibm-plex-mono-400.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/ibm-plex-mono-600.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/ibm-plex-sans.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/inter.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/jetbrains-mono.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/lexend.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/literata.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/manrope.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/nunito.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/opendyslexic-400.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/opendyslexic-700.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/public-sans.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/source-sans-3.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/source-serif-4.woff2", + "type": "font/woff2", + "kept": "used" + }, + { + "path": "fonts/space-grotesk.woff2", + "type": "font/woff2", + "kept": "used" + } + ] +} diff --git a/pm-stack/console/public/fonts/atkinson-hyperlegible-mono.woff2 b/pm-stack/console/public/fonts/atkinson-hyperlegible-mono.woff2 new file mode 100644 index 0000000000..f5c1081407 Binary files /dev/null and b/pm-stack/console/public/fonts/atkinson-hyperlegible-mono.woff2 differ diff --git a/pm-stack/console/public/fonts/atkinson-hyperlegible-next.woff2 b/pm-stack/console/public/fonts/atkinson-hyperlegible-next.woff2 new file mode 100644 index 0000000000..a9ca4bd6ff Binary files /dev/null and b/pm-stack/console/public/fonts/atkinson-hyperlegible-next.woff2 differ diff --git a/pm-stack/console/public/fonts/bitter.woff2 b/pm-stack/console/public/fonts/bitter.woff2 new file mode 100644 index 0000000000..c18148fdb1 Binary files /dev/null and b/pm-stack/console/public/fonts/bitter.woff2 differ diff --git a/pm-stack/console/public/fonts/comic-neue-400.woff2 b/pm-stack/console/public/fonts/comic-neue-400.woff2 new file mode 100644 index 0000000000..4f73b721aa Binary files /dev/null and b/pm-stack/console/public/fonts/comic-neue-400.woff2 differ diff --git a/pm-stack/console/public/fonts/comic-neue-700.woff2 b/pm-stack/console/public/fonts/comic-neue-700.woff2 new file mode 100644 index 0000000000..e25f252f4f Binary files /dev/null and b/pm-stack/console/public/fonts/comic-neue-700.woff2 differ diff --git a/pm-stack/console/public/fonts/figtree.woff2 b/pm-stack/console/public/fonts/figtree.woff2 new file mode 100644 index 0000000000..05ce657de8 Binary files /dev/null and b/pm-stack/console/public/fonts/figtree.woff2 differ diff --git a/pm-stack/console/public/fonts/fira-code.woff2 b/pm-stack/console/public/fonts/fira-code.woff2 new file mode 100644 index 0000000000..ed70084f32 Binary files /dev/null and b/pm-stack/console/public/fonts/fira-code.woff2 differ diff --git a/pm-stack/console/public/fonts/ibm-plex-mono-400.woff2 b/pm-stack/console/public/fonts/ibm-plex-mono-400.woff2 new file mode 100644 index 0000000000..0804aaff92 Binary files /dev/null and b/pm-stack/console/public/fonts/ibm-plex-mono-400.woff2 differ diff --git a/pm-stack/console/public/fonts/ibm-plex-mono-600.woff2 b/pm-stack/console/public/fonts/ibm-plex-mono-600.woff2 new file mode 100644 index 0000000000..67aeeb0104 Binary files /dev/null and b/pm-stack/console/public/fonts/ibm-plex-mono-600.woff2 differ diff --git a/pm-stack/console/public/fonts/ibm-plex-sans.woff2 b/pm-stack/console/public/fonts/ibm-plex-sans.woff2 new file mode 100644 index 0000000000..b757bc5ca2 Binary files /dev/null and b/pm-stack/console/public/fonts/ibm-plex-sans.woff2 differ diff --git a/pm-stack/console/public/fonts/inter.woff2 b/pm-stack/console/public/fonts/inter.woff2 new file mode 100644 index 0000000000..d15208de03 Binary files /dev/null and b/pm-stack/console/public/fonts/inter.woff2 differ diff --git a/pm-stack/console/public/fonts/jetbrains-mono.woff2 b/pm-stack/console/public/fonts/jetbrains-mono.woff2 new file mode 100644 index 0000000000..cd5102a44c Binary files /dev/null and b/pm-stack/console/public/fonts/jetbrains-mono.woff2 differ diff --git a/pm-stack/console/public/fonts/lexend.woff2 b/pm-stack/console/public/fonts/lexend.woff2 new file mode 100644 index 0000000000..2fe3b21f84 Binary files /dev/null and b/pm-stack/console/public/fonts/lexend.woff2 differ diff --git a/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-mono.txt b/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-mono.txt new file mode 100644 index 0000000000..8d2ce88f0f --- /dev/null +++ b/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-mono.txt @@ -0,0 +1,93 @@ +Copyright 2020-2024 The Atkinson Hyperlegible Mono Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next-mono) AtkinsonHyperlegibleMono-Italic[wght].ttf: Copyright 2020-2024 The Atkinson Hyperlegible Mono Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next-mono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-next.txt b/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-next.txt new file mode 100644 index 0000000000..9459440df2 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/atkinson-hyperlegible-next.txt @@ -0,0 +1,93 @@ +Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next) AtkinsonHyperlegibleNext-Italic[wght].ttf: Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/bitter.txt b/pm-stack/console/public/fonts/licences/bitter.txt new file mode 100644 index 0000000000..212cda3546 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/bitter.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Bitter Project Authors (https://github.com/solmatas/BitterPro) Bitter-Italic[wght].ttf: Copyright 2011 The Bitter Project Authors (https://github.com/solmatas/BitterPro) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/comic-neue.txt b/pm-stack/console/public/fonts/licences/comic-neue.txt new file mode 100644 index 0000000000..68f2dde028 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/comic-neue.txt @@ -0,0 +1,93 @@ +Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) ComicNeue-LightItalic.ttf: Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) ComicNeue-Regular.ttf: Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) ComicNeue-Italic.ttf: Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) ComicNeue-Bold.ttf: Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) ComicNeue-BoldItalic.ttf: Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/figtree.txt b/pm-stack/console/public/fonts/licences/figtree.txt new file mode 100644 index 0000000000..9766a6f815 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/figtree.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree) Figtree-Italic[wght].ttf: Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/fira-code.txt b/pm-stack/console/public/fonts/licences/fira-code.txt new file mode 100644 index 0000000000..5db0b0c302 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/fira-code.txt @@ -0,0 +1,93 @@ +Copyright 2014-2020 The Fira Code Project Authors (https://github.com/tonsky/FiraCode) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/ibm-plex-mono.txt b/pm-stack/console/public/fonts/licences/ibm-plex-mono.txt new file mode 100644 index 0000000000..83eac8278b --- /dev/null +++ b/pm-stack/console/public/fonts/licences/ibm-plex-mono.txt @@ -0,0 +1,93 @@ +Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ThinItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLight.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Light.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-LightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Regular.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Italic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Medium.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-MediumItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Bold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-BoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/ibm-plex-sans.txt b/pm-stack/console/public/fonts/licences/ibm-plex-sans.txt new file mode 100644 index 0000000000..2ae8ef3cc4 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/ibm-plex-sans.txt @@ -0,0 +1,93 @@ +Copyright 2019 IBM Corp. All rights reserved. IBMPlexSans-Italic[wdth,wght].ttf: Copyright 2019 IBM Corp. All rights reserved. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/inter.txt b/pm-stack/console/public/fonts/licences/inter.txt new file mode 100644 index 0000000000..40589daa9d --- /dev/null +++ b/pm-stack/console/public/fonts/licences/inter.txt @@ -0,0 +1,93 @@ +Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/jetbrains-mono.txt b/pm-stack/console/public/fonts/licences/jetbrains-mono.txt new file mode 100644 index 0000000000..8f7ed67113 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/jetbrains-mono.txt @@ -0,0 +1,93 @@ +Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/lexend.txt b/pm-stack/console/public/fonts/licences/lexend.txt new file mode 100644 index 0000000000..6c35713d3e --- /dev/null +++ b/pm-stack/console/public/fonts/licences/lexend.txt @@ -0,0 +1,93 @@ +Copyright 2019 The Lexend Project Authors (https://github.com/googlefonts/lexend) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/literata.txt b/pm-stack/console/public/fonts/licences/literata.txt new file mode 100644 index 0000000000..5030063f4f --- /dev/null +++ b/pm-stack/console/public/fonts/licences/literata.txt @@ -0,0 +1,93 @@ +Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata) Literata-Italic[opsz,wght].ttf: Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/manrope.txt b/pm-stack/console/public/fonts/licences/manrope.txt new file mode 100644 index 0000000000..462280f3e4 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/manrope.txt @@ -0,0 +1,93 @@ +Copyright 2019 The Manrope Project Authors (https://github.com/sharanda/manrope) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/nunito.txt b/pm-stack/console/public/fonts/licences/nunito.txt new file mode 100644 index 0000000000..ae9dd5a093 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/nunito.txt @@ -0,0 +1,93 @@ +Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito) Nunito-Italic[wght].ttf: Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/opendyslexic.txt b/pm-stack/console/public/fonts/licences/opendyslexic.txt new file mode 100644 index 0000000000..0a1d034b95 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/opendyslexic.txt @@ -0,0 +1,94 @@ +Copyright (c) 2019-07-29, Abbie Gonzalez (https://abbiecod.es|support@abbiecod.es), +with Reserved Font Name OpenDyslexic. +Copyright (c) 12/2012 - 2019 +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/public-sans.txt b/pm-stack/console/public/fonts/licences/public-sans.txt new file mode 100644 index 0000000000..a6cb63a617 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/public-sans.txt @@ -0,0 +1,93 @@ +Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) PublicSans-Italic[wght].ttf: Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/source-sans-3.txt b/pm-stack/console/public/fonts/licences/source-sans-3.txt new file mode 100644 index 0000000000..046fc66490 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/source-sans-3.txt @@ -0,0 +1,93 @@ +Google Inc. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/source-serif-4.txt b/pm-stack/console/public/fonts/licences/source-serif-4.txt new file mode 100644 index 0000000000..046fc66490 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/source-serif-4.txt @@ -0,0 +1,93 @@ +Google Inc. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/licences/space-grotesk.txt b/pm-stack/console/public/fonts/licences/space-grotesk.txt new file mode 100644 index 0000000000..d5666d7087 --- /dev/null +++ b/pm-stack/console/public/fonts/licences/space-grotesk.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/pm-stack/console/public/fonts/literata.woff2 b/pm-stack/console/public/fonts/literata.woff2 new file mode 100644 index 0000000000..c8da5e9ae4 Binary files /dev/null and b/pm-stack/console/public/fonts/literata.woff2 differ diff --git a/pm-stack/console/public/fonts/manrope.woff2 b/pm-stack/console/public/fonts/manrope.woff2 new file mode 100644 index 0000000000..71eb731d55 Binary files /dev/null and b/pm-stack/console/public/fonts/manrope.woff2 differ diff --git a/pm-stack/console/public/fonts/nunito.woff2 b/pm-stack/console/public/fonts/nunito.woff2 new file mode 100644 index 0000000000..3e909a1600 Binary files /dev/null and b/pm-stack/console/public/fonts/nunito.woff2 differ diff --git a/pm-stack/console/public/fonts/opendyslexic-400.woff2 b/pm-stack/console/public/fonts/opendyslexic-400.woff2 new file mode 100644 index 0000000000..47e26d82ac Binary files /dev/null and b/pm-stack/console/public/fonts/opendyslexic-400.woff2 differ diff --git a/pm-stack/console/public/fonts/opendyslexic-700.woff2 b/pm-stack/console/public/fonts/opendyslexic-700.woff2 new file mode 100644 index 0000000000..2f04ad1192 Binary files /dev/null and b/pm-stack/console/public/fonts/opendyslexic-700.woff2 differ diff --git a/pm-stack/console/public/fonts/public-sans.woff2 b/pm-stack/console/public/fonts/public-sans.woff2 new file mode 100644 index 0000000000..15b5f3da4d Binary files /dev/null and b/pm-stack/console/public/fonts/public-sans.woff2 differ diff --git a/pm-stack/console/public/fonts/source-sans-3.woff2 b/pm-stack/console/public/fonts/source-sans-3.woff2 new file mode 100644 index 0000000000..2622b1332b Binary files /dev/null and b/pm-stack/console/public/fonts/source-sans-3.woff2 differ diff --git a/pm-stack/console/public/fonts/source-serif-4.woff2 b/pm-stack/console/public/fonts/source-serif-4.woff2 new file mode 100644 index 0000000000..4c3e6b90c9 Binary files /dev/null and b/pm-stack/console/public/fonts/source-serif-4.woff2 differ diff --git a/pm-stack/console/public/fonts/space-grotesk.woff2 b/pm-stack/console/public/fonts/space-grotesk.woff2 new file mode 100644 index 0000000000..0f3474ee8a Binary files /dev/null and b/pm-stack/console/public/fonts/space-grotesk.woff2 differ diff --git a/pm-stack/console/public/index.html b/pm-stack/console/public/index.html index 0d4320309c..888660b000 100644 --- a/pm-stack/console/public/index.html +++ b/pm-stack/console/public/index.html @@ -12,6 +12,12 @@ + + + +
diff --git a/pm-stack/console/public/look.css b/pm-stack/console/public/look.css new file mode 100644 index 0000000000..6f4e4cc0e5 --- /dev/null +++ b/pm-stack/console/public/look.css @@ -0,0 +1,310 @@ +/* The app's typefaces, and the steps of everything else the owner can + set about how it looks: the size of the text, the room around + things, how round the corners are, and whether anything moves. Each + is one attribute on the root element, put there by look.js, which + holds the same names (the tests hold the two files together). + + The typefaces are files the app carries, in fonts/, each under the + SIL Open Font License (fonts/licences/ has every one's own). They + are the Latin part of each family as Fontsource publishes it. A + browser fetches a file only when something on the page is set in it, + so the ones not chosen cost nothing; the service worker keeps what + was fetched for when there is no connection. Each is given a name of + the app's own ("pm-…") so that a copy installed on the device, which + may be another version, is never mistaken for it. */ + +/* ---- typefaces -------------------------------------------------------- */ +@font-face { + font-family: "pm-inter"; + src: url("/console/fonts/inter.woff2") format("woff2"); + font-weight: 100 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-ibm-plex-sans"; + src: url("/console/fonts/ibm-plex-sans.woff2") format("woff2"); + font-weight: 100 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-source-sans-3"; + src: url("/console/fonts/source-sans-3.woff2") format("woff2"); + font-weight: 200 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-public-sans"; + src: url("/console/fonts/public-sans.woff2") format("woff2"); + font-weight: 100 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-figtree"; + src: url("/console/fonts/figtree.woff2") format("woff2"); + font-weight: 300 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-manrope"; + src: url("/console/fonts/manrope.woff2") format("woff2"); + font-weight: 200 800; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-space-grotesk"; + src: url("/console/fonts/space-grotesk.woff2") format("woff2"); + font-weight: 300 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-nunito"; + src: url("/console/fonts/nunito.woff2") format("woff2"); + font-weight: 200 1000; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-atkinson-hyperlegible-next"; + src: url("/console/fonts/atkinson-hyperlegible-next.woff2") format("woff2"); + font-weight: 200 800; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-lexend"; + src: url("/console/fonts/lexend.woff2") format("woff2"); + font-weight: 100 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-opendyslexic"; + src: url("/console/fonts/opendyslexic-400.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-opendyslexic"; + src: url("/console/fonts/opendyslexic-700.woff2") format("woff2"); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-comic-neue"; + src: url("/console/fonts/comic-neue-400.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-comic-neue"; + src: url("/console/fonts/comic-neue-700.woff2") format("woff2"); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-source-serif-4"; + src: url("/console/fonts/source-serif-4.woff2") format("woff2"); + font-weight: 200 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-literata"; + src: url("/console/fonts/literata.woff2") format("woff2"); + font-weight: 200 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-bitter"; + src: url("/console/fonts/bitter.woff2") format("woff2"); + font-weight: 100 900; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-jetbrains-mono"; + src: url("/console/fonts/jetbrains-mono.woff2") format("woff2"); + font-weight: 100 800; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-fira-code"; + src: url("/console/fonts/fira-code.woff2") format("woff2"); + font-weight: 300 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-ibm-plex-mono"; + src: url("/console/fonts/ibm-plex-mono-400.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-ibm-plex-mono"; + src: url("/console/fonts/ibm-plex-mono-600.woff2") format("woff2"); + font-weight: 600; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "pm-atkinson-hyperlegible-mono"; + src: url("/console/fonts/atkinson-hyperlegible-mono.woff2") format("woff2"); + font-weight: 200 800; + font-style: normal; + font-display: swap; +} +[data-font="system"] { + --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="system-serif"] { + --font: ui-serif, Georgia, "Times New Roman", serif; +} +[data-font="system-mono"] { + --font: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; +} +[data-font="inter"] { + --font: "pm-inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="ibm-plex-sans"] { + --font: "pm-ibm-plex-sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="source-sans-3"] { + --font: "pm-source-sans-3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="public-sans"] { + --font: "pm-public-sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="figtree"] { + --font: "pm-figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="manrope"] { + --font: "pm-manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="space-grotesk"] { + --font: "pm-space-grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="nunito"] { + --font: "pm-nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="atkinson-hyperlegible-next"] { + --font: "pm-atkinson-hyperlegible-next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="lexend"] { + --font: "pm-lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="opendyslexic"] { + --font: "pm-opendyslexic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="comic-neue"] { + --font: "pm-comic-neue", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; +} +[data-font="source-serif-4"] { + --font: "pm-source-serif-4", ui-serif, Georgia, "Times New Roman", serif; +} +[data-font="literata"] { + --font: "pm-literata", ui-serif, Georgia, "Times New Roman", serif; +} +[data-font="bitter"] { + --font: "pm-bitter", ui-serif, Georgia, "Times New Roman", serif; +} +[data-font="jetbrains-mono"] { + --font: "pm-jetbrains-mono", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; +} +[data-font="fira-code"] { + --font: "pm-fira-code", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; +} +[data-font="ibm-plex-mono"] { + --font: "pm-ibm-plex-mono", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; +} +[data-font="atkinson-hyperlegible-mono"] { + --font: "pm-atkinson-hyperlegible-mono", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; +} + +/* ---- the size of the text --------------------------------------------- */ +[data-size="xs"] { + --scale: 0.85; +} +[data-size="s"] { + --scale: 0.925; +} +[data-size="m"] { + --scale: 1; +} +[data-size="l"] { + --scale: 1.1; +} +[data-size="xl"] { + --scale: 1.2; +} +[data-size="xxl"] { + --scale: 1.35; +} +[data-size="xxxl"] { + --scale: 1.5; +} + +/* ---- the room around things ------------------------------------------- */ +[data-space="tight"] { + --space: 0.7; +} +[data-space="snug"] { + --space: 0.85; +} +[data-space="regular"] { + --space: 1; +} +[data-space="roomy"] { + --space: 1.2; +} +[data-space="airy"] { + --space: 1.45; +} + +/* ---- how round the corners are ---------------------------------------- */ +[data-corners="square"] { + --round: 0; +} +[data-corners="soft"] { + --round: 0.5; +} +[data-corners="regular"] { + --round: 1; +} +[data-corners="round"] { + --round: 1.7; +} + +/* ---- whether anything moves ------------------------------------------- */ +/* Left to the device, the device is asked; "less" and "full" are the + owner's own answer, whatever the device says. */ +@media (prefers-reduced-motion: reduce) { + :root:not([data-motion="full"]) *, + :root:not([data-motion="full"]) *::before, + :root:not([data-motion="full"]) *::after { + animation: none !important; + transition: none !important; + scroll-behavior: auto !important; + } +} +[data-motion="less"] *, +[data-motion="less"] *::before, +[data-motion="less"] *::after { + animation: none !important; + transition: none !important; + scroll-behavior: auto !important; +} diff --git a/pm-stack/console/public/look.js b/pm-stack/console/public/look.js new file mode 100644 index 0000000000..64d06d4aef --- /dev/null +++ b/pm-stack/console/public/look.js @@ -0,0 +1,301 @@ +// How the app looks on this device: its colours, its typeface, the size +// of its text, the room around things, how round the corners are, and +// whether anything moves. +// +// Each choice is one attribute on the page's root element (data-theme, +// data-font, data-size, data-space, data-corners, data-motion) and the +// style sheets do the rest: themes.css has a block of colours for each +// theme, look.css a rule for each of the others. Nothing here writes a +// style, so the page's content policy stays as strict as it is. +// +// The choices are kept on the device they were made on (a phone with an +// OLED screen and a desk monitor want different things), and they are +// put on the page before it is first drawn: this file is loaded in the +// page's head, after the style sheets and before anything is shown. +// +// One file for the page and the tests alike. It is a plain script, not +// a module, so the page has it before the app's own script runs; both +// find it as PMLook. +((root) => { + /** Every theme: its name in themes.css, what the chooser calls it, + * the group it is shown in, and whether it is a dark or a light one. */ + const THEMES = [ + ["slate", "Slate", "standard", "dark"], + ["paper", "Paper", "standard", "light"], + ["black", "Black", "black", "dark"], + ["black-amber", "Black amber", "black", "dark"], + ["black-green", "Black terminal", "black", "dark"], + ["black-rose", "Black rose", "black", "dark"], + ["black-ice", "Black ice", "black", "dark"], + ["black-violet", "Black violet", "black", "dark"], + ["black-ember", "Black ember", "black", "dark"], + ["black-dim", "Black, dimmed", "black", "dark"], + ["contrast-dark", "High contrast dark", "contrast", "dark"], + ["contrast-aqua", "High contrast aqua", "contrast", "dark"], + ["contrast-light", "High contrast light", "contrast", "light"], + ["nord", "Nord", "dark", "dark"], + ["dracula", "Dracula", "dark", "dark"], + ["solarized-dark", "Solarized dark", "dark", "dark"], + ["gruvbox-dark", "Gruvbox dark", "dark", "dark"], + ["catppuccin-mocha", "Catppuccin Mocha", "dark", "dark"], + ["tokyo-night", "Tokyo Night", "dark", "dark"], + ["rose-pine", "Rosé Pine", "dark", "dark"], + ["everforest", "Everforest", "dark", "dark"], + ["one-dark", "One Dark", "dark", "dark"], + ["ocean", "Ocean", "dark", "dark"], + ["dusk", "Dusk", "dark", "dark"], + ["graphite", "Graphite", "dark", "dark"], + ["blueprint", "Blueprint", "dark", "dark"], + ["solarized-light", "Solarized light", "light", "light"], + ["gruvbox-light", "Gruvbox light", "light", "light"], + ["catppuccin-latte", "Catppuccin Latte", "light", "light"], + ["rose-pine-dawn", "Rosé Pine Dawn", "light", "light"], + ["sepia", "Sepia", "light", "light"], + ["mint", "Mint", "light", "light"], + ["ink", "Ink", "light", "light"], + ]; + /** The groups, in the order the chooser shows them. */ + const THEME_GROUPS = [ + ["standard", "Standard", "What the app has always looked like."], + ["black", "True black", "The page is pure black: an OLED screen leaves those pixels off."], + ["contrast", "High contrast", "Text at 15 to 1 or more, and edges that can be seen."], + ["dark", "Dark", ""], + ["light", "Light", ""], + ]; + /** Every typeface: its name in look.css, what the chooser calls it, + * its kind, and what is worth knowing about it. The first three are + * the device's own and cost nothing to fetch; the rest are files the + * app carries (public/fonts, each with its licence) and are fetched + * when first chosen, then kept for when there is no connection. */ + const FONTS = [ + ["system", "System", "sans", "This device's own interface typeface."], + ["system-serif", "System serif", "serif", "This device's own serif."], + ["system-mono", "System mono", "mono", "This device's own fixed-width typeface."], + ["inter", "Inter", "sans", "Made for screens; tall and even."], + ["ibm-plex-sans", "IBM Plex Sans", "sans", "Engineered, a little square."], + ["source-sans-3", "Source Sans", "sans", "Calm and narrow: more on a line."], + ["public-sans", "Public Sans", "sans", "Plain and strong, made for public services."], + ["figtree", "Figtree", "sans", "Friendly and clean."], + ["manrope", "Manrope", "sans", "Modern, open shapes."], + ["space-grotesk", "Space Grotesk", "sans", "Geometric, with character."], + ["nunito", "Nunito", "sans", "Rounded ends; soft."], + ["atkinson-hyperlegible-next", "Atkinson Hyperlegible", "reading", "Letters that cannot be mistaken for each other; made for low vision."], + ["lexend", "Lexend", "reading", "Wide and open, made to be read fast."], + ["opendyslexic", "OpenDyslexic", "reading", "Weighted at the bottom, made for readers with dyslexia."], + ["comic-neue", "Comic Neue", "reading", "Casual, hand-drawn shapes."], + ["source-serif-4", "Source Serif", "serif", "A reading serif."], + ["literata", "Literata", "serif", "A book face, made for long reading."], + ["bitter", "Bitter", "serif", "A slab serif, sturdy on a screen."], + ["jetbrains-mono", "JetBrains Mono", "mono", "Fixed width, made for code."], + ["fira-code", "Fira Code", "mono", "Fixed width, with joined-up arrows."], + ["ibm-plex-mono", "IBM Plex Mono", "mono", "Fixed width, typewriter in feel."], + ["atkinson-hyperlegible-mono", "Atkinson Hyperlegible Mono", "mono", "Fixed width, and hard to misread."], + ]; + const FONT_GROUPS = [ + ["sans", "Sans"], + ["reading", "Made to be easy to read"], + ["serif", "Serif"], + ["mono", "Fixed width"], + ]; + /** The steps of the other choices: the name in look.css, what the + * chooser calls it, and the number look.css gives it (for the tests, + * which hold the two together). */ + const SIZES = [ + ["xs", "Smallest", 0.85], + ["s", "Smaller", 0.925], + ["m", "Regular", 1], + ["l", "Larger", 1.1], + ["xl", "Large", 1.2], + ["xxl", "Very large", 1.35], + ["xxxl", "Largest", 1.5], + ]; + const SPACES = [ + ["tight", "Tight", 0.7], + ["snug", "Snug", 0.85], + ["regular", "Regular", 1], + ["roomy", "Roomy", 1.2], + ["airy", "Airy", 1.45], + ]; + const CORNERS = [ + ["square", "Square", 0], + ["soft", "Soft", 0.5], + ["regular", "Regular", 1], + ["round", "Round", 1.7], + ]; + const MOTIONS = [ + ["system", "As this device asks"], + ["full", "Everything moves"], + ["less", "Nothing moves"], + ]; + + /** What the app looks like until something else is chosen: it + * follows the system between Paper by day and Slate by night, which + * is what it did before there was a choice. */ + const DEFAULTS = Object.freeze({ + follow: true, + theme: "slate", + day: "paper", + night: "slate", + font: "system", + size: "m", + space: "regular", + corners: "regular", + motion: "system", + }); + const KEY = "pm.look"; + + const known = (list, id) => typeof id === "string" && list.some((entry) => entry[0] === id); + const schemeOf = (id) => THEMES.find((t) => t[0] === id)?.[3]; + + /** The choices as they will be used: anything missing, of the wrong + * kind or no longer on offer (a theme since removed, a file edited by + * hand) is the default instead, so a bad value can never leave the + * page without colours. */ + function normal(raw) { + const from = raw && typeof raw === "object" ? raw : {}; + const pick = (list, name) => (known(list, from[name]) ? from[name] : DEFAULTS[name]); + return { + follow: typeof from.follow === "boolean" ? from.follow : DEFAULTS.follow, + theme: pick(THEMES, "theme"), + day: pick(THEMES, "day"), + night: pick(THEMES, "night"), + font: pick(FONTS, "font"), + size: pick(SIZES, "size"), + space: pick(SPACES, "space"), + corners: pick(CORNERS, "corners"), + motion: pick(MOTIONS, "motion"), + }; + } + + /** The theme to show: the one chosen, or, following the system, the + * one chosen for the day or for the night. */ + function themeFor(settings, systemDark) { + const s = normal(settings); + if (!s.follow) return s.theme; + return systemDark ? s.night : s.day; + } + + /** The attributes the root element is given. Motion left to the + * device has no attribute at all: the style sheet then asks the + * device. */ + function attrs(settings, systemDark) { + const s = normal(settings); + return { + "data-theme": themeFor(s, systemDark), + "data-font": s.font, + "data-size": s.size, + "data-space": s.space, + "data-corners": s.corners, + "data-motion": s.motion === "system" ? null : s.motion, + }; + } + + /** The choices kept on this device. A device that keeps nothing (a + * private window, storage refused) gets the defaults every time. */ + function read(storage) { + try { + const text = storage?.getItem(KEY); + return normal(text ? JSON.parse(text) : null); + } catch { + return normal(null); + } + } + + /** Keep the choices. Says whether they were kept. */ + function write(storage, settings) { + try { + storage.setItem(KEY, JSON.stringify(normal(settings))); + return true; + } catch { + return false; + } + } + + /** Put the choices on a page. The bar the browser draws around the + * page (and the phone's status bar, in the installed app) is given + * the theme's own page colour. */ + function apply(doc, settings, systemDark, view = root) { + const el = doc.documentElement; + for (const [name, value] of Object.entries(attrs(settings, systemDark))) { + if (value === null) el.removeAttribute(name); + else el.setAttribute(name, value); + } + try { + const bg = view.getComputedStyle?.(el).getPropertyValue("--bg").trim(); + const meta = doc.querySelector?.('meta[name="theme-color"]'); + if (bg && meta) meta.setAttribute("content", bg); + } catch { + // The bar keeps the colour it had. + } + } + + const storageOf = (view) => { + try { + return view.localStorage; + } catch { + return null; + } + }; + const darkOf = (view) => { + try { + return view.matchMedia("(prefers-color-scheme: dark)").matches; + } catch { + return true; + } + }; + + /** Put this device's choices on its page now, and again whenever the + * system goes from day to night or another tab changes them. */ + function start(view = root) { + const again = () => apply(view.document, read(storageOf(view)), darkOf(view), view); + again(); + try { + view.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", again); + view.addEventListener("storage", (event) => { + if (event.key === null || event.key === KEY) again(); + }); + } catch { + // A browser without these shows what was chosen when it opened. + } + return again; + } + + /** Change the choices on this device, and show them at once. A value + * that is not on offer changes nothing: what was chosen before stays. */ + function choose(change, view = root) { + const storage = storageOf(view); + const before = read(storage); + const offered = Object.entries(change || {}).filter(([name, value]) => Object.hasOwn(DEFAULTS, name) && normal({ [name]: value })[name] === value); + const next = normal({ ...before, ...Object.fromEntries(offered) }); + const kept = storage ? write(storage, next) : false; + apply(view.document, next, darkOf(view), view); + return { settings: next, kept }; + } + + root.PMLook = { + THEMES, + THEME_GROUPS, + FONTS, + FONT_GROUPS, + SIZES, + SPACES, + CORNERS, + MOTIONS, + DEFAULTS, + KEY, + schemeOf, + normal, + themeFor, + attrs, + read, + write, + apply, + start, + choose, + current: (view = root) => read(storageOf(view)), + systemDark: (view = root) => darkOf(view), + }; + // On a page, at once: this is what keeps the first thing drawn from + // being the wrong colours. + if (root.document?.documentElement && typeof root.matchMedia === "function") start(root); +})(typeof self !== "undefined" ? self : globalThis); diff --git a/pm-stack/console/public/sw.js b/pm-stack/console/public/sw.js index d19c9015cd..6e1778931e 100644 --- a/pm-stack/console/public/sw.js +++ b/pm-stack/console/public/sw.js @@ -14,10 +14,33 @@ self.importScripts("/console/outbox.js"); const KEPT = "pm-console-v1"; -/** The app's own files, fetched when the worker is installed so that - * the first visit is already enough to open it offline. */ -const FILES = ["/console/", "/console/app.js", "/console/outbox.js", "/console/app.css", "/console/icon.svg"]; +/** Where the app's own files are named: one list (public/files.json) + * that the services, the Worker's build and this worker all read. */ +const LIST = "/console/files.json"; +const PAGE = "/console/"; const EXTRAS = ["/manifest.webmanifest", "/icons/icon-192.png", "/icons/icon-512.png"]; +/** What one of the app's files ends in. Anything else under /console + * (the Android build, say, which is large and is a download) is none + * of this worker's business. */ +const APP_FILE = /^\/console\/[a-z0-9/_-]+\.(?:js|css|svg|json|woff2)$/; + +/** The files to fetch when the worker is installed, so that the first + * visit is already enough to open the app offline: the page, the list, + * and what the list says is kept from the start. A typeface is kept + * when it is first used instead, so nobody fetches the ones they did + * not choose. Without the list (it could not be fetched) it is the + * page alone; the rest is kept as the page next asks for it. */ +async function filesToKeep() { + try { + const res = await self.fetch(LIST, { cache: "no-store", redirect: "manual" }); + if (!res.ok) return [PAGE]; + const list = await res.json(); + const named = (list.files ?? []).filter((f) => f.kept === "installed").map((f) => `/console/${f.path}`); + return [...new Set([PAGE, LIST, ...named])]; + } catch { + return [PAGE]; + } +} /** How long the network is waited for before a copy is shown instead. * The network's answer still replaces the copy when it comes. */ const PAGE_WAIT_MS = 4_000; @@ -33,7 +56,8 @@ self.addEventListener("install", (event) => { const cache = await self.caches.open(KEPT); // Each by itself: one that cannot be fetched (not signed in, // say) does not stop the others, or the worker. - await Promise.all([...FILES, ...EXTRAS].map((path) => keep(cache, path).catch(() => {}))); + const files = await filesToKeep(); + await Promise.all([...files, ...EXTRAS].map((path) => keep(cache, path).catch(() => {}))); } catch { // Nothing is kept this time. } @@ -75,7 +99,7 @@ function kindOf(request, url) { if (!path.startsWith("/console")) return null; // The app is one page, at one address (its screens are after the #). if (path === "/console/" || path === "/console") return "page"; - return FILES.includes(path) ? "file" : null; + return APP_FILE.test(path) && path !== "/console/sw.js" ? "file" : null; } /** The address a copy is kept under: what was asked, without the mark diff --git a/pm-stack/console/public/themes.css b/pm-stack/console/public/themes.css new file mode 100644 index 0000000000..64ecbbd162 --- /dev/null +++ b/pm-stack/console/public/themes.css @@ -0,0 +1,566 @@ +/* The app's colour themes. One block each: the thirteen colours the + style sheet (app.css) draws everything with, under the name the + chooser (look.js, THEMES) knows it by. A new theme is a block here + and a line there; the tests then hold it to the same rules as the + rest: + + text 7 to 1 or more on the page, a panel and a raised panel + quiet 4.5 to 1 on all three (the small print) + accent, good, warn, bad + 4.5 to 1 on all three (they are written with) + *-ink 4.5 to 1 on the colour it is the ink for + line can be told from the page and from a panel (1.25 to 1) + + and the high-contrast ones to 15, 10, 7, 7 and 3 to 1. + + A block here comes after app.css's own :root, so a chosen theme wins + over what the system prefers. Put on any element, a block colours + just that element and what is in it: that is how the chooser shows + every theme at once. + + The palettes with names from elsewhere are their makers' colours + (Nord, Dracula, Solarized, Gruvbox, Catppuccin, Tokyo Night, Rosé + Pine, Everforest, One Dark: each published under a permissive + licence), with any colour that missed a rule above moved toward + white or black until it met it. */ + +/* ---- The two the app follows the system with --------------------------- */ +[data-theme="slate"] { + color-scheme: dark; + --bg: #0b0f14; + --panel: #151b23; + --panel-2: #1c2430; + --line: #2a3441; + --text: #e6edf3; + --quiet: #8b98a8; + --accent: #4c9aff; + --accent-ink: #06121f; + --good: #3fb950; + --good-ink: #04130a; + --warn: #d29922; + --bad: #f85149; + --bad-ink: #1a0405; +} +[data-theme="paper"] { + color-scheme: light; + --bg: #f4f6f9; + --panel: #ffffff; + --panel-2: #eef1f5; + --line: #d5dbe3; + --text: #17202b; + --quiet: #5b6777; + --accent: #0b63ce; + --accent-ink: #ffffff; + --good: #18753a; + --good-ink: #ffffff; + --warn: #8a5a00; + --bad: #c5222c; + --bad-ink: #ffffff; +} + +/* ---- True black: the page is #000000, and an OLED screen leaves those pixels off --- */ +[data-theme="black"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #0e0e0e; + --line: #303030; + --text: #f2f2f2; + --quiet: #9a9a9a; + --accent: #5aa9ff; + --accent-ink: #00101f; + --good: #3fb950; + --good-ink: #04130a; + --warn: #d9a520; + --bad: #ff5c52; + --bad-ink: #1a0405; +} +[data-theme="black-amber"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #100c04; + --line: #3a2e12; + --text: #f5ecd9; + --quiet: #a89c82; + --accent: #ffb000; + --accent-ink: #1a1000; + --good: #7ac74f; + --good-ink: #06140a; + --warn: #ffd166; + --bad: #ff6b5e; + --bad-ink: #1a0405; +} +[data-theme="black-green"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #06100a; + --line: #173a22; + --text: #c9f5d0; + --quiet: #7fa98a; + --accent: #39d353; + --accent-ink: #021207; + --good: #39d353; + --good-ink: #021207; + --warn: #e3c14a; + --bad: #ff6b6b; + --bad-ink: #1a0405; +} +[data-theme="black-rose"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #12070c; + --line: #3d1c2a; + --text: #f7e9ef; + --quiet: #ab8f9b; + --accent: #ff5fa2; + --accent-ink: #1f0010; + --good: #4cc38a; + --good-ink: #04130a; + --warn: #e9b44c; + --bad: #ff5c52; + --bad-ink: #1a0405; +} +[data-theme="black-ice"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #050f12; + --line: #143840; + --text: #e6f6fa; + --quiet: #86a6ae; + --accent: #22d3ee; + --accent-ink: #00161b; + --good: #34d399; + --good-ink: #03130d; + --warn: #fbbf24; + --bad: #fb7185; + --bad-ink: #1a0405; +} +[data-theme="black-violet"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #0c0914; + --line: #2e2649; + --text: #efeafc; + --quiet: #9d94b8; + --accent: #a78bfa; + --accent-ink: #0f0726; + --good: #4ade80; + --good-ink: #04130a; + --warn: #facc15; + --bad: #f87171; + --bad-ink: #1a0405; +} +[data-theme="black-ember"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #120906; + --line: #40241a; + --text: #f8ebe4; + --quiet: #b0978c; + --accent: #ff7a45; + --accent-ink: #1c0a02; + --good: #84cc16; + --good-ink: #0a1402; + --warn: #fbbf24; + --bad: #ff5c52; + --bad-ink: #1a0405; +} +[data-theme="black-dim"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #0a0a0a; + --line: #262626; + --text: #b8b8b8; + --quiet: #7d7d7d; + --accent: #6b9bd1; + --accent-ink: #020d19; + --good: #5a9e62; + --good-ink: #020d05; + --warn: #a88a3a; + --bad: #c96a64; + --bad-ink: #140303; +} + +/* ---- High contrast: text at 15 to 1 or more on every surface, and edges at 3 to 1 --- */ +[data-theme="contrast-dark"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #1a1a1a; + --line: #ffffff; + --text: #ffffff; + --quiet: #e6e6e6; + --accent: #ffff00; + --accent-ink: #000000; + --good: #00ff66; + --good-ink: #000000; + --warn: #ffcc00; + --bad: #ff8a80; + --bad-ink: #000000; + --edge: 2px; +} +[data-theme="contrast-aqua"] { + color-scheme: dark; + --bg: #000000; + --panel: #000000; + --panel-2: #101820; + --line: #9fefff; + --text: #ffffff; + --quiet: #d9f6ff; + --accent: #00ffff; + --accent-ink: #000000; + --good: #7dff9b; + --good-ink: #000000; + --warn: #ffe066; + --bad: #ffa0a0; + --bad-ink: #000000; + --edge: 2px; +} +[data-theme="contrast-light"] { + color-scheme: light; + --bg: #ffffff; + --panel: #ffffff; + --panel-2: #f0f0f0; + --line: #000000; + --text: #000000; + --quiet: #1f1f1f; + --accent: #0000c8; + --accent-ink: #ffffff; + --good: #005a1e; + --good-ink: #ffffff; + --warn: #5c3a00; + --bad: #a50000; + --bad-ink: #ffffff; + --edge: 2px; +} + +/* ---- Dark -------------------------------------------------------------- */ +[data-theme="nord"] { + color-scheme: dark; + --bg: #2e3440; + --panel: #3b4252; + --panel-2: #434c5e; + --line: #596377; + --text: #eceff4; + --quiet: #b9c2d0; + --accent: #8fc4d3; + --accent-ink: #1d2530; + --good: #acc498; + --good-ink: #1b2415; + --warn: #ebcb8b; + --bad: #dfb0b4; + --bad-ink: #2a0d10; +} +[data-theme="dracula"] { + color-scheme: dark; + --bg: #282a36; + --panel: #343746; + --panel-2: #44475a; + --line: #5c6080; + --text: #f8f8f2; + --quiet: #b9bdd6; + --accent: #caa9fa; + --accent-ink: #1b0f33; + --good: #50fa7b; + --good-ink: #06240f; + --warn: #f1fa8c; + --bad: #ff9c9c; + --bad-ink: #2b0606; +} +[data-theme="solarized-dark"] { + color-scheme: dark; + --bg: #002b36; + --panel: #073642; + --panel-2: #0d4250; + --line: #2a5f6e; + --text: #eee8d5; + --quiet: #9ca9a9; + --accent: #67aee0; + --accent-ink: #00141f; + --good: #a0af38; + --good-ink: #0e1400; + --warn: #c5a338; + --bad: #eb8c8b; + --bad-ink: #1f0504; +} +[data-theme="gruvbox-dark"] { + color-scheme: dark; + --bg: #1d2021; + --panel: #282828; + --panel-2: #3c3836; + --line: #5a524c; + --text: #ebdbb2; + --quiet: #afa18e; + --accent: #fabd2f; + --accent-ink: #241a00; + --good: #b8bb26; + --good-ink: #1a1b00; + --warn: #fe8019; + --bad: #fc7c6d; + --bad-ink: #250603; +} +[data-theme="catppuccin-mocha"] { + color-scheme: dark; + --bg: #11111b; + --panel: #1e1e2e; + --panel-2: #313244; + --line: #4b4d63; + --text: #cdd6f4; + --quiet: #a6adc8; + --accent: #cba6f7; + --accent-ink: #1e1033; + --good: #a6e3a1; + --good-ink: #0f2410; + --warn: #f9e2af; + --bad: #f38ba8; + --bad-ink: #2b0a14; +} +[data-theme="tokyo-night"] { + color-scheme: dark; + --bg: #1a1b26; + --panel: #1f2335; + --panel-2: #292e42; + --line: #414868; + --text: #c0caf5; + --quiet: #9aa5ce; + --accent: #7aa2f7; + --accent-ink: #0b1430; + --good: #9ece6a; + --good-ink: #142106; + --warn: #e0af68; + --bad: #f7768e; + --bad-ink: #2b0810; +} +[data-theme="rose-pine"] { + color-scheme: dark; + --bg: #191724; + --panel: #1f1d2e; + --panel-2: #26233a; + --line: #44415a; + --text: #e0def4; + --quiet: #908caa; + --accent: #c4a7e7; + --accent-ink: #1c1033; + --good: #9ccfd8; + --good-ink: #0a2226; + --warn: #f6c177; + --bad: #eb6f92; + --bad-ink: #2b0813; +} +[data-theme="everforest"] { + color-scheme: dark; + --bg: #272e33; + --panel: #2e383c; + --panel-2: #374145; + --line: #4f585e; + --text: #ddd3bd; + --quiet: #a3aea6; + --accent: #a7c080; + --accent-ink: #1a2410; + --good: #83c092; + --good-ink: #0d2417; + --warn: #dbbc7f; + --bad: #ea9394; + --bad-ink: #2b0c0d; +} +[data-theme="one-dark"] { + color-scheme: dark; + --bg: #21252b; + --panel: #282c34; + --panel-2: #323842; + --line: #4b5263; + --text: #d7dae0; + --quiet: #9da5b4; + --accent: #61afef; + --accent-ink: #071a2b; + --good: #98c379; + --good-ink: #14210a; + --warn: #e5c07b; + --bad: #e6868e; + --bad-ink: #2b0a0e; +} +[data-theme="ocean"] { + color-scheme: dark; + --bg: #071a26; + --panel: #0c2433; + --panel-2: #123044; + --line: #23506b; + --text: #e2f1f8; + --quiet: #8fb0c2; + --accent: #2dd4bf; + --accent-ink: #03201c; + --good: #4ade80; + --good-ink: #04130a; + --warn: #fbbf24; + --bad: #fb7185; + --bad-ink: #2b0810; +} +[data-theme="dusk"] { + color-scheme: dark; + --bg: #17131f; + --panel: #1f1a2b; + --panel-2: #2a2339; + --line: #453a5c; + --text: #ece6f5; + --quiet: #a79cbd; + --accent: #f0a35e; + --accent-ink: #2b1503; + --good: #7bd88f; + --good-ink: #06200d; + --warn: #f4d35e; + --bad: #ff7b89; + --bad-ink: #2b070c; +} +[data-theme="graphite"] { + color-scheme: dark; + --bg: #161616; + --panel: #1f1f1f; + --panel-2: #2a2a2a; + --line: #444444; + --text: #ededed; + --quiet: #a0a0a0; + --accent: #f5f5f5; + --accent-ink: #111111; + --good: #6fcf7f; + --good-ink: #06200d; + --warn: #e2b84a; + --bad: #ff7b72; + --bad-ink: #2b0806; +} +[data-theme="blueprint"] { + color-scheme: dark; + --bg: #0a2540; + --panel: #0f3057; + --panel-2: #15406f; + --line: #2f6aa3; + --text: #eaf3ff; + --quiet: #a9c4e4; + --accent: #ffd43b; + --accent-ink: #201a00; + --good: #6ee7a0; + --good-ink: #03200f; + --warn: #ffb454; + --bad: #ff8fa3; + --bad-ink: #33060f; +} + +/* ---- Light ------------------------------------------------------------- */ +[data-theme="solarized-light"] { + color-scheme: light; + --bg: #fdf6e3; + --panel: #fffbf0; + --panel-2: #eee8d5; + --line: #d6cfb9; + --text: #002b36; + --quiet: #566c73; + --accent: #1e6ca4; + --accent-ink: #ffffff; + --good: #606e00; + --good-ink: #ffffff; + --warn: #826300; + --bad: #c22c29; + --bad-ink: #ffffff; +} +[data-theme="gruvbox-light"] { + color-scheme: light; + --bg: #f9f5d7; + --panel: #fbf1c7; + --panel-2: #ebdbb2; + --line: #d0bf9c; + --text: #282828; + --quiet: #665c54; + --accent: #ac3903; + --accent-ink: #ffffff; + --good: #66610c; + --good-ink: #ffffff; + --warn: #86570f; + --bad: #9d0006; + --bad-ink: #ffffff; +} +[data-theme="catppuccin-latte"] { + color-scheme: light; + --bg: #e6e9ef; + --panel: #eff1f5; + --panel-2: #dce0e8; + --line: #b9bdca; + --text: #41445a; + --quiet: #5c5f77; + --accent: #7d34dc; + --accent-ink: #ffffff; + --good: #2d701e; + --good-ink: #ffffff; + --warn: #8a5812; + --bad: #c50e36; + --bad-ink: #ffffff; +} +[data-theme="rose-pine-dawn"] { + color-scheme: light; + --bg: #faf4ed; + --panel: #fffaf3; + --panel-2: #f2e9e1; + --line: #d9cdc3; + --text: #4d486a; + --quiet: #6a6781; + --accent: #736287; + --accent-ink: #ffffff; + --good: #286983; + --good-ink: #ffffff; + --warn: #8c5e1f; + --bad: #975366; + --bad-ink: #ffffff; +} +[data-theme="sepia"] { + color-scheme: light; + --bg: #f4ecd8; + --panel: #fbf5e6; + --panel-2: #eadfc6; + --line: #cdbf9f; + --text: #3b2f20; + --quiet: #6b5a45; + --accent: #8a4b08; + --accent-ink: #ffffff; + --good: #3d6b21; + --good-ink: #ffffff; + --warn: #875800; + --bad: #a3261d; + --bad-ink: #ffffff; +} +[data-theme="mint"] { + color-scheme: light; + --bg: #eef7f2; + --panel: #ffffff; + --panel-2: #e0efe7; + --line: #bfd8cb; + --text: #12261c; + --quiet: #4d6a5b; + --accent: #0f766e; + --accent-ink: #ffffff; + --good: #17703a; + --good-ink: #ffffff; + --warn: #855a00; + --bad: #b3261e; + --bad-ink: #ffffff; +} +[data-theme="ink"] { + color-scheme: light; + --bg: #ffffff; + --panel: #ffffff; + --panel-2: #f3f3f3; + --line: #cfcfcf; + --text: #111111; + --quiet: #5c5c5c; + --accent: #111111; + --accent-ink: #ffffff; + --good: #1f6f3a; + --good-ink: #ffffff; + --warn: #7a5200; + --bad: #b00020; + --bad-ink: #ffffff; +} diff --git a/pm-stack/console/scripts/edge-smoke.ts b/pm-stack/console/scripts/edge-smoke.ts index 74f8b91578..ee0d1aea5f 100644 --- a/pm-stack/console/scripts/edge-smoke.ts +++ b/pm-stack/console/scripts/edge-smoke.ts @@ -504,6 +504,29 @@ try { me.email === "owner@example.com" && me.edge === true, JSON.stringify(me), ); + + // The app is one list of files (public/files.json): the Worker's build + // ships them and the Worker serves them. Each is asked for here, as + // the signed-in owner, and has to come back whole and as what it is. + const appFiles = JSON.parse(readFileSync(join(import.meta.dir, "..", "public", "files.json"), "utf8")) as { + files: { path: string; type: string }[]; + }; + const wrong: string[] = []; + for (const file of appFiles.files) { + const res = await asOwner(`/console/${file.path}`); + const got = new Uint8Array(await res.arrayBuffer()); + const want = readFileSync(join(import.meta.dir, "..", "public", file.path)); + if (res.status !== 200 || res.headers.get("content-type") !== file.type || got.length !== want.length) { + wrong.push(`${file.path}: ${res.status} ${res.headers.get("content-type")} ${got.length}/${want.length}`); + } + } + check( + `every file the app is made of is served whole and as what it is (${appFiles.files.length} files, typefaces among them)`, + appFiles.files.length > 20 && wrong.length === 0, + wrong.join("; "), + ); + const unlisted = await asOwner("/console/fonts/licences/inter.txt"); + check("a file the list does not name is not served", unlisted.status !== 200, String(unlisted.status)); const onceId = "11111111-1111-4111-8111-111111111111"; const didFirst = (await (await actAsOwner("push.class", { class: "trouble", on: false }, onceId)).json()) as { result?: Record; diff --git a/pm-stack/console/src/server.ts b/pm-stack/console/src/server.ts index 96874d5f16..26f7b45988 100644 --- a/pm-stack/console/src/server.ts +++ b/pm-stack/console/src/server.ts @@ -43,15 +43,13 @@ import { contact, Push } from "./push.ts"; import { Named } from "./named.ts"; import { EdgeLink } from "./sync.ts"; import { Work } from "./work.ts"; +import appFiles from "../public/files.json"; const PUBLIC_DIR = join(import.meta.dir, "..", "public"); -const STATIC = new Map([ - ["app.js", "text/javascript; charset=utf-8"], - ["outbox.js", "text/javascript; charset=utf-8"], - ["app.css", "text/css; charset=utf-8"], - ["icon.svg", "image/svg+xml"], - ["sw.js", "text/javascript; charset=utf-8"], -]); +/** The app's files and what each is served as: public/files.json is the + * one list of them (the Worker, its build and the service worker read + * the same one). */ +const STATIC = new Map(appFiles.files.map((f) => [f.path, f.type])); const APK_NAME = "pm-console.apk"; const ACT_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/; diff --git a/pm-stack/console/test/console.test.ts b/pm-stack/console/test/console.test.ts index 8a6adcb87c..f803fcef5f 100644 --- a/pm-stack/console/test/console.test.ts +++ b/pm-stack/console/test/console.test.ts @@ -13,7 +13,7 @@ // compared with literal URLs, so no spelling of a path can pass as one // of the public files unless the dashboard is asked for exactly that file. import { beforeEach, describe, expect, test } from "bun:test"; -import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { actions } from "../src/actions.ts"; @@ -1166,37 +1166,108 @@ describe("HTTP surface", () => { expect((await handle(get("/elsewhere"), alone)).status).toBe(404); }); - test("every file the page and the worker load is served here, served by the edge, and shipped in the edge's build", async () => { - // Three lists name the app's files: this service's, the edge's, and - // what the edge's build copies. A file missing from one of them - // works on the laptop and is a 404 behind Cloudflare, or the other - // way round; and the worker cannot open the app offline without - // every one of them. - const read = (path: string) => readFileSync(join(import.meta.dir, "..", path), "utf8"); - const page = [...read("public/index.html").matchAll(/(?:src|href)="\/console\/([^"]+)"/g)].map((m) => m[1]); - const worker = [ - ...(/const FILES = \[([^\]]+)\]/.exec(read("public/sw.js"))?.[1] ?? "").matchAll(/"\/console\/([^"]+)"/g), - ].map((m) => m[1]); - const loaded = [...new Set([...page, ...worker, "sw.js"])].sort(); - expect(loaded).toEqual(["app.css", "app.js", "icon.svg", "outbox.js", "sw.js"]); - // The worker keeps everything the page loads, or the page would not open offline. - expect([...new Set(worker)].sort()).toEqual(page.sort()); + test("the app's files are named in one list, and this service, the Worker's build and the page all go by it", async () => { + // public/files.json is the one place a file of the app is named. + // The oracle for "is everything there" is what the page and its + // style sheets and scripts actually ask for, read from their own + // text; the oracle for "is it served" is the file on disk. + const at = (path: string) => join(import.meta.dir, "..", path); + const read = (path: string) => readFileSync(at(path), "utf8"); + const list = JSON.parse(read("public/files.json")) as { + page: string; + files: { path: string; type: string; kept: string }[]; + }; + const named = list.files.map((f) => f.path); + expect(new Set(named).size).toBe(named.length); + expect(list.page).toBe("index.html"); + // Each is a real file with something in it, of a kind the service worker takes for the app's. + for (const f of list.files) { + expect([f.path, statSync(at(`public/${f.path}`)).size > 0]).toEqual([f.path, true]); + expect([f.path, /^[a-z0-9/_-]+\.(?:js|css|svg|json|woff2)$/.test(f.path)]).toEqual([f.path, true]); + expect([f.path, ["installed", "used", "never"].includes(f.kept)]).toEqual([f.path, true]); + } + // What the page loads, what the style sheets load, and what the + // scripts import: all of it is on the list. + const asked = new Set(); + for (const m of read("public/index.html").matchAll(/(?:src|href)="\/console\/([^"]+)"/g)) asked.add(m[1]); + for (const sheet of named.filter((n) => n.endsWith(".css"))) { + for (const m of read(`public/${sheet}`).matchAll(/url\("\/console\/([^"]+)"\)/g)) asked.add(m[1]); + } + for (const script of named.filter((n) => n.endsWith(".js"))) { + for (const m of read(`public/${script}`).matchAll( + /(?:^import [^"\n]*|importScripts\()"(?:\.\/|\/console\/)([^"]+)"/gm, + )) + asked.add(m[1]); + } + expect([...asked].filter((name) => !named.includes(name))).toEqual([]); + // The page asks for its style sheets, the look, the outbox and the app (and the icon). + for (const must of ["app.css", "themes.css", "look.css", "look.js", "outbox.js", "app.js", "icon.svg"]) + expect([...asked]).toContain(must); + // Everything the page needs to open is kept from the start; a + // typeface is kept when used; the worker itself never. + const keptWhen = Object.fromEntries(list.files.map((f) => [f.path, f.kept])); + for (const m of read("public/index.html").matchAll(/(?:src|href)="\/console\/([^"]+)"/g)) + expect([m[1], keptWhen[m[1]]]).toEqual([m[1], "installed"]); + expect(keptWhen["files.json"]).toBe("installed"); + expect(keptWhen["sw.js"]).toBe("never"); + expect( + list.files.filter((f) => f.path.startsWith("fonts/")).every((f) => f.kept === "used" && f.type === "font/woff2"), + ).toBe(true); + expect(list.files.filter((f) => f.path.startsWith("fonts/")).length).toBe( + readdirSync(at("public/fonts")).filter((n) => n.endsWith(".woff2")).length, + ); + + // This service serves each as what the list says it is, byte for + // byte, and nothing in the folder that the list does not name. const d = deps("owner"); - for (const name of loaded) expect([name, (await handle(get(`/console/${name}`), d)).status]).toEqual([name, 200]); - const edgeServes = [ - ...(/const STATIC: Record = \{([^}]+)\}/.exec(read("edge/src/edge.ts"))?.[1] ?? "").matchAll( - /"([^"]+)":/g, - ), - ].map((m) => m[1]); - expect(edgeServes.sort()).toEqual(loaded); - const built = [ - ...( - /for \(const name of \[([^\]]+)\]\) \{\s*cpSync\(join\(here, "\.\.", "public"/.exec( - read("edge/build.mjs"), - )?.[1] ?? "" - ).matchAll(/"([^"]+)"/g), - ].map((m) => m[1]); - expect(built.sort()).toEqual([...loaded, "index.html"].sort()); + for (const f of list.files) { + const res = await handle(get(`/console/${f.path}`), d); + expect([f.path, res.status, res.headers.get("content-type")]).toEqual([f.path, 200, f.type]); + expect([f.path, Buffer.from(await res.arrayBuffer()).equals(readFileSync(at(`public/${f.path}`)))]).toEqual([ + f.path, + true, + ]); + } + for (const unlisted of ["index.html", "fonts/licences/inter.txt", "fonts/", "files.json.bak"]) { + expect([unlisted, (await handle(get(`/console/${unlisted}`), d)).status]).toEqual([unlisted, 404]); + } + + // The Worker's build, run for real into a folder of its own: the + // page and every listed file, byte for byte, and nothing else. + const out = mkdtempSync(join(tmpdir(), "pm-build-")); + try { + const built = Bun.spawnSync([process.execPath, at("edge/build.mjs"), "--out", out], { + stdout: "pipe", + stderr: "pipe", + }); + expect([built.exitCode, built.stderr.toString()]).toEqual([0, ""]); + const shipped: string[] = []; + const walk = (dir: string, under: string) => { + for (const entry of readdirSync(dir, { withFileTypes: true })) { + if (entry.isDirectory()) walk(join(dir, entry.name), `${under}${entry.name}/`); + else shipped.push(`${under}${entry.name}`); + } + }; + walk(join(out, "console"), ""); + expect(shipped.sort()).toEqual([...named, "index.html"].sort()); + for (const name of shipped) { + expect([name, readFileSync(join(out, "console", name)).equals(readFileSync(at(`public/${name}`)))]).toEqual([ + name, + true, + ]); + } + // It takes a folder to build into, and nothing else. + const odd = Bun.spawnSync([process.execPath, at("edge/build.mjs"), "--somewhere"], { + stdout: "pipe", + stderr: "pipe", + }); + expect([odd.exitCode, odd.stderr.toString().startsWith("usage:")]).toEqual([2, true]); + } finally { + rmSync(out, { recursive: true, force: true }); + } + // And the Worker serves from the same list (its own tests ask it for the files). + expect(read("edge/src/edge.ts")).toContain('import appFiles from "../../public/files.json";'); + expect(read("src/server.ts")).toContain('import appFiles from "../public/files.json";'); }); test("the page and its files are served to the owner with a strict policy", async () => { diff --git a/pm-stack/console/test/look.test.ts b/pm-stack/console/test/look.test.ts new file mode 100644 index 0000000000..fc605c89cd --- /dev/null +++ b/pm-stack/console/test/look.test.ts @@ -0,0 +1,569 @@ +// How the app looks: its themes, typefaces, text size, spacing, corners +// and movement, and the choices of them kept on a device. +// +// Oracles: +// - whether a theme can be read is the WCAG 2 contrast formula, +// written out here and checked on two pairs everybody knows, held +// against the rules themes.css states for itself; +// - what a true-black theme is, is the colour #000000 and nothing near it; +// - that the chooser and the style sheets agree is each file's own +// text, read here (a name in one and not the other is a choice that +// does nothing, or a look nobody can choose); +// - a typeface file is what its first four bytes say it is ("wOF2"), +// and its licence is the text of the licence; +// - what the choices do to a page is a stand-in page that records the +// attributes it is given, with the expected attributes written out +// by hand for each case. +// That a real browser draws each theme, typeface and step as chosen was +// looked at in Chromium on the laptop (see the design record). +import { expect, test } from "bun:test"; +import { readdirSync, readFileSync } from "node:fs"; +import { join } from "node:path"; +import "../public/look.js"; +import { lookCounts, lookSaid, themeChange } from "../public/app.js"; + +type Row = [string, string, ...unknown[]]; +interface Settings { + follow: boolean; + theme: string; + day: string; + night: string; + font: string; + size: string; + space: string; + corners: string; + motion: string; +} +const L = (globalThis as unknown as { PMLook: Record }).PMLook as { + THEMES: [string, string, string, string][]; + THEME_GROUPS: [string, string, string][]; + FONTS: [string, string, string, string][]; + FONT_GROUPS: [string, string][]; + SIZES: [string, string, number][]; + SPACES: [string, string, number][]; + CORNERS: [string, string, number][]; + MOTIONS: [string, string][]; + DEFAULTS: Settings; + KEY: string; + schemeOf(id: string): string | undefined; + normal(raw: unknown): Settings; + themeFor(s: Partial, dark: boolean): string; + attrs(s: Partial, dark: boolean): Record; + read(storage: unknown): Settings; + write(storage: unknown, s: Partial): boolean; + apply(doc: unknown, s: Partial, dark: boolean, view?: unknown): void; + start(view: unknown): () => void; + choose(change: Partial, view: unknown): { settings: Settings; kept: boolean }; +}; + +const PUBLIC = join(import.meta.dir, "../public"); +const text = (name: string) => readFileSync(join(PUBLIC, name), "utf8"); +const themesCss = text("themes.css"); +const lookCss = text("look.css"); +const appCss = text("app.css"); + +const luminance = (hex: string) => { + const channel = (i: number) => { + const c = Number.parseInt(hex.slice(1 + 2 * i, 3 + 2 * i), 16) / 255; + return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; + }; + return 0.2126 * channel(0) + 0.7152 * channel(1) + 0.0722 * channel(2); +}; +const contrast = (a: string, b: string) => { + const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x); + return (hi + 0.05) / (lo + 0.05); +}; + +/** Every rule of a style sheet whose selector is one attribute with one + * value: the value, and what the rule declares. */ +function rulesFor(css: string, attribute: string): Map> { + const out = new Map>(); + for (const m of css.matchAll(new RegExp(`^\\[${attribute}="([^"]+)"\\] \\{([^}]*)\\}`, "gm"))) { + const decls = Object.fromEntries( + [...m[2].matchAll(/^\s*([a-z0-9-]+):\s*([^;]+);/gm)].map((d) => [d[1], d[2].trim()]), + ); + expect([m[1], out.has(m[1])]).toEqual([m[1], false]); // named once + out.set(m[1], decls); + } + return out; +} + +const COLOURS = [ + "--bg", + "--panel", + "--panel-2", + "--line", + "--text", + "--quiet", + "--accent", + "--accent-ink", + "--good", + "--good-ink", + "--warn", + "--bad", + "--bad-ink", +]; +const themes = rulesFor(themesCss, "data-theme"); + +test("the contrast formula is the one everybody uses", () => { + expect(contrast("#000000", "#ffffff")).toBeCloseTo(21, 5); + expect(contrast("#777777", "#ffffff")).toBeCloseTo(4.48, 2); +}); + +test("the chooser offers exactly the themes the style sheet has, each whole", () => { + expect([...themes.keys()]).toEqual(L.THEMES.map((t) => t[0])); + for (const [id, name, group, scheme] of L.THEMES) { + const block = themes.get(id) as Record; + // The thirteen colours, each a six-digit colour, and whether the + // browser's own controls are to be dark or light. + for (const colour of COLOURS) + expect([id, colour, /^#[0-9a-f]{6}$/.test(block[colour] ?? "")]).toEqual([id, colour, true]); + expect([id, block["color-scheme"]]).toEqual([id, scheme]); + const extra = Object.keys(block).filter((k) => !COLOURS.includes(k) && k !== "color-scheme" && k !== "--edge"); + expect([id, extra]).toEqual([id, []]); + expect([id, name.length > 0, L.THEME_GROUPS.some((g) => g[0] === group)]).toEqual([id, true, true]); + // A dark theme is dark and a light one light, by the page's own colour. + expect([id, luminance(block["--bg"]) < 0.2 ? "dark" : "light"]).toEqual([id, scheme]); + } + expect(new Set(L.THEMES.map((t) => t[1])).size).toBe(L.THEMES.length); // no two called the same + // A wide variety, of every kind asked for. + const count = (group: string) => L.THEMES.filter((t) => t[2] === group).length; + expect(L.THEMES.length).toBeGreaterThanOrEqual(30); + expect(count("black")).toBeGreaterThanOrEqual(5); + expect(count("contrast")).toBeGreaterThanOrEqual(2); + expect(count("light")).toBeGreaterThanOrEqual(5); + expect(count("dark")).toBeGreaterThanOrEqual(10); +}); + +test("every theme can be read: text, small print, the status colours, and the ink on each", () => { + for (const [id, , group] of L.THEMES) { + const c = themes.get(id) as Record; + const high = group === "contrast"; + const surfaces = ["--bg", "--panel", "--panel-2"]; + const rules: [string, string[], number][] = [ + ["--text", surfaces, high ? 15 : 7], + ["--quiet", surfaces, high ? 10 : 4.5], + ["--accent", surfaces, high ? 7 : 4.5], + ["--good", surfaces, high ? 7 : 4.5], + ["--warn", surfaces, high ? 7 : 4.5], + ["--bad", surfaces, high ? 7 : 4.5], + ["--accent-ink", ["--accent"], high ? 7 : 4.5], + ["--good-ink", ["--good"], high ? 7 : 4.5], + ["--bad-ink", ["--bad"], high ? 7 : 4.5], + // An edge has to be told from what it is drawn on. + ["--line", ["--bg", "--panel"], high ? 3 : 1.25], + ]; + for (const [ink, ons, least] of rules) { + for (const on of ons) { + const ratio = contrast(c[ink], c[on]); + expect(`${id} ${ink} on ${on}: ${ratio >= least ? "readable" : `${ratio.toFixed(2)} of ${least}`}`).toBe( + `${id} ${ink} on ${on}: readable`, + ); + } + } + // A high-contrast theme's edges are heavier too. + expect([id, c["--edge"] ?? "the app's own"]).toEqual([id, high ? "2px" : "the app's own"]); + } +}); + +test("a true-black theme is black: the page and its panels are #000000", () => { + const black = L.THEMES.filter((t) => t[2] === "black"); + for (const [id] of black) { + const c = themes.get(id) as Record; + expect([id, c["--bg"], c["--panel"]]).toEqual([id, "#000000", "#000000"]); + // What is raised from it is all but black, so the screen stays dark. + expect([id, luminance(c["--panel-2"]) < 0.006]).toEqual([id, true]); + } + // And nothing outside that group claims to be (a near-black is not black). + for (const [id, , group] of L.THEMES) { + if (group === "black" || group === "contrast") continue; + expect([id, (themes.get(id) as Record)["--bg"] === "#000000"]).toEqual([id, false]); + } +}); + +test("the two standard themes are what the app looks like before anything is chosen", () => { + const block = (from: number) => appCss.slice(appCss.indexOf("{", from) + 1, appCss.indexOf("}", from)); + const vars = (body: string) => + Object.fromEntries([...body.matchAll(/(--[a-z0-9-]+):\s*(#[0-9a-fA-F]{6})\s*;/g)].map((m) => [m[1], m[2]])); + const dark = vars(block(appCss.indexOf(":root"))); + const lightAt = appCss.indexOf("@media (prefers-color-scheme: light)"); + const light = { ...dark, ...vars(block(appCss.indexOf(":root", lightAt))) }; + const colours = (id: string) => + Object.fromEntries(COLOURS.map((k) => [k, (themes.get(id) as Record)[k]])); + expect(colours("slate")).toEqual(dark); + expect(colours("paper")).toEqual(light); + // Until something is chosen, the system is followed between those two. + expect([L.DEFAULTS.follow, L.DEFAULTS.day, L.DEFAULTS.night]).toEqual([true, "paper", "slate"]); + // The themes come after the app's own colours, or a chosen theme + // would lose to what the system prefers. + const page = text("index.html"); + expect(page.indexOf("/console/app.css")).toBeLessThan(page.indexOf("/console/themes.css")); +}); + +test("the chooser offers exactly the typefaces the style sheet has, and every file is there with its licence", () => { + const fonts = rulesFor(lookCss, "data-font"); + expect([...fonts.keys()].sort()).toEqual(L.FONTS.map((f) => f[0]).sort()); + const faces = [...lookCss.matchAll(/@font-face \{([^}]*)\}/g)].map((m) => ({ + family: /font-family: "([^"]+)"/.exec(m[1])?.[1] ?? "", + file: /src: url\("\/console\/(fonts\/[^"]+)"\) format\("woff2"\)/.exec(m[1])?.[1] ?? "", + weight: /font-weight: ([^;]+);/.exec(m[1])?.[1] ?? "", + swap: m[1].includes("font-display: swap"), + })); + const listed = (JSON.parse(text("files.json")) as { files: { path: string }[] }).files.map((f) => f.path); + const carried = new Set(); + for (const [id, name, group, note] of L.FONTS) { + const family = /^("pm-[a-z0-9-]+")?/.exec(fonts.get(id)?.["--font"] ?? "")?.[1]; + expect([id, name.length > 0, note.length > 0, L.FONT_GROUPS.some((g) => g[0] === group)]).toEqual([ + id, + true, + true, + true, + ]); + if (id.startsWith("system")) { + // The device's own: nothing to fetch. + expect([id, family]).toEqual([id, undefined]); + continue; + } + expect([id, family]).toEqual([id, `"pm-${id}"`]); + const mine = faces.filter((f) => f.family === `pm-${id}`); + expect([id, mine.length > 0]).toEqual([id, true]); + // It falls back to one of the device's own while it is fetched, or if it cannot be. + expect([id, /(sans-serif|serif|monospace)$/.test(fonts.get(id)?.["--font"] ?? "")]).toEqual([id, true]); + for (const face of mine) { + expect([id, face.file, listed.includes(face.file), face.swap, /^\d+( \d+)?$/.test(face.weight)]).toEqual([ + id, + face.file, + true, + true, + true, + ]); + const bytes = readFileSync(join(PUBLIC, face.file)); + expect([face.file, bytes.subarray(0, 4).toString("latin1")]).toEqual([face.file, "wOF2"]); + carried.add(face.file); + } + const licence = text(`fonts/licences/${id}.txt`); + expect([id, licence.includes("SIL OPEN FONT LICENSE Version 1.1"), /Copyright/.test(licence)]).toEqual([ + id, + true, + true, + ]); + } + // No face without a choice, no file without a face, no licence without a typeface. + expect(faces.filter((f) => !L.FONTS.some((font) => `pm-${font[0]}` === f.family))).toEqual([]); + expect(listed.filter((p) => p.startsWith("fonts/")).sort()).toEqual([...carried].sort()); + const bundled = L.FONTS.filter((f) => !f[0].startsWith("system")).map((f) => `${f[0]}.txt`); + expect(readdirSync(join(PUBLIC, "fonts/licences")).sort()).toEqual(bundled.sort()); + // A dozen or more, beyond the device's own. + expect(bundled.length).toBeGreaterThanOrEqual(12); + expect(new Set(L.FONTS.map((f) => f[1])).size).toBe(L.FONTS.length); +}); + +test("each step of size, spacing and corners is in the style sheet with its number, and the app is drawn with them", () => { + for (const [attribute, variable, steps] of [ + ["data-size", "--scale", L.SIZES], + ["data-space", "--space", L.SPACES], + ["data-corners", "--round", L.CORNERS], + ] as const) { + const rules = rulesFor(lookCss, attribute); + expect([...rules.keys()]).toEqual(steps.map((s) => s[0])); + for (const [id, , value] of steps) expect([id, Number(rules.get(id)?.[variable])]).toEqual([id, value]); + // In order, with the app's own look (1) among them, and it is the default. + const values = steps.map((s) => s[2]); + expect(values).toEqual([...values].sort((a, b) => a - b)); + expect(values).toContain(1); + } + expect([L.DEFAULTS.size, L.DEFAULTS.space, L.DEFAULTS.corners]).toEqual(["m", "regular", "regular"]); + expect(L.SIZES.find((s) => s[0] === "m")?.[2]).toBe(1); + // The root starts from 1 for each, and takes its typeface and size from them. + const root = appCss.slice(appCss.indexOf(":root {"), appCss.indexOf("}", appCss.indexOf(":root {"))); + for (const start of [ + "--scale: 1;", + "--space: 1;", + "--round: 1;", + "--edge: 1px;", + "font-family: var(--font);", + "font-size: calc(16px * var(--scale));", + ]) { + expect(root).toContain(start); + } + // Room: every padding, margin and gap of 2px or more goes by --space, + // but for the frame's own (the fixed header and tab bar, and the + // badge on a tab), which are written out here. + const fixed = ["padding: 0 5px;", "padding-left: 96px;", "padding-bottom: 24px;", "padding-top: 12px;"]; + const raw: string[] = []; + for (const m of appCss.matchAll(/^\s*((?:padding|margin|gap|row-gap|column-gap)[a-z-]*: [^;]*;)/gm)) { + const decl = m[1]; + if (decl.includes("env(safe-area-inset-bottom) + 12px")) continue; // the page clearing the tab bar + const bare = decl.replace(/calc\(\d+px \* var\(--space\)\)/g, ""); + if (/(? m[1]); + expect(radii.filter((r) => !/^(0|999px|calc\(\d+px \* var\(--round\)\))$/.test(r))).toEqual([]); + // Edges: a hairline is the theme's to make heavier. + expect(appCss).not.toMatch(/border[a-z-]*: 1px solid var\(--line\)/); + // No colour of its own: everything is drawn in the theme's. + const after = appCss.slice(appCss.indexOf("* {")); + expect(after.match(/#[0-9a-fA-F]{3,8}\b/g) ?? []).toEqual([]); +}); + +test("movement stops when the owner says so, and when the device asks unless the owner said otherwise", () => { + expect(L.MOTIONS.map((m) => m[0])).toEqual(["system", "full", "less"]); + expect(lookCss).toContain('[data-motion="less"] *,'); + const asked = lookCss.slice(lookCss.indexOf("@media (prefers-reduced-motion: reduce)")); + expect(asked).toContain(':root:not([data-motion="full"]) *,'); + expect(asked).toContain("animation: none !important;"); + expect(asked).toContain("transition: none !important;"); +}); + +test("choices that are missing, of the wrong kind or no longer on offer are the defaults", () => { + expect(L.normal(null)).toEqual({ ...L.DEFAULTS }); + expect(L.normal("slate")).toEqual({ ...L.DEFAULTS }); + expect(L.normal([])).toEqual({ ...L.DEFAULTS }); + const mixed = L.normal({ + follow: "yes", + theme: "a-theme-since-removed", + day: "sepia", + night: 7, + font: "inter", + size: "huge", + space: "airy", + corners: null, + motion: "less", + extra: "ignored", + }); + expect(mixed).toEqual({ + follow: true, + theme: "slate", + day: "sepia", + night: "slate", + font: "inter", + size: "m", + space: "airy", + corners: "regular", + motion: "less", + }); + // Every choice on offer is taken as it is. + for (const [id] of L.THEMES) expect(L.normal({ theme: id }).theme).toBe(id); + for (const [id] of L.FONTS) expect(L.normal({ font: id }).font).toBe(id); + // A name that is one of an object's own workings is not a choice. + expect(L.normal({ theme: "constructor", font: "__proto__" })).toEqual({ ...L.DEFAULTS }); + expect(L.schemeOf("ink")).toBe("light"); + expect(L.schemeOf("nope")).toBeUndefined(); +}); + +test("following the system shows the day's theme when it is light and the night's when it is dark; otherwise the one chosen", () => { + const s = { follow: true, theme: "nord", day: "sepia", night: "black" }; + expect(L.themeFor(s, false)).toBe("sepia"); + expect(L.themeFor(s, true)).toBe("black"); + expect(L.themeFor({ ...s, follow: false }, false)).toBe("nord"); + expect(L.themeFor({ ...s, follow: false }, true)).toBe("nord"); + expect(L.attrs({ ...s, font: "lexend", size: "xl", space: "tight", corners: "round", motion: "less" }, true)).toEqual( + { + "data-theme": "black", + "data-font": "lexend", + "data-size": "xl", + "data-space": "tight", + "data-corners": "round", + "data-motion": "less", + }, + ); + // Movement left to the device is no attribute at all: the style sheet asks the device. + expect(L.attrs({}, false)).toEqual({ + "data-theme": "paper", + "data-font": "system", + "data-size": "m", + "data-space": "regular", + "data-corners": "regular", + "data-motion": null, + }); + expect(L.attrs({ motion: "full" }, true)["data-motion"]).toBe("full"); +}); + +/** A page, as far as the look touches it: a root element that records + * its attributes, the bar-colour tag, the system's day or night, and + * what the device keeps. */ +function page(options: { dark?: boolean; stored?: string | null; refuses?: boolean; noStorage?: boolean } = {}) { + const attributes = new Map(); + const meta = { content: "#11161d" }; + const kept = new Map(); + if (options.stored) kept.set(L.KEY, options.stored); + const listeners: Record void)[]> = {}; + const media = { + matches: options.dark ?? true, + addEventListener: (_: string, fn: (event: unknown) => void) => { + listeners.media = [...(listeners.media ?? []), fn]; + }, + }; + /** The page colour of each theme, as the style sheet has it. */ + const bgOf = (id: string | undefined) => (id ? ((themes.get(id) as Record)["--bg"] ?? "") : ""); + const view = { + document: { + documentElement: { + setAttribute: (name: string, value: string) => void attributes.set(name, value), + removeAttribute: (name: string) => void attributes.delete(name), + }, + querySelector: (selector: string) => + selector === 'meta[name="theme-color"]' + ? { setAttribute: (_: string, value: string) => void (meta.content = value) } + : null, + }, + getComputedStyle: () => ({ + getPropertyValue: (name: string) => (name === "--bg" ? ` ${bgOf(attributes.get("data-theme"))} ` : ""), + }), + matchMedia: (query: string) => { + expect(query).toBe("(prefers-color-scheme: dark)"); + return media; + }, + addEventListener: (name: string, fn: (event: unknown) => void) => { + listeners[name] = [...(listeners[name] ?? []), fn]; + }, + get localStorage() { + if (options.noStorage) throw new DOMException("The operation is insecure.", "SecurityError"); + return { + getItem: (key: string) => kept.get(key) ?? null, + setItem: (key: string, value: string) => { + if (options.refuses) throw new DOMException("Quota exceeded", "QuotaExceededError"); + kept.set(key, value); + }, + }; + }, + }; + return { + view, + attributes, + meta, + kept, + media, + fire: (name: string, event: unknown = {}) => (listeners[name] ?? []).forEach((fn) => fn(event)), + }; +} +const shown = (p: ReturnType) => Object.fromEntries([...p.attributes.entries()].sort()); + +test("opened, the page wears what this device chose, and the bar around it takes the theme's colour", () => { + const stored = JSON.stringify({ + follow: false, + theme: "black-amber", + font: "jetbrains-mono", + size: "l", + space: "snug", + corners: "square", + motion: "full", + }); + const p = page({ stored }); + L.start(p.view); + expect(shown(p)).toEqual({ + "data-corners": "square", + "data-font": "jetbrains-mono", + "data-motion": "full", + "data-size": "l", + "data-space": "snug", + "data-theme": "black-amber", + }); + expect(p.meta.content).toBe("#000000"); + // Nothing chosen yet: the system is followed, as before there was a choice. + const fresh = page({ dark: false }); + L.start(fresh.view); + expect(shown(fresh)).toEqual({ + "data-corners": "regular", + "data-font": "system", + "data-size": "m", + "data-space": "regular", + "data-theme": "paper", + }); + expect(fresh.meta.content).toBe("#f4f6f9"); + // What is kept is not what this file wrote (edited by hand, or cut short): the defaults. + for (const bad of ["{not json", '"a string"', "null", '{"theme":42}']) { + const odd = page({ stored: bad, dark: true }); + L.start(odd.view); + expect([bad, shown(odd)["data-theme"]]).toEqual([bad, "slate"]); + } + // A browser that gives the site no storage at all still gets a page. + const none = page({ noStorage: true, dark: true }); + L.start(none.view); + expect(shown(none)["data-theme"]).toBe("slate"); +}); + +test("the page follows the system from day to night, and another tab's change, without being reloaded", () => { + const p = page({ dark: false, stored: JSON.stringify({ follow: true, day: "mint", night: "black-ice" }) }); + L.start(p.view); + expect([shown(p)["data-theme"], p.meta.content]).toEqual(["mint", "#eef7f2"]); + p.media.matches = true; + p.fire("media"); + expect([shown(p)["data-theme"], p.meta.content]).toEqual(["black-ice", "#000000"]); + // Another tab chose something else. + p.kept.set(L.KEY, JSON.stringify({ follow: false, theme: "sepia", motion: "less" })); + p.fire("storage", { key: "something.else" }); + expect(shown(p)["data-theme"]).toBe("black-ice"); // not ours: nothing changes + p.fire("storage", { key: L.KEY }); + expect([shown(p)["data-theme"], shown(p)["data-motion"]]).toEqual(["sepia", "less"]); + // Everything this site kept was cleared: back to the defaults. + p.kept.clear(); + p.fire("storage", { key: null }); + expect([shown(p)["data-theme"], "data-motion" in shown(p)]).toEqual(["slate", false]); +}); + +test("a choice is kept on the device and shown at once; a device that will not keep it is told apart", () => { + const p = page({ dark: true }); + L.start(p.view); + const first = L.choose({ follow: false, theme: "dracula" }, p.view); + expect([first.kept, first.settings.theme, shown(p)["data-theme"], p.meta.content]).toEqual([ + true, + "dracula", + "dracula", + "#282a36", + ]); + // The next choice keeps the last one. + const second = L.choose({ font: "literata", size: "xxl" }, p.view); + expect(second.settings).toEqual({ ...L.DEFAULTS, follow: false, theme: "dracula", font: "literata", size: "xxl" }); + expect(JSON.parse(p.kept.get(L.KEY) as string)).toEqual(second.settings); + expect(L.read(p.view.localStorage)).toEqual(second.settings); + // Something not on offer changes nothing of that kind. + expect(L.choose({ theme: "nope", space: "roomy" }, p.view).settings).toEqual({ ...second.settings, space: "roomy" }); + // Movement back to the device's own: the attribute goes. + L.choose({ motion: "less" }, p.view); + expect(shown(p)["data-motion"]).toBe("less"); + L.choose({ motion: "system" }, p.view); + expect(shown(p)["data-motion"]).toBeUndefined(); + // Storage refused: shown all the same, and said not to be kept. + const full = page({ dark: true, refuses: true }); + const tried = L.choose({ follow: false, theme: "ink" }, full.view); + expect([tried.kept, shown(full)["data-theme"], full.kept.size]).toEqual([false, "ink", 0]); + expect(L.write({ setItem: () => undefined }, {})).toBe(true); + expect(L.write(null, {})).toBe(false); +}); + +test("the look is on the page before it is first drawn, and nothing writes a style the page's policy would refuse", () => { + const html = text("index.html"); + const head = html.slice(0, html.indexOf("")); + // After the style sheets (it reads the page colour from them), in the + // head (so before anything is shown), and not deferred. + const at = head.indexOf(''); + expect(at).toBeGreaterThan(head.indexOf("/console/look.css")); + expect(at).toBeGreaterThan(head.indexOf("/console/themes.css")); + expect(html).not.toMatch(/\sstyle=/); + expect(html).not.toMatch(/