annotepage-client 2.32.0 → 2.34.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 +44 -0
- package/dist/HASHES.txt +3 -1
- package/dist/annotepage.js +367 -95
- package/labels/fr.js +6 -4
- package/labels/fr.json +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,8 @@ the site.
|
|
|
69
69
|
| `data-version` | the version really being served, as the site names it |
|
|
70
70
|
| `data-environment` | the name of the environment, written into the note as it stands |
|
|
71
71
|
| `data-labels` | a label file belonging to the site, resolved against the document |
|
|
72
|
+
| `data-author` | the reviewer's name: the tool signs with it and never asks for one. Without it, the name is asked for once and remembered. The object's `author` is the same |
|
|
73
|
+
| `data-container` | a CSS selector for an element to draw the panel **inside**, instead of floating it over the page; the host then opens and closes annotation mode itself. The object may pass the element itself. See **Embedding it in an application** |
|
|
72
74
|
|
|
73
75
|
`data-version` earns its place: when a note is resolved, the tool compares the
|
|
74
76
|
version of the fix with this one to tell "resolved and online" — which folds
|
|
@@ -76,6 +78,48 @@ into the history — from "resolved, not deployed yet" — which stays in front
|
|
|
76
78
|
the reviewer, because the defect is still on their screen. Missing: the fix is
|
|
77
79
|
taken as not deployed and the note stays visible.
|
|
78
80
|
|
|
81
|
+
## Embedding it in an application
|
|
82
|
+
|
|
83
|
+
Four options let the tool sit inside a component you already have, rather than
|
|
84
|
+
float over a whole page. Each is **off by default**: without it, the tool
|
|
85
|
+
behaves exactly as it does today — same tag, same attributes, same format.
|
|
86
|
+
|
|
87
|
+
- **`author`** — the signature, given once by the host (`data-author`, or
|
|
88
|
+
`author` in the object). The "your name" field is then never shown and every
|
|
89
|
+
remark and reply is signed with this name. Left out, the name is asked for and
|
|
90
|
+
remembered, as before.
|
|
91
|
+
- **`container`** — where the panel is drawn: a CSS selector (`data-container`,
|
|
92
|
+
or `container`), or — in the object only — the **element itself**. The panel
|
|
93
|
+
fills that element instead of floating, and there is **no floating button**:
|
|
94
|
+
the host opens and closes annotation mode. When the tool is ready it sets a
|
|
95
|
+
small controller on the element and raises a `ready` event on it:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
const box = document.querySelector('#remarks');
|
|
99
|
+
box.addEventListener('annotepage:ready', () => {
|
|
100
|
+
myButton.onclick = () => box.annotepage.toggle();
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`box.annotepage` carries `open()`, `close()`, `toggle()` and `isOpen`.
|
|
105
|
+
- **`frame`** — an `<iframe>` (object only) whose page is annotated instead of
|
|
106
|
+
this one. The iframe is sealed (`sandbox="allow-scripts"`, without
|
|
107
|
+
`allow-same-origin`): it reaches no network and no storage, and the host
|
|
108
|
+
cannot touch its DOM. The page inside it loads the small companion
|
|
109
|
+
`dist/annotepage-frame.js`, which does only the pointing, the numbers and the
|
|
110
|
+
scrolling; this client, in the host page, holds the panel (drawn in
|
|
111
|
+
`container`) and talks to the server. The two speak by `postMessage`, each
|
|
112
|
+
message namespaced and checked by source. The page path (the blind index)
|
|
113
|
+
comes from the `page` option on the host side, never from the iframe's URL.
|
|
114
|
+
- **`onChange`** — a function (object only), called when a remark is **added,
|
|
115
|
+
resolved or reopened**, with `{ type, id, title, open, total }`. The tool
|
|
116
|
+
notifies nothing else; without it, nothing happens.
|
|
117
|
+
|
|
118
|
+
`frame` and `onChange` carry a live value — an element, a function — that a
|
|
119
|
+
`data-` attribute cannot hold, so they live in `window.annotepageConfig` alone,
|
|
120
|
+
never on a tag. They are page wiring, not a statement about which project runs
|
|
121
|
+
here, so they take no part in the "one tool per page" rule.
|
|
122
|
+
|
|
79
123
|
## Translating it
|
|
80
124
|
|
|
81
125
|
Every text is in `src/15-labels.js`, a flat object, in English. Replace what
|
package/dist/HASHES.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.34.0 sha384-mpjjXnI6z8LFBuAbersXKtendIjMmnx5kUMAq5r5iL/wOnpcvs/CUf9XxJQ//MRr 353983 bytes
|
|
2
|
+
2.33.0 sha384-z7+ADpaUbIFjt8C2aZYeCJOAHwvqL/yRodW7VCoOly5BcFphOUygRPgqfBz1yTAY 338834 bytes
|
|
3
|
+
2.32.0 sha384-p7i+J4F2MfPvVTJ6iph3jr1gPefcV+/tKDQTzFeq1usqqpgFODKXD1gHTkt0jPU3 338834 bytes
|
|
2
4
|
2.31.0 sha384-Z6F1K1imsrF1kdOxmiDluPauBXZYUgCpQNkksyIc6Z7xVSov4D0ugF/sOOQrqJqc 331235 bytes
|
|
3
5
|
2.30.0 sha384-/pIpSIUKGK7sU+9ZGx0iUTxEY56cWBp5WzJf1XrE+bbNmq1/YQCL0rwiVbgV4z8W 315659 bytes
|
|
4
6
|
2.29.0 sha384-2N0B7fBqiLD7kE1Jg6ObeS+5JTqFZZWud4icxW2z4qn8qPr3F8CI02LNj429GId9 276739 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.34.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.34.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 zones a remark can be written in (data-zone), while annotation mode is on.\n\n DISCREET ON PURPOSE: a dashed line and no fill. The page under review is\n what the reviewer is reading, and a veil over every open area would tint\n the very colours they may be writing about. Drawn from coordinates, like\n the highlight: nothing is put on the site's element.\n ---------------------------------------------------------------------------- */\n\n.ap-zone {\n position: fixed;\n border: 1px dashed var(--ap-accent);\n border-radius: 4px;\n opacity: 0.6;\n pointer-events: none;\n box-sizing: border-box;\n}\n\n.ap-zone-notice {\n position: fixed;\n max-width: 280px;\n padding: 6px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 6px;\n background: var(--ap-bg);\n color: var(--ap-text);\n font-size: 13px;\n box-shadow: var(--ap-shadow);\n pointer-events: none;\n display: none;\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/* The retention line, when there is one. `:empty` rather than a class the\n script has to add and remove: the element is always there, and CSS decides\n whether it takes any room -- so a server that deletes nothing costs the\n panel exactly nothing. */\n.ap-panel-keeps { margin-top: 6px; color: var(--ap-text-soft); }\n.ap-panel-keeps:empty { display: none; }\n\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.ap-pop-body .ap-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/* TWO BLOCKS, THIS SITE THEN THE WHOLE SERVER, and the second is absent on\n nearly every server. Each block is a label, the figures it holds, and -- when\n age takes anything here -- a second row for what it took. */\n.ap-stats { display: flex; flex-direction: column; gap: 16px; }\n.ap-stats-block { display: flex; flex-direction: column; gap: 4px; }\n.ap-stats .ap-panel-stats { margin-bottom: 0; }\n/* WHAT WAS REMOVED READS AS A FOOTNOTE TO THE ROW ABOVE, not as a second set of\n figures competing with it: same shapes, one step quieter, and indented under\n the count it belongs to. */\n.ap-stat-gone { padding-left: 10px; border-left: 2px solid var(--ap-border); }\n.ap-stat-gone .ap-stat-n { font-size: 13px; font-weight: 600; color: var(--ap-text-soft); }\n.ap-stat-since {\n font-size: 11px; font-weight: 650; letter-spacing: .02em;\n text-transform: uppercase; color: var(--ap-text-soft); align-self: baseline;\n}\n/* The date of the last sweep is context for the figures beside it, not another\n figure: soft ink, smaller, and it wraps under them rather than stretching\n the row. */\n.ap-stat-when { font-size: 12px; color: var(--ap-text-soft); align-self: baseline; }\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/* Plain wears the same coat as public, and for the same reason: both are a\n choice somebody made on purpose, and both carry a consequence for whoever\n is about to write. Neither is an incident, so neither takes an alert\n colour. They cannot both be true at once. */\n.ap-mode-public .ap-mode-chip,\n.ap-mode-plain .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 zones a remark can be written in (data-zone), while annotation mode is on.\n\n DISCREET ON PURPOSE: a dashed line and no fill. The page under review is\n what the reviewer is reading, and a veil over every open area would tint\n the very colours they may be writing about. Drawn from coordinates, like\n the highlight: nothing is put on the site's element.\n ---------------------------------------------------------------------------- */\n\n.ap-zone {\n position: fixed;\n border: 1px dashed var(--ap-accent);\n border-radius: 4px;\n opacity: 0.6;\n pointer-events: none;\n box-sizing: border-box;\n}\n\n.ap-zone-notice {\n position: fixed;\n max-width: 280px;\n padding: 6px 10px;\n border: 1px solid var(--ap-border);\n border-radius: 6px;\n background: var(--ap-bg);\n color: var(--ap-text);\n font-size: 13px;\n box-shadow: var(--ap-shadow);\n pointer-events: none;\n display: none;\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/* ----------------------------------------------------------------------------\n DOCKED (the `container` option): the panel FILLS the element the host page\n handed over, and there is no floating button -- the page opens and closes the\n tool. One class, added only when `container` is set (buildUi), so none of the\n floating layout above is touched without it.\n\n Two classes of specificity, so it wins over the edge-card rules and over the\n narrow-screen bottom band below: inside a container, the container's own box\n is what decides the size, not the viewport. The markers, the highlight and\n the pointing stay viewport-fixed and are untouched here -- only the panel\n moves from a floating card to a fill.\n ---------------------------------------------------------------------------- */\n.ap-docked .ap-button { display: none; }\n.ap-docked .ap-side-toggle { display: none; }\n.ap-docked .ap-panel {\n position: absolute;\n inset: 0;\n width: auto;\n max-width: none;\n border: 0;\n border-radius: 0;\n box-shadow: none;\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/* The retention line, when there is one. `:empty` rather than a class the\n script has to add and remove: the element is always there, and CSS decides\n whether it takes any room -- so a server that deletes nothing costs the\n panel exactly nothing. */\n.ap-panel-keeps { margin-top: 6px; color: var(--ap-text-soft); }\n.ap-panel-keeps:empty { display: none; }\n\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.ap-pop-body .ap-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/* UP TO THREE BLOCKS: this site, the server, every server. Each is a label and\n the figures it holds, and the figures are the same size in all three. */\n.ap-stats { display: flex; flex-direction: column; gap: 14px; }\n.ap-stats-block { display: flex; flex-direction: column; gap: 4px; }\n.ap-stats .ap-panel-stats { margin-bottom: 0; }\n/* What follows a label on its line -- \"updated daily\" -- is about the label,\n not part of it: lower case, lighter, after a dot. */\n.ap-stat-aside { font-weight: 400; letter-spacing: 0; text-transform: none; }\n.ap-stat-aside::before { content: \"\\00b7\"; margin: 0 6px; }\n/* THE LAST BLOCK IS NOT THIS SERVER'S. A soft ground sets it apart from the\n two above it, which are; nothing about it is larger. */\n.ap-stats-world {\n margin: 0 -8px; padding: 8px;\n background: var(--ap-bg-soft); border-radius: 8px;\n}\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/* Plain wears the same coat as public, and for the same reason: both are a\n choice somebody made on purpose, and both carry a consequence for whoever\n is about to write. Neither is an incident, so neither takes an alert\n colour. They cannot both be true at once. */\n.ap-mode-public .ap-mode-chip,\n.ap-mode-plain .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
|
|
|
@@ -146,7 +146,23 @@
|
|
|
146
146
|
window.annotepageConfig is ours alone, so a name we do not know there is a
|
|
147
147
|
typo, and a typo that is ignored is a setting somebody believes they set. */
|
|
148
148
|
const SETTINGS = ['server', 'project', 'key', 'setup', 'mode', 'path',
|
|
149
|
-
'domains', 'version', 'environment', 'labels', 'zone', 'page'
|
|
149
|
+
'domains', 'version', 'environment', 'labels', 'zone', 'page',
|
|
150
|
+
'author', 'container'];
|
|
151
|
+
|
|
152
|
+
/* THE OBJECT-ONLY OPTIONS. Each carries a live JavaScript value -- a function,
|
|
153
|
+
or an element -- that a data- attribute cannot hold and a tag therefore
|
|
154
|
+
cannot declare: they are read from window.annotepageConfig alone, never from
|
|
155
|
+
the tag. They are NOT part of what makes a configuration (COPY_IDENTITY
|
|
156
|
+
leaves them out), because they are the host page wiring ITSELF to the tool,
|
|
157
|
+
not a statement about which project runs here: two copies that differ only
|
|
158
|
+
by them are the same configuration, and a router re-executing the tag does
|
|
159
|
+
not bring a second tool.
|
|
160
|
+
|
|
161
|
+
`container` is in SETTINGS above and not here, because it also has a string
|
|
162
|
+
form -- a selector -- that a tag can carry; its element form is read beside
|
|
163
|
+
these two (adoptObjectOption). Each is documented in the client's README,
|
|
164
|
+
and client/tools/check.mjs refuses a list that has drifted from it. */
|
|
165
|
+
const OBJECT_OPTIONS = ['frame', 'onChange'];
|
|
150
166
|
|
|
151
167
|
/* Not "written": 60-ui already holds a local of that name, and a helper of the
|
|
152
168
|
whole file shadowed inside one function is a reader's trap for nothing. */
|
|
@@ -236,8 +252,14 @@
|
|
|
236
252
|
still holding the document would read this one's identity as a different
|
|
237
253
|
configuration and warn about a second tool, on a page carrying one tag.
|
|
238
254
|
|
|
239
|
-
3 SINCE `page` JOINED THEM, for that same reason.
|
|
240
|
-
|
|
255
|
+
3 SINCE `page` JOINED THEM, for that same reason.
|
|
256
|
+
|
|
257
|
+
4 SINCE `author` AND `container` JOINED THE SETTINGS -- two more members in
|
|
258
|
+
every identity. The object-only options (OBJECT_OPTIONS: frame, onChange)
|
|
259
|
+
add NO member: they are left out of the identity on purpose, so that a page
|
|
260
|
+
wiring a callback or an iframe to the tool is not read as a second tool, and
|
|
261
|
+
a router re-executing its tag is still the same configuration. */
|
|
262
|
+
const IDENTITY_FORMAT = 'annotepage/identity/4';
|
|
241
263
|
const readableIdentity = (value) =>
|
|
242
264
|
typeof value === 'string' && value.indexOf('["' + IDENTITY_FORMAT + '",') === 0;
|
|
243
265
|
const REFUSED_KEPT = 8;
|
|
@@ -313,6 +335,13 @@
|
|
|
313
335
|
for (let i = 0; i < names.length; i += 1) {
|
|
314
336
|
const name = names[i];
|
|
315
337
|
if (name === 'version') continue;
|
|
338
|
+
/* The object-only options are left out of the identity (see
|
|
339
|
+
OBJECT_OPTIONS): a page wiring a callback or an iframe to the tool
|
|
340
|
+
is the same configuration with or without them. `container` stays
|
|
341
|
+
when it is a selector -- a real setting -- and leaves when it is an
|
|
342
|
+
element, which is page wiring like the other two. */
|
|
343
|
+
if (name === 'frame' || name === 'onChange') continue;
|
|
344
|
+
if (name === 'container' && typeof object[name] !== 'string') continue;
|
|
316
345
|
let text;
|
|
317
346
|
try {
|
|
318
347
|
text = SETTINGS.indexOf(name) === -1
|
|
@@ -396,16 +425,40 @@
|
|
|
396
425
|
sources can be compared at all. */
|
|
397
426
|
if (declaredIn(data, 'setup')) fromTag.setup = 'yes';
|
|
398
427
|
|
|
428
|
+
/* THE OBJECT-ONLY OPTIONS, read apart from the string settings. Each carries a
|
|
429
|
+
live value a tag cannot hold: a function (onChange), or an element (frame,
|
|
430
|
+
and container in its element form). They never go into `fromPage`, so the
|
|
431
|
+
two-sources agreement below never compares them and the identity above never
|
|
432
|
+
includes them -- they are the page wiring itself to the tool, honoured even
|
|
433
|
+
when a tag is what configures the project. */
|
|
434
|
+
const pageHandles = {};
|
|
435
|
+
const isElement = (v) => !!v && typeof v === 'object' && v.nodeType === 1;
|
|
436
|
+
|
|
399
437
|
const fromPage = {};
|
|
400
438
|
if (HAS_CONFIG && !CONFIG_FAILURE) {
|
|
401
439
|
const names = Object.keys(declaredConfig);
|
|
402
440
|
for (let i = 0; i < names.length; i += 1) {
|
|
403
441
|
const name = names[i];
|
|
404
442
|
const value = declaredConfig[name];
|
|
405
|
-
if (SETTINGS.indexOf(name) === -1) {
|
|
443
|
+
if (SETTINGS.indexOf(name) === -1 && OBJECT_OPTIONS.indexOf(name) === -1) {
|
|
406
444
|
refuse('tag.config_setting', { name: name },
|
|
407
445
|
'window.annotepageConfig carries "' + name + '", which is not a '
|
|
408
446
|
+ 'setting of this client. Nothing was read from it.');
|
|
447
|
+
} else if (name === 'onChange') {
|
|
448
|
+
// A function, never text: it is kept as a handle, not a setting.
|
|
449
|
+
if (typeof value === 'function') pageHandles.onChange = value;
|
|
450
|
+
else refuse('tag.config_function', { name: name },
|
|
451
|
+
'"onChange" in window.annotepageConfig has to be a function. '
|
|
452
|
+
+ 'Nothing was read from it.');
|
|
453
|
+
} else if (name === 'frame') {
|
|
454
|
+
if (isElement(value)) pageHandles.frame = value;
|
|
455
|
+
else refuse('tag.config_element', { name: name },
|
|
456
|
+
'"frame" in window.annotepageConfig has to be an element, the '
|
|
457
|
+
+ '<iframe> to annotate. Nothing was read from it.');
|
|
458
|
+
} else if (name === 'container' && isElement(value)) {
|
|
459
|
+
// The element form of container; its selector form falls through to
|
|
460
|
+
// the string branch below and is a setting like any other.
|
|
461
|
+
pageHandles.container = value;
|
|
409
462
|
} else if (name === 'setup') {
|
|
410
463
|
fromPage.setup = value ? 'yes' : 'no';
|
|
411
464
|
} else if (typeof value === 'string') {
|
|
@@ -654,6 +707,29 @@
|
|
|
654
707
|
That is the rule of silence, applied to setup. */
|
|
655
708
|
const SETUP_REQUESTED = read('setup') === 'yes';
|
|
656
709
|
|
|
710
|
+
/* -- The embedding options --------------------------------------------------
|
|
711
|
+
Each is off by default: without it, the tool behaves exactly as it did
|
|
712
|
+
before any of this existed.
|
|
713
|
+
|
|
714
|
+
AUTHOR -- the signature the host declares. Given, the tool signs with it and
|
|
715
|
+
never shows the "your name" field; empty is "not given", and the tool asks
|
|
716
|
+
and remembers as it always has. Not normalised here -- 10-utils is evaluated
|
|
717
|
+
later -- so 90-boot trims and clips it (MAX_AUTHOR) where the name is read. */
|
|
718
|
+
const DECLARED_AUTHOR = read('author');
|
|
719
|
+
const AUTHOR_FIXED = DECLARED_AUTHOR !== '';
|
|
720
|
+
|
|
721
|
+
/* CONTAINER -- where the panel is drawn. An element handed in the object
|
|
722
|
+
(CONTAINER_EL), or a selector resolved against the document when the UI is
|
|
723
|
+
built (CONTAINER_SELECTOR). With neither, the panel floats as always.
|
|
724
|
+
FRAME -- the <iframe> whose page is annotated. ON_CHANGE -- the host's hook,
|
|
725
|
+
called when a remark is added, resolved or reopened. All three are page
|
|
726
|
+
wiring: read from the object alone, and only when the configuration is sound
|
|
727
|
+
(a refused one draws nothing, so its handles would never be used). */
|
|
728
|
+
const CONTAINER_EL = (!CONFIG_FAILURE && pageHandles.container) || null;
|
|
729
|
+
const CONTAINER_SELECTOR = read('container');
|
|
730
|
+
const FRAME_EL = (!CONFIG_FAILURE && pageHandles.frame) || null;
|
|
731
|
+
const ON_CHANGE = (!CONFIG_FAILURE && pageHandles.onChange) || null;
|
|
732
|
+
|
|
657
733
|
/* Note-taking context, DECLARED by the host site, never guessed. A
|
|
658
734
|
standalone tool cannot know how the site names its version; the site
|
|
659
735
|
does. Without these the fields stay empty: an invented version would send
|
|
@@ -826,6 +902,19 @@
|
|
|
826
902
|
const pageLanguage = () =>
|
|
827
903
|
(document.documentElement.getAttribute('lang') || '').trim();
|
|
828
904
|
|
|
905
|
+
/**
|
|
906
|
+
* A count, with its thousands apart: 6204 is read digit by digit, 6,204 at a
|
|
907
|
+
* glance. Written the way the DOCUMENT's language writes it, like the dates
|
|
908
|
+
* below, and the plain digits where that language is not one the browser knows.
|
|
909
|
+
*/
|
|
910
|
+
const readableNumber = (n) => {
|
|
911
|
+
try {
|
|
912
|
+
return Number(n).toLocaleString(pageLanguage() || 'en');
|
|
913
|
+
} catch (e) {
|
|
914
|
+
return String(n);
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
|
|
829
918
|
/**
|
|
830
919
|
* ISO date from the server -> THE READER'S LOCAL TIME.
|
|
831
920
|
*
|
|
@@ -1013,29 +1102,29 @@
|
|
|
1013
1102
|
'config.author': 'Assistant',
|
|
1014
1103
|
'config.warn': 'It carries your key. Anyone holding this file can read '
|
|
1015
1104
|
+ 'these notes and write them.',
|
|
1016
|
-
'panel.
|
|
1105
|
+
'panel.stats_written': 'notes written',
|
|
1106
|
+
'panel.stats_servers': 'servers',
|
|
1017
1107
|
'panel.stats_open': 'still open',
|
|
1018
1108
|
'panel.stats_pages': 'pages',
|
|
1019
1109
|
'panel.stats_sites': 'sites',
|
|
1020
1110
|
/* THE SINGULAR OF EACH, looked up when the figure is 1. A translation
|
|
1021
1111
|
that writes none of these falls back on the plural above, in English,
|
|
1022
1112
|
like every other missing label. */
|
|
1023
|
-
'panel.
|
|
1113
|
+
'panel.stats_written_one': 'note written',
|
|
1114
|
+
'panel.stats_servers_one': 'server',
|
|
1024
1115
|
'panel.stats_open_one': 'still open',
|
|
1025
1116
|
'panel.stats_pages_one': 'page',
|
|
1026
1117
|
'panel.stats_sites_one': 'site',
|
|
1027
|
-
/* WHAT WENT, AND WHY THE WINDOW SAYS IT AT ALL. The panel already warns
|
|
1028
|
-
that this server removes a thread after so many days; a reviewer who
|
|
1029
|
-
comes back to a page they annotated and finds it bare deserves the
|
|
1030
|
-
figure that turns a hole into a fact. "Removed by age" and not
|
|
1031
|
-
"deleted": nobody chose these, which is the whole point. */
|
|
1032
1118
|
'panel.stats_here_label': 'On this site',
|
|
1033
|
-
'panel.stats_gone_label': 'Removed by age',
|
|
1034
|
-
'panel.stats_swept': 'last sweep {d}',
|
|
1035
1119
|
/* THE WHOLE SERVER, on the servers that publish it -- most do not, and
|
|
1036
1120
|
then this line is never drawn. "This server" and not "the API": the
|
|
1037
1121
|
reviewer is being told about the machine holding their notes. */
|
|
1038
1122
|
'panel.stats_server_label': 'On this whole server',
|
|
1123
|
+
/* EVERY SERVER TOGETHER, where this one takes part in the statistics. The
|
|
1124
|
+
second label follows the first on the same line, quieter: the figures
|
|
1125
|
+
came with the server's last daily report and are as old as it is. */
|
|
1126
|
+
'panel.stats_world_label': 'On all annotepage servers',
|
|
1127
|
+
'panel.stats_daily': 'updated daily',
|
|
1039
1128
|
'panel.refresh': 'Refresh',
|
|
1040
1129
|
|
|
1041
1130
|
/* -- Notes whose element cannot be found any more ------------------- */
|
|
@@ -1637,6 +1726,10 @@
|
|
|
1637
1726
|
|
|
1638
1727
|
let host = null; // the single element added to the site
|
|
1639
1728
|
let root = null; // its shadow root
|
|
1729
|
+
let dockEl = null; // the element the panel is drawn INSIDE (container
|
|
1730
|
+
// option), or null when the tool floats as it always
|
|
1731
|
+
// has. Set at buildHost, read where the host is put
|
|
1732
|
+
// back after a navigation (85-pages)
|
|
1640
1733
|
let ui = null; // the interface elements, once built
|
|
1641
1734
|
let mode = false; // is annotation mode on?
|
|
1642
1735
|
let notes = []; // the page's notes, as the server states them
|
|
@@ -1657,6 +1750,10 @@
|
|
|
1657
1750
|
let serverWide = null; // { projects, notes, pages } for the WHOLE server,
|
|
1658
1751
|
// and only where its operator published them.
|
|
1659
1752
|
// Absent everywhere else, on purpose
|
|
1753
|
+
let world = null; // { servers|null, sites|null, notes } for EVERY annotepage
|
|
1754
|
+
// server together, as this one was last told.
|
|
1755
|
+
// null where the server takes no part in the
|
|
1756
|
+
// statistics, or has not reported yet
|
|
1660
1757
|
let target = null; // element being annotated
|
|
1661
1758
|
let hovered = null; // element under the pointer
|
|
1662
1759
|
let currentFailure = null; // { title, detail } shown in the panel
|
|
@@ -1794,6 +1891,13 @@
|
|
|
1794
1891
|
|
|
1795
1892
|
function writeAuthor(value) {
|
|
1796
1893
|
author = value;
|
|
1894
|
+
// A DECLARED author (AUTHOR_FIXED, 00-preamble) is the host's to set, not
|
|
1895
|
+
// the browser's to remember: it is kept in memory for the session -- which
|
|
1896
|
+
// the line above does -- and never written to the shared author key, where
|
|
1897
|
+
// it would bleed onto every other project reviewed from this browser. This
|
|
1898
|
+
// is also the "keep in memory even when storage throws" the option asks
|
|
1899
|
+
// for: the value is held whatever the storage does, with nothing said.
|
|
1900
|
+
if (AUTHOR_FIXED) return;
|
|
1797
1901
|
try {
|
|
1798
1902
|
window.localStorage.setItem(AUTHOR_KEY, value);
|
|
1799
1903
|
} catch (e) {
|
|
@@ -2330,6 +2434,23 @@
|
|
|
2330
2434
|
};
|
|
2331
2435
|
};
|
|
2332
2436
|
|
|
2437
|
+
/* WHAT EVERY ANNOTEPAGE SERVER HOLDS, TOGETHER. Three numbers this server was
|
|
2438
|
+
handed with the answer to its daily report and passes on: this page asks
|
|
2439
|
+
nobody else for them. Absent from a server that takes no part in the
|
|
2440
|
+
statistics and from one older than the field, and then null draws nothing. */
|
|
2441
|
+
const readWorld = (data) => {
|
|
2442
|
+
const w = data && data.world;
|
|
2443
|
+
if (!w || typeof w !== 'object') return null;
|
|
2444
|
+
const n = (v) => (typeof v === 'number' && isFinite(v) && v >= 0 ? Math.floor(v) : null);
|
|
2445
|
+
const notes = n(w.notes);
|
|
2446
|
+
if (notes === null) return null;
|
|
2447
|
+
/* THE COUNTS OF SERVERS AND OF SITES ARE THE SERVER'S TO GIVE OR NOT. It
|
|
2448
|
+
leaves each out while there are few -- "2 servers" beside five thousand
|
|
2449
|
+
notes reads as a small thing, and it is not one -- and then the row is
|
|
2450
|
+
the figures that are there. */
|
|
2451
|
+
return { servers: n(w.servers), sites: n(w.sites), notes: notes };
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2333
2454
|
const readList = (data) => {
|
|
2334
2455
|
skipped = { newer: 0, unreadable: 0, unknown: 0 };
|
|
2335
2456
|
const raw = data && Array.isArray(data.notes) ? data.notes : [];
|
|
@@ -2572,6 +2693,17 @@
|
|
|
2572
2693
|
* load them into -- but it shows nothing: the interface itself is only built
|
|
2573
2694
|
* once the texts are available.
|
|
2574
2695
|
*/
|
|
2696
|
+
/* The first element matching a selector, or null -- and null, not a throw, for
|
|
2697
|
+
a selector the browser cannot parse. The container option takes a selector
|
|
2698
|
+
from the host page, and a mistake in it must not take the whole tool down. */
|
|
2699
|
+
const firstMatch = (selector) => {
|
|
2700
|
+
try {
|
|
2701
|
+
return document.querySelector(selector);
|
|
2702
|
+
} catch (e) {
|
|
2703
|
+
return null;
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
|
|
2575
2707
|
const buildHost = () => {
|
|
2576
2708
|
// IDEMPOTENT, and this is not a stylistic precaution: the key-pasting
|
|
2577
2709
|
// screen built the host BEFORE the normal startup asked for it in turn.
|
|
@@ -2580,20 +2712,52 @@
|
|
|
2580
2712
|
// first pasted key.
|
|
2581
2713
|
if (host) return;
|
|
2582
2714
|
host = document.createElement('annotepage-notes');
|
|
2715
|
+
|
|
2716
|
+
/* WHERE THE TOOL IS DRAWN. By default it floats: the host is a full-screen,
|
|
2717
|
+
click-through layer pinned to the viewport, exactly as it has always
|
|
2718
|
+
been. With the `container` option it is DOCKED instead -- the host fills
|
|
2719
|
+
the element the host page handed over, the panel fills the host, and
|
|
2720
|
+
there is no floating button (the page opens and closes it, see buildUi).
|
|
2721
|
+
A container asked for but not found on the page is said once and the tool
|
|
2722
|
+
floats: a tool that draws nothing, silently, is the failure nobody finds. */
|
|
2723
|
+
dockEl = CONTAINER_EL
|
|
2724
|
+
|| (CONTAINER_SELECTOR ? firstMatch(CONTAINER_SELECTOR) : null);
|
|
2725
|
+
if (!dockEl && (CONTAINER_EL || CONTAINER_SELECTOR)) {
|
|
2726
|
+
complain('the container "' + (CONTAINER_SELECTOR || '[element]') + '" was not '
|
|
2727
|
+
+ 'found on the page; the tool falls back to its floating button.');
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2583
2730
|
// These properties are set INLINE and with !important, on our own
|
|
2584
2731
|
// element: a site rule aiming at "body > div" must not be able to move
|
|
2585
2732
|
// the layer. "all: initial" also cuts off any inheritance from the site
|
|
2586
2733
|
// into the tool.
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2734
|
+
if (dockEl) {
|
|
2735
|
+
/* DOCKED: the host fills the element it was given and takes part in its
|
|
2736
|
+
layout (position: relative, so the panel's absolute fill is measured
|
|
2737
|
+
against it). Still click-through at the host -- only the panel inside
|
|
2738
|
+
takes clicks -- and the markers and highlight stay viewport-fixed, so
|
|
2739
|
+
pointing at the page works exactly as when floating. */
|
|
2740
|
+
host.style.cssText =
|
|
2741
|
+
'all: initial !important;' +
|
|
2742
|
+
'position: relative !important;' +
|
|
2743
|
+
'display: block !important;' +
|
|
2744
|
+
'width: 100% !important; height: 100% !important;' +
|
|
2745
|
+
'margin: 0 !important; padding: 0 !important; border: 0 !important;' +
|
|
2746
|
+
'pointer-events: none !important;' +
|
|
2747
|
+
'z-index: 2147483000 !important;';
|
|
2748
|
+
dockEl.appendChild(host);
|
|
2749
|
+
} else {
|
|
2750
|
+
host.style.cssText =
|
|
2751
|
+
'all: initial !important;' +
|
|
2752
|
+
'position: fixed !important;' +
|
|
2753
|
+
'top: 0 !important; left: 0 !important;' +
|
|
2754
|
+
'right: 0 !important; bottom: 0 !important;' +
|
|
2755
|
+
'width: auto !important; height: auto !important;' +
|
|
2756
|
+
'margin: 0 !important; padding: 0 !important; border: 0 !important;' +
|
|
2757
|
+
'pointer-events: none !important;' +
|
|
2758
|
+
'z-index: 2147483000 !important;';
|
|
2759
|
+
document.body.appendChild(host);
|
|
2760
|
+
}
|
|
2597
2761
|
// And kept there: a router that swaps the body takes it along (85-pages).
|
|
2598
2762
|
watchHost();
|
|
2599
2763
|
root = host.attachShadow({ mode: 'open' });
|
|
@@ -2641,6 +2805,10 @@
|
|
|
2641
2805
|
/** The interface. Built AFTER the labels: no fallback text to put in. */
|
|
2642
2806
|
const buildUi = () => {
|
|
2643
2807
|
const layer = create('div', 'ap-layer');
|
|
2808
|
+
// DOCKED (container option): the panel fills the host and there is no
|
|
2809
|
+
// floating button. One class carries both, so the floating stylesheet is
|
|
2810
|
+
// untouched -- without `container`, this class is never added.
|
|
2811
|
+
if (dockEl) layer.classList.add('ap-docked');
|
|
2644
2812
|
root.appendChild(layer);
|
|
2645
2813
|
|
|
2646
2814
|
/* -- the button -- */
|
|
@@ -2750,6 +2918,42 @@
|
|
|
2750
2918
|
};
|
|
2751
2919
|
|
|
2752
2920
|
applySide();
|
|
2921
|
+
if (dockEl) publishController();
|
|
2922
|
+
};
|
|
2923
|
+
|
|
2924
|
+
/* THE HOST PAGE'S HANDLE ON A DOCKED TOOL. With no floating button, the page is
|
|
2925
|
+
what opens and closes annotation mode, so the tool hands it a small controller
|
|
2926
|
+
ON THE CONTAINER ELEMENT and raises a `ready` event on it. The event may be
|
|
2927
|
+
missed by a listener attached too late; the handle is a property as well, so
|
|
2928
|
+
the page can either wait for the event or read `el.annotepage` when it likes.
|
|
2929
|
+
|
|
2930
|
+
const box = document.querySelector('#remarks');
|
|
2931
|
+
const wire = () => myButton.onclick = () => box.annotepage.toggle();
|
|
2932
|
+
box.annotepage ? wire() : box.addEventListener('annotepage:ready', wire);
|
|
2933
|
+
|
|
2934
|
+
Nothing here reaches into the page; the page reaches into nothing of ours. */
|
|
2935
|
+
const publishController = () => {
|
|
2936
|
+
if (!dockEl) return;
|
|
2937
|
+
const controller = {
|
|
2938
|
+
open: () => { if (!mode) enterMode(); },
|
|
2939
|
+
close: () => { if (mode) leaveMode(); },
|
|
2940
|
+
toggle: () => toggleMode(),
|
|
2941
|
+
get isOpen() { return mode; }
|
|
2942
|
+
};
|
|
2943
|
+
try {
|
|
2944
|
+
dockEl.annotepage = controller;
|
|
2945
|
+
} catch (e) {
|
|
2946
|
+
// A frozen or exotic element we cannot write a property on: the event
|
|
2947
|
+
// below still fires, and the page can keep its own reference from it.
|
|
2948
|
+
}
|
|
2949
|
+
try {
|
|
2950
|
+
dockEl.dispatchEvent(new CustomEvent('annotepage:ready', {
|
|
2951
|
+
detail: { annotepage: controller }
|
|
2952
|
+
}));
|
|
2953
|
+
} catch (e) {
|
|
2954
|
+
// CustomEvent absent (it is everywhere the tool runs) or dispatch
|
|
2955
|
+
// refused: the property above remains the way in.
|
|
2956
|
+
}
|
|
2753
2957
|
};
|
|
2754
2958
|
|
|
2755
2959
|
/* -- What the whole project holds ----------------------------------------
|
|
@@ -2778,60 +2982,64 @@
|
|
|
2778
2982
|
one, which is the rule everywhere else here. */
|
|
2779
2983
|
const figure = (n, word) => {
|
|
2780
2984
|
const box = create('span', 'ap-stat');
|
|
2781
|
-
box.appendChild(create('span', 'ap-stat-n',
|
|
2985
|
+
box.appendChild(create('span', 'ap-stat-n', readableNumber(n)));
|
|
2782
2986
|
box.appendChild(create('span', 'ap-stat-w', T(n === 1 ? word + '_one' : word)));
|
|
2783
2987
|
return box;
|
|
2784
2988
|
};
|
|
2785
2989
|
|
|
2786
|
-
/*
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
const block = (label) => {
|
|
2990
|
+
/* UP TO THREE ROWS OF ONE SHAPE: this site, the server holding it, every
|
|
2991
|
+
server there is. A label and at most three figures each, the same size
|
|
2992
|
+
in all three -- the last row is one more scope, not an advertisement.
|
|
2993
|
+
The first is always there; each of the others only where this server
|
|
2994
|
+
has it to give. */
|
|
2995
|
+
const block = (label, aside) => {
|
|
2792
2996
|
const box = create('div', 'ap-stats-block');
|
|
2793
|
-
|
|
2997
|
+
const head = create('span', 'ap-stat-label', T(label));
|
|
2998
|
+
if (aside) head.appendChild(create('span', 'ap-stat-aside', T(aside)));
|
|
2999
|
+
box.appendChild(head);
|
|
2794
3000
|
const row = create('div', 'ap-panel-stats');
|
|
2795
3001
|
box.appendChild(row);
|
|
2796
3002
|
rows.appendChild(box);
|
|
2797
3003
|
return { box: box, row: row };
|
|
2798
3004
|
};
|
|
2799
3005
|
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
T('panel.stats_swept', { d: readableDate(last) })));
|
|
2808
|
-
}
|
|
2809
|
-
box.appendChild(line);
|
|
2810
|
-
};
|
|
3006
|
+
/* NOTES WRITTEN, AND WHAT AGE TOOK IS AMONG THEM. A server that removes
|
|
3007
|
+
old threads used to show what was left and, on a line of its own, what
|
|
3008
|
+
had gone: two figures to add up for one answer, and a count of notes
|
|
3009
|
+
that went DOWN on a site people were still using. What was written was
|
|
3010
|
+
written. "Written" is in the label so that "still open" beside it reads
|
|
3011
|
+
as a part of it and not as a second count of the same thing. */
|
|
3012
|
+
const gone = expired !== null ? expired : { notes: 0, pages: 0 };
|
|
2811
3013
|
|
|
2812
3014
|
const here = block('panel.stats_here_label');
|
|
2813
|
-
here.row.appendChild(figure(totals.notes, 'panel.
|
|
3015
|
+
here.row.appendChild(figure(totals.notes + gone.notes, 'panel.stats_written'));
|
|
2814
3016
|
here.row.appendChild(figure(totals.open, 'panel.stats_open'));
|
|
2815
|
-
here.row.appendChild(figure(totals.pages, 'panel.stats_pages'));
|
|
2816
|
-
/* Drawn only where the server counts AND something can go: a server with
|
|
2817
|
-
no retention has nothing to report, and one that has never swept says
|
|
2818
|
-
zero, which is an answer and not a blank. */
|
|
2819
|
-
if (expired !== null && (retention > 0 || expired.notes > 0 || expired.pages > 0)) {
|
|
2820
|
-
removed(here.box, expired.notes, expired.pages, expired.last);
|
|
2821
|
-
}
|
|
3017
|
+
here.row.appendChild(figure(totals.pages + gone.pages, 'panel.stats_pages'));
|
|
2822
3018
|
|
|
2823
|
-
/*
|
|
3019
|
+
/* THE WHOLE SERVER, on the servers whose operator chose to publish it.
|
|
2824
3020
|
Absent everywhere else -- see `publish_server_totals`, which is off until
|
|
2825
|
-
somebody writes it
|
|
2826
|
-
|
|
3021
|
+
somebody writes it. Sites and notes: pages are a figure of the site,
|
|
3022
|
+
where the reader can see them. */
|
|
2827
3023
|
if (serverWide !== null) {
|
|
2828
3024
|
const all = block('panel.stats_server_label');
|
|
2829
3025
|
all.row.appendChild(figure(serverWide.projects, 'panel.stats_sites'));
|
|
2830
|
-
all.row.appendChild(figure(serverWide.notes, 'panel.
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
3026
|
+
all.row.appendChild(figure(serverWide.notes + serverWide.expiredNotes, 'panel.stats_written'));
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
/* AND EVERY SERVER TOGETHER, where this one takes part in the statistics.
|
|
3030
|
+
SERVERS AND SITES BEFORE NOTES: a count of notes alone could be one
|
|
3031
|
+
person's, and what a reader wants to know is whether anybody else uses
|
|
3032
|
+
this. The figures are a day old, and the label says so. */
|
|
3033
|
+
if (world !== null) {
|
|
3034
|
+
const everywhere = block('panel.stats_world_label', 'panel.stats_daily');
|
|
3035
|
+
everywhere.box.classList.add('ap-stats-world');
|
|
3036
|
+
if (world.servers !== null) {
|
|
3037
|
+
everywhere.row.appendChild(figure(world.servers, 'panel.stats_servers'));
|
|
2834
3038
|
}
|
|
3039
|
+
if (world.sites !== null) {
|
|
3040
|
+
everywhere.row.appendChild(figure(world.sites, 'panel.stats_sites'));
|
|
3041
|
+
}
|
|
3042
|
+
everywhere.row.appendChild(figure(world.notes, 'panel.stats_written'));
|
|
2835
3043
|
}
|
|
2836
3044
|
|
|
2837
3045
|
return rows;
|
|
@@ -3414,7 +3622,11 @@
|
|
|
3414
3622
|
if (name) writeAuthor(name);
|
|
3415
3623
|
block.remove();
|
|
3416
3624
|
// As everywhere: we read the server back instead of assuming.
|
|
3417
|
-
reload();
|
|
3625
|
+
const done = reload();
|
|
3626
|
+
// The host hears of it once the counts are the panel's again:
|
|
3627
|
+
// "resolved" when a fix was marked, "reopened" when one was
|
|
3628
|
+
// taken back. Nothing fires without a hook (notifyChange).
|
|
3629
|
+
if (ON_CHANGE) done.then(() => notifyChange(mark ? 'resolved' : 'reopened', note));
|
|
3418
3630
|
}, () => {
|
|
3419
3631
|
confirm.disabled = false;
|
|
3420
3632
|
cancel.disabled = false;
|
|
@@ -3922,6 +4134,43 @@
|
|
|
3922
4134
|
return block;
|
|
3923
4135
|
};
|
|
3924
4136
|
|
|
4137
|
+
/* WHAT IS STILL IN FRONT OF THE READER, AND HOW MANY THERE HAVE BEEN, in one
|
|
4138
|
+
place: the button's count, and the hook's. The same test the panel uses to
|
|
4139
|
+
fold a note away -- resolved AND online has done its job, anything else is
|
|
4140
|
+
still there. Orphans count with the rest: they are shown, so they are in
|
|
4141
|
+
front of somebody. */
|
|
4142
|
+
const pageCounts = () => {
|
|
4143
|
+
let open = 0;
|
|
4144
|
+
for (let i = 0; i < notes.length; i += 1) {
|
|
4145
|
+
const n = notes[i];
|
|
4146
|
+
if (!(n.resolved_at && alreadyDeployed(n.resolved_version))) open += 1;
|
|
4147
|
+
}
|
|
4148
|
+
return { open: open, total: notes.length };
|
|
4149
|
+
};
|
|
4150
|
+
|
|
4151
|
+
/* THE HOST'S HOOK (onChange, 00-preamble), called when a remark is ADDED,
|
|
4152
|
+
RESOLVED or REOPENED -- and for nothing else. It is the host page's own code,
|
|
4153
|
+
so it runs inside a try: a throw from it must not break a tool that has just
|
|
4154
|
+
succeeded at what it was asked, and the action itself is already done. The
|
|
4155
|
+
counts are the page's, read after the reload that every such action triggers,
|
|
4156
|
+
so they are exactly what the panel shows. */
|
|
4157
|
+
const notifyChange = (type, note) => {
|
|
4158
|
+
if (!ON_CHANGE) return;
|
|
4159
|
+
const counts = pageCounts();
|
|
4160
|
+
try {
|
|
4161
|
+
ON_CHANGE({
|
|
4162
|
+
type: type,
|
|
4163
|
+
id: note && note.id !== undefined && note.id !== null ? note.id : null,
|
|
4164
|
+
title: (note && (note.title || note.excerpt)) || '',
|
|
4165
|
+
open: counts.open,
|
|
4166
|
+
total: counts.total
|
|
4167
|
+
});
|
|
4168
|
+
} catch (e) {
|
|
4169
|
+
/* The host's hook threw: its problem, not the tool's. Nothing else is
|
|
4170
|
+
notified, by rule -- the tool tells the host, it does not react. */
|
|
4171
|
+
}
|
|
4172
|
+
};
|
|
4173
|
+
|
|
3925
4174
|
const drawPanel = () => {
|
|
3926
4175
|
/* HOW LONG A THREAD IS KEPT, refreshed with the rest: the value arrives
|
|
3927
4176
|
with the first list and can change under a server that was reconfigured
|
|
@@ -4051,13 +4300,18 @@
|
|
|
4051
4300
|
takes the whole width; everything after it starts a line. */
|
|
4052
4301
|
const who = create('div', 'ap-foot-who');
|
|
4053
4302
|
who.appendChild(create('span', null, T('author.known', { name: author })));
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4303
|
+
/* No way to change a DECLARED name: the host set it, and the field it
|
|
4304
|
+
would reopen is the one the option hides. The name is still SHOWN --
|
|
4305
|
+
you see what you sign with -- it just cannot be cleared from here. */
|
|
4306
|
+
if (!AUTHOR_FIXED) {
|
|
4307
|
+
const change = create('button', 'ap-link', T('author.change'));
|
|
4308
|
+
change.type = 'button';
|
|
4309
|
+
change.addEventListener('click', () => {
|
|
4310
|
+
writeAuthor('');
|
|
4311
|
+
drawPanel();
|
|
4312
|
+
});
|
|
4313
|
+
who.appendChild(change);
|
|
4314
|
+
}
|
|
4061
4315
|
ui.footer.appendChild(who);
|
|
4062
4316
|
}
|
|
4063
4317
|
|
|
@@ -4119,21 +4373,11 @@
|
|
|
4119
4373
|
ui.footer.appendChild(forget);
|
|
4120
4374
|
}
|
|
4121
4375
|
|
|
4122
|
-
/*
|
|
4123
|
-
The same test the panel uses to fold a note away, applied to the whole
|
|
4124
|
-
list: resolved AND online has done its job, anything else is still
|
|
4125
|
-
there. Orphans are counted with the rest -- they are shown, so they are
|
|
4126
|
-
in front of somebody.
|
|
4127
|
-
|
|
4128
|
-
The single number is kept while nothing has been fixed yet: "3 notes"
|
|
4376
|
+
/* The single number is kept while nothing has been fixed yet: "3 notes"
|
|
4129
4377
|
says it better than "3 of 3", and that is the state a page spends its
|
|
4130
|
-
first day in.
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
for (let i = 0; i < notes.length; i += 1) {
|
|
4134
|
-
const n = notes[i];
|
|
4135
|
-
if (!(n.resolved_at && alreadyDeployed(n.resolved_version))) open += 1;
|
|
4136
|
-
}
|
|
4378
|
+
first day in. The counts themselves are pageCounts (above), shared with
|
|
4379
|
+
the host's hook so the two never drift. */
|
|
4380
|
+
const { open, total } = pageCounts();
|
|
4137
4381
|
/* AND THE WINDOW FOLLOWS. Replying or resolving redraws this panel from
|
|
4138
4382
|
what the server answered; a window still showing the card as it was
|
|
4139
4383
|
would be the one place on screen telling the old story. The remark is
|
|
@@ -4310,16 +4554,20 @@
|
|
|
4310
4554
|
colleague who used the same machine. */
|
|
4311
4555
|
const reminder = create('div', 'ap-form-signature');
|
|
4312
4556
|
reminder.appendChild(create('span', null, T('author.known', { name: author })));
|
|
4313
|
-
|
|
4314
|
-
change
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4557
|
+
// A declared name is shown here too, so you see what you sign with, but
|
|
4558
|
+
// it offers no way to change it (AUTHOR_FIXED): that is the host's call.
|
|
4559
|
+
if (!AUTHOR_FIXED) {
|
|
4560
|
+
const change = create('button', 'ap-link', T('author.change'));
|
|
4561
|
+
change.type = 'button';
|
|
4562
|
+
change.addEventListener('click', () => {
|
|
4563
|
+
// The remark in progress is CARRIED OVER into the rebuilt form:
|
|
4564
|
+
// changing the name does not cost what has been written.
|
|
4565
|
+
const pending = area.value;
|
|
4566
|
+
writeAuthor('');
|
|
4567
|
+
openForm(el, pending);
|
|
4568
|
+
});
|
|
4569
|
+
reminder.appendChild(change);
|
|
4570
|
+
}
|
|
4323
4571
|
form.appendChild(reminder);
|
|
4324
4572
|
}
|
|
4325
4573
|
|
|
@@ -4372,6 +4620,9 @@
|
|
|
4372
4620
|
/* The page path goes into the PAYLOAD, never into the query string:
|
|
4373
4621
|
the server groups by blind index. In plain mode it still files it
|
|
4374
4622
|
in its "page" column, as in format 1. */
|
|
4623
|
+
// The ids present BEFORE the send, so the one the reload brings back can
|
|
4624
|
+
// be told from the rest and named to the host's hook (onChange).
|
|
4625
|
+
const before = notes.map((n) => n.id);
|
|
4375
4626
|
noteBody({
|
|
4376
4627
|
page: pagePath(),
|
|
4377
4628
|
selector: cssPath(el),
|
|
@@ -4394,7 +4645,17 @@
|
|
|
4394
4645
|
}
|
|
4395
4646
|
writeAuthor(writer);
|
|
4396
4647
|
closeForm();
|
|
4397
|
-
reload();
|
|
4648
|
+
const done = reload();
|
|
4649
|
+
// The host hears "added" once the new remark is on the list, named
|
|
4650
|
+
// by the note the reload brought back that was not there before.
|
|
4651
|
+
// Nothing fires without a hook (notifyChange).
|
|
4652
|
+
if (ON_CHANGE) done.then(() => {
|
|
4653
|
+
let added = null;
|
|
4654
|
+
for (let i = 0; i < notes.length; i += 1) {
|
|
4655
|
+
if (before.indexOf(notes[i].id) === -1) { added = notes[i]; break; }
|
|
4656
|
+
}
|
|
4657
|
+
notifyChange('added', added || { id: null, title: excerpt });
|
|
4658
|
+
});
|
|
4398
4659
|
}, () => {
|
|
4399
4660
|
send.disabled = false;
|
|
4400
4661
|
cancel.disabled = false;
|
|
@@ -5564,6 +5825,12 @@
|
|
|
5564
5825
|
if (found[i] !== host && !found[i].shadowRoot) found[i].remove();
|
|
5565
5826
|
}
|
|
5566
5827
|
if (!detached) return;
|
|
5828
|
+
/* DOCKED (container option): the host belongs INSIDE the page's element,
|
|
5829
|
+
not on the body. While that element is here, the host goes back into it;
|
|
5830
|
+
once the page has taken its own element away, there is nowhere of ours to
|
|
5831
|
+
put the host back -- the page owns that element's life, and pinning the
|
|
5832
|
+
panel to the body instead would be worse than letting it go with it. */
|
|
5833
|
+
if (dockEl && !dockEl.isConnected) return;
|
|
5567
5834
|
if (!reattachAllowed(reattached, Date.now())) {
|
|
5568
5835
|
/* THE BOOT UNDER WAY ENDS HERE TOO. The ping-pong runs in microtasks,
|
|
5569
5836
|
so it can spend the budget while a label file is still on the
|
|
@@ -5585,7 +5852,7 @@
|
|
|
5585
5852
|
}
|
|
5586
5853
|
return;
|
|
5587
5854
|
}
|
|
5588
|
-
body.appendChild(host);
|
|
5855
|
+
(dockEl || body).appendChild(host);
|
|
5589
5856
|
};
|
|
5590
5857
|
|
|
5591
5858
|
/**
|
|
@@ -5637,6 +5904,7 @@
|
|
|
5637
5904
|
retention = readRetention(r.data);
|
|
5638
5905
|
expired = readExpired(r.data);
|
|
5639
5906
|
serverWide = readServerTotals(r.data);
|
|
5907
|
+
world = readWorld(r.data);
|
|
5640
5908
|
return readList(r.data).then((read) => {
|
|
5641
5909
|
if (index !== PAGE_INDEX) return null;
|
|
5642
5910
|
notes = read;
|
|
@@ -5870,6 +6138,7 @@
|
|
|
5870
6138
|
retention = readRetention(first.data);
|
|
5871
6139
|
expired = readExpired(first.data);
|
|
5872
6140
|
serverWide = readServerTotals(first.data);
|
|
6141
|
+
world = readWorld(first.data);
|
|
5873
6142
|
return readList(first.data).then((read) => {
|
|
5874
6143
|
if (staleBoot(run, index)) return null;
|
|
5875
6144
|
notes = read;
|
|
@@ -5897,7 +6166,10 @@
|
|
|
5897
6166
|
// dropped when it lands (bootIsStale, 85-pages).
|
|
5898
6167
|
bootRun += 1;
|
|
5899
6168
|
const run = bootRun;
|
|
5900
|
-
author
|
|
6169
|
+
/* A DECLARED author wins and is NOT read from storage; otherwise the name
|
|
6170
|
+
this browser remembers, exactly as before. Trimmed and clipped here,
|
|
6171
|
+
where 10-utils exists -- the preamble that read it could not. */
|
|
6172
|
+
author = AUTHOR_FIXED ? clip(normalize(DECLARED_AUTHOR), MAX_AUTHOR) : readAuthor();
|
|
5901
6173
|
// Read ONCE, here, and never again: the side is asked of the storage at
|
|
5902
6174
|
// startup like the name, not at every draw.
|
|
5903
6175
|
side = readSide();
|
package/labels/fr.js
CHANGED
|
@@ -26,17 +26,19 @@
|
|
|
26
26
|
"panel.refresh": "Actualiser",
|
|
27
27
|
"panel.stats_label": "Les chiffres",
|
|
28
28
|
"panel.stats_here_label": "Sur ce site",
|
|
29
|
-
"panel.
|
|
29
|
+
"panel.stats_written": "notes écrites",
|
|
30
|
+
"panel.stats_servers": "serveurs",
|
|
30
31
|
"panel.stats_open": "encore ouvertes",
|
|
31
32
|
"panel.stats_pages": "pages",
|
|
32
33
|
"panel.stats_sites": "sites",
|
|
33
|
-
"panel.
|
|
34
|
+
"panel.stats_written_one": "note écrite",
|
|
35
|
+
"panel.stats_servers_one": "serveur",
|
|
34
36
|
"panel.stats_open_one": "encore ouverte",
|
|
35
37
|
"panel.stats_pages_one": "page",
|
|
36
38
|
"panel.stats_sites_one": "site",
|
|
37
|
-
"panel.stats_gone_label": "Supprimées par ancienneté",
|
|
38
|
-
"panel.stats_swept": "dernier passage {d}",
|
|
39
39
|
"panel.stats_server_label": "Sur tout le serveur",
|
|
40
|
+
"panel.stats_world_label": "Sur tous les serveurs annotepage",
|
|
41
|
+
"panel.stats_daily": "mis à jour chaque jour",
|
|
40
42
|
"orphans.title": "Notes dont l’élément a changé",
|
|
41
43
|
"orphans.help": "Ces remarques portaient sur un élément qui n’existe plus sous la même forme. Elles sont conservées telles quelles.",
|
|
42
44
|
"note.about": "À propos de : {excerpt}",
|
package/labels/fr.json
CHANGED
|
@@ -22,17 +22,19 @@
|
|
|
22
22
|
"panel.refresh": "Actualiser",
|
|
23
23
|
"panel.stats_label": "Les chiffres",
|
|
24
24
|
"panel.stats_here_label": "Sur ce site",
|
|
25
|
-
"panel.
|
|
25
|
+
"panel.stats_written": "notes écrites",
|
|
26
|
+
"panel.stats_servers": "serveurs",
|
|
26
27
|
"panel.stats_open": "encore ouvertes",
|
|
27
28
|
"panel.stats_pages": "pages",
|
|
28
29
|
"panel.stats_sites": "sites",
|
|
29
|
-
"panel.
|
|
30
|
+
"panel.stats_written_one": "note écrite",
|
|
31
|
+
"panel.stats_servers_one": "serveur",
|
|
30
32
|
"panel.stats_open_one": "encore ouverte",
|
|
31
33
|
"panel.stats_pages_one": "page",
|
|
32
34
|
"panel.stats_sites_one": "site",
|
|
33
|
-
"panel.stats_gone_label": "Supprimées par ancienneté",
|
|
34
|
-
"panel.stats_swept": "dernier passage {d}",
|
|
35
35
|
"panel.stats_server_label": "Sur tout le serveur",
|
|
36
|
+
"panel.stats_world_label": "Sur tous les serveurs annotepage",
|
|
37
|
+
"panel.stats_daily": "mis à jour chaque jour",
|
|
36
38
|
"orphans.title": "Notes dont l’élément a changé",
|
|
37
39
|
"orphans.help": "Ces remarques portaient sur un élément qui n’existe plus sous la même forme. Elles sont conservées telles quelles.",
|
|
38
40
|
"note.about": "À propos de : {excerpt}",
|
package/package.json
CHANGED