annotepage-client 2.20.0 → 2.22.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 +55 -368
- package/dist/HASHES.txt +2 -0
- package/dist/annotepage.js +69 -10
- package/labels/fr.json +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,406 +1,93 @@
|
|
|
1
1
|
# annotepage-client
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The annotation layer of [annotepage](https://annotepage.com). One file, one
|
|
4
|
+
`<script>` tag, no dependency, no bundler, no stylesheet of its own.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ships in, and the remark moves into the history without ever being deleted.
|
|
6
|
+
A reviewer clicks an element of the page and writes what is wrong. The remark
|
|
7
|
+
is encrypted in their browser and pinned to that element. An assistant reads
|
|
8
|
+
the notes, fixes the code, replies in the thread with what it measured, and
|
|
9
|
+
resolves the remark stamped with the version the fix ships in.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
tag under an SRI digest. It talks about no site in particular and knows none.
|
|
11
|
+
**Everything you need in order to install it is on the site:**
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
- [how you use it](https://annotepage.com/how-to-use-it.html)
|
|
14
|
+
- [every way to install it](https://annotepage.com/how-to-install-it.html) —
|
|
15
|
+
it builds the tag below with your own address and key
|
|
16
|
+
- [the questions people ask](https://annotepage.com/questions.html)
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## The tag
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
encrypt nor even compute the page index -- it says so on screen rather than
|
|
23
|
-
pretending;
|
|
24
|
-
- a reachable **annotepage server**: the site itself (self-hosted), or a third
|
|
25
|
-
party machine (relay). One single PHP codebase, deployed at either end;
|
|
26
|
-
- nothing else. No framework, no bundler, no stylesheet to load separately.
|
|
27
|
-
|
|
28
|
-
## Putting the tool on a site
|
|
29
|
-
|
|
30
|
-
### 1. Generate the key, and put it away
|
|
31
|
-
|
|
32
|
-
Load the client once, on a page of the site, with `data-setup` and **without**
|
|
33
|
-
`data-project`:
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<script src="https://<your-cdn>/annotepage-client@2.20.0/dist/annotepage.js"
|
|
37
|
-
integrity="sha384-KVPw51MY5AnBF9Ef+lJB1kJd/pbv58Ml7k2wvkcj99S3b4HDtrzSP+SGk7I0ylRs"
|
|
38
|
-
crossorigin="anonymous"
|
|
39
|
-
data-server="https://<your-server>/annotepage/api.php"
|
|
40
|
-
data-setup
|
|
41
|
-
defer></script>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The setup screen generates a **256-bit key** and gives you four things to
|
|
45
|
-
copy: the key, the project id, the final tag, and the three lines to declare
|
|
46
|
-
on the server. No network request is made at that point.
|
|
47
|
-
|
|
48
|
-
> **KEY LOST = NOTES LOST.** The key is the only secret of the project. It
|
|
49
|
-
> never leaves the browser, the server receives it in no form whatsoever, and
|
|
50
|
-
> nobody can give it back to you. There is no recovery, no security question,
|
|
51
|
-
> no escrow third party. Put it where your team keeps its passwords **before**
|
|
52
|
-
> continuing.
|
|
53
|
-
|
|
54
|
-
### 2. Paste the final tag, at the end of `<body>`
|
|
20
|
+
At the end of `<body>`. Needs a **secure context** — https, or localhost —
|
|
21
|
+
because the encryption is WebCrypto's.
|
|
55
22
|
|
|
56
23
|
```html
|
|
57
|
-
<script src="https
|
|
58
|
-
integrity="sha384-
|
|
24
|
+
<script src="https://annotepage.com/annotepage-client-2.22.0.js"
|
|
25
|
+
integrity="sha384-Iw9wfZ6d9e9+lE0pZQ3fSjkZ++f3qHdxQtLH4+d42SCEeiYmSzDD3Gbkw4SYjCZm"
|
|
59
26
|
crossorigin="anonymous"
|
|
60
|
-
data-server="https
|
|
61
|
-
data-project="
|
|
62
|
-
data-version="1.4.12"
|
|
63
|
-
data-environment="staging"
|
|
27
|
+
data-server="https://your-server.example.com/annotepage/api.php"
|
|
28
|
+
data-project="your-project-id"
|
|
64
29
|
defer></script>
|
|
65
30
|
```
|
|
66
31
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
SRI digest is what makes that swap useless. `crossorigin="anonymous"` goes with
|
|
71
|
-
it: without it the browser does not check the digest of a cross-origin
|
|
72
|
-
resource.
|
|
32
|
+
It must stay a **classic script tag**: the tool reads its own attributes
|
|
33
|
+
through `document.currentScript`, which is `null` inside a module. Loaded as
|
|
34
|
+
a module it stops, silently, with one line in the console.
|
|
73
35
|
|
|
74
|
-
The
|
|
75
|
-
and the build prints it. The one above is 2.0.0's. Never copy a digest from a
|
|
76
|
-
documentation page for another version: the browser will refuse the file, and
|
|
77
|
-
that is exactly its job.
|
|
36
|
+
## The attributes
|
|
78
37
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
and would stand down in silence.
|
|
82
|
-
|
|
83
|
-
### 3. Declare the project on the server, and give the key to the team
|
|
84
|
-
|
|
85
|
-
The server receives the project id (public) and the list of allowed origins.
|
|
86
|
-
The key travels **out of band** -- the tool provides no channel for it. Each
|
|
87
|
-
reviewer pastes it once: the tool shows them the pasting screen, checks that
|
|
88
|
-
the key really derives the id declared by the page, and remembers it in their
|
|
89
|
-
browser.
|
|
90
|
-
|
|
91
|
-
## The tag attributes
|
|
38
|
+
The only thing here the site does not say, because it is the package's own
|
|
39
|
+
contract rather than a step in an installation.
|
|
92
40
|
|
|
93
41
|
| Attribute | What it declares |
|
|
94
42
|
|---|---|
|
|
95
|
-
| `data-server` | the address of `api.php`. Required as soon as the client comes from a CDN
|
|
96
|
-
| `data-key` | **the key itself**, 43 characters. The project is then **public**: the tool derives the
|
|
97
|
-
| `data-project` | the project id, 22 characters. The project is then **confidential**: the key is asked for once per browser. Without either attribute the tool does
|
|
98
|
-
| `data-setup` | opens the setup screen.
|
|
99
|
-
| `data-mode` | `encrypted` (default) or `plain
|
|
100
|
-
| `data-path` | path prefix:
|
|
43
|
+
| `data-server` | the address of `api.php`. Required as soon as the client comes from a CDN |
|
|
44
|
+
| `data-key` | **the key itself**, 43 characters. The project is then **public**: the tool derives the id from it and starts, asking nothing |
|
|
45
|
+
| `data-project` | the project id, 22 characters. The project is then **confidential**: the key is asked for once per browser. Without either attribute the tool does nothing |
|
|
46
|
+
| `data-setup` | opens the setup screen. Remove it once the project exists |
|
|
47
|
+
| `data-mode` | `encrypted` (default) or `plain` |
|
|
48
|
+
| `data-path` | path prefix: which pages belong to the project. `/fr/` does not annotate `/en/` |
|
|
101
49
|
| `data-domains` | origins of the project, separated by commas |
|
|
102
|
-
| `data-version` | the version
|
|
50
|
+
| `data-version` | the version really being served, as the site names it |
|
|
103
51
|
| `data-environment` | the name of the environment, written into the note as it stands |
|
|
104
52
|
| `data-labels` | a label file belonging to the site, resolved against the document |
|
|
105
53
|
|
|
106
|
-
`data-version`
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
NOT deployed, the note stays visible.
|
|
112
|
-
|
|
113
|
-
A standalone tool does not guess how a site names its version: without these
|
|
114
|
-
attributes the fields stay empty, and that is intended.
|
|
115
|
-
|
|
116
|
-
## The key in the tag, or the id in the tag
|
|
117
|
-
|
|
118
|
-
The tag carries **one of the two**, and which one it carries **is** the mode.
|
|
119
|
-
There is no setting anywhere else, and nothing in a stored note records it:
|
|
120
|
-
|
|
121
|
-
```html
|
|
122
|
-
<!-- public: whoever can open the page reads AND writes -->
|
|
123
|
-
<script src="..." data-server="..." data-key="<43 characters>" defer></script>
|
|
124
|
-
|
|
125
|
-
<!-- confidential: each reviewer pastes the key once, per browser -->
|
|
126
|
-
<script src="..." data-server="..." data-project="<22 characters>" defer></script>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
The id is **not** written next to the key: the client derives it (HKDF label
|
|
130
|
-
`id`), so writing both is writing the same fact twice in a tag people copy by
|
|
131
|
-
hand. A tag carrying both is not a third mode -- the client checks that they
|
|
132
|
-
agree and **refuses** the whole tag if they do not, with nothing sent and
|
|
133
|
-
nothing decrypted, rather than guessing which of the two is the typo. A
|
|
134
|
-
`data-key` that is not 43 base64url characters is refused the same way, and
|
|
135
|
-
said on screen: somebody put that attribute there on purpose.
|
|
136
|
-
|
|
137
|
-
**Which of the two a project runs in is said in the panel, at every draw** --
|
|
138
|
-
in BOTH modes, and not once at load time. It is one badge, one word, above the
|
|
139
|
-
notes:
|
|
140
|
-
|
|
141
|
-
> `Public` `Secure`
|
|
142
|
-
|
|
143
|
-
It is not a button and there is nothing to press. Point at it, or reach it with
|
|
144
|
-
Tab, and it gives the sentence -- the badge is focusable for exactly that
|
|
145
|
-
reason, so the explanation is not reserved to whoever has a pointer:
|
|
146
|
-
|
|
147
|
-
> **Public** -- End-to-end encrypted, and the key is in this page: anyone who
|
|
148
|
-
> can open the page can read these notes AND write them. The key gives both --
|
|
149
|
-
> this format has no reader-only role.
|
|
150
|
-
|
|
151
|
-
> **Secure** -- End-to-end encrypted, and the key is not in this page: each
|
|
152
|
-
> browser pastes it once, and the server never receives it.
|
|
153
|
-
|
|
154
|
-
The encryption is not written on the badge itself: it holds in both modes, at
|
|
155
|
-
all times, so a word that appears in both distinguishes nothing. It belongs to
|
|
156
|
-
the sentence, where somebody asking the question is. All four texts are labels
|
|
157
|
-
(`mode.public`, `mode.secure`, `mode.public_detail`, `mode.secure_detail`) and
|
|
158
|
-
translate like the rest.
|
|
159
|
-
|
|
160
|
-
### What a public key actually opens, and it is not mainly reading
|
|
161
|
-
|
|
162
|
-
Reading is the obvious half. **The key gives read AND write, and there is no
|
|
163
|
-
reader role in this format**: a page anybody can open is a page anybody can
|
|
164
|
-
post to. Two consequences that have to be named before choosing it:
|
|
165
|
-
|
|
166
|
-
- the project's note cap is the only thing between that and a full database.
|
|
167
|
-
The relay's rate limit is per IP, which is not an answer to more than one of
|
|
168
|
-
them;
|
|
169
|
-
- **a copied tag writes into your project.** The domain lock is what normally
|
|
170
|
-
stops that -- and on a relay with open registration a project has no declared
|
|
171
|
-
origins to match, so it does not apply. Someone who lifts your public tag out
|
|
172
|
-
of your page source writes into your notes, from their own site.
|
|
173
|
-
|
|
174
|
-
On a staging site behind a login, a VPN or an IP allowlist, that audience is
|
|
175
|
-
your team: the notes are protected by the same thing that protects the site,
|
|
176
|
-
being able to reach it. On a public production page, that audience is the
|
|
177
|
-
internet.
|
|
178
|
-
|
|
179
|
-
And it is **irreversible**: the key is served to whoever the page is served to,
|
|
180
|
-
search engines and archive sites included. A project made public cannot be made
|
|
181
|
-
private again -- that would mean a new key, therefore a new project id,
|
|
182
|
-
therefore a new tag, and the old notes stay behind.
|
|
183
|
-
|
|
184
|
-
What does **not** change: the notes are encrypted exactly as before, the server
|
|
185
|
-
still cannot read a single one, and a note written on a public key is an
|
|
186
|
-
ordinary `encrypted` note. The public/confidential choice is not the
|
|
187
|
-
`data-mode` below -- they are two different words for two different things.
|
|
188
|
-
|
|
189
|
-
## Encrypted, or plain
|
|
190
|
-
|
|
191
|
-
Encryption is **on by default**. In encrypted mode, everything typed or
|
|
192
|
-
observed goes out in an AES-256-GCM envelope the server cannot open: the text,
|
|
193
|
-
but also the page, the selector, the excerpt, the reviewer's name, the version,
|
|
194
|
-
the environment. Encrypting the text alone would hand over the site's tree, its
|
|
195
|
-
wording and the list of its reviewers -- and a staging site is precisely what
|
|
196
|
-
is not published yet.
|
|
197
|
-
|
|
198
|
-
`data-mode="plain"` is only acceptable **when self-hosted**, where encryption
|
|
199
|
-
protects nothing: the notes are in the same database, on the same machine,
|
|
200
|
-
behind the same access restriction as the site under review. **A relay refuses
|
|
201
|
-
it**, with a 400, and shows its message.
|
|
202
|
-
|
|
203
|
-
The mode is written into each note. An installation that ran plain for two
|
|
204
|
-
weeks before turning encryption on stays entirely readable: every row says what
|
|
205
|
-
it is.
|
|
206
|
-
|
|
207
|
-
## What the server never sees, and what it sees anyway
|
|
208
|
-
|
|
209
|
-
It receives neither the key, nor the key, nor the path of your pages: it
|
|
210
|
-
groups by **blind index**, an HMAC of the path that it cannot invert. It does
|
|
211
|
-
see the number of projects and notes, the number of distinct pages, the time of
|
|
212
|
-
every write, the shape of the threads, the approximate length of each remark,
|
|
213
|
-
the IP address of each reviewer -- and, on a relay, **the domain of the site
|
|
214
|
-
under review**, through the `Origin` header that the domain lock requires it to
|
|
215
|
-
read. The promise is not "the relay does not know which site you are
|
|
216
|
-
reviewing"; it is "the relay cannot read your paths, your names or your
|
|
217
|
-
remarks".
|
|
218
|
-
|
|
219
|
-
The server's domain lock is an **anti-abuse** measure: it stops another site
|
|
220
|
-
from consuming a project id found in the source of a page. **It is not a
|
|
221
|
-
protection against XSS**: an XSS runs INSIDE the target page, so with the
|
|
222
|
-
legitimate origin, and it has access to `localStorage`, hence to the key.
|
|
54
|
+
`data-version` earns its place: when a note is resolved, the tool compares the
|
|
55
|
+
version of the fix with this one to tell "resolved and online" — which folds
|
|
56
|
+
into the history — from "resolved, not deployed yet" — which stays in front of
|
|
57
|
+
the reviewer, because the defect is still on their screen. Missing: the fix is
|
|
58
|
+
taken as not deployed and the note stays visible.
|
|
223
59
|
|
|
224
|
-
|
|
225
|
-
not see paths. It is **tidiness**, not a security boundary.
|
|
60
|
+
## Translating it
|
|
226
61
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
If the site serves one, three directives concern it:
|
|
230
|
-
|
|
231
|
-
- `script-src`: the CDN's origin, without which the client does not load;
|
|
232
|
-
- `connect-src`: the annotepage server's origin, without which `fetch` fails
|
|
233
|
-
and the tool stands down in silence, as if nothing were configured;
|
|
234
|
-
- `style-src`: nothing to do in most cases. The stylesheet is put in as a
|
|
235
|
-
**constructed sheet**, which is not an inline sheet in the policy's sense. On
|
|
236
|
-
a browser that cannot construct one, the tool falls back on a `<style>`,
|
|
237
|
-
which `style-src` without `'unsafe-inline'` will block -- the tool will work,
|
|
238
|
-
but unstyled.
|
|
239
|
-
|
|
240
|
-
## Two silences and a shout
|
|
241
|
-
|
|
242
|
-
**It stands down in silence when it has nothing to do.** If the API does not
|
|
243
|
-
answer, does not answer JSON, says it is not configured, or if the page is out
|
|
244
|
-
of the project's scope, the client adds nothing to the DOM and writes nothing
|
|
245
|
-
to the console. So the tag can be left in a template shared by the whole site.
|
|
246
|
-
|
|
247
|
-
**But once in place, it no longer keeps quiet.** Every failure is shown, with
|
|
248
|
-
the message the server wrote, and **the text typed stays in the form**. A
|
|
249
|
-
remark believed saved and not saved is worse than no tool at all.
|
|
250
|
-
|
|
251
|
-
**A refusal is named.** Defect seen in production: a hosting firewall answers
|
|
252
|
-
403 with an HTML page, and the user read "the server answered something
|
|
253
|
-
unexpected". That was true and useless. The tool now names the refusal, gives
|
|
254
|
-
its code, and suggests the one move that often gets around it: rephrase the
|
|
255
|
-
remark, with no tags and no fragments of code. The text itself is kept -- that
|
|
256
|
-
has not changed.
|
|
257
|
-
|
|
258
|
-
A refusal on the very first call is shown too, unlike 1.2.0: a firewall
|
|
259
|
-
blocking everything made the tool entirely invisible, and one looked for the
|
|
260
|
-
failure in the wrong file.
|
|
261
|
-
|
|
262
|
-
**And a tag that cannot be used is named too**, for the same reason: a
|
|
263
|
-
`data-key` that is not a key, or a `data-key` and a `data-project` that do not
|
|
264
|
-
derive one another, open a screen saying which of the two is wrong. Standing
|
|
265
|
-
down silently would be indistinguishable from a page with no tag at all, and
|
|
266
|
-
that is the difference nobody finds.
|
|
267
|
-
|
|
268
|
-
## What it does not touch
|
|
269
|
-
|
|
270
|
-
The client adds **one single element** to the site, at the end of `<body>`, and
|
|
271
|
-
works inside a `shadow root`: it puts no class, no attribute and no style on an
|
|
272
|
-
element of the page, and the pointing highlight is a rectangle drawn on its own
|
|
273
|
-
side, never an outline placed on the element aimed at. Its styles are prefixed
|
|
274
|
-
`ap-` and live inside the shadow root: they cannot reach the site, and the site
|
|
275
|
-
cannot reach them.
|
|
276
|
-
|
|
277
|
-
Its palette is its own and follows `prefers-color-scheme`: it reads neither the
|
|
278
|
-
variables nor the theme of the host site.
|
|
279
|
-
|
|
280
|
-
`textContent` everywhere, `innerHTML` nowhere: the text of a note is typed by a
|
|
281
|
-
human and is never interpreted as markup.
|
|
282
|
-
|
|
283
|
-
## The interface says "key", the format says "key"
|
|
284
|
-
|
|
285
|
-
Since 2.0.2 every string a person reads says **key** -- "The key of this
|
|
286
|
-
project is needed", "The project key (43 characters)". Cryptographically that
|
|
287
|
-
is what it is: 32 bytes of key material, from which HKDF derives the project
|
|
288
|
-
id, the AES-256-GCM key and the blind-index key. A key, by definition, is
|
|
289
|
-
public; this is the only secret there is, and the word invited people to treat
|
|
290
|
-
it as if it were not.
|
|
291
|
-
|
|
292
|
-
What did NOT change, deliberately: the label KEYS are still `key.title`,
|
|
293
|
-
`key.help` and so on -- renaming them would silently break every translation
|
|
294
|
-
file already written against them -- and `FORMAT.md`, the storage key
|
|
295
|
-
`annotepage/key/<project>`, and the MCP's `key` configuration field are
|
|
296
|
-
unchanged, because those are a format and a contract rather than prose.
|
|
297
|
-
|
|
298
|
-
## Translating, or changing a word
|
|
299
|
-
|
|
300
|
-
Every text shown is in `src/15-labels.js`, in a flat object, in English. Two
|
|
301
|
-
ways to replace them without touching the code, by priority:
|
|
62
|
+
Every text is in `src/15-labels.js`, a flat object, in English. Replace what
|
|
63
|
+
you like without touching the code:
|
|
302
64
|
|
|
303
65
|
```html
|
|
304
|
-
<!-- 1. an object, defined BEFORE the client -->
|
|
305
66
|
<script>window.Annotepage = { labels: { 'button.open': 'Annoter la page' } };</script>
|
|
306
|
-
<script src="https
|
|
307
|
-
|
|
308
|
-
<!-- 2. a neighbouring file, DECLARED on the tag -->
|
|
309
|
-
<script src="https://.../annotepage.js" data-labels="/local-labels.js" ... defer></script>
|
|
67
|
+
<script src="https://annotepage.com/annotepage-client-2.22.0.js" ... defer></script>
|
|
310
68
|
```
|
|
311
69
|
|
|
312
|
-
A missing label falls back on English
|
|
70
|
+
A missing label falls back on English, so a partial translation is usable. A
|
|
71
|
+
complete French set ships in the package, in `labels/fr.json`.
|
|
313
72
|
|
|
314
|
-
|
|
315
|
-
not a script, so it cannot be given to `data-labels` as it stands -- that
|
|
316
|
-
attribute loads a **script**. Either paste the object into the page:
|
|
73
|
+
## Key lost = notes lost
|
|
317
74
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
75
|
+
The notes are encrypted in the browser. The server stores sealed envelopes and
|
|
76
|
+
cannot read a path, a name or a remark — nor can whoever runs it. There is no
|
|
77
|
+
recovery and no escrow.
|
|
321
78
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
```js
|
|
325
|
-
// local-labels.js
|
|
326
|
-
window.Annotepage = window.Annotepage || {};
|
|
327
|
-
window.Annotepage.labels = { /* the contents of labels/fr.json */ };
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
The keys are the same in both files; only the values change. This tool does not
|
|
331
|
-
force English onto the reviewers of a French site.
|
|
332
|
-
|
|
333
|
-
## Building, checking, publishing
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
npm run build assembles dist/annotepage.js and prints its sha384 digest
|
|
337
|
-
npm test checks the derivations, the blind index and the envelope
|
|
338
|
-
npm publish
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
The build has **no dependency**: no bundler, no minifier. That is deliberate --
|
|
342
|
-
the file goes into somebody else's page, and the supply chain is the main risk
|
|
343
|
-
of this architecture. The file stays readable, and a digest is checked against
|
|
344
|
-
something one can read.
|
|
345
|
-
|
|
346
|
-
`npm test` cross-checks the format vectors against a second implementation of
|
|
347
|
-
HKDF-SHA-256 written by hand from RFC 5869. That is what guarantees that the
|
|
348
|
-
key is the input keying material and `annotepage/1` the HKDF salt, and not the
|
|
349
|
-
other way round: both "work", only one is the format. The PHP server and the
|
|
350
|
-
MCP package can copy these vectors to check that they speak the same format.
|
|
351
|
-
|
|
352
|
-
## What is in the package
|
|
353
|
-
|
|
354
|
-
```
|
|
355
|
-
dist/annotepage.js THE served file. Generated: do not edit it by hand
|
|
356
|
-
dist/HASHES.txt one sha384 digest per published version
|
|
357
|
-
labels/fr.json the complete French label set, as an example
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
The sources and the build tools are **not published**: what a page loads is the
|
|
361
|
-
one file above, and its digest is checked against it. They are in the
|
|
362
|
-
repository:
|
|
363
|
-
|
|
364
|
-
```
|
|
365
|
-
src/00-preamble.js reading the tag: server, project, scope, limits
|
|
366
|
-
src/10-utils.js labels, base64url, dates, versions
|
|
367
|
-
src/15-labels.js EVERY text shown, English by default
|
|
368
|
-
src/20-crypto.js key, HKDF, blind index, AES-256-GCM envelope
|
|
369
|
-
src/30-state.js state, browser memory, scope
|
|
370
|
-
src/40-api.js the calls, the refusals, what goes out encrypted or plain
|
|
371
|
-
src/50-anchors.js finding the element of a note, or calling it orphaned
|
|
372
|
-
src/60-ui.js all the DOM, inside the shadow root
|
|
373
|
-
src/70-setup.js the two screens that show or ask for the key
|
|
374
|
-
src/90-boot.js the order of ignition, and the silences
|
|
375
|
-
src/styles.css confined styles, inlined by the build
|
|
376
|
-
tools/build.mjs the assembly, and the SRI digest
|
|
377
|
-
tools/check.mjs the format vectors
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
The sources are not modules: they are the **sections** of one single file, put
|
|
381
|
-
end to end by the build inside one single scope. That is what makes it possible
|
|
382
|
-
to port the client from 1.2.0 without rewriting it.
|
|
383
|
-
|
|
384
|
-
## What it does not do
|
|
79
|
+
## What it does not touch
|
|
385
80
|
|
|
386
|
-
|
|
81
|
+
No cookie, no analytics, no third-party request. The interface lives in a
|
|
82
|
+
shadow root, so no rule of the site can reach it and no rule of the tool can
|
|
83
|
+
reach the site. Outside annotation mode the page is exactly the site's.
|
|
387
84
|
|
|
388
|
-
|
|
389
|
-
The project id is a bearer token: whoever has it can read and write. In
|
|
390
|
-
encrypted mode, what they read is useless without the key;
|
|
391
|
-
- **no moderation, and no deletion.** A note that is posted stays. The only
|
|
392
|
-
state it can change is "resolved", and that state can be taken back;
|
|
393
|
-
- **no key rotation.** There is no mechanism: a leaked key means starting
|
|
394
|
-
from a fresh project, abandoning the notes;
|
|
395
|
-
- **no channel for handing the key** to the second reviewer;
|
|
396
|
-
- **no masking of the length** of the remarks: the size of the envelope gives
|
|
397
|
-
it away to within a few bytes.
|
|
85
|
+
## The exchange format
|
|
398
86
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
key" buys.
|
|
87
|
+
[`FORMAT.md`](https://github.com/tuxo83/annotepage/blob/main/FORMAT.md) — the
|
|
88
|
+
envelope, the derivations, the blind index, the text export. It is the
|
|
89
|
+
reference; where any other file disagrees with it, it is right.
|
|
403
90
|
|
|
404
91
|
## Licence
|
|
405
92
|
|
|
406
|
-
MIT.
|
|
93
|
+
MIT. Source: [github.com/tuxo83/annotepage](https://github.com/tuxo83/annotepage)
|
package/dist/HASHES.txt
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
2.22.0 sha384-Iw9wfZ6d9e9+lE0pZQ3fSjkZ++f3qHdxQtLH4+d42SCEeiYmSzDD3Gbkw4SYjCZm 239022 bytes
|
|
2
|
+
2.21.0 sha384-somAD2fmEFshhHeIPtH2osNOi6CvkCHukXSYrGu1h0EHoJODDc9OFbSzvq2jfq57 236179 bytes
|
|
1
3
|
2.20.0 sha384-KVPw51MY5AnBF9Ef+lJB1kJd/pbv58Ml7k2wvkcj99S3b4HDtrzSP+SGk7I0ylRs 234888 bytes
|
|
2
4
|
2.19.0 sha384-hL/U4r8aaUu1kdUkQhtiSbd/fsMDxj7HFM9zV98zMLP/6gRiQArTQRi58hBbIzZr 233326 bytes
|
|
3
5
|
2.18.0 sha384-SwgUVo/IQit/fdJUFZQNpK/+ZHZUScHyghwV+LIo6dcomV3uvgpD0nogm5ZMY8dn 231364 bytes
|
package/dist/annotepage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
2
|
annotepage -- the annotation layer, browser side.
|
|
3
3
|
|
|
4
|
-
Package version : 2.
|
|
4
|
+
Package version : 2.22.0
|
|
5
5
|
Format version : 2 (see FORMAT.md)
|
|
6
6
|
Licence : MIT
|
|
7
7
|
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
/* Injected by the build: they come from package.json and from
|
|
17
17
|
src/styles.css, so that no value is written in two places and can
|
|
18
18
|
therefore diverge. */
|
|
19
|
-
const TOOL_VERSION = "2.
|
|
19
|
+
const TOOL_VERSION = "2.22.0";
|
|
20
20
|
const FORMAT = 2;
|
|
21
|
-
const STYLES = "/* ============================================================================\n styles.css -- THE STYLES OF THE TOOL, AND OF NO OTHER ELEMENT.\n\n This sheet is INLINED into the served file by the build, then put into the\n tool's shadow root -- as a constructed sheet when the browser can do it, in\n a <style> otherwise. It was loaded by a <link> in the original tool; the\n move to a CDN under SRI brought it inside the file, so that there is only\n one digest to keep up to date. The containment itself has not changed, and\n is still twofold:\n\n - from the tool towards the site: no rule from here can reach an element\n of the host site, the browser sees to that. That is what makes the\n claim \"the layer touches nothing\" checkable rather than promised;\n - from the site towards the tool: no rule of the site can reach an\n element here. A redesign of the site's stylesheet therefore cannot\n distort the tool, nor the other way round.\n\n The \"ap-\" prefix on every class is the third safeguard: the day somebody\n loads these styles WITHOUT a shadow root -- by mistake, or to debug --\n nothing would answer a selector of the site.\n\n NO RULE TARGETS html, body, * OR ANY SELECTOR OF THE SITE. That is the one\n absolute prohibition of this file.\n\n COLOURS: the tool has its OWN palette, defined on the shadow root. It\n reads neither the site's variables nor its theme attribute: it has no\n reason to know how the site names its colours, and it must stay readable\n on a light site as on a dark one. The switch follows the system\n preference, the only information the tool has without asking anyone.\n ============================================================================ */\n\n\n:host {\n --ap-bg: #ffffff;\n --ap-bg-soft: #f4f6f8;\n --ap-bg-raised: #e9edf2;\n --ap-text: #1a1d21;\n --ap-text-soft: #5b6570;\n --ap-border: #d5dbe2;\n --ap-accent: #2f6fed;\n --ap-accent-dark: #1d55c8;\n --ap-accent-text: #ffffff;\n --ap-accent-veil: rgba(47, 111, 237, 0.14);\n --ap-alert-bg: #fdeceb;\n --ap-alert-border: #e3a9a4;\n --ap-alert-text: #8a1f16;\n /* THE TWO STATES A REMARK CAN BE IN ONCE IT IS ANSWERED, as tokens rather\n than as literals. They were literals, written once inside the card's\n state mark -- which meant the dark theme drew them at the LIGHT theme's\n ink: measured, 2.42:1 for \"resolved\" and 2.02:1 against the veil they\n sit on, where WCAG 1.4.3 asks 4.5. Below they are 4.68 and 5.23 in the\n light theme, 6.43 and 6.64 in the dark one, on the same composite.\n\n `pending` is the state that must never be mistaken for done: resolved,\n but not deployed -- the defect is still on the reader's screen. `fill`\n is the same colour asked to carry --ap-accent-text on top of it, for the\n badge on the page: 5.93:1 in light, 10.14:1 in dark. */\n --ap-done-ink: #0f7a52;\n --ap-done-veil: rgba(16, 185, 129, 0.14);\n --ap-pending-ink: #8a5a00;\n --ap-pending-veil: rgba(245, 158, 11, 0.16);\n --ap-pending-fill: #8a5a00;\n --ap-shadow: 0 6px 24px rgba(16, 24, 40, 0.18);\n --ap-radius: 10px;\n --ap-font: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\",\n Arial, sans-serif;\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --ap-bg: #1d2126;\n --ap-bg-soft: #262b32;\n --ap-bg-raised: #323942;\n --ap-text: #e9ecf0;\n --ap-text-soft: #a4adb8;\n --ap-border: #3a424c;\n --ap-accent: #6d9bff;\n --ap-accent-dark: #8fb4ff;\n --ap-accent-text: #10151c;\n --ap-accent-veil: rgba(109, 155, 255, 0.18);\n --ap-alert-bg: #3a1f1c;\n --ap-alert-border: #7c3a33;\n --ap-alert-text: #ffb9b1;\n --ap-done-ink: #56d3a0;\n --ap-done-veil: rgba(16, 185, 129, 0.18);\n --ap-pending-ink: #f0b757;\n --ap-pending-veil: rgba(245, 158, 11, 0.16);\n --ap-pending-fill: #f0b757;\n --ap-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);\n }\n}\n\n/* ----------------------------------------------------------------------------\n The layer.\n\n It covers the viewport and receives NO click: that is what lets the page\n behave exactly as usual as long as the tool is not in annotation mode.\n Each widget re-enables clicks for itself alone.\n ---------------------------------------------------------------------------- */\n\n.ap-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n font-family: var(--ap-font);\n font-size: 14px;\n line-height: 1.45;\n color: var(--ap-text);\n text-align: left;\n -webkit-font-smoothing: antialiased;\n}\n\n.ap-layer button,\n.ap-layer input,\n.ap-layer textarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* ----------------------------------------------------------------------------\n The button: the only thing visible when the tool is at rest.\n ---------------------------------------------------------------------------- */\n\n.ap-button {\n position: fixed;\n right: 16px;\n bottom: 16px;\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 9px 14px;\n border: 1px solid var(--ap-border);\n border-radius: 999px;\n background: var(--ap-bg);\n color: var(--ap-text);\n box-shadow: var(--ap-shadow);\n cursor: pointer;\n pointer-events: auto;\n opacity: 0.92;\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n\n.ap-button:hover,\n.ap-button:focus-visible {\n opacity: 1;\n transform: translateY(-1px);\n}\n\n.ap-button:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n.ap-button[aria-pressed=\"true\"] {\n background: var(--ap-accent);\n border-color: var(--ap-accent);\n color: var(--ap-accent-text);\n opacity: 1;\n}\n\n.ap-button-dot {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ap-accent);\n flex: none;\n}\n\n.ap-button[aria-pressed=\"true\"] .ap-button-dot {\n background: var(--ap-accent-text);\n}\n\n.ap-button-count {\n padding: 1px 7px;\n border-radius: 999px;\n background: var(--ap-bg-raised);\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-button[aria-pressed=\"true\"] .ap-button-count {\n background: rgba(255, 255, 255, 0.22);\n color: var(--ap-accent-text);\n}\n\n/* ----------------------------------------------------------------------------\n The pointing highlight.\n\n It is DRAWN HERE, from the coordinates of the element being pointed at.\n Nothing is put on the element itself: no class, no attribute, no style. So\n the site cannot move by a single pixel because of the pointing.\n ---------------------------------------------------------------------------- */\n\n.ap-highlight {\n position: fixed;\n border: 2px solid var(--ap-accent);\n border-radius: 3px;\n background: var(--ap-accent-veil);\n pointer-events: none;\n display: none;\n}\n\n.ap-highlight-label {\n position: fixed;\n max-width: 320px;\n padding: 4px 8px;\n border-radius: 6px;\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none;\n display: none;\n box-shadow: var(--ap-shadow);\n}\n\n/* ----------------------------------------------------------------------------\n The markers: \"there are already notes here\".\n ---------------------------------------------------------------------------- */\n\n.ap-marker {\n position: fixed;\n min-width: 22px;\n height: 22px;\n padding: 0 6px;\n border: 2px solid var(--ap-bg);\n border-radius: 999px;\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-size: 12px;\n font-weight: 700;\n line-height: 18px;\n text-align: center;\n cursor: pointer;\n pointer-events: auto;\n box-shadow: var(--ap-shadow);\n}\n\n/* THE STATE, IN THE BADGE ITSELF. The rule above is the OPEN state -- work to\n do -- and it stays the tool's accent, because that is what a badge on a page\n has always meant here. The other two are read against it:\n\n pending filled amber. Resolved, not deployed: the defect is still on the\n screen the reader is looking at, and it is the one state worth\n catching an eye that was not looking for it.\n done hollow, in the soft ink. History: there, countable, and not\n asking for anything.\n\n THE COLOUR IS NEVER ALONE. The count is written in the badge and the state\n is spelled out in its accessible name -- a badge that said \"still to fix\"\n by hue only would say nothing at all to a good part of its readers. */\n.ap-marker-pending {\n background: var(--ap-pending-fill);\n}\n.ap-marker-done {\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-weight: 600;\n /* The 2px border is the halo against the page and cannot be spent on the\n outline, so the outline is drawn inside. */\n box-shadow: var(--ap-shadow), inset 0 0 0 1px var(--ap-border);\n}\n\n.ap-marker:focus-visible {\n outline: 2px solid var(--ap-accent-dark);\n outline-offset: 2px;\n}\n\n/* ----------------------------------------------------------------------------\n The panel.\n ---------------------------------------------------------------------------- */\n\n.ap-panel {\n position: fixed;\n top: 12px;\n right: 12px;\n bottom: 72px;\n width: 360px;\n max-width: calc(100vw - 24px);\n display: none;\n flex-direction: column;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n box-shadow: var(--ap-shadow);\n pointer-events: auto;\n overflow: hidden;\n}\n\n.ap-panel.ap-open {\n display: flex;\n}\n\n/* The other side. Two positions, right and left, and no third one: in\n annotation mode the layer takes every click, so every pixel of panel is a\n pixel of page that can no longer be pointed at. A floating panel would\n only move that loss around.\n\n \"bottom\" IS NOT REDECLARED, on purpose: the panel keeps the same 72 px of\n clearance above the floating button either way, and that clearance is the\n same on both sides because the button moves WITH it.\n\n AND THE BUTTON MOVES WITH IT, which was decided the other way first. The\n argument for leaving it was that it is the tool's only visible trace at\n rest, so an anchor that moved would stop being one. The owner's answer,\n and it is the better one: \"move left\" is asked of the TOOL, not of half of\n it. A panel on one edge and the control that opens it on the other makes\n the eye cross the whole window for one gesture, and somebody who set the\n side set it for the tool.\n\n TWO THINGS THIS RULE DEPENDS ON, both fragile:\n - it is written with ONE class, so it weighs exactly what \".ap-panel\"\n weighs;\n - it is written BEFORE the narrow block below.\n Reverse either and it wins under 560 px, where the panel is a bottom band\n spanning the width -- and a panel pinned to the left there is the full-\n height panel whose defect at 375 px is described in that block. */\n.ap-left {\n right: auto;\n left: 12px;\n}\n/* The button follows, and it is put on the LAYER and not on the panel: the\n button is not inside the panel, so the side has to be readable from a\n common ancestor. Same offset mirrored, same bottom -- only the edge\n changes. */\n.ap-layer.ap-left-side .ap-button {\n right: auto;\n left: 16px;\n}\n\n.ap-panel-header {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 12px 14px;\n border-bottom: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n}\n\n.ap-panel-title {\n font-size: 15px;\n font-weight: 600;\n flex: 1 1 auto;\n}\n\n/* -- what the whole project holds ---------------------------------------\n THE FIRST LINE OF THE FOOTER, on its own row. The footer is a flex row of\n short things -- a name, two buttons -- so this takes the whole width and the\n rest wraps under it. No ground and no border of its own: it is IN the footer,\n not beside it. */\n.ap-panel-footer { flex-wrap: wrap; }\n\n/* WHO YOU ARE SIGNING AS, ON A LINE OF ITS OWN. `flex-basis: 100%` is the same\n device the block above uses, and for the same reason: the footer is one\n wrapping row and everything in it was being strung end to end. */\n.ap-foot-who {\n flex-basis: 100%;\n display: flex; align-items: baseline; gap: 8px;\n}\n\n/* -- the list of remarks -------------------------------------------------\n A ROW, AND EVERY ROW IS A BUTTON. Not a card with a link in it: the whole\n line is the target, which is what a list of things to open should be, and it\n is reachable with a keyboard for free.\n\n THE EXCERPT TAKES THE ROOM AND FOLDS TO ONE LINE. What a remark is about can\n be a paragraph; what a list can show is a line. The author keeps a fixed\n place at the end so the eye can run down it. */\n.ap-row {\n display: flex; align-items: baseline; gap: 8px;\n width: 100%; margin: 0 0 4px; padding: 8px 10px;\n border: 1px solid var(--ap-border); border-radius: 8px;\n background: var(--ap-bg); color: var(--ap-text);\n font: inherit; text-align: left; cursor: pointer;\n transition: border-color .15s ease, background-color .15s ease;\n}\n.ap-row:hover { background: var(--ap-bg-soft); border-color: var(--ap-accent); }\n.ap-row:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 2px; }\n.ap-row-about {\n flex: 1; min-width: 0;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n}\n.ap-row-who { flex: none; font-size: 12px; color: var(--ap-text-soft); }\n/* THE STATE, AS A DOT. Three of them, and the middle one is the one that must\n not read as done: resolved but not deployed is a defect still on screen. The\n accessible name spells all three out -- a colour is not a fact for\n everybody. */\n.ap-row-dot {\n flex: none; width: 8px; height: 8px; border-radius: 999px;\n background: var(--ap-accent); align-self: center;\n}\n.ap-row-pending .ap-row-dot { background: var(--ap-text-soft); }\n.ap-row-done .ap-row-dot { background: transparent; border: 1px solid var(--ap-border); }\n.ap-row-done .ap-row-about { color: var(--ap-text-soft); }\n@media (prefers-reduced-motion: reduce) { .ap-row { transition: none; } }\n\n/* -- a window that is not the panel --------------------------------------\n IT FLOATS OVER THE PAGE, and that is the point: the panel is a band down one\n edge, and what goes in here is not about the page beside it. Fixed rather\n than absolute -- the reader scrolls the page under it, and a window that\n scrolled away with the article would have to be chased.\n\n ABOVE THE PANEL AND BELOW NOTHING. It is opened from the panel's footer, so\n it must cover it; the tool's own layer already sits above the site.\n\n WIDTH: it is read, not filled in. 26rem is a paragraph, and min() keeps it\n inside a phone without a media query. */\n.ap-pop {\n position: fixed; z-index: 3;\n /* THE LAYER IS `pointer-events: none` so the site underneath keeps working,\n and every piece that must be reachable turns it back on. Without this\n line the window is a picture: no click on its buttons, and no drag on its\n bar -- which is exactly how it behaved when first measured. */\n pointer-events: auto;\n width: min(26rem, calc(100vw - 24px));\n max-height: calc(100vh - 24px);\n display: flex; flex-direction: column;\n border: 1px solid var(--ap-border); border-radius: 12px;\n background: var(--ap-bg); color: var(--ap-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, .22);\n overflow: hidden;\n}\n/* THE HANDLE. `touch-action: none` is what makes a finger drag the window\n instead of scrolling the page under it -- without it the browser claims the\n gesture before the first pointermove arrives. */\n.ap-pop-bar {\n display: flex; align-items: center; gap: 8px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n cursor: grab; touch-action: none; user-select: none;\n}\n.ap-pop-moving .ap-pop-bar { cursor: grabbing; }\n.ap-pop-title { flex: 1; font-size: 13px; font-weight: 650; }\n/* `min-height: 0` is what makes the scroll happen INSIDE the window rather\n than the window growing past its own height: a flex item does not shrink\n below its content without it, and the end of a long remark would be behind\n the bottom edge with nothing to scroll. */\n.ap-pop-body { flex: 1 1 auto; min-height: 0; padding: 12px; overflow: auto; }\n/* THE CORNER, AND IT IS DRAWN RATHER THAN LEFT TO THE BROWSER. `resize: both`\n would have done this in one line and does nothing under a finger on iOS; the\n window is moved with pointer events for exactly that reason, and it is\n resized with them too. Two hairlines, the shape everybody already reads as a\n grip, in the same ink as the borders around it. */\n.ap-pop-grip {\n position: absolute; right: 0; bottom: 0;\n width: 18px; height: 18px;\n cursor: nwse-resize; touch-action: none;\n background:\n linear-gradient(135deg, transparent 42%, var(--ap-border) 42%,\n var(--ap-border) 54%, transparent 54%),\n linear-gradient(135deg, transparent 66%, var(--ap-border) 66%,\n var(--ap-border) 78%, transparent 78%);\n}\n.ap-pop-sizing { user-select: none; }\n.ap-pop-sizing .ap-pop-grip { cursor: nwse-resize; }\n/* Inside a window, the block is the window: no second frame around it. */\n.ap-pop-body .ap-config { margin: 0; padding: 0; border: 0; background: none; }\n.ap-pop-body .ap-forget { margin: 0; }\n.ap-pop-body .ap-panel-stats { margin: 0; }\n/* A WINDOW HAS ROOM, SO THE FILE GETS IT. In the panel this field was two or\n four lines because the column had nothing to spare; here it can show the\n whole thing without being scrolled. */\n.ap-pop-body .ap-code { min-height: 9.5em; }\n\n/* -- the file the assistant needs ---------------------------------------\n Drawn like the other block the panel opens in its body -- a title, a\n sentence, the thing itself, two buttons -- so nothing here is a new shape to\n learn. The last line is the warning, and it is a line and not a dialog: the\n reviewer asked for this file. */\n.ap-config {\n margin: 10px 0 0; padding: 12px;\n border: 1px solid var(--ap-border); border-radius: 10px;\n background: var(--ap-bg-soft);\n}\n/* The warning is a line at the tool's own soft ink, not in an alert colour:\n the reviewer asked for this file, they are not being warned off it. There is\n no --ap-warn token and this does not invent one. */\n.ap-config .ap-warn { margin-top: 10px; }\n.ap-panel-stats {\n flex-basis: 100%;\n display: flex; flex-wrap: wrap; gap: 4px 18px;\n margin-bottom: 4px;\n}\n.ap-stat { display: inline-flex; align-items: baseline; gap: 5px; }\n/* The row says what it counts, once, and the three figures follow it. Without\n it, \"3 / 2 / 1\" beside a panel about one page reads as being about that\n page. */\n.ap-stat-label {\n flex-basis: 100%; margin-bottom: 2px;\n font-size: 11px; font-weight: 650; letter-spacing: .02em;\n text-transform: uppercase; color: var(--ap-text-soft);\n}\n.ap-stat-n { font-size: 15px; font-weight: 650; color: var(--ap-text); }\n.ap-stat-w { font-size: 12px; color: var(--ap-text-soft); }\n.ap-panel-instructions {\n padding: 10px 14px;\n border-bottom: 1px solid var(--ap-border);\n color: var(--ap-text-soft);\n font-size: 13px;\n}\n\n.ap-panel-body {\n flex: 1 1 auto;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 4px 14px 14px;\n}\n\n.ap-panel-footer {\n padding: 8px 14px;\n border-top: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ap-section-title {\n margin: 14px 0 6px;\n color: var(--ap-text-soft);\n font-size: 12px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.ap-section-help {\n margin: 0 0 8px;\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-empty {\n margin: 16px 0;\n color: var(--ap-text-soft);\n}\n\n/* ----------------------------------------------------------------------------\n THE MODE BADGE: one word, drawn in both modes, at the top of every draw.\n\n It replaced a paragraph that only the public mode ever drew. Two things\n were wrong with that: secure mode said nothing, so the panel never told a\n reviewer which of the two they were in; and a paragraph pinned to the top\n for ever is skipped after the second reading, while a single word is not.\n\n IT IS NOT A BUTTON AND MUST NOT LOOK LIKE ONE. No shadow, no pressed\n state, cursor stays default: there is nothing to press. What it does have\n is a focus ring, because it takes focus -- the description below has to be\n reachable without a pointer, and that is the only reason it is focusable.\n ---------------------------------------------------------------------------- */\n\n.ap-mode {\n /* The frame the description is positioned against. It spans the width of\n the panel body, so a description pinned to its two edges cannot spill\n sideways out of a body that scrolls -- and a scrolling body clips both\n axes, not just the one it scrolls. */\n position: relative;\n margin: 4px 0 10px;\n}\n\n.ap-mode-chip {\n display: inline-block;\n padding: 2px 9px 3px;\n border: 1px solid var(--ap-border);\n border-radius: 999px;\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n cursor: default;\n}\n\n/* The public badge is the one that carries a consequence, so it is the one\n that is coloured -- in the tool's own accent, not in the alert colours: a\n public key is a choice somebody made on purpose, not an incident. Secure\n keeps the quiet frame: it is the case where nothing is being said. */\n/* The same ring as every other focusable thing in the panel. It is the only\n visual proof, for somebody arriving by Tab, that this word is where their\n focus went. */\n.ap-mode-chip:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n.ap-mode-public .ap-mode-chip {\n border-color: var(--ap-accent);\n background: var(--ap-accent-veil);\n color: var(--ap-accent-dark);\n}\n\n/* The description. Hidden by DEFAULT and shown on demand, and hidden in a way\n that leaves it readable to a screen reader: it is the badge's\n aria-describedby target, and an accessible description is computed from the\n referenced element whether or not it is painted. It is taken out of the\n layout entirely (absolute) so that showing it moves not one pixel of the\n list underneath -- a tooltip that pushes the notes down is a tooltip that\n makes people lose their place. */\n.ap-mode-tip {\n position: absolute;\n z-index: 2;\n top: calc(100% + 6px);\n left: 0;\n right: 0;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg-raised);\n color: var(--ap-text);\n box-shadow: var(--ap-shadow);\n font-size: 12px;\n font-weight: 400;\n letter-spacing: normal;\n text-transform: none;\n line-height: 1.45;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-3px);\n transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;\n pointer-events: none;\n}\n\n/* BOTH, and the keyboard one is not the afterthought: :focus-visible is what\n makes the sentence reachable by somebody who never touches a pointer. */\n.ap-mode-chip:hover ~ .ap-mode-tip,\n.ap-mode-chip:focus-visible ~ .ap-mode-tip {\n opacity: 1;\n visibility: visible;\n transform: none;\n transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ap-mode-tip {\n transform: none;\n transition: none;\n }\n .ap-mode-chip:hover ~ .ap-mode-tip,\n .ap-mode-chip:focus-visible ~ .ap-mode-tip {\n transition: none;\n }\n}\n\n/* The \"a newer client exists\" line and the \"this server speaks another\n format\" line are the same object on screen: a standing statement about what\n one is looking at, above the notes and above the failures. One rule, so\n they cannot drift apart -- and the second one joins it rather than\n inventing a colour, precisely because a protocol disagreement is a fact\n about the project, not an incident.\n\n Deliberately NOT the alert colours: neither is a failure, and an alarm that\n never goes away stops being read. */\n.ap-upgrade,\n.ap-format {\n margin: 0 0 10px;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 12px;\n line-height: 1.45;\n}\n\n/* ----------------------------------------------------------------------------\n A note, and its replies.\n ---------------------------------------------------------------------------- */\n\n.ap-note {\n margin: 8px 0;\n padding: 10px 12px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n}\n\n.ap-note.ap-orphan {\n background: var(--ap-bg-soft);\n}\n\n\n.ap-note-header {\n display: flex;\n align-items: baseline;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-note-author {\n font-weight: 600;\n}\n\n.ap-note-date {\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-note-target {\n margin: 4px 0 0;\n color: var(--ap-text-soft);\n font-size: 12px;\n font-style: italic;\n overflow-wrap: anywhere;\n}\n\n.ap-note-text {\n margin: 6px 0 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.ap-note-actions {\n margin-top: 8px;\n display: flex;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-replies {\n margin: 8px 0 0;\n padding-left: 10px;\n border-left: 2px solid var(--ap-border);\n}\n\n.ap-reply {\n margin: 8px 0 0;\n}\n\n/* ----------------------------------------------------------------------------\n The form, anchored near the element pointed at.\n ---------------------------------------------------------------------------- */\n\n.ap-form {\n position: fixed;\n width: 340px;\n max-width: calc(100vw - 24px);\n display: none;\n flex-direction: column;\n gap: 8px;\n padding: 14px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n box-shadow: var(--ap-shadow);\n pointer-events: auto;\n}\n\n.ap-form.ap-open {\n display: flex;\n}\n\n.ap-form-title {\n font-size: 15px;\n font-weight: 600;\n}\n\n.ap-form-target {\n color: var(--ap-text-soft);\n font-size: 12px;\n font-style: italic;\n overflow-wrap: anywhere;\n}\n\n.ap-label {\n display: block;\n margin-bottom: 3px;\n font-size: 12px;\n font-weight: 600;\n color: var(--ap-text-soft);\n}\n\n.ap-help {\n margin: 3px 0 0;\n font-size: 12px;\n color: var(--ap-text-soft);\n}\n\n.ap-field,\n.ap-area {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 8px;\n background: var(--ap-bg-soft);\n color: var(--ap-text);\n}\n\n.ap-field:focus,\n.ap-area:focus {\n outline: 2px solid var(--ap-accent);\n outline-offset: 1px;\n}\n\n.ap-area {\n min-height: 92px;\n resize: vertical;\n}\n\n.ap-actions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-counter {\n margin-left: auto;\n font-size: 12px;\n color: var(--ap-text-soft);\n}\n\n/* ----------------------------------------------------------------------------\n Buttons.\n ---------------------------------------------------------------------------- */\n\n.ap-primary,\n.ap-secondary,\n.ap-link {\n border-radius: 8px;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ap-primary {\n padding: 8px 14px;\n border: 1px solid var(--ap-accent);\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-weight: 600;\n}\n\n.ap-primary:hover {\n background: var(--ap-accent-dark);\n border-color: var(--ap-accent-dark);\n}\n\n.ap-secondary {\n padding: 8px 14px;\n border: 1px solid var(--ap-border);\n background: var(--ap-bg);\n color: var(--ap-text);\n}\n\n.ap-secondary:hover {\n background: var(--ap-bg-raised);\n}\n\n.ap-link {\n padding: 2px 4px;\n border: 0;\n background: none;\n color: var(--ap-accent);\n text-decoration: underline;\n font-size: 13px;\n}\n\n.ap-primary:disabled,\n.ap-secondary:disabled,\n.ap-link:disabled {\n opacity: 0.6;\n cursor: default;\n}\n\n.ap-primary:focus-visible,\n.ap-secondary:focus-visible,\n.ap-link:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n/* ----------------------------------------------------------------------------\n The failures.\n\n They are RED, at the top of the block concerned, and carry the message the\n server returned as it stands: that is how a non-technical team learns that\n its remark is not saved, instead of believing it is.\n ---------------------------------------------------------------------------- */\n\n.ap-error {\n margin: 8px 0;\n padding: 10px 12px;\n border: 1px solid var(--ap-alert-border);\n border-radius: var(--ap-radius);\n background: var(--ap-alert-bg);\n color: var(--ap-alert-text);\n}\n\n.ap-error-title {\n font-weight: 700;\n margin-bottom: 4px;\n}\n\n.ap-error-detail {\n margin: 6px 0 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-size: 13px;\n}\n\n.ap-error .ap-link {\n color: var(--ap-alert-text);\n}\n\n/* ----------------------------------------------------------------------------\n Narrow: the panel takes the full width, and so does the form.\n ---------------------------------------------------------------------------- */\n\n/* ----------------------------------------------------------------------------\n Narrow.\n\n DEFECT OBSERVED at 375 px wide: a panel taking the full height covers the\n whole page, and no element can be pointed at any more -- every click lands\n on the panel. So it becomes a bottom band, which leaves the top half of\n the viewport free; one scrolls the page there to bring the wanted element\n into view. The form, for its part, hides the panel while typing (see\n notes.js): on a screen that size, writing and reading the list at the same\n time does not hold.\n ---------------------------------------------------------------------------- */\n\n/* On a narrow screen the panel becomes a bottom band and the form takes the\n full width.\n\n THE WIDTH CEILING IS KEPT, and it comes from a measured defect: \"left: 8;\n right: 8\" sizes the element against its CONTAINING BLOCK, which the host\n site's horizontal overflow can make wider than the visible window.\n Measured, in mobile emulation at 390 px: the site overflows to 407 px\n (with the tool and without it), and the panel came out 391 px wide\n starting at 8, that is 9 px off screen. \"100vw\" is the window, not the\n containing block: the ceiling therefore does nothing when the site does\n not overflow, and pulls the width back when it does. */\n@media (max-width: 560px) {\n .ap-panel {\n top: auto;\n right: 8px;\n left: 8px;\n bottom: 66px;\n height: 52vh;\n width: auto;\n max-width: calc(100vw - 16px);\n }\n\n /* A band spanning the width has no side, so the choice is inert here and\n the button says so by not being there. Offering a control that visibly\n does nothing is worse than offering none. The stored side is untouched:\n it is waiting for the wide screen it was chosen on. */\n .ap-side-toggle {\n display: none;\n }\n\n .ap-form {\n left: 8px;\n right: 8px;\n width: auto;\n max-width: calc(100vw - 16px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ap-button {\n transition: none;\n }\n}\n\n/* The failure shows without opening the panel: the button's dot changes\n colour. A team that does not click must be able to see that something is\n wrong. */\n.ap-button.ap-failed .ap-button-dot {\n background: var(--ap-alert-text);\n}\n\n.ap-button.ap-failed {\n border-color: var(--ap-alert-border);\n}\n\n/* Signature reminder, in the note form.\n The name was shown at the foot of the panel only: invisible at the moment\n one writes. A user reported not knowing which name they were writing\n under. */\n.ap-form-signature {\n display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;\n margin: 0 0 .6rem; font-size: .85rem; opacity: .8;\n}\n\n/* Resolution state, said on the card.\n Two cases NOT to be confused: resolved and online, resolved but not\n deployed yet. The second keeps the defect on the reviewer's screen; hiding\n it or announcing it as fixed would cost them their trust in the tool. */\n.ap-state-mark {\n display: inline-block; margin: 0 0 .5rem;\n padding: .15rem .55rem; border-radius: 4px;\n font-size: .75rem; font-weight: 600; letter-spacing: .02em;\n}\n.ap-note.ap-resolved { opacity: .72; }\n.ap-note.ap-resolved .ap-state-mark {\n color: var(--ap-done-ink); background: var(--ap-done-veil);\n}\n.ap-note.ap-resolved-pending .ap-state-mark {\n color: var(--ap-pending-ink); background: var(--ap-pending-veil);\n}\n/* The \"it is fixed\" / \"reopen\" block, opened under the card. Same shape as\n the reply block: it is the same gesture, one answers a remark. */\n.ap-resolve,\n.ap-reply-form {\n margin-top: .6rem;\n padding-top: .6rem;\n border-top: 1px solid var(--ap-border);\n}\n\n/* The question asked before the key is dropped, at the foot of the list.\n Framed like the resolution block -- it is the same shape of gesture, one\n answers before something changes -- and set apart from the notes above it,\n because it is not about a note. */\n.ap-forget {\n margin-top: 1rem;\n padding-top: .6rem;\n border-top: 1px solid var(--ap-border);\n}\n\n.ap-forget .ap-actions {\n margin-top: .5rem;\n}\n\n.ap-history-toggle {\n display: block; width: 100%; margin: 1rem 0 .25rem;\n padding: .5rem .75rem; border: 1px dashed currentColor; border-radius: 6px;\n background: none; color: inherit; font: inherit; opacity: .7; cursor: pointer;\n}\n.ap-history-toggle:hover { opacity: 1; }\n\n\n/* ----------------------------------------------------------------------------\n Setup and pasting the salt.\n\n These are the only screens where something is copied by hand. Everything\n there is SELECTABLE and monospaced: a 43-character salt copied wrong\n cannot be recovered, and nothing helps less than a font that confuses I, l\n and 1.\n ---------------------------------------------------------------------------- */\n\n.ap-panel-wide {\n width: 560px;\n}\n\n.ap-copy {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n margin: 0 0 12px;\n}\n\n.ap-code {\n flex: 1 1 auto;\n width: 100%;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 8px;\n background: var(--ap-bg-soft);\n color: var(--ap-text);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\",\n monospace;\n font-size: 12.5px;\n line-height: 1.5;\n resize: vertical;\n white-space: pre;\n overflow-x: auto;\n}\n\n.ap-code:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 1px;\n}\n\n@media (max-width: 560px) {\n .ap-panel-wide {\n width: auto;\n }\n\n .ap-copy {\n flex-direction: column;\n }\n}\n";
|
|
21
|
+
const STYLES = "/* ============================================================================\n styles.css -- THE STYLES OF THE TOOL, AND OF NO OTHER ELEMENT.\n\n This sheet is INLINED into the served file by the build, then put into the\n tool's shadow root -- as a constructed sheet when the browser can do it, in\n a <style> otherwise. It was loaded by a <link> in the original tool; the\n move to a CDN under SRI brought it inside the file, so that there is only\n one digest to keep up to date. The containment itself has not changed, and\n is still twofold:\n\n - from the tool towards the site: no rule from here can reach an element\n of the host site, the browser sees to that. That is what makes the\n claim \"the layer touches nothing\" checkable rather than promised;\n - from the site towards the tool: no rule of the site can reach an\n element here. A redesign of the site's stylesheet therefore cannot\n distort the tool, nor the other way round.\n\n The \"ap-\" prefix on every class is the third safeguard: the day somebody\n loads these styles WITHOUT a shadow root -- by mistake, or to debug --\n nothing would answer a selector of the site.\n\n NO RULE TARGETS html, body, * OR ANY SELECTOR OF THE SITE. That is the one\n absolute prohibition of this file.\n\n COLOURS: the tool has its OWN palette, defined on the shadow root. It\n reads neither the site's variables nor its theme attribute: it has no\n reason to know how the site names its colours, and it must stay readable\n on a light site as on a dark one. The switch follows the system\n preference, the only information the tool has without asking anyone.\n ============================================================================ */\n\n\n:host {\n --ap-bg: #ffffff;\n --ap-bg-soft: #f4f6f8;\n --ap-bg-raised: #e9edf2;\n --ap-text: #1a1d21;\n --ap-text-soft: #5b6570;\n --ap-border: #d5dbe2;\n --ap-accent: #2f6fed;\n --ap-accent-dark: #1d55c8;\n --ap-accent-text: #ffffff;\n --ap-accent-veil: rgba(47, 111, 237, 0.14);\n --ap-alert-bg: #fdeceb;\n --ap-alert-border: #e3a9a4;\n --ap-alert-text: #8a1f16;\n /* THE TWO STATES A REMARK CAN BE IN ONCE IT IS ANSWERED, as tokens rather\n than as literals. They were literals, written once inside the card's\n state mark -- which meant the dark theme drew them at the LIGHT theme's\n ink: measured, 2.42:1 for \"resolved\" and 2.02:1 against the veil they\n sit on, where WCAG 1.4.3 asks 4.5. Below they are 4.68 and 5.23 in the\n light theme, 6.43 and 6.64 in the dark one, on the same composite.\n\n `pending` is the state that must never be mistaken for done: resolved,\n but not deployed -- the defect is still on the reader's screen. `fill`\n is the same colour asked to carry --ap-accent-text on top of it, for the\n badge on the page: 5.93:1 in light, 10.14:1 in dark. */\n --ap-done-ink: #0f7a52;\n --ap-done-veil: rgba(16, 185, 129, 0.14);\n --ap-pending-ink: #8a5a00;\n --ap-pending-veil: rgba(245, 158, 11, 0.16);\n --ap-pending-fill: #8a5a00;\n --ap-shadow: 0 6px 24px rgba(16, 24, 40, 0.18);\n --ap-radius: 10px;\n --ap-font: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\",\n Arial, sans-serif;\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --ap-bg: #1d2126;\n --ap-bg-soft: #262b32;\n --ap-bg-raised: #323942;\n --ap-text: #e9ecf0;\n --ap-text-soft: #a4adb8;\n --ap-border: #3a424c;\n --ap-accent: #6d9bff;\n --ap-accent-dark: #8fb4ff;\n --ap-accent-text: #10151c;\n --ap-accent-veil: rgba(109, 155, 255, 0.18);\n --ap-alert-bg: #3a1f1c;\n --ap-alert-border: #7c3a33;\n --ap-alert-text: #ffb9b1;\n --ap-done-ink: #56d3a0;\n --ap-done-veil: rgba(16, 185, 129, 0.18);\n --ap-pending-ink: #f0b757;\n --ap-pending-veil: rgba(245, 158, 11, 0.16);\n --ap-pending-fill: #f0b757;\n --ap-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);\n }\n}\n\n/* ----------------------------------------------------------------------------\n The layer.\n\n It covers the viewport and receives NO click: that is what lets the page\n behave exactly as usual as long as the tool is not in annotation mode.\n Each widget re-enables clicks for itself alone.\n ---------------------------------------------------------------------------- */\n\n.ap-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n font-family: var(--ap-font);\n font-size: 14px;\n line-height: 1.45;\n color: var(--ap-text);\n text-align: left;\n -webkit-font-smoothing: antialiased;\n}\n\n.ap-layer button,\n.ap-layer input,\n.ap-layer textarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* ----------------------------------------------------------------------------\n The button: the only thing visible when the tool is at rest.\n ---------------------------------------------------------------------------- */\n\n.ap-button {\n position: fixed;\n right: 16px;\n bottom: 16px;\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 9px 14px;\n border: 1px solid var(--ap-border);\n border-radius: 999px;\n background: var(--ap-bg);\n color: var(--ap-text);\n box-shadow: var(--ap-shadow);\n cursor: pointer;\n pointer-events: auto;\n opacity: 0.92;\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n\n.ap-button:hover,\n.ap-button:focus-visible {\n opacity: 1;\n transform: translateY(-1px);\n}\n\n.ap-button:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n.ap-button[aria-pressed=\"true\"] {\n background: var(--ap-accent);\n border-color: var(--ap-accent);\n color: var(--ap-accent-text);\n opacity: 1;\n}\n\n.ap-button-dot {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ap-accent);\n flex: none;\n}\n\n.ap-button[aria-pressed=\"true\"] .ap-button-dot {\n background: var(--ap-accent-text);\n}\n\n.ap-button-count {\n padding: 1px 7px;\n border-radius: 999px;\n background: var(--ap-bg-raised);\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-button[aria-pressed=\"true\"] .ap-button-count {\n background: rgba(255, 255, 255, 0.22);\n color: var(--ap-accent-text);\n}\n\n/* ----------------------------------------------------------------------------\n The pointing highlight.\n\n It is DRAWN HERE, from the coordinates of the element being pointed at.\n Nothing is put on the element itself: no class, no attribute, no style. So\n the site cannot move by a single pixel because of the pointing.\n ---------------------------------------------------------------------------- */\n\n.ap-highlight {\n position: fixed;\n border: 2px solid var(--ap-accent);\n border-radius: 3px;\n background: var(--ap-accent-veil);\n pointer-events: none;\n display: none;\n}\n\n.ap-highlight-label {\n position: fixed;\n max-width: 320px;\n padding: 4px 8px;\n border-radius: 6px;\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none;\n display: none;\n box-shadow: var(--ap-shadow);\n}\n\n/* ----------------------------------------------------------------------------\n The markers: \"there are already notes here\".\n ---------------------------------------------------------------------------- */\n\n.ap-marker {\n position: fixed;\n min-width: 22px;\n height: 22px;\n padding: 0 6px;\n border: 2px solid var(--ap-bg);\n border-radius: 999px;\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-size: 12px;\n font-weight: 700;\n line-height: 18px;\n text-align: center;\n cursor: pointer;\n pointer-events: auto;\n box-shadow: var(--ap-shadow);\n}\n\n/* THE STATE, IN THE BADGE ITSELF. The rule above is the OPEN state -- work to\n do -- and it stays the tool's accent, because that is what a badge on a page\n has always meant here. The other two are read against it:\n\n pending filled amber. Resolved, not deployed: the defect is still on the\n screen the reader is looking at, and it is the one state worth\n catching an eye that was not looking for it.\n done hollow, in the soft ink. History: there, countable, and not\n asking for anything.\n\n THE COLOUR IS NEVER ALONE. The count is written in the badge and the state\n is spelled out in its accessible name -- a badge that said \"still to fix\"\n by hue only would say nothing at all to a good part of its readers. */\n.ap-marker-pending {\n background: var(--ap-pending-fill);\n}\n.ap-marker-done {\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-weight: 600;\n /* The 2px border is the halo against the page and cannot be spent on the\n outline, so the outline is drawn inside. */\n box-shadow: var(--ap-shadow), inset 0 0 0 1px var(--ap-border);\n}\n\n.ap-marker:focus-visible {\n outline: 2px solid var(--ap-accent-dark);\n outline-offset: 2px;\n}\n\n/* ----------------------------------------------------------------------------\n The panel.\n ---------------------------------------------------------------------------- */\n\n.ap-panel {\n position: fixed;\n top: 12px;\n right: 12px;\n bottom: 72px;\n width: 360px;\n max-width: calc(100vw - 24px);\n display: none;\n flex-direction: column;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n box-shadow: var(--ap-shadow);\n pointer-events: auto;\n overflow: hidden;\n}\n\n.ap-panel.ap-open {\n display: flex;\n}\n\n/* The other side. Two positions, right and left, and no third one: in\n annotation mode the layer takes every click, so every pixel of panel is a\n pixel of page that can no longer be pointed at. A floating panel would\n only move that loss around.\n\n \"bottom\" IS NOT REDECLARED, on purpose: the panel keeps the same 72 px of\n clearance above the floating button either way, and that clearance is the\n same on both sides because the button moves WITH it.\n\n AND THE BUTTON MOVES WITH IT, which was decided the other way first. The\n argument for leaving it was that it is the tool's only visible trace at\n rest, so an anchor that moved would stop being one. The owner's answer,\n and it is the better one: \"move left\" is asked of the TOOL, not of half of\n it. A panel on one edge and the control that opens it on the other makes\n the eye cross the whole window for one gesture, and somebody who set the\n side set it for the tool.\n\n TWO THINGS THIS RULE DEPENDS ON, both fragile:\n - it is written with ONE class, so it weighs exactly what \".ap-panel\"\n weighs;\n - it is written BEFORE the narrow block below.\n Reverse either and it wins under 560 px, where the panel is a bottom band\n spanning the width -- and a panel pinned to the left there is the full-\n height panel whose defect at 375 px is described in that block. */\n.ap-left {\n right: auto;\n left: 12px;\n}\n/* The button follows, and it is put on the LAYER and not on the panel: the\n button is not inside the panel, so the side has to be readable from a\n common ancestor. Same offset mirrored, same bottom -- only the edge\n changes. */\n.ap-layer.ap-left-side .ap-button {\n right: auto;\n left: 16px;\n}\n\n.ap-panel-header {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 12px 14px;\n border-bottom: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n}\n\n.ap-panel-title {\n font-size: 15px;\n font-weight: 600;\n flex: 1 1 auto;\n}\n\n/* -- what the whole project holds ---------------------------------------\n THE FIRST LINE OF THE FOOTER, on its own row. The footer is a flex row of\n short things -- a name, two buttons -- so this takes the whole width and the\n rest wraps under it. No ground and no border of its own: it is IN the footer,\n not beside it. */\n.ap-panel-footer { flex-wrap: wrap; }\n\n/* WHO YOU ARE SIGNING AS, ON A LINE OF ITS OWN. `flex-basis: 100%` is the same\n device the block above uses, and for the same reason: the footer is one\n wrapping row and everything in it was being strung end to end. */\n.ap-foot-who {\n flex-basis: 100%;\n display: flex; align-items: baseline; gap: 8px;\n}\n\n/* -- the list of remarks -------------------------------------------------\n A ROW, AND EVERY ROW IS A BUTTON. Not a card with a link in it: the whole\n line is the target, which is what a list of things to open should be, and it\n is reachable with a keyboard for free.\n\n THE EXCERPT TAKES THE ROOM AND FOLDS TO ONE LINE. What a remark is about can\n be a paragraph; what a list can show is a line. The author keeps a fixed\n place at the end so the eye can run down it. */\n.ap-row {\n display: flex; align-items: baseline; gap: 8px;\n width: 100%; margin: 0 0 4px; padding: 8px 10px;\n border: 1px solid var(--ap-border); border-radius: 8px;\n background: var(--ap-bg); color: var(--ap-text);\n font: inherit; text-align: left; cursor: pointer;\n transition: border-color .15s ease, background-color .15s ease;\n}\n.ap-row:hover { background: var(--ap-bg-soft); border-color: var(--ap-accent); }\n.ap-row:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 2px; }\n.ap-row-about {\n flex: 1; min-width: 0;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n}\n.ap-row-who { flex: none; font-size: 12px; color: var(--ap-text-soft); }\n/* THE STATE, AS A DOT. Three of them, and the middle one is the one that must\n not read as done: resolved but not deployed is a defect still on screen. The\n accessible name spells all three out -- a colour is not a fact for\n everybody. */\n.ap-row-dot {\n flex: none; width: 8px; height: 8px; border-radius: 999px;\n background: var(--ap-accent); align-self: center;\n}\n.ap-row-pending .ap-row-dot { background: var(--ap-text-soft); }\n.ap-row-done .ap-row-dot { background: transparent; border: 1px solid var(--ap-border); }\n.ap-row-done .ap-row-about { color: var(--ap-text-soft); }\n@media (prefers-reduced-motion: reduce) { .ap-row { transition: none; } }\n\n/* -- a window that is not the panel --------------------------------------\n IT FLOATS OVER THE PAGE, and that is the point: the panel is a band down one\n edge, and what goes in here is not about the page beside it. Fixed rather\n than absolute -- the reader scrolls the page under it, and a window that\n scrolled away with the article would have to be chased.\n\n ABOVE THE PANEL AND BELOW NOTHING. It is opened from the panel's footer, so\n it must cover it; the tool's own layer already sits above the site.\n\n WIDTH: it is read, not filled in. 26rem is a paragraph, and min() keeps it\n inside a phone without a media query. */\n.ap-pop {\n position: fixed; z-index: 3;\n /* THE LAYER IS `pointer-events: none` so the site underneath keeps working,\n and every piece that must be reachable turns it back on. Without this\n line the window is a picture: no click on its buttons, and no drag on its\n bar -- which is exactly how it behaved when first measured. */\n pointer-events: auto;\n width: min(26rem, calc(100vw - 24px));\n max-height: calc(100vh - 24px);\n display: flex; flex-direction: column;\n border: 1px solid var(--ap-border); border-radius: 12px;\n background: var(--ap-bg); color: var(--ap-text);\n box-shadow: 0 18px 48px rgba(0, 0, 0, .22);\n overflow: hidden;\n}\n/* THE HANDLE. `touch-action: none` is what makes a finger drag the window\n instead of scrolling the page under it -- without it the browser claims the\n gesture before the first pointermove arrives. */\n.ap-pop-bar {\n display: flex; align-items: center; gap: 8px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n cursor: grab; touch-action: none; user-select: none;\n}\n.ap-pop-moving .ap-pop-bar { cursor: grabbing; }\n.ap-pop-title { flex: 1; font-size: 13px; font-weight: 650; }\n/* `min-height: 0` is what makes the scroll happen INSIDE the window rather\n than the window growing past its own height: a flex item does not shrink\n below its content without it, and the end of a long remark would be behind\n the bottom edge with nothing to scroll. */\n.ap-pop-body { flex: 1 1 auto; min-height: 0; padding: 12px; overflow: auto; }\n/* The one line that says why the page stayed where it was. Drawn as the panel\n draws its own help text, not as an alert: nothing has gone wrong. */\n.ap-why {\n margin: 0 0 10px; padding: 8px 10px;\n border-radius: 8px; background: var(--ap-bg-soft);\n color: var(--ap-text-soft); font-size: 12.5px;\n}\n/* THE CORNER, AND IT IS DRAWN RATHER THAN LEFT TO THE BROWSER. `resize: both`\n would have done this in one line and does nothing under a finger on iOS; the\n window is moved with pointer events for exactly that reason, and it is\n resized with them too. Two hairlines, the shape everybody already reads as a\n grip, in the same ink as the borders around it. */\n.ap-pop-grip {\n position: absolute; right: 0; bottom: 0;\n width: 18px; height: 18px;\n cursor: nwse-resize; touch-action: none;\n background:\n linear-gradient(135deg, transparent 42%, var(--ap-border) 42%,\n var(--ap-border) 54%, transparent 54%),\n linear-gradient(135deg, transparent 66%, var(--ap-border) 66%,\n var(--ap-border) 78%, transparent 78%);\n}\n.ap-pop-sizing { user-select: none; }\n.ap-pop-sizing .ap-pop-grip { cursor: nwse-resize; }\n/* Inside a window, the block is the window: no second frame around it. */\n.ap-pop-body .ap-config { margin: 0; padding: 0; border: 0; background: none; }\n.ap-pop-body .ap-forget { margin: 0; }\n.ap-pop-body .ap-panel-stats { margin: 0; }\n/* A WINDOW HAS ROOM, SO THE FILE GETS IT. In the panel this field was two or\n four lines because the column had nothing to spare; here it can show the\n whole thing without being scrolled. */\n.ap-pop-body .ap-code { min-height: 9.5em; }\n\n/* -- the file the assistant needs ---------------------------------------\n Drawn like the other block the panel opens in its body -- a title, a\n sentence, the thing itself, two buttons -- so nothing here is a new shape to\n learn. The last line is the warning, and it is a line and not a dialog: the\n reviewer asked for this file. */\n.ap-config {\n margin: 10px 0 0; padding: 12px;\n border: 1px solid var(--ap-border); border-radius: 10px;\n background: var(--ap-bg-soft);\n}\n/* The warning is a line at the tool's own soft ink, not in an alert colour:\n the reviewer asked for this file, they are not being warned off it. There is\n no --ap-warn token and this does not invent one. */\n.ap-config .ap-warn { margin-top: 10px; }\n.ap-panel-stats {\n flex-basis: 100%;\n display: flex; flex-wrap: wrap; gap: 4px 18px;\n margin-bottom: 4px;\n}\n.ap-stat { display: inline-flex; align-items: baseline; gap: 5px; }\n/* The row says what it counts, once, and the three figures follow it. Without\n it, \"3 / 2 / 1\" beside a panel about one page reads as being about that\n page. */\n.ap-stat-label {\n flex-basis: 100%; margin-bottom: 2px;\n font-size: 11px; font-weight: 650; letter-spacing: .02em;\n text-transform: uppercase; color: var(--ap-text-soft);\n}\n.ap-stat-n { font-size: 15px; font-weight: 650; color: var(--ap-text); }\n.ap-stat-w { font-size: 12px; color: var(--ap-text-soft); }\n.ap-panel-instructions {\n padding: 10px 14px;\n border-bottom: 1px solid var(--ap-border);\n color: var(--ap-text-soft);\n font-size: 13px;\n}\n\n.ap-panel-body {\n flex: 1 1 auto;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 4px 14px 14px;\n}\n\n.ap-panel-footer {\n padding: 8px 14px;\n border-top: 1px solid var(--ap-border);\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ap-section-title {\n margin: 14px 0 6px;\n color: var(--ap-text-soft);\n font-size: 12px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.ap-section-help {\n margin: 0 0 8px;\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-empty {\n margin: 16px 0;\n color: var(--ap-text-soft);\n}\n\n/* ----------------------------------------------------------------------------\n THE MODE BADGE: one word, drawn in both modes, at the top of every draw.\n\n It replaced a paragraph that only the public mode ever drew. Two things\n were wrong with that: secure mode said nothing, so the panel never told a\n reviewer which of the two they were in; and a paragraph pinned to the top\n for ever is skipped after the second reading, while a single word is not.\n\n IT IS NOT A BUTTON AND MUST NOT LOOK LIKE ONE. No shadow, no pressed\n state, cursor stays default: there is nothing to press. What it does have\n is a focus ring, because it takes focus -- the description below has to be\n reachable without a pointer, and that is the only reason it is focusable.\n ---------------------------------------------------------------------------- */\n\n.ap-mode {\n /* The frame the description is positioned against. It spans the width of\n the panel body, so a description pinned to its two edges cannot spill\n sideways out of a body that scrolls -- and a scrolling body clips both\n axes, not just the one it scrolls. */\n position: relative;\n margin: 4px 0 10px;\n}\n\n.ap-mode-chip {\n display: inline-block;\n padding: 2px 9px 3px;\n border: 1px solid var(--ap-border);\n border-radius: 999px;\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n cursor: default;\n}\n\n/* The public badge is the one that carries a consequence, so it is the one\n that is coloured -- in the tool's own accent, not in the alert colours: a\n public key is a choice somebody made on purpose, not an incident. Secure\n keeps the quiet frame: it is the case where nothing is being said. */\n/* The same ring as every other focusable thing in the panel. It is the only\n visual proof, for somebody arriving by Tab, that this word is where their\n focus went. */\n.ap-mode-chip:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n.ap-mode-public .ap-mode-chip {\n border-color: var(--ap-accent);\n background: var(--ap-accent-veil);\n color: var(--ap-accent-dark);\n}\n\n/* The description. Hidden by DEFAULT and shown on demand, and hidden in a way\n that leaves it readable to a screen reader: it is the badge's\n aria-describedby target, and an accessible description is computed from the\n referenced element whether or not it is painted. It is taken out of the\n layout entirely (absolute) so that showing it moves not one pixel of the\n list underneath -- a tooltip that pushes the notes down is a tooltip that\n makes people lose their place. */\n.ap-mode-tip {\n position: absolute;\n z-index: 2;\n top: calc(100% + 6px);\n left: 0;\n right: 0;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg-raised);\n color: var(--ap-text);\n box-shadow: var(--ap-shadow);\n font-size: 12px;\n font-weight: 400;\n letter-spacing: normal;\n text-transform: none;\n line-height: 1.45;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-3px);\n transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;\n pointer-events: none;\n}\n\n/* BOTH, and the keyboard one is not the afterthought: :focus-visible is what\n makes the sentence reachable by somebody who never touches a pointer. */\n.ap-mode-chip:hover ~ .ap-mode-tip,\n.ap-mode-chip:focus-visible ~ .ap-mode-tip {\n opacity: 1;\n visibility: visible;\n transform: none;\n transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ap-mode-tip {\n transform: none;\n transition: none;\n }\n .ap-mode-chip:hover ~ .ap-mode-tip,\n .ap-mode-chip:focus-visible ~ .ap-mode-tip {\n transition: none;\n }\n}\n\n/* The \"a newer client exists\" line and the \"this server speaks another\n format\" line are the same object on screen: a standing statement about what\n one is looking at, above the notes and above the failures. One rule, so\n they cannot drift apart -- and the second one joins it rather than\n inventing a colour, precisely because a protocol disagreement is a fact\n about the project, not an incident.\n\n Deliberately NOT the alert colours: neither is a failure, and an alarm that\n never goes away stops being read. */\n.ap-upgrade,\n.ap-format {\n margin: 0 0 10px;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg-soft);\n color: var(--ap-text-soft);\n font-size: 12px;\n line-height: 1.45;\n}\n\n/* ----------------------------------------------------------------------------\n A note, and its replies.\n ---------------------------------------------------------------------------- */\n\n.ap-note {\n margin: 8px 0;\n padding: 10px 12px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n}\n\n.ap-note.ap-orphan {\n background: var(--ap-bg-soft);\n}\n\n\n.ap-note-header {\n display: flex;\n align-items: baseline;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-note-author {\n font-weight: 600;\n}\n\n.ap-note-date {\n color: var(--ap-text-soft);\n font-size: 12px;\n}\n\n.ap-note-target {\n margin: 4px 0 0;\n color: var(--ap-text-soft);\n font-size: 12px;\n font-style: italic;\n overflow-wrap: anywhere;\n}\n\n.ap-note-text {\n margin: 6px 0 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.ap-note-actions {\n margin-top: 8px;\n display: flex;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-replies {\n margin: 8px 0 0;\n padding-left: 10px;\n border-left: 2px solid var(--ap-border);\n}\n\n.ap-reply {\n margin: 8px 0 0;\n}\n\n/* ----------------------------------------------------------------------------\n The form, anchored near the element pointed at.\n ---------------------------------------------------------------------------- */\n\n.ap-form {\n position: fixed;\n width: 340px;\n max-width: calc(100vw - 24px);\n display: none;\n flex-direction: column;\n gap: 8px;\n padding: 14px;\n border: 1px solid var(--ap-border);\n border-radius: var(--ap-radius);\n background: var(--ap-bg);\n box-shadow: var(--ap-shadow);\n pointer-events: auto;\n}\n\n.ap-form.ap-open {\n display: flex;\n}\n\n.ap-form-title {\n font-size: 15px;\n font-weight: 600;\n}\n\n.ap-form-target {\n color: var(--ap-text-soft);\n font-size: 12px;\n font-style: italic;\n overflow-wrap: anywhere;\n}\n\n.ap-label {\n display: block;\n margin-bottom: 3px;\n font-size: 12px;\n font-weight: 600;\n color: var(--ap-text-soft);\n}\n\n.ap-help {\n margin: 3px 0 0;\n font-size: 12px;\n color: var(--ap-text-soft);\n}\n\n.ap-field,\n.ap-area {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 8px;\n background: var(--ap-bg-soft);\n color: var(--ap-text);\n}\n\n.ap-field:focus,\n.ap-area:focus {\n outline: 2px solid var(--ap-accent);\n outline-offset: 1px;\n}\n\n.ap-area {\n min-height: 92px;\n resize: vertical;\n}\n\n.ap-actions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n}\n\n.ap-counter {\n margin-left: auto;\n font-size: 12px;\n color: var(--ap-text-soft);\n}\n\n/* ----------------------------------------------------------------------------\n Buttons.\n ---------------------------------------------------------------------------- */\n\n.ap-primary,\n.ap-secondary,\n.ap-link {\n border-radius: 8px;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ap-primary {\n padding: 8px 14px;\n border: 1px solid var(--ap-accent);\n background: var(--ap-accent);\n color: var(--ap-accent-text);\n font-weight: 600;\n}\n\n.ap-primary:hover {\n background: var(--ap-accent-dark);\n border-color: var(--ap-accent-dark);\n}\n\n.ap-secondary {\n padding: 8px 14px;\n border: 1px solid var(--ap-border);\n background: var(--ap-bg);\n color: var(--ap-text);\n}\n\n.ap-secondary:hover {\n background: var(--ap-bg-raised);\n}\n\n.ap-link {\n padding: 2px 4px;\n border: 0;\n background: none;\n color: var(--ap-accent);\n text-decoration: underline;\n font-size: 13px;\n}\n\n.ap-primary:disabled,\n.ap-secondary:disabled,\n.ap-link:disabled {\n opacity: 0.6;\n cursor: default;\n}\n\n.ap-primary:focus-visible,\n.ap-secondary:focus-visible,\n.ap-link:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 2px;\n}\n\n/* ----------------------------------------------------------------------------\n The failures.\n\n They are RED, at the top of the block concerned, and carry the message the\n server returned as it stands: that is how a non-technical team learns that\n its remark is not saved, instead of believing it is.\n ---------------------------------------------------------------------------- */\n\n.ap-error {\n margin: 8px 0;\n padding: 10px 12px;\n border: 1px solid var(--ap-alert-border);\n border-radius: var(--ap-radius);\n background: var(--ap-alert-bg);\n color: var(--ap-alert-text);\n}\n\n.ap-error-title {\n font-weight: 700;\n margin-bottom: 4px;\n}\n\n.ap-error-detail {\n margin: 6px 0 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-size: 13px;\n}\n\n.ap-error .ap-link {\n color: var(--ap-alert-text);\n}\n\n/* ----------------------------------------------------------------------------\n Narrow: the panel takes the full width, and so does the form.\n ---------------------------------------------------------------------------- */\n\n/* ----------------------------------------------------------------------------\n Narrow.\n\n DEFECT OBSERVED at 375 px wide: a panel taking the full height covers the\n whole page, and no element can be pointed at any more -- every click lands\n on the panel. So it becomes a bottom band, which leaves the top half of\n the viewport free; one scrolls the page there to bring the wanted element\n into view. The form, for its part, hides the panel while typing (see\n notes.js): on a screen that size, writing and reading the list at the same\n time does not hold.\n ---------------------------------------------------------------------------- */\n\n/* On a narrow screen the panel becomes a bottom band and the form takes the\n full width.\n\n THE WIDTH CEILING IS KEPT, and it comes from a measured defect: \"left: 8;\n right: 8\" sizes the element against its CONTAINING BLOCK, which the host\n site's horizontal overflow can make wider than the visible window.\n Measured, in mobile emulation at 390 px: the site overflows to 407 px\n (with the tool and without it), and the panel came out 391 px wide\n starting at 8, that is 9 px off screen. \"100vw\" is the window, not the\n containing block: the ceiling therefore does nothing when the site does\n not overflow, and pulls the width back when it does. */\n@media (max-width: 560px) {\n .ap-panel {\n top: auto;\n right: 8px;\n left: 8px;\n bottom: 66px;\n height: 52vh;\n width: auto;\n max-width: calc(100vw - 16px);\n }\n\n /* A band spanning the width has no side, so the choice is inert here and\n the button says so by not being there. Offering a control that visibly\n does nothing is worse than offering none. The stored side is untouched:\n it is waiting for the wide screen it was chosen on. */\n .ap-side-toggle {\n display: none;\n }\n\n .ap-form {\n left: 8px;\n right: 8px;\n width: auto;\n max-width: calc(100vw - 16px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ap-button {\n transition: none;\n }\n}\n\n/* The failure shows without opening the panel: the button's dot changes\n colour. A team that does not click must be able to see that something is\n wrong. */\n.ap-button.ap-failed .ap-button-dot {\n background: var(--ap-alert-text);\n}\n\n.ap-button.ap-failed {\n border-color: var(--ap-alert-border);\n}\n\n/* Signature reminder, in the note form.\n The name was shown at the foot of the panel only: invisible at the moment\n one writes. A user reported not knowing which name they were writing\n under. */\n.ap-form-signature {\n display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;\n margin: 0 0 .6rem; font-size: .85rem; opacity: .8;\n}\n\n/* Resolution state, said on the card.\n Two cases NOT to be confused: resolved and online, resolved but not\n deployed yet. The second keeps the defect on the reviewer's screen; hiding\n it or announcing it as fixed would cost them their trust in the tool. */\n.ap-state-mark {\n display: inline-block; margin: 0 0 .5rem;\n padding: .15rem .55rem; border-radius: 4px;\n font-size: .75rem; font-weight: 600; letter-spacing: .02em;\n}\n.ap-note.ap-resolved { opacity: .72; }\n.ap-note.ap-resolved .ap-state-mark {\n color: var(--ap-done-ink); background: var(--ap-done-veil);\n}\n.ap-note.ap-resolved-pending .ap-state-mark {\n color: var(--ap-pending-ink); background: var(--ap-pending-veil);\n}\n/* The \"it is fixed\" / \"reopen\" block, opened under the card. Same shape as\n the reply block: it is the same gesture, one answers a remark. */\n.ap-resolve,\n.ap-reply-form {\n margin-top: .6rem;\n padding-top: .6rem;\n border-top: 1px solid var(--ap-border);\n}\n\n/* The question asked before the key is dropped, at the foot of the list.\n Framed like the resolution block -- it is the same shape of gesture, one\n answers before something changes -- and set apart from the notes above it,\n because it is not about a note. */\n.ap-forget {\n margin-top: 1rem;\n padding-top: .6rem;\n border-top: 1px solid var(--ap-border);\n}\n\n.ap-forget .ap-actions {\n margin-top: .5rem;\n}\n\n.ap-history-toggle {\n display: block; width: 100%; margin: 1rem 0 .25rem;\n padding: .5rem .75rem; border: 1px dashed currentColor; border-radius: 6px;\n background: none; color: inherit; font: inherit; opacity: .7; cursor: pointer;\n}\n.ap-history-toggle:hover { opacity: 1; }\n\n\n/* ----------------------------------------------------------------------------\n Setup and pasting the salt.\n\n These are the only screens where something is copied by hand. Everything\n there is SELECTABLE and monospaced: a 43-character salt copied wrong\n cannot be recovered, and nothing helps less than a font that confuses I, l\n and 1.\n ---------------------------------------------------------------------------- */\n\n.ap-panel-wide {\n width: 560px;\n}\n\n.ap-copy {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n margin: 0 0 12px;\n}\n\n.ap-code {\n flex: 1 1 auto;\n width: 100%;\n padding: 8px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 8px;\n background: var(--ap-bg-soft);\n color: var(--ap-text);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\",\n monospace;\n font-size: 12.5px;\n line-height: 1.5;\n resize: vertical;\n white-space: pre;\n overflow-x: auto;\n}\n\n.ap-code:focus-visible {\n outline: 2px solid var(--ap-accent);\n outline-offset: 1px;\n}\n\n@media (max-width: 560px) {\n .ap-panel-wide {\n width: auto;\n }\n\n .ap-copy {\n flex-direction: column;\n }\n}\n";
|
|
22
22
|
|
|
23
23
|
/* ==== 00-preamble.js ==== */
|
|
24
24
|
|
|
@@ -451,6 +451,15 @@
|
|
|
451
451
|
'note.about': 'About: {excerpt}',
|
|
452
452
|
'note.no_element': 'About the whole page',
|
|
453
453
|
'note.element_lost': 'Element not found on the current page',
|
|
454
|
+
/* WHY THE PAGE DID NOT MOVE, said in the window that just opened. Two
|
|
455
|
+
cases, and they are not the same news: one the reader can undo in a
|
|
456
|
+
click, the other nobody can. */
|
|
457
|
+
'list.not_shown':
|
|
458
|
+
'The page did not move: what this remark is about is on it, but hidden '
|
|
459
|
+
+ 'by a setting further up.',
|
|
460
|
+
'list.not_here':
|
|
461
|
+
'The page did not move: what this remark is about is not on it any '
|
|
462
|
+
+ 'more. The remark is kept as it was written.',
|
|
454
463
|
'note.show': 'Show on the page',
|
|
455
464
|
'note.reply': 'Reply',
|
|
456
465
|
'note.reply_placeholder': 'Your reply',
|
|
@@ -2143,11 +2152,16 @@
|
|
|
2143
2152
|
badge that says 3, it holds three. */
|
|
2144
2153
|
let popNotes = null;
|
|
2145
2154
|
|
|
2146
|
-
const showNotes = (notes, orphan, title) => {
|
|
2155
|
+
const showNotes = (notes, orphan, title, why) => {
|
|
2147
2156
|
const ids = [];
|
|
2148
2157
|
for (let i = 0; i < notes.length; i += 1) ids.push(notes[i].id);
|
|
2149
|
-
popNotes = { ids: ids, orphan: orphan };
|
|
2158
|
+
popNotes = { ids: ids, orphan: orphan, why: why || null };
|
|
2150
2159
|
openPop(title, (into) => {
|
|
2160
|
+
/* WHY THE PAGE DID NOT MOVE, at the top of what the reader is now
|
|
2161
|
+
looking at. It is one line and it only exists when there is
|
|
2162
|
+
something to explain: a window that carried a strip every time
|
|
2163
|
+
would teach the reader to skip the place the explanation lives. */
|
|
2164
|
+
if (why) into.appendChild(create('p', 'ap-why', why));
|
|
2151
2165
|
for (let i = 0; i < notes.length; i += 1) {
|
|
2152
2166
|
into.appendChild(noteCard(notes[i], orphan));
|
|
2153
2167
|
}
|
|
@@ -2170,16 +2184,22 @@
|
|
|
2170
2184
|
viewport, so the reader is already looking at it, and scrolling the page
|
|
2171
2185
|
under a hand that just clicked would be the tool moving for no reason. */
|
|
2172
2186
|
const showNote = (note, orphan) => {
|
|
2173
|
-
|
|
2174
|
-
|
|
2187
|
+
/* THE PAGE IS ASKED TO MOVE FIRST, so that what the window says about it is
|
|
2188
|
+
what actually happened rather than a guess made before trying. */
|
|
2189
|
+
const went = orphan ? 'gone' : showElement(note);
|
|
2190
|
+
showNotes([note], orphan, note.title || note.excerpt || T('list.untitled'),
|
|
2191
|
+
went === 'scrolled' ? null
|
|
2192
|
+
: T(went === 'hidden' ? 'list.not_shown' : 'list.not_here'));
|
|
2175
2193
|
};
|
|
2176
2194
|
|
|
2177
2195
|
/* THE BADGE'S OWN WINDOW. Its title is what the ELEMENT says, not what the
|
|
2178
2196
|
first remark says: the window holds all of them, and naming it after one
|
|
2179
2197
|
would be wrong as soon as there are two. */
|
|
2180
2198
|
const showGroup = (group) => {
|
|
2199
|
+
/* No line about scrolling here: a badge is only drawn for an element
|
|
2200
|
+
inside the viewport, so the reader is already looking at it. */
|
|
2181
2201
|
showNotes(group.notes, false,
|
|
2182
|
-
excerptOf(group.element) || T('list.untitled'));
|
|
2202
|
+
excerptOf(group.element) || T('list.untitled'), null);
|
|
2183
2203
|
};
|
|
2184
2204
|
|
|
2185
2205
|
const noteCard = (note, orphan) => {
|
|
@@ -3053,6 +3073,7 @@
|
|
|
3053
3073
|
const body = pop && pop.querySelector('.ap-pop-body');
|
|
3054
3074
|
if (body) {
|
|
3055
3075
|
empty(body);
|
|
3076
|
+
if (popNotes.why) body.appendChild(create('p', 'ap-why', popNotes.why));
|
|
3056
3077
|
for (let i = 0; i < again.length; i += 1) {
|
|
3057
3078
|
body.appendChild(noteCard(again[i], popNotes.orphan));
|
|
3058
3079
|
}
|
|
@@ -3079,13 +3100,32 @@
|
|
|
3079
3100
|
did nothing. Its one caller was the badge, which now opens the window
|
|
3080
3101
|
instead. The rule went with it. */
|
|
3081
3102
|
|
|
3082
|
-
/**
|
|
3103
|
+
/**
|
|
3104
|
+
* Brings the commented element back into view, by showing it on our side.
|
|
3105
|
+
*
|
|
3106
|
+
* AND IT SAYS WHICH OF THE THREE THINGS HAPPENED, because two of them look
|
|
3107
|
+
* identical from the reader's chair: the page does not move. Reported as "it
|
|
3108
|
+
* shows me the note but does not scroll to it", and on the page where it was
|
|
3109
|
+
* reported every visible remark was in the third case -- the element it was
|
|
3110
|
+
* written on no longer exists. A feature that silently does nothing is
|
|
3111
|
+
* indistinguishable from one that is broken.
|
|
3112
|
+
*
|
|
3113
|
+
* `hidden` is the case nobody thinks of and this page makes common: the
|
|
3114
|
+
* element IS anchored, and a dial at the top of the site has folded the
|
|
3115
|
+
* chapter it lives in. It measures 0x0, so there is nothing to scroll to and
|
|
3116
|
+
* nothing to outline -- and the reader can fix it, which is exactly why they
|
|
3117
|
+
* have to be told.
|
|
3118
|
+
*
|
|
3119
|
+
* @returns {'scrolled'|'hidden'|'gone'}
|
|
3120
|
+
*/
|
|
3083
3121
|
const showElement = (note) => {
|
|
3084
3122
|
let el = null;
|
|
3085
3123
|
for (let i = 0; i < anchored.length; i += 1) {
|
|
3086
3124
|
if (anchored[i].notes.indexOf(note) !== -1) el = anchored[i].element;
|
|
3087
3125
|
}
|
|
3088
|
-
if (!el) return;
|
|
3126
|
+
if (!el || !document.contains(el)) return 'gone';
|
|
3127
|
+
const r = el.getBoundingClientRect();
|
|
3128
|
+
if (r.width === 0 && r.height === 0) return 'hidden';
|
|
3089
3129
|
// scrollIntoView moves the viewpoint, never the document: no node, no
|
|
3090
3130
|
// style of the site is touched.
|
|
3091
3131
|
el.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
@@ -3093,6 +3133,7 @@
|
|
|
3093
3133
|
showHighlight(el);
|
|
3094
3134
|
window.setTimeout(hideHighlight, 1400);
|
|
3095
3135
|
}, 350);
|
|
3136
|
+
return 'scrolled';
|
|
3096
3137
|
};
|
|
3097
3138
|
|
|
3098
3139
|
/* -- 16. The form for a new note ------------------------------------------ */
|
|
@@ -3304,6 +3345,13 @@
|
|
|
3304
3345
|
on whatever happens to be under a pointer that has not moved. */
|
|
3305
3346
|
const onHover = (event) => {
|
|
3306
3347
|
if (pop) return;
|
|
3348
|
+
/* AND NOT WHILE A REMARK IS BEING WRITTEN, for the same reason and on the
|
|
3349
|
+
same report: the outline and its label kept moving from paragraph to
|
|
3350
|
+
paragraph behind the form, so the tool was proposing the next thing to
|
|
3351
|
+
annotate to somebody in the middle of annotating this one. The element
|
|
3352
|
+
being written about stays outlined until the form closes -- which is
|
|
3353
|
+
what a reader looking away from their own sentence needs to find. */
|
|
3354
|
+
if (ui.form.classList.contains('ap-open')) return;
|
|
3307
3355
|
const el = event.target;
|
|
3308
3356
|
if (!el || el.nodeType !== 1 || inTool(el)) return;
|
|
3309
3357
|
if (el === document.body || el === document.documentElement) return;
|
|
@@ -3338,6 +3386,17 @@
|
|
|
3338
3386
|
closePop();
|
|
3339
3387
|
return;
|
|
3340
3388
|
}
|
|
3389
|
+
/* AND A CLICK ELSEWHERE DOES NOT THROW A REMARK AWAY. openForm() rebuilds
|
|
3390
|
+
the form from nothing, so aiming at another element while something was
|
|
3391
|
+
written DISCARDED it -- silently, with no confirmation, on a click the
|
|
3392
|
+
reader may not have meant. Nothing typed: aiming again costs nothing and
|
|
3393
|
+
still works, which is what one does when the first click missed by one
|
|
3394
|
+
block. Something typed: the form stays where it is. Escape and Cancel
|
|
3395
|
+
are the two ways out, and both are on screen. */
|
|
3396
|
+
if (ui.form.classList.contains('ap-open')) {
|
|
3397
|
+
const written = ui.form.querySelector('.ap-area');
|
|
3398
|
+
if (written && written.value.trim() !== '') return;
|
|
3399
|
+
}
|
|
3341
3400
|
if (!el || el.nodeType !== 1) return;
|
|
3342
3401
|
if (el === document.body || el === document.documentElement) return;
|
|
3343
3402
|
openForm(el);
|
package/labels/fr.json
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"orphans.help": "Ces remarques portaient sur un élément qui n’existe plus sous la même forme. Elles sont conservées telles quelles.",
|
|
21
21
|
"note.about": "À propos de : {excerpt}",
|
|
22
22
|
"note.no_element": "À propos de la page entière",
|
|
23
|
+
"list.not_shown": "La page n’a pas bougé : ce dont parle cette remarque est bien dessus, mais masqué par un réglage plus haut.",
|
|
24
|
+
"list.not_here": "La page n’a pas bougé : ce dont parle cette remarque n’y est plus. La remarque est conservée telle qu’elle a été écrite.",
|
|
23
25
|
"note.element_lost": "Élément non retrouvé sur la page actuelle",
|
|
24
26
|
"note.show": "Montrer sur la page",
|
|
25
27
|
"note.reply": "Répondre",
|
package/package.json
CHANGED