@bkazemi/verily 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/instance/auth.js +6 -9
- package/dist/instance/cloudflare.js +3 -2
- package/dist/instance/dashboard.d.ts +41 -0
- package/dist/instance/dashboard.js +334 -0
- package/dist/instance/env.d.ts +2 -0
- package/dist/instance/env.js +1 -0
- package/dist/instance/index.d.ts +16 -1
- package/dist/instance/index.js +224 -83
- package/dist/instance/limits.d.ts +5 -3
- package/dist/instance/limits.js +6 -5
- package/dist/instance/owner-sites.d.ts +17 -0
- package/dist/instance/owner-sites.js +130 -0
- package/dist/instance/page.d.ts +11 -1
- package/dist/instance/page.js +22 -2
- package/dist/instance/register.d.ts +44 -0
- package/dist/instance/register.js +254 -0
- package/dist/instance/routes.js +14 -0
- package/dist/instance/sites.d.ts +135 -4
- package/dist/instance/sites.js +326 -57
- package/dist/server/email.js +134 -46
- package/dist/server/html.d.ts +34 -0
- package/dist/server/html.js +67 -0
- package/dist/server/index.js +364 -163
- package/dist/server/render.d.ts +10 -7
- package/dist/server/render.js +71 -21
- package/dist/server/service.d.ts +3 -1
- package/dist/server/service.js +5 -1
- package/dist/server/style.d.ts +1 -1
- package/dist/server/style.js +37 -1
- package/dist/site/index.d.ts +6 -0
- package/dist/site/index.js +8 -1
- package/dist/verily.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/server/render.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { type ExternalAccount } from '../core/index.js';
|
|
2
2
|
import { type MarkTone } from '../marks.js';
|
|
3
|
+
import { type Html, type OptionalHtml } from './html.js';
|
|
3
4
|
/**
|
|
4
5
|
* The shell every Verily page shares: the stylesheet, the logotype and the heading. `variant`
|
|
5
6
|
* is a class on the page's `main`, such as `single` for a page with one thing on it.
|
|
6
7
|
* `script` is the path of one script the page runs. `mark` is drawn before the heading.
|
|
7
8
|
*/
|
|
8
|
-
export declare const page: (prefix: string, title: string, body:
|
|
9
|
+
export declare const page: (prefix: string, title: string, body: Html, variant?: string, script?: string, mark?: OptionalHtml) => string;
|
|
9
10
|
/**
|
|
10
11
|
* The V the badge draws for a record, in the tone that says how the record stands.
|
|
11
12
|
* `cropped` fits the box to the strokes, for a V that has to meet the edges around it.
|
|
12
13
|
*/
|
|
13
|
-
export declare function verdict(tone: MarkTone, cropped?: boolean):
|
|
14
|
+
export declare function verdict(tone: MarkTone, cropped?: boolean): Html;
|
|
14
15
|
/** A card's heading: its text, and the provider's mark before it where there is one. */
|
|
15
16
|
export type Heading = string | {
|
|
16
17
|
text: string;
|
|
17
|
-
mark:
|
|
18
|
+
mark: Html;
|
|
18
19
|
};
|
|
19
20
|
/** A provider's name with its mark, for a card's heading. */
|
|
20
21
|
export declare function marked(text: string, provider: string, method?: string): Heading;
|
|
@@ -25,25 +26,27 @@ export declare function marked(text: string, provider: string, method?: string):
|
|
|
25
26
|
*
|
|
26
27
|
* Both sides render as the same card, so the pair reads as a pair.
|
|
27
28
|
*/
|
|
28
|
-
export declare function card(heading: Heading, name: string, url: string | undefined, reference?: string | string[], ...extra:
|
|
29
|
+
export declare function card(heading: Heading, name: string, url: string | undefined, reference?: string | string[], ...extra: OptionalHtml[]): Html;
|
|
29
30
|
/**
|
|
30
31
|
* The card for an external account: its name, link and id, with the "Joined <date>" text
|
|
31
32
|
* on the name's line when the creation date is known.
|
|
32
33
|
*/
|
|
33
|
-
export declare function externalCard(heading: Heading, external: ExternalAccount, ...extra:
|
|
34
|
-
export declare function side(heading: Heading, name: string, url: string | undefined, reference: string | string[] | undefined, since: string | undefined, extra:
|
|
34
|
+
export declare function externalCard(heading: Heading, external: ExternalAccount, ...extra: OptionalHtml[]): Html;
|
|
35
|
+
export declare function side(heading: Heading, name: string, url: string | undefined, reference: string | string[] | undefined, since: string | undefined, extra: OptionalHtml[]): Html;
|
|
35
36
|
/** A day, as the date alone. */
|
|
36
37
|
export declare const day: (time: number) => string;
|
|
37
38
|
/** A day as it is said, such as "Jan 11, 2027". In UTC, as every other time here is. */
|
|
38
39
|
export declare const date: (time: number) => string;
|
|
39
40
|
/** How far off a time is in whole days, such as "in 90 days" or "12 days ago". */
|
|
40
41
|
export declare function distance(time: number, now: number): string;
|
|
42
|
+
/** A time to the minute, in UTC, such as "Oct 16, 2026, 18:28 UTC". */
|
|
43
|
+
export declare const minute: (time: number) => string;
|
|
41
44
|
/** Seconds are the finest thing a record measured in days can mean; milliseconds are noise. */
|
|
42
45
|
export declare const moment: (time: number) => string;
|
|
43
46
|
/**
|
|
44
47
|
* Every time on the page in one list. A date inside a sentence is a date a reader has to
|
|
45
48
|
* find; the times of a record belong together, where they can be compared at a glance.
|
|
46
49
|
*/
|
|
47
|
-
export declare function times(rows: [string, number | undefined][]):
|
|
50
|
+
export declare function times(rows: [string, number | undefined][]): Html;
|
|
48
51
|
/** A URL as written if it is http(s), and nothing otherwise. */
|
|
49
52
|
export declare function safeUrl(value: string): string | undefined;
|
package/dist/server/render.js
CHANGED
|
@@ -1,39 +1,68 @@
|
|
|
1
1
|
import { externalId, externalIdGroups, externalLink, externalName, externalSince, } from '../core/index.js';
|
|
2
2
|
import { logo } from '../logo.js';
|
|
3
3
|
import { markOf, pathAttributes, tones, verification } from '../marks.js';
|
|
4
|
-
import {
|
|
4
|
+
import { html, raw } from './html.js';
|
|
5
5
|
import { styleVersion } from './style.js';
|
|
6
6
|
/**
|
|
7
7
|
* The shell every Verily page shares: the stylesheet, the logotype and the heading. `variant`
|
|
8
8
|
* is a class on the page's `main`, such as `single` for a page with one thing on it.
|
|
9
9
|
* `script` is the path of one script the page runs. `mark` is drawn before the heading.
|
|
10
10
|
*/
|
|
11
|
-
export const page = (prefix, title, body, variant = '', script = '', mark
|
|
11
|
+
export const page = (prefix, title, body, variant = '', script = '', mark) => html `
|
|
12
|
+
<!doctype html>
|
|
13
|
+
<html lang="en">
|
|
14
|
+
<meta charset="utf-8">
|
|
15
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
16
|
+
<title>${title} · Verily</title>
|
|
17
|
+
<link rel="stylesheet" href="${prefix}/style.css?v=${styleVersion}">
|
|
18
|
+
<body>
|
|
19
|
+
<main${variant && html ` class="${variant}"`}>
|
|
20
|
+
${raw(logo)}
|
|
21
|
+
<h1>${mark}${title}</h1>
|
|
22
|
+
${body}
|
|
23
|
+
</main>
|
|
24
|
+
${script && html `<script src="${script}" defer></script>`}
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
27
|
+
`.markup;
|
|
12
28
|
/**
|
|
13
29
|
* The V the badge draws for a record, in the tone that says how the record stands.
|
|
14
30
|
* `cropped` fits the box to the strokes, for a V that has to meet the edges around it.
|
|
15
31
|
*/
|
|
16
32
|
export function verdict(tone, cropped = false) {
|
|
17
33
|
const [first, second] = tones[tone];
|
|
18
|
-
const stroke = 'stroke-width="32" stroke-linejoin="miter"';
|
|
19
|
-
const check = Object.entries(verification.check)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
const stroke = raw('stroke-width="32" stroke-linejoin="miter"');
|
|
35
|
+
const check = Object.entries(verification.check).map(([name, value]) => html ` ${raw(name)}="${value}"`);
|
|
36
|
+
return html `
|
|
37
|
+
<svg
|
|
38
|
+
class="verdict ${tone}"
|
|
39
|
+
viewBox="${cropped ? verification.strokes : verification.viewBox}"
|
|
40
|
+
fill="none"
|
|
41
|
+
aria-hidden="true"
|
|
42
|
+
focusable="false">
|
|
43
|
+
<path d="${verification.path}" ${stroke} stroke="${first}"/>
|
|
44
|
+
<path d="${verification.path}" ${stroke}${check} stroke="${second}"/>
|
|
45
|
+
</svg>
|
|
46
|
+
`;
|
|
23
47
|
}
|
|
24
48
|
/** A provider's name with its mark, for a card's heading. */
|
|
25
49
|
export function marked(text, provider, method) {
|
|
26
50
|
const mark = markOf(provider, method);
|
|
27
51
|
if (!mark)
|
|
28
52
|
return text;
|
|
29
|
-
const attributes = pathAttributes(mark)
|
|
30
|
-
.map(([name, value]) => ` ${name}="${value}"`)
|
|
31
|
-
.join('');
|
|
53
|
+
const attributes = pathAttributes(mark).map(([name, value]) => html ` ${raw(name)}="${value}"`);
|
|
32
54
|
return {
|
|
33
55
|
text,
|
|
34
|
-
mark:
|
|
35
|
-
|
|
36
|
-
|
|
56
|
+
mark: html `
|
|
57
|
+
<svg
|
|
58
|
+
class="provider"
|
|
59
|
+
viewBox="${mark.viewBox}"
|
|
60
|
+
fill="${mark.stroke ? 'none' : 'currentColor'}"
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
focusable="false">
|
|
63
|
+
${mark.paths.map((d) => html `<path d="${d}"${attributes}/>`)}
|
|
64
|
+
</svg>
|
|
65
|
+
`,
|
|
37
66
|
};
|
|
38
67
|
}
|
|
39
68
|
/**
|
|
@@ -57,11 +86,23 @@ export function externalCard(heading, external, ...extra) {
|
|
|
57
86
|
}
|
|
58
87
|
export function side(heading, name, url, reference, since, extra) {
|
|
59
88
|
const profile = url && safeUrl(url);
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
return html `
|
|
90
|
+
<div class="side">
|
|
91
|
+
<p class="who">${typeof heading === 'string' ? heading : [heading.mark, heading.text]}</p>
|
|
92
|
+
<p class="name">
|
|
93
|
+
${profile ? html `<a href="${profile}" rel="noreferrer">${name}</a>` : name}${since && html `<span class="since">${since}</span>`}
|
|
94
|
+
</p>
|
|
95
|
+
${typeof reference === 'string'
|
|
96
|
+
? html `<p class="reference">${reference}</p>`
|
|
97
|
+
: reference &&
|
|
98
|
+
html `
|
|
99
|
+
<p class="reference fingerprint">
|
|
100
|
+
${reference.map((group) => html `<span>${group}</span>`)}
|
|
101
|
+
</p>
|
|
102
|
+
`}
|
|
103
|
+
${extra}
|
|
104
|
+
</div>
|
|
105
|
+
`;
|
|
65
106
|
}
|
|
66
107
|
/** A day, as the date alone. */
|
|
67
108
|
export const day = (time) => new Date(time).toISOString().slice(0, 10);
|
|
@@ -80,6 +121,16 @@ export function distance(time, now) {
|
|
|
80
121
|
const count = `${Math.abs(days)} day${Math.abs(days) === 1 ? '' : 's'}`;
|
|
81
122
|
return days > 0 ? `in ${count}` : `${count} ago`;
|
|
82
123
|
}
|
|
124
|
+
/** A time to the minute, in UTC, such as "Oct 16, 2026, 18:28 UTC". */
|
|
125
|
+
export const minute = (time) => `${new Date(time).toLocaleString('en-US', {
|
|
126
|
+
year: 'numeric',
|
|
127
|
+
month: 'short',
|
|
128
|
+
day: 'numeric',
|
|
129
|
+
hour: '2-digit',
|
|
130
|
+
minute: '2-digit',
|
|
131
|
+
hourCycle: 'h23',
|
|
132
|
+
timeZone: 'UTC',
|
|
133
|
+
})} UTC`;
|
|
83
134
|
/** Seconds are the finest thing a record measured in days can mean; milliseconds are noise. */
|
|
84
135
|
export const moment = (time) => new Date(time).toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
85
136
|
/**
|
|
@@ -87,10 +138,9 @@ export const moment = (time) => new Date(time).toISOString().replace(/\.\d{3}Z$/
|
|
|
87
138
|
* find; the times of a record belong together, where they can be compared at a glance.
|
|
88
139
|
*/
|
|
89
140
|
export function times(rows) {
|
|
90
|
-
return `<dl>${rows
|
|
141
|
+
return html `<dl>${rows
|
|
91
142
|
.filter(([, time]) => time !== undefined)
|
|
92
|
-
.map(([label, time]) => `<dt>${
|
|
93
|
-
.join('')}</dl>`;
|
|
143
|
+
.map(([label, time]) => html `<dt>${label}</dt><dd>${moment(time)}</dd>`)}</dl>`;
|
|
94
144
|
}
|
|
95
145
|
/** A URL as written if it is http(s), and nothing otherwise. */
|
|
96
146
|
export function safeUrl(value) {
|
package/dist/server/service.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ export interface ServiceOptions {
|
|
|
24
24
|
baseUrl: string;
|
|
25
25
|
siteName: string;
|
|
26
26
|
verifierName: string;
|
|
27
|
-
|
|
27
|
+
/** A function is asked on every check, for a list that changes while the server runs. */
|
|
28
|
+
profileOrigins: string[] | (() => string[]);
|
|
28
29
|
validityMs?: number;
|
|
29
30
|
flowTtlMs?: number;
|
|
30
31
|
shareTtlMs?: number;
|
|
@@ -144,6 +145,7 @@ export declare class VerilyService {
|
|
|
144
145
|
/** A proof is only as fresh as the schedule that reads it, so both live together. */
|
|
145
146
|
private get freshness();
|
|
146
147
|
validateLocal(local: LocalAccount): LocalAccount;
|
|
148
|
+
private profileOrigins;
|
|
147
149
|
/** The site a subject belongs to: its own name where it has one, else this instance's. */
|
|
148
150
|
siteOf(local: Pick<LocalAccount, 'siteName'>): string;
|
|
149
151
|
/**
|
package/dist/server/service.js
CHANGED
|
@@ -190,11 +190,15 @@ export class VerilyService {
|
|
|
190
190
|
if (!['https:', 'http:'].includes(url.protocol) ||
|
|
191
191
|
url.username ||
|
|
192
192
|
url.password ||
|
|
193
|
-
!this.
|
|
193
|
+
!this.profileOrigins().includes(url.origin))
|
|
194
194
|
throw new Error('Unregistered profile origin');
|
|
195
195
|
}
|
|
196
196
|
return structuredClone(local);
|
|
197
197
|
}
|
|
198
|
+
profileOrigins() {
|
|
199
|
+
const origins = this.options.profileOrigins;
|
|
200
|
+
return typeof origins === 'function' ? origins() : origins;
|
|
201
|
+
}
|
|
198
202
|
/** The site a subject belongs to: its own name where it has one, else this instance's. */
|
|
199
203
|
siteOf(local) {
|
|
200
204
|
return local.siteName ?? this.options.siteName;
|
package/dist/server/style.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* leaves. So the styling does the two things that helps with, a measured column and a
|
|
9
9
|
* legible hierarchy, and nothing that would make a record look like a product.
|
|
10
10
|
*/
|
|
11
|
-
export declare const stylesheet = ":root {\n --ink: #23312b;\n --muted: #6b786f;\n --line: #dce2de;\n --surface: #fff;\n --raised: #f7f9f7;\n --accent: #245f43;\n --warn: #a4442b;\n color-scheme: light dark;\n accent-color: var(--accent);\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --ink: #dde5e0;\n --muted: #96a39b;\n --line: #2f3b35;\n --surface: #161a18;\n --raised: #1d2220;\n --accent: #7fc4a2;\n --warn: #e59a82;\n }\n}\n\n* { box-sizing: border-box; }\n\nbody {\n margin: 0;\n padding: 0 1rem 4rem;\n background: var(--surface);\n color: var(--ink);\n font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', sans-serif;\n text-rendering: optimizeLegibility;\n}\n\nmain {\n max-width: 34rem;\n margin: 0 auto;\n padding-top: 3rem;\n}\n\n/*\n * The logotype, above the page's own heading, on its own dark plate. Sized so the word is\n * the height it was without the plate, whose margin makes the box that much taller. The\n * word is white in either scheme: the plate is what it is read against, not the page.\n */\n.logo {\n display: block;\n height: 2.5rem;\n margin-bottom: 1.5rem;\n}\n\nh1 {\n margin: 0 0 1.75rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid var(--line);\n font-size: 1.5rem;\n font-weight: 620;\n letter-spacing: -.02em;\n line-height: 1.25;\n}\n\n/*\n * A page holding one thing needs no rule under its heading. The rule divides a heading\n * from the record beneath it, and a page that only asks for a key has no record to divide.\n */\nmain.single h1 { margin-bottom: 1.25rem; padding-bottom: 0; border-bottom: none; }\n\n/*\n * A page holding one thing sits in the middle of the window rather than at its top,\n * where it would leave most of the window empty below it.\n */\nbody:has(main.single) { display: flex; min-height: 100vh; min-height: 100dvh; }\nmain.single { width: 100%; max-width: 24rem; margin: auto; padding-bottom: 3rem; }\n\nh2 { margin: 2rem 0 .75rem; font-size: 1.125rem; font-weight: 620; letter-spacing: -.01em; }\n\nh3 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 620; }\n\np { margin: 0 0 1rem; overflow-wrap: break-word; }\n\na { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }\n\na:hover { text-decoration-thickness: 2px; }\n\n/*\n * Something to be run or published exactly as written. Its own line breaks are kept and a\n * long line is soft-wrapped rather than cut off: a soft wrap is drawn, not inserted, so\n * what is copied is still character for character what was written. Selecting inside the\n * block takes all of it, since half a command is worse than none.\n */\npre {\n position: relative;\n margin: 0 0 1rem;\n /* Room along the top line for the copy button, which sits over the block rather than in it. */\n padding: .75rem 5.25rem .75rem .875rem;\n border: 1px solid var(--line);\n border-radius: 6px;\n background: var(--raised);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n user-select: all;\n}\n\ncode { font: .8125rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }\n\n/* Made by a script, so it exists only where it works. Quiet: the block is the point. */\n.copy {\n position: absolute;\n top: .5rem;\n right: .5rem;\n padding: .1875rem .5rem;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--surface);\n color: var(--muted);\n font: 500 .75rem/1.5 system-ui, sans-serif;\n user-select: none;\n}\n\n.copy:hover { color: var(--ink); border-color: var(--muted); }\n\n/*\n * The two sides of the link, which is what a reader came to read. Each fact about a side\n * gets its own line: what it is, what it is called, the identifier behind that, and how it\n * was shown. Everything else on the page qualifies the pair, so it is set quieter.\n */\n.side {\n margin-bottom: .75rem;\n padding: .875rem 1rem;\n border: 1px solid var(--line);\n border-radius: 8px;\n background: var(--raised);\n}\n\n/*\n * A subject's accounts are peers, so where there is room they sit two across. The page\n * that lists them is wider for it, and a narrow one keeps them in a single column.\n */\nmain:has(.accounts) { max-width: 54rem; }\n\n.accounts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));\n gap: .75rem;\n margin-bottom: .75rem;\n}\n\n.accounts .side { position: relative; display: flex; flex-direction: column; margin-bottom: 0; }\n\n/* How the holder lists the account, in the card's corner and out of the lines below. */\n.listing {\n position: absolute;\n top: .75rem;\n right: .875rem;\n padding: .0625rem .5rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n color: var(--muted);\n font-size: .6875rem;\n font-weight: 550;\n}\n\n.listing.preferred { border-color: var(--accent); color: var(--accent); }\n\n/* The times sit at the foot of the card, so they line up along a row of uneven cards. */\n.accounts .side dl { margin-top: auto; }\n.accounts .side p:last-of-type { margin-bottom: .625rem; }\n\n/* Between a subject and its accounts on the page that lists them. */\n.joiner { display: block; width: 1.25rem; height: 1.25rem; margin: 0 auto .75rem; color: var(--muted); }\n\n.who {\n margin: 0 0 .125rem;\n color: var(--muted);\n font-size: .75rem;\n font-weight: 550;\n letter-spacing: .02em;\n}\n\n/* A provider's mark before its name, at the height of the letters. */\n.who .provider { display: inline-block; width: .875rem; height: .875rem; margin-right: .375rem; vertical-align: -.125rem; }\n\n/* Clipped 4px left of the text, which hides the date's dot when the date wraps to a new line. */\n.name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; margin: 0 0 0 -4px; padding-left: 4px; overflow-x: clip; font-size: 1.0625rem; font-weight: 620; letter-spacing: -.01em; }\n\n/* The account's creation date, after the name and a dot. It wraps under a long name. */\n.name .since { position: relative; color: var(--muted); font-size: .8125rem; font-weight: 400; letter-spacing: 0; white-space: nowrap; }\n\n/* The dot sits in the gap before the date. */\n.name .since::before { content: \"\u00B7\"; position: absolute; left: -.5rem; transform: translateX(-50%); }\n\n/* The name is the card's subject before it is a link, so the rule is drawn on hover. */\n.name a { text-decoration: none; }\n\n.name a:hover { text-decoration: underline; }\n\n.reference, .how { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }\n\n.name + .how, .reference + .how { margin-top: .5rem; }\n.fingerprint { font-family: ui-monospace, monospace; text-wrap: balance; }\n.fingerprint span { display: inline-block; margin-right: .5ch; }\n.how.additional { padding-left: .75rem; }\n/* The \"signed\" pill after the verifier's name, one size smaller than the line it sits on. */\n.how .signed-mark { display: inline-block; margin-left: .3125rem; padding: 0 .375rem; border: 1px solid var(--line); border-radius: 999px; font-size: .625rem; font-weight: 550; line-height: 1.3; text-decoration: none; vertical-align: .0625rem; }\n\n.fine { color: var(--muted); font-size: .8125rem; line-height: 1.55; margin-bottom: .625rem; }\n\n/* That the record is signed is a fact about it, so it is set as one and not as fine print. */\n.signed { font-size: .875rem; line-height: 1.55; margin-bottom: .875rem; }\n/* Arrived at from a badge's \"signed\" link, so the reader is shown where they landed. */\n.signed:target { margin-inline: -.75rem; padding: .625rem .75rem; border-radius: 8px; background: var(--raised); }\n\n/* Every time on the record in one column, so they can be compared rather than hunted for. */\ndl {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: .3rem 1.5rem;\n margin: 1.25rem 0;\n padding-top: 1rem;\n border-top: 1px solid var(--line);\n font-size: .8125rem;\n}\n\ndt { color: var(--muted); }\n\ndd { margin: 0; font-variant-numeric: tabular-nums; }\n\n/* Inside a card the rule above it is the card's own edge, so the list needs none. */\nsection dl { margin: .5rem 0 1rem; padding-top: 0; border-top: 0; }\n.side dl { margin: .625rem 0 0; padding-top: .625rem; }\n\nsection {\n margin: 0 0 1.25rem;\n padding: 1.25rem 1.375rem;\n border: 1px solid var(--line);\n border-radius: 10px;\n}\n\nsection > :last-child { margin-bottom: 0; }\n\nform { margin: 0 0 1.5rem; }\n\nlabel { display: block; margin: 0 0 .75rem; color: var(--muted); font-size: .8125rem; }\n\ninput, textarea {\n display: block;\n width: 100%;\n margin-top: .375rem;\n padding: .5rem .625rem;\n border: 1px solid var(--line);\n border-radius: 6px;\n background: var(--surface);\n color: var(--ink);\n font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n/* Height comes from the rows attribute, which differs per box. */\ntextarea { resize: vertical; }\n\ninput:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }\n\nbutton {\n padding: .5rem 1rem;\n border: 1px solid var(--accent);\n border-radius: 6px;\n background: var(--accent);\n color: var(--surface);\n font: 500 .9375rem/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;\n cursor: pointer;\n}\n\n/* A link that starts something, drawn as a button. */\na.button {\n display: inline-block;\n padding: .5rem 1rem;\n border: 1px solid var(--accent);\n border-radius: 6px;\n background: var(--accent);\n color: var(--surface);\n font-weight: 500;\n font-size: .9375rem;\n line-height: 1.4;\n text-decoration: none;\n}\n\nbutton + button { margin-left: .5rem; border-color: var(--line); background: none; color: var(--ink); }\n\n/* The other choice beside a page's one action, such as Cancel. */\na.button.secondary { border-color: var(--line); background: none; color: var(--ink); }\n\n/* A page's action and its alternative, side by side. */\n.choice { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }\n.choice form { margin: 0; }\n\n/* A control that ends something. Filled where it is the page's one action. */\nbutton.danger { border-color: var(--warn); background: var(--warn); }\n\n/*\n * A connection on the settings page: the account's card, then what can be done with it.\n * Its state sits in the card's corner, on the line that names the method.\n */\n.connection { position: relative; margin-bottom: 1rem; }\n\n.state {\n position: absolute;\n top: .75rem;\n right: .875rem;\n display: flex;\n align-items: center;\n gap: .375rem;\n height: 1.625rem;\n padding: 0 .75rem 0 .5rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n background: var(--surface);\n color: var(--ink);\n font-size: .8125rem;\n font-weight: 550;\n}\n\n/*\n * The V the badge draws, in the tone that says how the record stands. A record that claims\n * nothing is drawn faint in the text colour, as the badge draws it.\n */\n.verdict { flex-shrink: 0; width: 1rem; height: 1rem; }\n.verdict.pending { opacity: .45; }\n.how .verdict { width: .875rem; height: .875rem; margin-right: .3125rem; vertical-align: -.125rem; }\nh1 .verdict { width: 1.25rem; height: 1.25rem; margin-right: .5rem; vertical-align: -.0625rem; }\n\n/*\n * In a state pill the V is cropped to its strokes and fills the pill's height, so its arms\n * and its foot meet the border. The pill's left padding keeps the arms clear of its curve.\n */\n.state .verdict { width: auto; height: 100%; }\n\n/*\n * A pill's line includes room for descenders below the letters, which leaves its text\n * sitting high. Trimmed to the letters, the padding alone sets the space above and below.\n * In a state pill the word alone is trimmed, so it centres on the V by its letters.\n */\n@supports (text-box: trim-both cap alphabetic) {\n .listing { padding: .3125rem .5rem; text-box: trim-both cap alphabetic; }\n .state > span { text-box: trim-both cap alphabetic; }\n}\n\n/* Links that sit together on one line, wrapping where there is no room. */\n.links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; font-size: .875rem; }\n\n/* Under the account's id, with the facts about it rather than the controls. */\n.evidence { margin: .375rem 0 0; font-size: .8125rem; }\n\n.connection dl { margin-bottom: .75rem; }\n.connection .side > :last-child { margin-bottom: 0; }\n.connection pre { margin: .75rem 0; background: var(--surface); }\n.connection .actions { margin-top: .875rem; }\n\n/* The buttons for one connection in a row, wrapping where there is no room. */\n.actions { display: flex; flex-wrap: wrap; gap: .5rem; }\n.actions form { display: contents; }\n\n.actions button, .actions a.button {\n margin: 0;\n padding: .3125rem .75rem;\n border-color: var(--line);\n background: var(--surface);\n color: var(--ink);\n font-size: .8125rem;\n}\n\n.actions button:hover, .actions a.button:hover { border-color: var(--muted); }\n\n/* The controls that cannot be undone, together at the foot of the card. */\n.ending { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }\n.ending form { margin: 0; }\n\n.ending button.danger {\n padding: .3125rem .75rem;\n background: var(--surface);\n color: var(--warn);\n font-size: .8125rem;\n}\n\nfieldset { margin: 0 0 1.25rem; padding: 1rem 1.125rem .25rem; border: 1px solid var(--line); border-radius: 8px; }\n\nlegend { padding: 0 .375rem; color: var(--muted); font-size: .8125rem; }\n\nfieldset label { display: flex; align-items: baseline; gap: .5rem; color: var(--ink); font-size: .9375rem; }\n\nfieldset input { width: auto; margin: 0; }\n\nfieldset p { margin: .25rem 0 .875rem 1.5rem; color: var(--muted); font-size: .8125rem; }\n";
|
|
11
|
+
export declare const stylesheet = ":root {\n --ink: #23312b;\n --muted: #6b786f;\n --line: #dce2de;\n --surface: #fff;\n --raised: #f7f9f7;\n --accent: #245f43;\n --warn: #a4442b;\n --caution: #b07a12;\n color-scheme: light dark;\n accent-color: var(--accent);\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --ink: #dde5e0;\n --muted: #96a39b;\n --line: #2f3b35;\n --surface: #161a18;\n --raised: #1d2220;\n --accent: #7fc4a2;\n --warn: #e59a82;\n --caution: #d9a843;\n }\n}\n\n* { box-sizing: border-box; }\n\nbody {\n margin: 0;\n padding: 0 1rem 4rem;\n background: var(--surface);\n color: var(--ink);\n font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', sans-serif;\n text-rendering: optimizeLegibility;\n}\n\nmain {\n max-width: 34rem;\n margin: 0 auto;\n padding-top: 3rem;\n}\n\n/*\n * The logotype, above the page's own heading, on its own dark plate. Sized so the word is\n * the height it was without the plate, whose margin makes the box that much taller. The\n * word is white in either scheme: the plate is what it is read against, not the page.\n */\n.logo {\n display: block;\n height: 2.5rem;\n margin-bottom: 1.5rem;\n}\n\nh1 {\n margin: 0 0 1.75rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid var(--line);\n font-size: 1.5rem;\n font-weight: 620;\n letter-spacing: -.02em;\n line-height: 1.25;\n}\n\n/*\n * A page holding one thing needs no rule under its heading. The rule divides a heading\n * from the record beneath it, and a page that only asks for a key has no record to divide.\n */\nmain.single h1 { margin-bottom: 1.25rem; padding-bottom: 0; border-bottom: none; }\n\n/*\n * A page holding one thing sits in the middle of the window rather than at its top,\n * where it would leave most of the window empty below it.\n */\nbody:has(main.single) { display: flex; min-height: 100vh; min-height: 100dvh; }\nmain.single { width: 100%; max-width: 24rem; margin: auto; padding-bottom: 3rem; }\n\nh2 { margin: 2rem 0 .75rem; font-size: 1.125rem; font-weight: 620; letter-spacing: -.01em; }\n\nh3 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 620; }\n\np { margin: 0 0 1rem; overflow-wrap: break-word; }\n\na { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }\n\na:hover { text-decoration-thickness: 2px; }\n\n/*\n * Something to be run or published exactly as written. Its own line breaks are kept and a\n * long line is soft-wrapped rather than cut off: a soft wrap is drawn, not inserted, so\n * what is copied is still character for character what was written. Selecting inside the\n * block takes all of it, since half a command is worse than none.\n */\npre {\n position: relative;\n margin: 0 0 1rem;\n /* Room along the top line for the copy button, which sits over the block rather than in it. */\n padding: .75rem 5.25rem .75rem .875rem;\n border: 1px solid var(--line);\n border-radius: 6px;\n background: var(--raised);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n user-select: all;\n}\n\ncode { font: .8125rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }\n\n/* Made by a script, so it exists only where it works. Quiet: the block is the point. */\n.copy {\n position: absolute;\n top: .5rem;\n right: .5rem;\n padding: .1875rem .5rem;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--surface);\n color: var(--muted);\n font: 500 .75rem/1.5 system-ui, sans-serif;\n user-select: none;\n}\n\n.copy:hover { color: var(--ink); border-color: var(--muted); }\n\n/*\n * The two sides of the link, which is what a reader came to read. Each fact about a side\n * gets its own line: what it is, what it is called, the identifier behind that, and how it\n * was shown. Everything else on the page qualifies the pair, so it is set quieter.\n */\n.side {\n margin-bottom: .75rem;\n padding: .875rem 1rem;\n border: 1px solid var(--line);\n border-radius: 8px;\n background: var(--raised);\n}\n\n/*\n * A subject's accounts are peers, so where there is room they sit two across. The page\n * that lists them is wider for it, and a narrow one keeps them in a single column.\n */\nmain:has(.accounts) { max-width: 54rem; }\n\n.accounts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));\n gap: .75rem;\n margin-bottom: .75rem;\n}\n\n.accounts .side { position: relative; display: flex; flex-direction: column; margin-bottom: 0; }\n\n/* How the holder lists the account, in the card's corner and out of the lines below. */\n.listing {\n position: absolute;\n top: .75rem;\n right: .875rem;\n padding: .0625rem .5rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n color: var(--muted);\n font-size: .6875rem;\n font-weight: 550;\n}\n\n.listing.preferred { border-color: var(--accent); color: var(--accent); }\n\n/* The times sit at the foot of the card, so they line up along a row of uneven cards. */\n.accounts .side dl { margin-top: auto; }\n.accounts .side p:last-of-type { margin-bottom: .625rem; }\n\n/* Between a subject and its accounts on the page that lists them. */\n.joiner { display: block; width: 1.25rem; height: 1.25rem; margin: 0 auto .75rem; color: var(--muted); }\n\n.who {\n margin: 0 0 .125rem;\n color: var(--muted);\n font-size: .75rem;\n font-weight: 550;\n letter-spacing: .02em;\n}\n\n/* A provider's mark before its name, at the height of the letters. */\n.who .provider { display: inline-block; width: .875rem; height: .875rem; margin-right: .375rem; vertical-align: -.125rem; }\n\n/* Clipped 4px left of the text, which hides the date's dot when the date wraps to a new line. */\n.name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; margin: 0 0 0 -4px; padding-left: 4px; overflow-x: clip; font-size: 1.0625rem; font-weight: 620; letter-spacing: -.01em; }\n\n/* The account's creation date, after the name and a dot. It wraps under a long name. */\n.name .since { position: relative; color: var(--muted); font-size: .8125rem; font-weight: 400; letter-spacing: 0; white-space: nowrap; }\n\n/* The dot sits in the gap before the date. */\n.name .since::before { content: \"\u00B7\"; position: absolute; left: -.5rem; transform: translateX(-50%); }\n\n/* The name is the card's subject before it is a link, so the rule is drawn on hover. */\n.name a { text-decoration: none; }\n\n.name a:hover { text-decoration: underline; }\n\n.reference, .how { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }\n\n.name + .how, .reference + .how { margin-top: .5rem; }\n.fingerprint { font-family: ui-monospace, monospace; text-wrap: balance; }\n.fingerprint span { display: inline-block; margin-right: .5ch; }\n.how.additional { padding-left: .75rem; }\n/* The \"signed\" pill after the verifier's name, one size smaller than the line it sits on. */\n.how .signed-mark { display: inline-block; margin-left: .3125rem; padding: 0 .375rem; border: 1px solid var(--line); border-radius: 999px; font-size: .625rem; font-weight: 550; line-height: 1.3; text-decoration: none; vertical-align: .0625rem; }\n\n.fine { color: var(--muted); font-size: .8125rem; line-height: 1.55; margin-bottom: .625rem; }\n\n/* That the record is signed is a fact about it, so it is set as one and not as fine print. */\n.signed { font-size: .875rem; line-height: 1.55; margin-bottom: .875rem; }\n/* Arrived at from a badge's \"signed\" link, so the reader is shown where they landed. */\n.signed:target { margin-inline: -.75rem; padding: .625rem .75rem; border-radius: 8px; background: var(--raised); }\n\n/* Every time on the record in one column, so they can be compared rather than hunted for. */\ndl {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: .3rem 1.5rem;\n margin: 1.25rem 0;\n padding-top: 1rem;\n border-top: 1px solid var(--line);\n font-size: .8125rem;\n}\n\ndt { color: var(--muted); }\n\ndd { margin: 0; font-variant-numeric: tabular-nums; }\n\n/* Inside a card the rule above it is the card's own edge, so the list needs none. */\nsection dl { margin: .5rem 0 1rem; padding-top: 0; border-top: 0; }\n\n/* Right under the heading, the heading's own rule is the one above it. */\nh1 + dl { padding-top: 0; border-top: 0; }\n.side dl { margin: .625rem 0 0; padding-top: .625rem; }\n\n/* The links under a record, ruled off from the record and its disclaimer. */\nfooter { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }\nfooter > :last-child { margin-bottom: 0; }\n\nsection {\n margin: 0 0 1.25rem;\n padding: 1.25rem 1.375rem;\n border: 1px solid var(--line);\n border-radius: 10px;\n}\n\nsection > :last-child { margin-bottom: 0; }\n\n/* What holds a control that cannot be undone. */\nsection.danger, section.caution { margin-top: 2rem; }\nsection.danger { border-color: var(--warn); }\n\n/* What holds a control that breaks something for a while, but can be recovered from. */\nsection.caution { border-color: var(--caution); }\nsection > h2:first-child { margin-top: 0; }\n\nform { margin: 0 0 1.5rem; }\n\nlabel { display: block; margin: 0 0 .75rem; color: var(--muted); font-size: .8125rem; }\n\ninput, textarea {\n display: block;\n width: 100%;\n margin-top: .375rem;\n padding: .5rem .625rem;\n border: 1px solid var(--line);\n border-radius: 6px;\n background: var(--surface);\n color: var(--ink);\n font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n/* Height comes from the rows attribute, which differs per box. */\ntextarea { resize: vertical; }\n\ninput:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }\n\nbutton {\n padding: .5rem 1rem;\n border: 1px solid var(--accent);\n border-radius: 6px;\n background: var(--accent);\n color: var(--surface);\n font: 500 .9375rem/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;\n cursor: pointer;\n}\n\n/* A link that starts something, drawn as a button. */\na.button {\n display: inline-block;\n padding: .5rem 1rem;\n border: 1px solid var(--accent);\n border-radius: 6px;\n background: var(--accent);\n color: var(--surface);\n font-weight: 500;\n font-size: .9375rem;\n line-height: 1.4;\n text-decoration: none;\n}\n\nbutton + button { margin-left: .5rem; border-color: var(--line); background: none; color: var(--ink); }\n\n/* The other choice beside a page's one action, such as Cancel. */\na.button.secondary { border-color: var(--line); background: none; color: var(--ink); }\n\n/* A page's action and its alternative, side by side. */\n.choice { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }\n.choice form { margin: 0; }\n\n/* Ways to verify: one full-width button per method, none filled over the others. */\n.choices { display: grid; gap: .5rem; margin-bottom: 1.5rem; }\n.choices form { margin: 0; }\n\n.choices button {\n width: 100%;\n text-align: left;\n border-color: var(--line);\n background: var(--surface);\n color: var(--ink);\n}\n\n.choices button:hover { border-color: var(--muted); }\n\n/* A provider's mark before a button's label, at the height of the letters. */\nbutton .provider { width: 1rem; height: 1rem; margin-right: .5rem; vertical-align: -.1875rem; }\n\n/* A control that ends something. Filled where it is the page's one action. */\nbutton.danger { border-color: var(--warn); background: var(--warn); }\n\n/*\n * A connection on the settings page: the account's card, then what can be done with it.\n * Its state sits in the card's corner, on the line that names the method.\n */\n.connection { position: relative; margin-bottom: 1rem; }\n\n.state {\n position: absolute;\n top: .75rem;\n right: .875rem;\n display: flex;\n align-items: center;\n gap: .375rem;\n height: 1.625rem;\n padding: 0 .75rem 0 .5rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n background: var(--surface);\n color: var(--ink);\n font-size: .8125rem;\n font-weight: 550;\n}\n\n/*\n * The V the badge draws, in the tone that says how the record stands. A record that claims\n * nothing is drawn faint in the text colour, as the badge draws it.\n */\n.verdict { flex-shrink: 0; width: 1rem; height: 1rem; }\n.verdict.pending { opacity: .45; }\n.how .verdict { width: .875rem; height: .875rem; margin-right: .3125rem; vertical-align: -.125rem; }\n/* Cropped to its strokes and taller than the heading's letters, centred beside them. */\nh1:has(.verdict) { display: flex; align-items: center; gap: .75rem; }\nh1 .verdict { width: auto; height: 2.25rem; }\n\n/*\n * In a state pill the V is cropped to its strokes and fills the pill's height, so its arms\n * and its foot meet the border. The pill's left padding keeps the arms clear of its curve.\n */\n.state .verdict { width: auto; height: 100%; }\n\n/*\n * A pill's line includes room for descenders below the letters, which leaves its text\n * sitting high. Trimmed to the letters, the padding alone sets the space above and below.\n * In a state pill the word alone is trimmed, so it centres on the V by its letters.\n */\n@supports (text-box: trim-both cap alphabetic) {\n .listing { padding: .3125rem .5rem; text-box: trim-both cap alphabetic; }\n .state > span { text-box: trim-both cap alphabetic; }\n}\n\n/* Links that sit together on one line, wrapping where there is no room. */\n.links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; font-size: .875rem; }\n\n/* Under the account's id, with the facts about it rather than the controls. */\n.evidence { margin: .375rem 0 0; font-size: .8125rem; }\n\n.connection dl { margin-bottom: .75rem; }\n.connection .side > :last-child { margin-bottom: 0; }\n.connection pre { margin: .75rem 0; background: var(--surface); }\n.connection .actions { margin-top: .875rem; }\n\n/* The buttons for one connection in a row, wrapping where there is no room. */\n.actions { display: flex; flex-wrap: wrap; gap: .5rem; }\n.actions form { display: contents; }\n\n.actions button, .actions a.button {\n margin: 0;\n padding: .3125rem .75rem;\n border-color: var(--line);\n background: var(--surface);\n color: var(--ink);\n font-size: .8125rem;\n}\n\n.actions button:hover, .actions a.button:hover { border-color: var(--muted); }\n\n/* The controls that cannot be undone, together at the foot of the card. */\n.ending { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }\n.ending form { margin: 0; }\n\n.ending button.danger {\n padding: .3125rem .75rem;\n background: var(--surface);\n color: var(--warn);\n font-size: .8125rem;\n}\n\nfieldset { margin: 0 0 1.25rem; padding: 1rem 1.125rem .25rem; border: 1px solid var(--line); border-radius: 8px; }\n\nlegend { padding: 0 .375rem; color: var(--muted); font-size: .8125rem; }\n\nfieldset label { display: flex; align-items: baseline; gap: .5rem; color: var(--ink); font-size: .9375rem; }\n\nfieldset input { width: auto; margin: 0; }\n\nfieldset p { margin: .25rem 0 .875rem 1.5rem; color: var(--muted); font-size: .8125rem; }\n";
|
|
12
12
|
/**
|
|
13
13
|
* A short digest of the sheet above, put in the link's query so a release that changes the
|
|
14
14
|
* styling changes its address. Without that the only safe cache is no cache: a reader who
|
package/dist/server/style.js
CHANGED
|
@@ -16,6 +16,7 @@ export const stylesheet = `:root {
|
|
|
16
16
|
--raised: #f7f9f7;
|
|
17
17
|
--accent: #245f43;
|
|
18
18
|
--warn: #a4442b;
|
|
19
|
+
--caution: #b07a12;
|
|
19
20
|
color-scheme: light dark;
|
|
20
21
|
accent-color: var(--accent);
|
|
21
22
|
}
|
|
@@ -29,6 +30,7 @@ export const stylesheet = `:root {
|
|
|
29
30
|
--raised: #1d2220;
|
|
30
31
|
--accent: #7fc4a2;
|
|
31
32
|
--warn: #e59a82;
|
|
33
|
+
--caution: #d9a843;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -238,8 +240,15 @@ dd { margin: 0; font-variant-numeric: tabular-nums; }
|
|
|
238
240
|
|
|
239
241
|
/* Inside a card the rule above it is the card's own edge, so the list needs none. */
|
|
240
242
|
section dl { margin: .5rem 0 1rem; padding-top: 0; border-top: 0; }
|
|
243
|
+
|
|
244
|
+
/* Right under the heading, the heading's own rule is the one above it. */
|
|
245
|
+
h1 + dl { padding-top: 0; border-top: 0; }
|
|
241
246
|
.side dl { margin: .625rem 0 0; padding-top: .625rem; }
|
|
242
247
|
|
|
248
|
+
/* The links under a record, ruled off from the record and its disclaimer. */
|
|
249
|
+
footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
|
|
250
|
+
footer > :last-child { margin-bottom: 0; }
|
|
251
|
+
|
|
243
252
|
section {
|
|
244
253
|
margin: 0 0 1.25rem;
|
|
245
254
|
padding: 1.25rem 1.375rem;
|
|
@@ -249,6 +258,14 @@ section {
|
|
|
249
258
|
|
|
250
259
|
section > :last-child { margin-bottom: 0; }
|
|
251
260
|
|
|
261
|
+
/* What holds a control that cannot be undone. */
|
|
262
|
+
section.danger, section.caution { margin-top: 2rem; }
|
|
263
|
+
section.danger { border-color: var(--warn); }
|
|
264
|
+
|
|
265
|
+
/* What holds a control that breaks something for a while, but can be recovered from. */
|
|
266
|
+
section.caution { border-color: var(--caution); }
|
|
267
|
+
section > h2:first-child { margin-top: 0; }
|
|
268
|
+
|
|
252
269
|
form { margin: 0 0 1.5rem; }
|
|
253
270
|
|
|
254
271
|
label { display: block; margin: 0 0 .75rem; color: var(--muted); font-size: .8125rem; }
|
|
@@ -303,6 +320,23 @@ a.button.secondary { border-color: var(--line); background: none; color: var(--i
|
|
|
303
320
|
.choice { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
|
|
304
321
|
.choice form { margin: 0; }
|
|
305
322
|
|
|
323
|
+
/* Ways to verify: one full-width button per method, none filled over the others. */
|
|
324
|
+
.choices { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
|
|
325
|
+
.choices form { margin: 0; }
|
|
326
|
+
|
|
327
|
+
.choices button {
|
|
328
|
+
width: 100%;
|
|
329
|
+
text-align: left;
|
|
330
|
+
border-color: var(--line);
|
|
331
|
+
background: var(--surface);
|
|
332
|
+
color: var(--ink);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.choices button:hover { border-color: var(--muted); }
|
|
336
|
+
|
|
337
|
+
/* A provider's mark before a button's label, at the height of the letters. */
|
|
338
|
+
button .provider { width: 1rem; height: 1rem; margin-right: .5rem; vertical-align: -.1875rem; }
|
|
339
|
+
|
|
306
340
|
/* A control that ends something. Filled where it is the page's one action. */
|
|
307
341
|
button.danger { border-color: var(--warn); background: var(--warn); }
|
|
308
342
|
|
|
@@ -336,7 +370,9 @@ button.danger { border-color: var(--warn); background: var(--warn); }
|
|
|
336
370
|
.verdict { flex-shrink: 0; width: 1rem; height: 1rem; }
|
|
337
371
|
.verdict.pending { opacity: .45; }
|
|
338
372
|
.how .verdict { width: .875rem; height: .875rem; margin-right: .3125rem; vertical-align: -.125rem; }
|
|
339
|
-
|
|
373
|
+
/* Cropped to its strokes and taller than the heading's letters, centred beside them. */
|
|
374
|
+
h1:has(.verdict) { display: flex; align-items: center; gap: .75rem; }
|
|
375
|
+
h1 .verdict { width: auto; height: 2.25rem; }
|
|
340
376
|
|
|
341
377
|
/*
|
|
342
378
|
* In a state pill the V is cropped to its strokes and fills the pill's height, so its arms
|
package/dist/site/index.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export interface SiteClientOptions {
|
|
|
16
16
|
site: string;
|
|
17
17
|
/** The key the instance holds for this site. Never sent to a browser. */
|
|
18
18
|
key: string;
|
|
19
|
+
/**
|
|
20
|
+
* The key this one replaced, while the instance still accepts it. A user who began
|
|
21
|
+
* before the switch returns with a result signed with it, which `result()` then accepts
|
|
22
|
+
* too. Nothing is signed with it. Remove it once the instance stops accepting it.
|
|
23
|
+
*/
|
|
24
|
+
previousKey?: string;
|
|
19
25
|
/**
|
|
20
26
|
* Set this and the site's user ids never leave it: every id this client is given is this
|
|
21
27
|
* site's own, and the instance is sent a stand-in made with `pseudonym()`. A subject
|
package/dist/site/index.js
CHANGED
|
@@ -50,6 +50,10 @@ export function createSiteClient(options) {
|
|
|
50
50
|
throw new Error('Invalid site id');
|
|
51
51
|
if (!/^[A-Za-z0-9_-]{43,}$/.test(options.key))
|
|
52
52
|
throw new Error('key must be the base64url key the instance holds for this site');
|
|
53
|
+
if (options.previousKey !== undefined && !/^[A-Za-z0-9_-]{43,}$/.test(options.previousKey))
|
|
54
|
+
throw new Error('previousKey must be the base64url key this site had before');
|
|
55
|
+
/** The keys a result may be signed with: the site's key, then the one it replaced. */
|
|
56
|
+
const resultKeys = [options.key, ...(options.previousKey ? [options.previousKey] : [])];
|
|
53
57
|
const request = options.fetch ?? fetch;
|
|
54
58
|
const idSecret = options.idSecret;
|
|
55
59
|
/** The id the instance knows a user by: the site's own, or its stand-in. */
|
|
@@ -183,7 +187,10 @@ export function createSiteClient(options) {
|
|
|
183
187
|
return undefined;
|
|
184
188
|
try {
|
|
185
189
|
const bytes = decode(payload);
|
|
186
|
-
|
|
190
|
+
let verified = false;
|
|
191
|
+
for (const key of resultKeys)
|
|
192
|
+
verified ||= await crypto.subtle.verify('HMAC', await hmacKey(key), decode(mac), bytes);
|
|
193
|
+
if (!verified)
|
|
187
194
|
return undefined;
|
|
188
195
|
const result = JSON.parse(new TextDecoder().decode(bytes));
|
|
189
196
|
return result.site === options.site &&
|
package/dist/verily.js
CHANGED
|
@@ -10520,7 +10520,7 @@ ${claims(evidence)}`;
|
|
|
10520
10520
|
}
|
|
10521
10521
|
|
|
10522
10522
|
// src/version.ts
|
|
10523
|
-
var version = "v0.
|
|
10523
|
+
var version = "v0.9.0";
|
|
10524
10524
|
|
|
10525
10525
|
// src/browser/evidence-dialog.ts
|
|
10526
10526
|
function stampLink() {
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED