@ascribed/review 0.2.0 → 0.2.1-next.10

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.
@@ -1 +1 @@
1
- export declare const OVERLAY_CSS = "\n:host {\n all: initial;\n --text: var(--ascribe-review-text, CanvasText);\n --muted: var(--ascribe-review-muted, #5b6475);\n --line: var(--ascribe-review-border, #d3d8e0);\n --surface: var(--ascribe-review-surface, Canvas);\n --thread: var(--ascribe-review-thread, #f5f7fb);\n --accent: var(--ascribe-review-focus, #1f6feb);\n --accent-text: var(--ascribe-review-accent-text, #ffffff);\n --input: var(--ascribe-review-input, var(--surface));\n --flash: var(--ascribe-review-flash, #fff6bf);\n --added: var(--ascribe-review-added, #1a7f37);\n --changed: var(--ascribe-review-changed, #8a5a00);\n --changed-background: var(--ascribe-review-changed-background, #fff1c2);\n --removed: var(--ascribe-review-removed, #c4222d);\n --removed-background: var(--ascribe-review-removed-background, #ffe4e2);\n --mono: var(--ascribe-review-mono, ui-monospace, monospace);\n font-family: var(--ascribe-review-font, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n font-size: 12.5px;\n line-height: 1.45;\n color: var(--text);\n}\n* {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\nbutton,\ntextarea,\ninput {\n font: inherit;\n color: inherit;\n}\nbutton {\n cursor: pointer;\n}\nbutton:disabled,\nbutton[aria-disabled=\"true\"] {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:focus-visible,\ntextarea:focus-visible,\ninput:focus-visible,\n.thread:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 1px;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n/* Buttons */\n.ghost {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n padding: 2px 8px;\n font-size: 12px;\n min-height: 24px;\n}\n.ghost:hover:not(:disabled):not([aria-disabled=\"true\"]) {\n border-color: var(--accent);\n color: var(--accent);\n}\n.primary {\n border: 1px solid var(--accent);\n background: var(--accent);\n color: var(--accent-text);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.danger {\n border: 1px solid var(--removed);\n background: var(--removed);\n color: var(--surface);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.link {\n border: 0;\n background: transparent;\n color: var(--accent);\n padding: 0;\n font-size: inherit;\n text-align: inherit;\n}\na.link {\n text-decoration: none;\n}\n.link:hover {\n text-decoration: underline;\n}\n.hint {\n color: var(--muted);\n font-size: 11.5px;\n}\n.refuse,\n.error {\n color: var(--removed);\n font-size: 12px;\n}\n.spacer {\n flex: 1;\n}\n\n/* The layer over the page: the column, markers' panel, dialogs. */\n.layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.layer > *,\n.column > * {\n pointer-events: auto;\n}\n.column {\n position: absolute;\n top: 0;\n width: 250px;\n pointer-events: none;\n}\n.slot {\n position: absolute;\n left: 0;\n right: 0;\n}\n.slot > .thread,\n.slot > .composer {\n margin: 0 0 6px;\n}\n.slot.linked .thread,\n.slot.linked .composer {\n border-color: var(--accent);\n}\n.highlight {\n position: absolute;\n pointer-events: none;\n background: color-mix(in srgb, var(--flash) 55%, transparent);\n border-radius: 3px;\n /* Over the page's text, a tint that keeps the text as it was: multiplied\n on a light page, screened on a dark one. */\n mix-blend-mode: var(--ascribe-review-blend, multiply);\n}\nsvg.connector {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n overflow: visible;\n pointer-events: none;\n}\nsvg.connector path {\n fill: none;\n stroke: var(--accent);\n stroke-width: 1.5;\n}\n\n/* The block tools: the Comment button, and the count marker at narrow widths. */\n.tool {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n font-size: 11.5px;\n padding: 0 7px;\n min-height: 22px;\n color: var(--accent);\n white-space: nowrap;\n}\n.hint-count {\n margin-inline-start: 2px;\n font-size: 11px;\n font-weight: 600;\n color: var(--accent);\n}\n\n.marker {\n border: 1px solid var(--accent);\n background: var(--surface);\n color: var(--accent);\n border-radius: 999px;\n font-size: 11px;\n font-weight: 700;\n padding: 0 8px;\n min-width: 30px;\n min-height: 24px;\n}\n\n/* Threads */\n.thread {\n background: var(--thread);\n border: 1px solid var(--line);\n border-radius: 6px;\n margin: 6px 0 10px;\n}\n.th {\n display: flex;\n flex-wrap: wrap;\n gap: 3px 8px;\n align-items: center;\n padding: 5px 9px 2px;\n font-size: 11.5px;\n color: var(--muted);\n}\n.acts {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n padding: 0 9px 5px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n}\n.thread.collapsed .acts {\n border-bottom: 0;\n}\n.orig,\n.inside {\n padding: 5px 9px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n color: var(--muted);\n}\n.orig q {\n color: var(--text);\n white-space: pre-wrap;\n}\n.badge {\n border-radius: 999px;\n padding: 0 7px;\n font-size: 10.5px;\n font-weight: 600;\n border: 1px solid currentColor;\n white-space: nowrap;\n}\n.badge.unsent {\n color: var(--changed);\n}\n.badge.resolved {\n color: var(--added);\n}\n.badge.outdated {\n color: var(--muted);\n}\n.badge.summary {\n color: var(--accent);\n}\n.badge.removed,\n.badge.detached {\n color: var(--removed);\n}\n.comment {\n display: grid;\n grid-template-columns: 22px minmax(0, 1fr);\n gap: 7px;\n padding: 6px 9px;\n}\n.comment + .comment {\n border-top: 1px dashed var(--line);\n}\n.avatar {\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--accent);\n color: var(--accent-text);\n display: grid;\n place-items: center;\n font-size: 9.5px;\n font-weight: 700;\n}\n.who {\n font-weight: 600;\n}\n.when {\n color: var(--muted);\n font-size: 11px;\n margin-left: 6px;\n}\n.body {\n overflow-wrap: anywhere;\n}\n.body > :first-child {\n margin-top: 1px;\n}\n.body > :last-child {\n margin-bottom: 0;\n}\n.body p,\n.body ul,\n.body ol,\n.body blockquote,\n.body pre {\n margin: 4px 0;\n}\n.body ul,\n.body ol {\n padding-left: 18px;\n}\n.body blockquote {\n border-left: 3px solid var(--line);\n padding-left: 8px;\n color: var(--muted);\n}\n.body code {\n font-family: var(--mono);\n font-size: 0.92em;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n padding: 0.05em 0.3em;\n border-radius: 3px;\n}\n.body pre {\n overflow-x: auto;\n padding: 6px 8px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n}\n.body pre code {\n background: none;\n padding: 0;\n}\n.body a {\n color: var(--accent);\n}\n.reply {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n padding: 6px 9px 8px;\n border-top: 1px solid var(--line);\n}\n.reply textarea {\n flex: 1 1 100%;\n min-width: 80px;\n padding: 2px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n resize: vertical;\n field-sizing: content;\n min-height: 26px;\n max-height: 160px;\n}\n.reply .error,\n.reply .hint {\n flex-basis: 100%;\n}\n.composer {\n background: var(--thread);\n border: 1px solid var(--accent);\n border-radius: 6px;\n padding: 8px 10px;\n margin: 6px 0 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.composer textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n align-items: center;\n}\n\n/* The detached list, above the page */\n.detached {\n margin: 12px 0;\n border: 1px dashed var(--line);\n border-radius: 6px;\n padding: 8px 10px 2px;\n color: var(--muted);\n max-width: 520px;\n}\n.detached .thread {\n color: var(--text);\n}\n\n/* The unsent bar, at the bottom */\n.unsent-bar {\n background: var(--changed-background);\n border-top: 1px solid var(--line);\n padding: 6px 10px;\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n align-items: center;\n}\n.unsent-bar .hint {\n font-size: 12px;\n}\n\n/* The panel for one block's threads, at narrow widths */\n.sheet {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n max-height: 62vh;\n overflow: auto;\n background: var(--surface);\n border-top: 2px solid var(--accent);\n box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);\n padding: 8px 12px 10px;\n z-index: 4;\n}\n.sheet .head {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12px;\n color: var(--muted);\n}\n\n/* Dialogs */\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n z-index: 8;\n display: grid;\n place-items: center;\n padding: 12px;\n}\n.dialog {\n background: var(--surface);\n border: 1px solid var(--line);\n border-radius: 8px;\n width: min(480px, 100%);\n max-height: 100%;\n overflow: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n font-size: 13px;\n}\n.dialog h2 {\n margin: 0;\n font-size: 14px;\n}\n.dialog ul.unsent-list {\n margin: 0;\n padding-left: 18px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.dialog fieldset {\n border: 0;\n padding: 0;\n margin: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px 14px;\n}\n.dialog textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.confirm {\n border: 1px solid var(--removed);\n background: var(--removed-background);\n border-radius: 6px;\n padding: 8px 10px;\n}\n.segmented {\n display: inline-flex;\n flex-wrap: wrap;\n align-self: flex-start;\n border: 1px solid var(--line);\n border-radius: 5px;\n overflow: hidden;\n}\n.segmented button {\n border: 0;\n background: transparent;\n padding: 2px 9px;\n font-size: 12px;\n color: var(--muted);\n min-height: 24px;\n}\n.segmented button + button {\n border-left: 1px solid var(--line);\n}\n.segmented button[aria-pressed=\"true\"] {\n background: var(--accent);\n color: var(--accent-text);\n}\n.thread-list {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.thread-list li + li {\n border-top: 1px solid var(--line);\n}\n.thread-list button {\n display: flex;\n flex-direction: column;\n gap: 1px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n padding: 6px 4px;\n}\n.thread-list button:hover,\n.thread-list button:focus-visible {\n background: color-mix(in srgb, var(--muted) 12%, transparent);\n}\n.thread-list .where {\n font-size: 11.5px;\n color: var(--muted);\n}\n.thread-list .first {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.flash {\n animation: flash 1.4s ease-out;\n}\n@keyframes flash {\n from {\n box-shadow: 0 0 0 3px var(--accent);\n }\n to {\n box-shadow: 0 0 0 0 transparent;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .flash {\n animation: none;\n outline: 2px solid var(--accent);\n }\n}\n";
1
+ export declare const OVERLAY_CSS = "\n:host {\n all: initial;\n --text: var(--ascribe-review-text, CanvasText);\n --muted: var(--ascribe-review-muted, #5b6475);\n --line: var(--ascribe-review-border, #d3d8e0);\n --surface: var(--ascribe-review-surface, Canvas);\n --thread: var(--ascribe-review-thread, #f5f7fb);\n --accent: var(--ascribe-review-focus, #1f6feb);\n --accent-text: var(--ascribe-review-accent-text, #ffffff);\n --input: var(--ascribe-review-input, var(--surface));\n --flash: var(--ascribe-review-flash, #fff6bf);\n --added: var(--ascribe-review-added, #1a7f37);\n --changed: var(--ascribe-review-changed, #8a5a00);\n --changed-background: var(--ascribe-review-changed-background, #fff1c2);\n --removed: var(--ascribe-review-removed, #c4222d);\n --removed-background: var(--ascribe-review-removed-background, #ffe4e2);\n --mono: var(--ascribe-review-mono, ui-monospace, monospace);\n font-family: var(--ascribe-review-font, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n font-size: 12.5px;\n line-height: 1.45;\n color: var(--text);\n}\n* {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\nbutton,\ntextarea,\ninput {\n font: inherit;\n color: inherit;\n}\nbutton {\n cursor: pointer;\n}\nbutton:disabled,\nbutton[aria-disabled=\"true\"] {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:focus-visible,\ntextarea:focus-visible,\ninput:focus-visible,\n.thread:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 1px;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n/* Buttons */\n.ghost {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n padding: 2px 8px;\n font-size: 12px;\n min-height: 24px;\n}\n.ghost:hover:not(:disabled):not([aria-disabled=\"true\"]) {\n border-color: var(--accent);\n color: var(--accent);\n}\n.primary {\n border: 1px solid var(--accent);\n background: var(--accent);\n color: var(--accent-text);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.danger {\n border: 1px solid var(--removed);\n background: var(--removed);\n color: var(--surface);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.link {\n border: 0;\n background: transparent;\n color: var(--accent);\n padding: 0;\n font-size: inherit;\n text-align: inherit;\n}\na.link {\n text-decoration: none;\n}\n.link:hover {\n text-decoration: underline;\n}\n.hint {\n color: var(--muted);\n font-size: 11.5px;\n}\n.refuse,\n.error {\n color: var(--removed);\n font-size: 12px;\n}\n.spacer {\n flex: 1;\n}\n\n/* The layer over the page: the column, markers' panel, dialogs. */\n.layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.layer > *,\n.column > * {\n pointer-events: auto;\n}\n.column {\n position: absolute;\n top: 0;\n width: 250px;\n pointer-events: none;\n}\n.slot {\n position: absolute;\n left: 0;\n right: 0;\n}\n.slot > .thread,\n.slot > .composer {\n margin: 0 0 6px;\n}\n.slot.linked .thread,\n.slot.linked .composer {\n border-color: var(--accent);\n}\n.highlight {\n position: absolute;\n pointer-events: none;\n background: color-mix(in srgb, var(--flash) 55%, transparent);\n border-radius: 3px;\n /* Over the page's text, a tint that keeps the text as it was: multiplied\n on a light page, screened on a dark one. */\n mix-blend-mode: var(--ascribe-review-blend, multiply);\n}\nsvg.connector {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n overflow: visible;\n pointer-events: none;\n}\nsvg.connector path {\n fill: none;\n stroke: var(--accent);\n stroke-width: 1.5;\n}\n\n/* The block tools: the Comment button, and the count marker at narrow widths. */\n.tool {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n font-size: 11.5px;\n padding: 0 7px;\n min-height: 22px;\n color: var(--accent);\n white-space: nowrap;\n}\n.hint-count {\n margin-inline-start: 2px;\n font-size: 11px;\n font-weight: 600;\n color: var(--accent);\n}\n\n.marker {\n border: 1px solid var(--accent);\n background: var(--surface);\n color: var(--accent);\n border-radius: 999px;\n font-size: 11px;\n font-weight: 700;\n padding: 0 8px;\n min-width: 30px;\n min-height: 24px;\n}\n\n/* Threads */\n.thread {\n background: var(--thread);\n border: 1px solid var(--line);\n border-radius: 6px;\n margin: 6px 0 10px;\n}\n.th {\n display: flex;\n flex-wrap: wrap;\n gap: 3px 8px;\n align-items: center;\n padding: 5px 9px 2px;\n font-size: 11.5px;\n color: var(--muted);\n}\n.acts {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n padding: 0 9px 5px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n}\n.thread.collapsed .acts {\n border-bottom: 0;\n}\n.orig,\n.inside {\n padding: 5px 9px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n color: var(--muted);\n}\n.orig q {\n color: var(--text);\n white-space: pre-wrap;\n}\n.badge {\n border-radius: 999px;\n padding: 0 7px;\n font-size: 10.5px;\n font-weight: 600;\n border: 1px solid currentColor;\n white-space: nowrap;\n}\n.badge.unsent {\n color: var(--changed);\n}\n.badge.resolved {\n color: var(--added);\n}\n.badge.outdated {\n color: var(--muted);\n}\n.badge.summary {\n color: var(--accent);\n}\n.badge.removed,\n.badge.detached {\n color: var(--removed);\n}\n.comment {\n display: grid;\n grid-template-columns: 22px minmax(0, 1fr);\n gap: 7px;\n padding: 6px 9px;\n}\n.comment + .comment {\n border-top: 1px dashed var(--line);\n}\n.avatar {\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--accent);\n color: var(--accent-text);\n display: grid;\n place-items: center;\n font-size: 9.5px;\n font-weight: 700;\n}\n.who {\n font-weight: 600;\n}\n.when {\n color: var(--muted);\n font-size: 11px;\n margin-left: 6px;\n}\n.body {\n overflow-wrap: anywhere;\n}\n.body > :first-child {\n margin-top: 1px;\n}\n.body > :last-child {\n margin-bottom: 0;\n}\n.body p,\n.body ul,\n.body ol,\n.body blockquote,\n.body pre {\n margin: 4px 0;\n}\n.body ul,\n.body ol {\n padding-left: 18px;\n}\n.body blockquote {\n border-left: 3px solid var(--line);\n padding-left: 8px;\n color: var(--muted);\n}\n.body code,\n.thread-list .where code {\n font-family: var(--mono);\n font-size: 0.92em;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n padding: 0.05em 0.3em;\n border-radius: 3px;\n}\n.body pre {\n overflow-x: auto;\n padding: 6px 8px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n}\n.body pre code {\n background: none;\n padding: 0;\n}\n.body a {\n color: var(--accent);\n}\n.reply {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n padding: 6px 9px 8px;\n border-top: 1px solid var(--line);\n}\n.reply textarea {\n flex: 1 1 100%;\n min-width: 80px;\n padding: 2px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n resize: vertical;\n field-sizing: content;\n min-height: 26px;\n max-height: 160px;\n}\n.reply .error,\n.reply .hint {\n flex-basis: 100%;\n}\n.composer {\n background: var(--thread);\n border: 1px solid var(--accent);\n border-radius: 6px;\n padding: 8px 10px;\n margin: 6px 0 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.composer textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n align-items: center;\n}\n\n/* The detached list, above the page */\n.detached {\n margin: 12px 0;\n border: 1px dashed var(--line);\n border-radius: 6px;\n padding: 8px 10px 2px;\n color: var(--muted);\n max-width: 520px;\n}\n.detached .thread {\n color: var(--text);\n}\n\n/* The unsent bar, at the bottom */\n.unsent-bar {\n background: var(--changed-background);\n border-top: 1px solid var(--line);\n padding: 6px 10px;\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n align-items: center;\n}\n.unsent-bar .hint {\n font-size: 12px;\n}\n\n/* The panel for one block's threads, at narrow widths */\n.sheet {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n max-height: 62vh;\n overflow: auto;\n background: var(--surface);\n border-top: 2px solid var(--accent);\n box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);\n padding: 8px 12px 10px;\n z-index: 4;\n}\n.sheet .head {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12px;\n color: var(--muted);\n}\n\n/* Dialogs */\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n z-index: 8;\n display: grid;\n place-items: center;\n padding: 12px;\n}\n.dialog {\n background: var(--surface);\n border: 1px solid var(--line);\n border-radius: 8px;\n width: min(480px, 100%);\n max-height: 100%;\n overflow: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n font-size: 13px;\n}\n.dialog h2 {\n margin: 0;\n font-size: 14px;\n}\n.dialog ul.unsent-list {\n margin: 0;\n padding-left: 18px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.dialog fieldset {\n border: 0;\n padding: 0;\n margin: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px 14px;\n}\n.dialog textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.confirm {\n border: 1px solid var(--removed);\n background: var(--removed-background);\n border-radius: 6px;\n padding: 8px 10px;\n}\n.segmented {\n display: inline-flex;\n flex-wrap: wrap;\n align-self: flex-start;\n border: 1px solid var(--line);\n border-radius: 5px;\n overflow: hidden;\n}\n.segmented button {\n border: 0;\n background: transparent;\n padding: 2px 9px;\n font-size: 12px;\n color: var(--muted);\n min-height: 24px;\n}\n.segmented button + button {\n border-left: 1px solid var(--line);\n}\n.segmented button[aria-pressed=\"true\"] {\n background: var(--accent);\n color: var(--accent-text);\n}\n.thread-list {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.thread-list li + li {\n border-top: 1px solid var(--line);\n}\n.thread-list button {\n display: flex;\n flex-direction: column;\n gap: 1px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n padding: 6px 4px;\n}\n.thread-list button:hover,\n.thread-list button:focus-visible {\n background: color-mix(in srgb, var(--muted) 12%, transparent);\n}\n.thread-list .where {\n font-size: 11.5px;\n color: var(--muted);\n}\n.thread-list .first {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.flash {\n animation: flash 1.4s ease-out;\n}\n@keyframes flash {\n from {\n box-shadow: 0 0 0 3px var(--accent);\n }\n to {\n box-shadow: 0 0 0 0 transparent;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .flash {\n animation: none;\n outline: 2px solid var(--accent);\n }\n}\n";
@@ -319,7 +319,8 @@ svg.connector path {
319
319
  padding-left: 8px;
320
320
  color: var(--muted);
321
321
  }
322
- .body code {
322
+ .body code,
323
+ .thread-list .where code {
323
324
  font-family: var(--mono);
324
325
  font-size: 0.92em;
325
326
  background: color-mix(in srgb, var(--muted) 14%, transparent);
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/overlay/style.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,kDAAkD;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmjB1B,CAAC","sourcesContent":["// The overlay's stylesheet. It applies inside the overlay's shadow roots only,\n// so the page's styles don't reach the overlay and the overlay's don't reach\n// the page. Colors come from the page's --ascribe-review-* custom properties\n// (`marks.css` sets them, with light and dark values; a host can set its own),\n// which reach inside shadow roots by inheritance.\n\nexport const OVERLAY_CSS = `\n:host {\n all: initial;\n --text: var(--ascribe-review-text, CanvasText);\n --muted: var(--ascribe-review-muted, #5b6475);\n --line: var(--ascribe-review-border, #d3d8e0);\n --surface: var(--ascribe-review-surface, Canvas);\n --thread: var(--ascribe-review-thread, #f5f7fb);\n --accent: var(--ascribe-review-focus, #1f6feb);\n --accent-text: var(--ascribe-review-accent-text, #ffffff);\n --input: var(--ascribe-review-input, var(--surface));\n --flash: var(--ascribe-review-flash, #fff6bf);\n --added: var(--ascribe-review-added, #1a7f37);\n --changed: var(--ascribe-review-changed, #8a5a00);\n --changed-background: var(--ascribe-review-changed-background, #fff1c2);\n --removed: var(--ascribe-review-removed, #c4222d);\n --removed-background: var(--ascribe-review-removed-background, #ffe4e2);\n --mono: var(--ascribe-review-mono, ui-monospace, monospace);\n font-family: var(--ascribe-review-font, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n font-size: 12.5px;\n line-height: 1.45;\n color: var(--text);\n}\n* {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\nbutton,\ntextarea,\ninput {\n font: inherit;\n color: inherit;\n}\nbutton {\n cursor: pointer;\n}\nbutton:disabled,\nbutton[aria-disabled=\"true\"] {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:focus-visible,\ntextarea:focus-visible,\ninput:focus-visible,\n.thread:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 1px;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n/* Buttons */\n.ghost {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n padding: 2px 8px;\n font-size: 12px;\n min-height: 24px;\n}\n.ghost:hover:not(:disabled):not([aria-disabled=\"true\"]) {\n border-color: var(--accent);\n color: var(--accent);\n}\n.primary {\n border: 1px solid var(--accent);\n background: var(--accent);\n color: var(--accent-text);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.danger {\n border: 1px solid var(--removed);\n background: var(--removed);\n color: var(--surface);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.link {\n border: 0;\n background: transparent;\n color: var(--accent);\n padding: 0;\n font-size: inherit;\n text-align: inherit;\n}\na.link {\n text-decoration: none;\n}\n.link:hover {\n text-decoration: underline;\n}\n.hint {\n color: var(--muted);\n font-size: 11.5px;\n}\n.refuse,\n.error {\n color: var(--removed);\n font-size: 12px;\n}\n.spacer {\n flex: 1;\n}\n\n/* The layer over the page: the column, markers' panel, dialogs. */\n.layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.layer > *,\n.column > * {\n pointer-events: auto;\n}\n.column {\n position: absolute;\n top: 0;\n width: 250px;\n pointer-events: none;\n}\n.slot {\n position: absolute;\n left: 0;\n right: 0;\n}\n.slot > .thread,\n.slot > .composer {\n margin: 0 0 6px;\n}\n.slot.linked .thread,\n.slot.linked .composer {\n border-color: var(--accent);\n}\n.highlight {\n position: absolute;\n pointer-events: none;\n background: color-mix(in srgb, var(--flash) 55%, transparent);\n border-radius: 3px;\n /* Over the page's text, a tint that keeps the text as it was: multiplied\n on a light page, screened on a dark one. */\n mix-blend-mode: var(--ascribe-review-blend, multiply);\n}\nsvg.connector {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n overflow: visible;\n pointer-events: none;\n}\nsvg.connector path {\n fill: none;\n stroke: var(--accent);\n stroke-width: 1.5;\n}\n\n/* The block tools: the Comment button, and the count marker at narrow widths. */\n.tool {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n font-size: 11.5px;\n padding: 0 7px;\n min-height: 22px;\n color: var(--accent);\n white-space: nowrap;\n}\n.hint-count {\n margin-inline-start: 2px;\n font-size: 11px;\n font-weight: 600;\n color: var(--accent);\n}\n\n.marker {\n border: 1px solid var(--accent);\n background: var(--surface);\n color: var(--accent);\n border-radius: 999px;\n font-size: 11px;\n font-weight: 700;\n padding: 0 8px;\n min-width: 30px;\n min-height: 24px;\n}\n\n/* Threads */\n.thread {\n background: var(--thread);\n border: 1px solid var(--line);\n border-radius: 6px;\n margin: 6px 0 10px;\n}\n.th {\n display: flex;\n flex-wrap: wrap;\n gap: 3px 8px;\n align-items: center;\n padding: 5px 9px 2px;\n font-size: 11.5px;\n color: var(--muted);\n}\n.acts {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n padding: 0 9px 5px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n}\n.thread.collapsed .acts {\n border-bottom: 0;\n}\n.orig,\n.inside {\n padding: 5px 9px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n color: var(--muted);\n}\n.orig q {\n color: var(--text);\n white-space: pre-wrap;\n}\n.badge {\n border-radius: 999px;\n padding: 0 7px;\n font-size: 10.5px;\n font-weight: 600;\n border: 1px solid currentColor;\n white-space: nowrap;\n}\n.badge.unsent {\n color: var(--changed);\n}\n.badge.resolved {\n color: var(--added);\n}\n.badge.outdated {\n color: var(--muted);\n}\n.badge.summary {\n color: var(--accent);\n}\n.badge.removed,\n.badge.detached {\n color: var(--removed);\n}\n.comment {\n display: grid;\n grid-template-columns: 22px minmax(0, 1fr);\n gap: 7px;\n padding: 6px 9px;\n}\n.comment + .comment {\n border-top: 1px dashed var(--line);\n}\n.avatar {\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--accent);\n color: var(--accent-text);\n display: grid;\n place-items: center;\n font-size: 9.5px;\n font-weight: 700;\n}\n.who {\n font-weight: 600;\n}\n.when {\n color: var(--muted);\n font-size: 11px;\n margin-left: 6px;\n}\n.body {\n overflow-wrap: anywhere;\n}\n.body > :first-child {\n margin-top: 1px;\n}\n.body > :last-child {\n margin-bottom: 0;\n}\n.body p,\n.body ul,\n.body ol,\n.body blockquote,\n.body pre {\n margin: 4px 0;\n}\n.body ul,\n.body ol {\n padding-left: 18px;\n}\n.body blockquote {\n border-left: 3px solid var(--line);\n padding-left: 8px;\n color: var(--muted);\n}\n.body code {\n font-family: var(--mono);\n font-size: 0.92em;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n padding: 0.05em 0.3em;\n border-radius: 3px;\n}\n.body pre {\n overflow-x: auto;\n padding: 6px 8px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n}\n.body pre code {\n background: none;\n padding: 0;\n}\n.body a {\n color: var(--accent);\n}\n.reply {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n padding: 6px 9px 8px;\n border-top: 1px solid var(--line);\n}\n.reply textarea {\n flex: 1 1 100%;\n min-width: 80px;\n padding: 2px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n resize: vertical;\n field-sizing: content;\n min-height: 26px;\n max-height: 160px;\n}\n.reply .error,\n.reply .hint {\n flex-basis: 100%;\n}\n.composer {\n background: var(--thread);\n border: 1px solid var(--accent);\n border-radius: 6px;\n padding: 8px 10px;\n margin: 6px 0 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.composer textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n align-items: center;\n}\n\n/* The detached list, above the page */\n.detached {\n margin: 12px 0;\n border: 1px dashed var(--line);\n border-radius: 6px;\n padding: 8px 10px 2px;\n color: var(--muted);\n max-width: 520px;\n}\n.detached .thread {\n color: var(--text);\n}\n\n/* The unsent bar, at the bottom */\n.unsent-bar {\n background: var(--changed-background);\n border-top: 1px solid var(--line);\n padding: 6px 10px;\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n align-items: center;\n}\n.unsent-bar .hint {\n font-size: 12px;\n}\n\n/* The panel for one block's threads, at narrow widths */\n.sheet {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n max-height: 62vh;\n overflow: auto;\n background: var(--surface);\n border-top: 2px solid var(--accent);\n box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);\n padding: 8px 12px 10px;\n z-index: 4;\n}\n.sheet .head {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12px;\n color: var(--muted);\n}\n\n/* Dialogs */\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n z-index: 8;\n display: grid;\n place-items: center;\n padding: 12px;\n}\n.dialog {\n background: var(--surface);\n border: 1px solid var(--line);\n border-radius: 8px;\n width: min(480px, 100%);\n max-height: 100%;\n overflow: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n font-size: 13px;\n}\n.dialog h2 {\n margin: 0;\n font-size: 14px;\n}\n.dialog ul.unsent-list {\n margin: 0;\n padding-left: 18px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.dialog fieldset {\n border: 0;\n padding: 0;\n margin: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px 14px;\n}\n.dialog textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.confirm {\n border: 1px solid var(--removed);\n background: var(--removed-background);\n border-radius: 6px;\n padding: 8px 10px;\n}\n.segmented {\n display: inline-flex;\n flex-wrap: wrap;\n align-self: flex-start;\n border: 1px solid var(--line);\n border-radius: 5px;\n overflow: hidden;\n}\n.segmented button {\n border: 0;\n background: transparent;\n padding: 2px 9px;\n font-size: 12px;\n color: var(--muted);\n min-height: 24px;\n}\n.segmented button + button {\n border-left: 1px solid var(--line);\n}\n.segmented button[aria-pressed=\"true\"] {\n background: var(--accent);\n color: var(--accent-text);\n}\n.thread-list {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.thread-list li + li {\n border-top: 1px solid var(--line);\n}\n.thread-list button {\n display: flex;\n flex-direction: column;\n gap: 1px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n padding: 6px 4px;\n}\n.thread-list button:hover,\n.thread-list button:focus-visible {\n background: color-mix(in srgb, var(--muted) 12%, transparent);\n}\n.thread-list .where {\n font-size: 11.5px;\n color: var(--muted);\n}\n.thread-list .first {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.flash {\n animation: flash 1.4s ease-out;\n}\n@keyframes flash {\n from {\n box-shadow: 0 0 0 3px var(--accent);\n }\n to {\n box-shadow: 0 0 0 0 transparent;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .flash {\n animation: none;\n outline: 2px solid var(--accent);\n }\n}\n`;\n"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/overlay/style.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,kDAAkD;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAojB1B,CAAC","sourcesContent":["// The overlay's stylesheet. It applies inside the overlay's shadow roots only,\n// so the page's styles don't reach the overlay and the overlay's don't reach\n// the page. Colors come from the page's --ascribe-review-* custom properties\n// (`marks.css` sets them, with light and dark values; a host can set its own),\n// which reach inside shadow roots by inheritance.\n\nexport const OVERLAY_CSS = `\n:host {\n all: initial;\n --text: var(--ascribe-review-text, CanvasText);\n --muted: var(--ascribe-review-muted, #5b6475);\n --line: var(--ascribe-review-border, #d3d8e0);\n --surface: var(--ascribe-review-surface, Canvas);\n --thread: var(--ascribe-review-thread, #f5f7fb);\n --accent: var(--ascribe-review-focus, #1f6feb);\n --accent-text: var(--ascribe-review-accent-text, #ffffff);\n --input: var(--ascribe-review-input, var(--surface));\n --flash: var(--ascribe-review-flash, #fff6bf);\n --added: var(--ascribe-review-added, #1a7f37);\n --changed: var(--ascribe-review-changed, #8a5a00);\n --changed-background: var(--ascribe-review-changed-background, #fff1c2);\n --removed: var(--ascribe-review-removed, #c4222d);\n --removed-background: var(--ascribe-review-removed-background, #ffe4e2);\n --mono: var(--ascribe-review-mono, ui-monospace, monospace);\n font-family: var(--ascribe-review-font, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n font-size: 12.5px;\n line-height: 1.45;\n color: var(--text);\n}\n* {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\nbutton,\ntextarea,\ninput {\n font: inherit;\n color: inherit;\n}\nbutton {\n cursor: pointer;\n}\nbutton:disabled,\nbutton[aria-disabled=\"true\"] {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:focus-visible,\ntextarea:focus-visible,\ninput:focus-visible,\n.thread:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 1px;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n/* Buttons */\n.ghost {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n padding: 2px 8px;\n font-size: 12px;\n min-height: 24px;\n}\n.ghost:hover:not(:disabled):not([aria-disabled=\"true\"]) {\n border-color: var(--accent);\n color: var(--accent);\n}\n.primary {\n border: 1px solid var(--accent);\n background: var(--accent);\n color: var(--accent-text);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.danger {\n border: 1px solid var(--removed);\n background: var(--removed);\n color: var(--surface);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n min-height: 24px;\n}\n.link {\n border: 0;\n background: transparent;\n color: var(--accent);\n padding: 0;\n font-size: inherit;\n text-align: inherit;\n}\na.link {\n text-decoration: none;\n}\n.link:hover {\n text-decoration: underline;\n}\n.hint {\n color: var(--muted);\n font-size: 11.5px;\n}\n.refuse,\n.error {\n color: var(--removed);\n font-size: 12px;\n}\n.spacer {\n flex: 1;\n}\n\n/* The layer over the page: the column, markers' panel, dialogs. */\n.layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.layer > *,\n.column > * {\n pointer-events: auto;\n}\n.column {\n position: absolute;\n top: 0;\n width: 250px;\n pointer-events: none;\n}\n.slot {\n position: absolute;\n left: 0;\n right: 0;\n}\n.slot > .thread,\n.slot > .composer {\n margin: 0 0 6px;\n}\n.slot.linked .thread,\n.slot.linked .composer {\n border-color: var(--accent);\n}\n.highlight {\n position: absolute;\n pointer-events: none;\n background: color-mix(in srgb, var(--flash) 55%, transparent);\n border-radius: 3px;\n /* Over the page's text, a tint that keeps the text as it was: multiplied\n on a light page, screened on a dark one. */\n mix-blend-mode: var(--ascribe-review-blend, multiply);\n}\nsvg.connector {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n overflow: visible;\n pointer-events: none;\n}\nsvg.connector path {\n fill: none;\n stroke: var(--accent);\n stroke-width: 1.5;\n}\n\n/* The block tools: the Comment button, and the count marker at narrow widths. */\n.tool {\n border: 1px solid var(--line);\n background: var(--surface);\n border-radius: 5px;\n font-size: 11.5px;\n padding: 0 7px;\n min-height: 22px;\n color: var(--accent);\n white-space: nowrap;\n}\n.hint-count {\n margin-inline-start: 2px;\n font-size: 11px;\n font-weight: 600;\n color: var(--accent);\n}\n\n.marker {\n border: 1px solid var(--accent);\n background: var(--surface);\n color: var(--accent);\n border-radius: 999px;\n font-size: 11px;\n font-weight: 700;\n padding: 0 8px;\n min-width: 30px;\n min-height: 24px;\n}\n\n/* Threads */\n.thread {\n background: var(--thread);\n border: 1px solid var(--line);\n border-radius: 6px;\n margin: 6px 0 10px;\n}\n.th {\n display: flex;\n flex-wrap: wrap;\n gap: 3px 8px;\n align-items: center;\n padding: 5px 9px 2px;\n font-size: 11.5px;\n color: var(--muted);\n}\n.acts {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n padding: 0 9px 5px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n}\n.thread.collapsed .acts {\n border-bottom: 0;\n}\n.orig,\n.inside {\n padding: 5px 9px;\n border-bottom: 1px solid var(--line);\n font-size: 11.5px;\n color: var(--muted);\n}\n.orig q {\n color: var(--text);\n white-space: pre-wrap;\n}\n.badge {\n border-radius: 999px;\n padding: 0 7px;\n font-size: 10.5px;\n font-weight: 600;\n border: 1px solid currentColor;\n white-space: nowrap;\n}\n.badge.unsent {\n color: var(--changed);\n}\n.badge.resolved {\n color: var(--added);\n}\n.badge.outdated {\n color: var(--muted);\n}\n.badge.summary {\n color: var(--accent);\n}\n.badge.removed,\n.badge.detached {\n color: var(--removed);\n}\n.comment {\n display: grid;\n grid-template-columns: 22px minmax(0, 1fr);\n gap: 7px;\n padding: 6px 9px;\n}\n.comment + .comment {\n border-top: 1px dashed var(--line);\n}\n.avatar {\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: var(--accent);\n color: var(--accent-text);\n display: grid;\n place-items: center;\n font-size: 9.5px;\n font-weight: 700;\n}\n.who {\n font-weight: 600;\n}\n.when {\n color: var(--muted);\n font-size: 11px;\n margin-left: 6px;\n}\n.body {\n overflow-wrap: anywhere;\n}\n.body > :first-child {\n margin-top: 1px;\n}\n.body > :last-child {\n margin-bottom: 0;\n}\n.body p,\n.body ul,\n.body ol,\n.body blockquote,\n.body pre {\n margin: 4px 0;\n}\n.body ul,\n.body ol {\n padding-left: 18px;\n}\n.body blockquote {\n border-left: 3px solid var(--line);\n padding-left: 8px;\n color: var(--muted);\n}\n.body code,\n.thread-list .where code {\n font-family: var(--mono);\n font-size: 0.92em;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n padding: 0.05em 0.3em;\n border-radius: 3px;\n}\n.body pre {\n overflow-x: auto;\n padding: 6px 8px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--muted) 14%, transparent);\n}\n.body pre code {\n background: none;\n padding: 0;\n}\n.body a {\n color: var(--accent);\n}\n.reply {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n padding: 6px 9px 8px;\n border-top: 1px solid var(--line);\n}\n.reply textarea {\n flex: 1 1 100%;\n min-width: 80px;\n padding: 2px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n resize: vertical;\n field-sizing: content;\n min-height: 26px;\n max-height: 160px;\n}\n.reply .error,\n.reply .hint {\n flex-basis: 100%;\n}\n.composer {\n background: var(--thread);\n border: 1px solid var(--accent);\n border-radius: 6px;\n padding: 8px 10px;\n margin: 6px 0 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.composer textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n align-items: center;\n}\n\n/* The detached list, above the page */\n.detached {\n margin: 12px 0;\n border: 1px dashed var(--line);\n border-radius: 6px;\n padding: 8px 10px 2px;\n color: var(--muted);\n max-width: 520px;\n}\n.detached .thread {\n color: var(--text);\n}\n\n/* The unsent bar, at the bottom */\n.unsent-bar {\n background: var(--changed-background);\n border-top: 1px solid var(--line);\n padding: 6px 10px;\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n align-items: center;\n}\n.unsent-bar .hint {\n font-size: 12px;\n}\n\n/* The panel for one block's threads, at narrow widths */\n.sheet {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n max-height: 62vh;\n overflow: auto;\n background: var(--surface);\n border-top: 2px solid var(--accent);\n box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);\n padding: 8px 12px 10px;\n z-index: 4;\n}\n.sheet .head {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12px;\n color: var(--muted);\n}\n\n/* Dialogs */\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n z-index: 8;\n display: grid;\n place-items: center;\n padding: 12px;\n}\n.dialog {\n background: var(--surface);\n border: 1px solid var(--line);\n border-radius: 8px;\n width: min(480px, 100%);\n max-height: 100%;\n overflow: auto;\n padding: 12px 14px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n font-size: 13px;\n}\n.dialog h2 {\n margin: 0;\n font-size: 14px;\n}\n.dialog ul.unsent-list {\n margin: 0;\n padding-left: 18px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.dialog fieldset {\n border: 0;\n padding: 0;\n margin: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px 14px;\n}\n.dialog textarea {\n width: 100%;\n min-height: 56px;\n resize: vertical;\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: 5px;\n background: var(--input);\n}\n.confirm {\n border: 1px solid var(--removed);\n background: var(--removed-background);\n border-radius: 6px;\n padding: 8px 10px;\n}\n.segmented {\n display: inline-flex;\n flex-wrap: wrap;\n align-self: flex-start;\n border: 1px solid var(--line);\n border-radius: 5px;\n overflow: hidden;\n}\n.segmented button {\n border: 0;\n background: transparent;\n padding: 2px 9px;\n font-size: 12px;\n color: var(--muted);\n min-height: 24px;\n}\n.segmented button + button {\n border-left: 1px solid var(--line);\n}\n.segmented button[aria-pressed=\"true\"] {\n background: var(--accent);\n color: var(--accent-text);\n}\n.thread-list {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.thread-list li + li {\n border-top: 1px solid var(--line);\n}\n.thread-list button {\n display: flex;\n flex-direction: column;\n gap: 1px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n padding: 6px 4px;\n}\n.thread-list button:hover,\n.thread-list button:focus-visible {\n background: color-mix(in srgb, var(--muted) 12%, transparent);\n}\n.thread-list .where {\n font-size: 11.5px;\n color: var(--muted);\n}\n.thread-list .first {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.flash {\n animation: flash 1.4s ease-out;\n}\n@keyframes flash {\n from {\n box-shadow: 0 0 0 3px var(--accent);\n }\n to {\n box-shadow: 0 0 0 0 transparent;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .flash {\n animation: none;\n outline: 2px solid var(--accent);\n }\n}\n`;\n"]}
@@ -1,3 +1,4 @@
1
+ import { DATA_OVERLAY, DATA_UI } from "../names.js";
1
2
  /** `"1 comment"`, `"2 comments"`. */
2
3
  export function plural(count, one, many = `${one}s`) {
3
4
  return `${count} ${count === 1 ? one : many}`;
@@ -163,8 +164,8 @@ export function blockText(block) {
163
164
  if (!(node instanceof Element))
164
165
  return;
165
166
  const tag = node.tagName.toUpperCase();
166
- if (node.hasAttribute("data-ascribe-overlay") ||
167
- (node.hasAttribute("data-ascribe-ui") && tag !== "INS") ||
167
+ if (node.hasAttribute(DATA_OVERLAY) ||
168
+ (node.hasAttribute(DATA_UI) && tag !== "INS") ||
168
169
  ["SCRIPT", "STYLE", "TEMPLATE", "NOSCRIPT"].includes(tag) ||
169
170
  unseen(node)) {
170
171
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/overlay/text.ts"],"names":[],"mappings":"AAKA,qCAAqC;AACrC,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,GAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG;IACjE,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,0CAA0C;AAC1C,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC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,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;YAAE,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC;QACnF,IAAI,KAAK;YAAE,SAAS,EAAE,CAAC;IACzB,CAAC,CAAC;IACF,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnB,SAAS,EAAE,CAAC;IACZ,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvF,CAAC","sourcesContent":["// What the overlay says about threads: where each one is, when a comment was\n// made, and counts in words.\nimport type { LocatedThread } from \"../place/place.js\";\nimport type { Author } from \"../shared/types.js\";\n\n/** `\"1 comment\"`, `\"2 comments\"`. */\nexport function plural(count: number, one: string, many = `${one}s`): string {\n return `${count} ${count === 1 ? one : many}`;\n}\n\n/** The last segment of a content path. */\nfunction fileName(path: string): string {\n return path.slice(path.lastIndexOf(\"/\") + 1);\n}\n\n/** `rollouts.md:28`, or `rollouts.md:28-30`. */\nexport function linesLabel(path: string, lines: { first: number; last: number }): string {\n const range = lines.first === lines.last ? `${lines.first}` : `${lines.first}-${lines.last}`;\n return `${fileName(path)}:${range}`;\n}\n\n/** Where a thread is, for its card's header. */\nexport function whereLabel(thread: LocatedThread): string {\n const file = fileName(thread.path);\n if (thread.detached === \"file\") return `On ${file} as a whole`;\n if (thread.detached === \"line-gone\") {\n const line = thread.originalLine ?? thread.line;\n const commit = thread.originalCommit?.slice(0, 7);\n if (line === null) return `Was on ${file}, since removed`;\n return `Was on ${file}, line ${line}${commit ? ` at ${commit}` : \"\"}, since removed`;\n }\n if (thread.lines === undefined) return file;\n if (thread.detached === \"no-block\")\n return `${linesLabel(thread.path, thread.lines)}, not on this page`;\n if (thread.kind === \"review\" && thread.side === \"LEFT\") return file;\n return linesLabel(thread.path, thread.lines);\n}\n\n/** Where a thread is, for a list of them: shorter, and naming removed text. */\nexport function listLabel(thread: LocatedThread): string {\n const file = fileName(thread.path);\n if (thread.detached !== undefined) return `no block, was ${file}`;\n if (thread.kind === \"review\" && thread.side === \"LEFT\") return `removed text in ${file}`;\n return thread.lines === undefined ? file : linesLabel(thread.path, thread.lines);\n}\n\n/** Whether the thread is on removed text. */\nexport function onRemovedText(thread: LocatedThread): boolean {\n return thread.kind === \"review\" && thread.side === \"LEFT\";\n}\n\n/** Whether any comment of the thread is unsent. */\nexport function hasUnsent(thread: LocatedThread): boolean {\n return thread.comments.some((comment) => comment.pending);\n}\n\n/** A comment's author's name, `\"you\"` for the viewer. */\nexport function authorName(author: Author | null, viewer: string): string {\n if (author === null) return \"ghost\";\n return author.login === viewer ? \"you\" : author.login;\n}\n\n/** Two letters standing for an author, for the avatar's place. */\nexport function initials(author: Author | null): string {\n return (\n (author?.login ?? \"?\")\n .replace(/[^A-Za-z0-9]/g, \"\")\n .slice(0, 2)\n .toUpperCase() || \"?\"\n );\n}\n\n/** `\"just now\"`, `\"5 minutes ago\"`, `\"yesterday\"`, or a date. */\nexport function relativeTime(iso: string, now: number): string {\n const then = Date.parse(iso);\n if (Number.isNaN(then)) return \"\";\n const seconds = Math.max(0, Math.round((now - then) / 1000));\n if (seconds < 60) return \"just now\";\n const minutes = Math.round(seconds / 60);\n if (minutes < 60) return `${plural(minutes, \"minute\")} ago`;\n const hours = Math.round(minutes / 60);\n if (hours < 24) return `${plural(hours, \"hour\")} ago`;\n const days = Math.round(hours / 24);\n if (days === 1) return \"yesterday\";\n if (days < 30) return `${days} days ago`;\n return new Date(then).toISOString().slice(0, 10);\n}\n\n/** Elements whose text starts on a line of its own. */\nconst BLOCK_TAGS = new Set([\n \"ADDRESS\",\n \"ARTICLE\",\n \"ASIDE\",\n \"BLOCKQUOTE\",\n \"DD\",\n \"DETAILS\",\n \"DIV\",\n \"DL\",\n \"DT\",\n \"FIGCAPTION\",\n \"FIGURE\",\n \"FOOTER\",\n \"H1\",\n \"H2\",\n \"H3\",\n \"H4\",\n \"H5\",\n \"H6\",\n \"HEADER\",\n \"HR\",\n \"LI\",\n \"OL\",\n \"P\",\n \"PRE\",\n \"SECTION\",\n \"SUMMARY\",\n \"TABLE\",\n \"TR\",\n \"UL\",\n]);\n\n/** Classes that hide text from sight but not from screen readers. */\nconst SCREEN_READER_ONLY = [\"sr-only\", \"visually-hidden\", \"sl-sr-only\"];\n\n/** Whether a reader can't see `el`. */\nfunction unseen(el: Element): boolean {\n if (\n el.hasAttribute(\"hidden\") ||\n el.getAttribute(\"aria-hidden\") === \"true\" ||\n SCREEN_READER_ONLY.some((name) => el.classList.contains(name))\n ) {\n return true;\n }\n const style = el.ownerDocument.defaultView?.getComputedStyle(el);\n return style?.display === \"none\" || style?.visibility === \"hidden\";\n}\n\n/**\n * A block's text as a reader sees it, for quoting: links as their text, a\n * line for each paragraph, list item, or row, numbered items with their\n * numbers, images as their alt text, and code as written. What the marks and\n * the overlay add is left out, but for the words a change inserted, and so\n * is anything a reader can't see.\n */\nexport function blockText(block: Element): string {\n // Each line, and whether it's code, which keeps its spaces.\n const lines: { text: string; pre: boolean }[] = [];\n let line = \"\";\n let linePre = false;\n const breakLine = (): void => {\n if (line.trim() !== \"\") lines.push({ text: line, pre: linePre });\n line = \"\";\n linePre = false;\n };\n const walk = (node: Node, pre: boolean): void => {\n if (node.nodeType === 3) {\n const text = node.nodeValue ?? \"\";\n if (!pre) {\n line += text.replace(/\\s+/g, \" \");\n return;\n }\n const [first = \"\", ...rest] = text.split(\"\\n\");\n line += first;\n linePre = true;\n for (const next of rest) {\n lines.push({ text: line, pre: true });\n line = next;\n }\n return;\n }\n if (!(node instanceof Element)) return;\n const tag = node.tagName.toUpperCase();\n if (\n node.hasAttribute(\"data-ascribe-overlay\") ||\n (node.hasAttribute(\"data-ascribe-ui\") && tag !== \"INS\") ||\n [\"SCRIPT\", \"STYLE\", \"TEMPLATE\", \"NOSCRIPT\"].includes(tag) ||\n unseen(node)\n ) {\n return;\n }\n if (tag === \"BR\") {\n breakLine();\n return;\n }\n if (tag === \"IMG\") {\n line += node.getAttribute(\"alt\") ?? \"\";\n return;\n }\n const block = BLOCK_TAGS.has(tag);\n if (block) breakLine();\n if ((tag === \"TD\" || tag === \"TH\") && node.previousElementSibling !== null) line += \" | \";\n if (tag === \"LI\" && node.parentElement?.tagName.toUpperCase() === \"OL\") {\n const list = node.parentElement;\n const start = Number(list.getAttribute(\"start\") ?? \"1\");\n const items = Array.from(list.children).filter((c) => c.tagName.toUpperCase() === \"LI\");\n line += `${(Number.isFinite(start) ? start : 1) + items.indexOf(node)}. `;\n }\n for (const child of Array.from(node.childNodes)) walk(child, pre || tag === \"PRE\");\n if (block) breakLine();\n };\n walk(block, false);\n breakLine();\n return lines.map(({ text, pre }) => (pre ? text.trimEnd() : text.trim())).join(\"\\n\");\n}\n"]}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/overlay/text.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,qCAAqC;AACrC,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,GAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG;IACjE,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,0CAA0C;AAC1C,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAsC;IAC7E,MAAM,KAA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,KAAK,CAAC,CAAC;QACnF,IAAI,KAAK;YAAE,SAAS,EAAE,CAAC;IACzB,CAAC,CAAC;IACF,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnB,SAAS,EAAE,CAAC;IACZ,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvF,CAAC","sourcesContent":["// What the overlay says about threads: where each one is, when a comment was\n// made, and counts in words.\nimport type { LocatedThread } from \"../place/place.js\";\nimport type { Author } from \"../shared/types.js\";\nimport { DATA_OVERLAY, DATA_UI } from \"../names.js\";\n\n/** `\"1 comment\"`, `\"2 comments\"`. */\nexport function plural(count: number, one: string, many = `${one}s`): string {\n return `${count} ${count === 1 ? one : many}`;\n}\n\n/** The last segment of a content path. */\nfunction fileName(path: string): string {\n return path.slice(path.lastIndexOf(\"/\") + 1);\n}\n\n/** `rollouts.md:28`, or `rollouts.md:28-30`. */\nexport function linesLabel(path: string, lines: { first: number; last: number }): string {\n const range = lines.first === lines.last ? `${lines.first}` : `${lines.first}-${lines.last}`;\n return `${fileName(path)}:${range}`;\n}\n\n/** Where a thread is, for its card's header. */\nexport function whereLabel(thread: LocatedThread): string {\n const file = fileName(thread.path);\n if (thread.detached === \"file\") return `On ${file} as a whole`;\n if (thread.detached === \"line-gone\") {\n const line = thread.originalLine ?? thread.line;\n const commit = thread.originalCommit?.slice(0, 7);\n if (line === null) return `Was on ${file}, since removed`;\n return `Was on ${file}, line ${line}${commit ? ` at ${commit}` : \"\"}, since removed`;\n }\n if (thread.lines === undefined) return file;\n if (thread.detached === \"no-block\")\n return `${linesLabel(thread.path, thread.lines)}, not on this page`;\n if (thread.kind === \"review\" && thread.side === \"LEFT\") return file;\n return linesLabel(thread.path, thread.lines);\n}\n\n/** Where a thread is, for a list of them: shorter, and naming removed text. */\nexport function listLabel(thread: LocatedThread): string {\n const file = fileName(thread.path);\n if (thread.detached !== undefined) return `no block, was ${file}`;\n if (thread.kind === \"review\" && thread.side === \"LEFT\") return `removed text in ${file}`;\n return thread.lines === undefined ? file : linesLabel(thread.path, thread.lines);\n}\n\n/** Whether the thread is on removed text. */\nexport function onRemovedText(thread: LocatedThread): boolean {\n return thread.kind === \"review\" && thread.side === \"LEFT\";\n}\n\n/** Whether any comment of the thread is unsent. */\nexport function hasUnsent(thread: LocatedThread): boolean {\n return thread.comments.some((comment) => comment.pending);\n}\n\n/** A comment's author's name, `\"you\"` for the viewer. */\nexport function authorName(author: Author | null, viewer: string): string {\n if (author === null) return \"ghost\";\n return author.login === viewer ? \"you\" : author.login;\n}\n\n/** Two letters standing for an author, for the avatar's place. */\nexport function initials(author: Author | null): string {\n return (\n (author?.login ?? \"?\")\n .replace(/[^A-Za-z0-9]/g, \"\")\n .slice(0, 2)\n .toUpperCase() || \"?\"\n );\n}\n\n/** `\"just now\"`, `\"5 minutes ago\"`, `\"yesterday\"`, or a date. */\nexport function relativeTime(iso: string, now: number): string {\n const then = Date.parse(iso);\n if (Number.isNaN(then)) return \"\";\n const seconds = Math.max(0, Math.round((now - then) / 1000));\n if (seconds < 60) return \"just now\";\n const minutes = Math.round(seconds / 60);\n if (minutes < 60) return `${plural(minutes, \"minute\")} ago`;\n const hours = Math.round(minutes / 60);\n if (hours < 24) return `${plural(hours, \"hour\")} ago`;\n const days = Math.round(hours / 24);\n if (days === 1) return \"yesterday\";\n if (days < 30) return `${days} days ago`;\n return new Date(then).toISOString().slice(0, 10);\n}\n\n/** Elements whose text starts on a line of its own. */\nconst BLOCK_TAGS = new Set([\n \"ADDRESS\",\n \"ARTICLE\",\n \"ASIDE\",\n \"BLOCKQUOTE\",\n \"DD\",\n \"DETAILS\",\n \"DIV\",\n \"DL\",\n \"DT\",\n \"FIGCAPTION\",\n \"FIGURE\",\n \"FOOTER\",\n \"H1\",\n \"H2\",\n \"H3\",\n \"H4\",\n \"H5\",\n \"H6\",\n \"HEADER\",\n \"HR\",\n \"LI\",\n \"OL\",\n \"P\",\n \"PRE\",\n \"SECTION\",\n \"SUMMARY\",\n \"TABLE\",\n \"TR\",\n \"UL\",\n]);\n\n/** Classes that hide text from sight but not from screen readers. */\nconst SCREEN_READER_ONLY = [\"sr-only\", \"visually-hidden\", \"sl-sr-only\"];\n\n/** Whether a reader can't see `el`. */\nfunction unseen(el: Element): boolean {\n if (\n el.hasAttribute(\"hidden\") ||\n el.getAttribute(\"aria-hidden\") === \"true\" ||\n SCREEN_READER_ONLY.some((name) => el.classList.contains(name))\n ) {\n return true;\n }\n const style = el.ownerDocument.defaultView?.getComputedStyle(el);\n return style?.display === \"none\" || style?.visibility === \"hidden\";\n}\n\n/**\n * A block's text as a reader sees it, for quoting: links as their text, a\n * line for each paragraph, list item, or row, numbered items with their\n * numbers, images as their alt text, and code as written. What the marks and\n * the overlay add is left out, but for the words a change inserted, and so\n * is anything a reader can't see.\n */\nexport function blockText(block: Element): string {\n // Each line, and whether it's code, which keeps its spaces.\n const lines: { text: string; pre: boolean }[] = [];\n let line = \"\";\n let linePre = false;\n const breakLine = (): void => {\n if (line.trim() !== \"\") lines.push({ text: line, pre: linePre });\n line = \"\";\n linePre = false;\n };\n const walk = (node: Node, pre: boolean): void => {\n if (node.nodeType === 3) {\n const text = node.nodeValue ?? \"\";\n if (!pre) {\n line += text.replace(/\\s+/g, \" \");\n return;\n }\n const [first = \"\", ...rest] = text.split(\"\\n\");\n line += first;\n linePre = true;\n for (const next of rest) {\n lines.push({ text: line, pre: true });\n line = next;\n }\n return;\n }\n if (!(node instanceof Element)) return;\n const tag = node.tagName.toUpperCase();\n if (\n node.hasAttribute(DATA_OVERLAY) ||\n (node.hasAttribute(DATA_UI) && tag !== \"INS\") ||\n [\"SCRIPT\", \"STYLE\", \"TEMPLATE\", \"NOSCRIPT\"].includes(tag) ||\n unseen(node)\n ) {\n return;\n }\n if (tag === \"BR\") {\n breakLine();\n return;\n }\n if (tag === \"IMG\") {\n line += node.getAttribute(\"alt\") ?? \"\";\n return;\n }\n const block = BLOCK_TAGS.has(tag);\n if (block) breakLine();\n if ((tag === \"TD\" || tag === \"TH\") && node.previousElementSibling !== null) line += \" | \";\n if (tag === \"LI\" && node.parentElement?.tagName.toUpperCase() === \"OL\") {\n const list = node.parentElement;\n const start = Number(list.getAttribute(\"start\") ?? \"1\");\n const items = Array.from(list.children).filter((c) => c.tagName.toUpperCase() === \"LI\");\n line += `${(Number.isFinite(start) ? start : 1) + items.indexOf(node)}. `;\n }\n for (const child of Array.from(node.childNodes)) walk(child, pre || tag === \"PRE\");\n if (block) breakLine();\n };\n walk(block, false);\n breakLine();\n return lines.map(({ text, pre }) => (pre ? text.trimEnd() : text.trim())).join(\"\\n\");\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import type { CommentTarget, PendingReview, ReviewEvent } from "../github/session.js";
2
2
  import type { Anchor } from "../place/anchor.js";
3
3
  import type { LocatedThread, PlacedThreads } from "../place/place.js";
4
+ import type { FormattedPiece } from "../shapes.js";
4
5
  import type { Thread, ThreadComment } from "../shared/types.js";
5
- export type { Anchor, CommentTarget, LocatedThread, PendingReview, PlacedThreads, ReviewEvent };
6
+ export type { Anchor, CommentTarget, FormattedPiece, LocatedThread, PendingReview, PlacedThreads, ReviewEvent, };
6
7
  /** What the overlay draws for the page it's on. */
7
8
  export interface OverlayData {
8
9
  /** The pull request: its number names it ("#128"). */
@@ -20,10 +21,15 @@ export interface OverlayData {
20
21
  /** A thread on the pull request, and the pages it's on. */
21
22
  export interface ThreadSummary {
22
23
  thread: LocatedThread;
23
- /** The pages that show it, by content path; empty when no page is known to. */
24
+ /**
25
+ * The pages that show it, by content path; empty when no page is known to.
26
+ * `formatted_title` is the title formatted, when its field sets `inline`;
27
+ * a host that doesn't know it leaves it out.
28
+ */
24
29
  pages: {
25
30
  path: string;
26
31
  title: string | null;
32
+ formatted_title?: FormattedPiece[] | null;
27
33
  }[];
28
34
  }
29
35
  /** A failure the host reports: `message` is a sentence to show; `code` is a `ReviewError` code. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/overlay/types.ts"],"names":[],"mappings":"","sourcesContent":["// What the overlay gets from its host, and what it gives back. The types are\n// shared with `./github` and `./place`, but only as types: nothing of them\n// runs in the browser.\nimport type { CommentTarget, PendingReview, ReviewEvent } from \"../github/session.js\";\nimport type { Anchor } from \"../place/anchor.js\";\nimport type { LocatedThread, PlacedThreads } from \"../place/place.js\";\nimport type { Thread, ThreadComment } from \"../shared/types.js\";\n\nexport type { Anchor, CommentTarget, LocatedThread, PendingReview, PlacedThreads, ReviewEvent };\n\n/** What the overlay draws for the page it's on. */\nexport interface OverlayData {\n /** The pull request: its number names it (\"#128\"). */\n pullRequest: { number: number; url: string };\n /** The page's threads, placed on its blocks (`ReviewSession.threads`). */\n threads: PlacedThreads;\n /** The viewer's pending review: what's unsent. */\n pending: PendingReview;\n /** The signed-in viewer's login. */\n viewer: string;\n}\n\n/** A thread on the pull request, and the pages it's on. */\nexport interface ThreadSummary {\n thread: LocatedThread;\n /** The pages that show it, by content path; empty when no page is known to. */\n pages: { path: string; title: string | null }[];\n}\n\n/** A failure the host reports: `message` is a sentence to show; `code` is a `ReviewError` code. */\nexport interface HostError {\n message: string;\n code?: string;\n}\n\n/**\n * Where the overlay gets its data and sends what the reviewer does. A host\n * keeps GitHub to itself: the overlay never sees a token or makes a request.\n */\nexport interface OverlayHost {\n load(): Promise<OverlayData>;\n /** How a comment on the block would go: as a thread, in the review's summary, or not yet. */\n commentTarget(anchor: Anchor): Promise<CommentTarget>;\n /** Comments on a block. `quote` is the block's text as the page shows it. */\n comment(anchor: Anchor, body: string, quote?: string): Promise<Thread>;\n reply(threadId: string, body: string, when: \"now\" | \"withReview\"): Promise<ThreadComment>;\n /** Every thread on the pull request's pages, with the pages each is on. */\n allThreads(): Promise<ThreadSummary[]>;\n resolve(threadId: string, resolved: boolean): Promise<void>;\n submit(event: ReviewEvent, body?: string): Promise<void>;\n /** Deletes the pending review and everything in it. */\n discard(): Promise<void>;\n openSource(anchor: Anchor): void;\n /** Shows a thread that's on another page: the host opens that page, and its overlay goes to the thread. */\n openThread(threadId: string, page: string): void;\n /** Opens a link from a comment. Without it, the link opens as the page would open it. */\n openLink?(url: string): void;\n /** Tells the reviewer something that happened, as the host shows notices. */\n notify?(message: string): void;\n /** Calls `listener` when the page re-rendered or the threads changed. */\n onDidChange(listener: () => void): void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/overlay/types.ts"],"names":[],"mappings":"","sourcesContent":["// What the overlay gets from its host, and what it gives back. The types are\n// shared with `./github` and `./place`, but only as types: nothing of them\n// runs in the browser.\nimport type { CommentTarget, PendingReview, ReviewEvent } from \"../github/session.js\";\nimport type { Anchor } from \"../place/anchor.js\";\nimport type { LocatedThread, PlacedThreads } from \"../place/place.js\";\nimport type { FormattedPiece } from \"../shapes.js\";\nimport type { Thread, ThreadComment } from \"../shared/types.js\";\n\nexport type {\n Anchor,\n CommentTarget,\n FormattedPiece,\n LocatedThread,\n PendingReview,\n PlacedThreads,\n ReviewEvent,\n};\n\n/** What the overlay draws for the page it's on. */\nexport interface OverlayData {\n /** The pull request: its number names it (\"#128\"). */\n pullRequest: { number: number; url: string };\n /** The page's threads, placed on its blocks (`ReviewSession.threads`). */\n threads: PlacedThreads;\n /** The viewer's pending review: what's unsent. */\n pending: PendingReview;\n /** The signed-in viewer's login. */\n viewer: string;\n}\n\n/** A thread on the pull request, and the pages it's on. */\nexport interface ThreadSummary {\n thread: LocatedThread;\n /**\n * The pages that show it, by content path; empty when no page is known to.\n * `formatted_title` is the title formatted, when its field sets `inline`;\n * a host that doesn't know it leaves it out.\n */\n pages: { path: string; title: string | null; formatted_title?: FormattedPiece[] | null }[];\n}\n\n/** A failure the host reports: `message` is a sentence to show; `code` is a `ReviewError` code. */\nexport interface HostError {\n message: string;\n code?: string;\n}\n\n/**\n * Where the overlay gets its data and sends what the reviewer does. A host\n * keeps GitHub to itself: the overlay never sees a token or makes a request.\n */\nexport interface OverlayHost {\n load(): Promise<OverlayData>;\n /** How a comment on the block would go: as a thread, in the review's summary, or not yet. */\n commentTarget(anchor: Anchor): Promise<CommentTarget>;\n /** Comments on a block. `quote` is the block's text as the page shows it. */\n comment(anchor: Anchor, body: string, quote?: string): Promise<Thread>;\n reply(threadId: string, body: string, when: \"now\" | \"withReview\"): Promise<ThreadComment>;\n /** Every thread on the pull request's pages, with the pages each is on. */\n allThreads(): Promise<ThreadSummary[]>;\n resolve(threadId: string, resolved: boolean): Promise<void>;\n submit(event: ReviewEvent, body?: string): Promise<void>;\n /** Deletes the pending review and everything in it. */\n discard(): Promise<void>;\n openSource(anchor: Anchor): void;\n /** Shows a thread that's on another page: the host opens that page, and its overlay goes to the thread. */\n openThread(threadId: string, page: string): void;\n /** Opens a link from a comment. Without it, the link opens as the page would open it. */\n openLink?(url: string): void;\n /** Tells the reviewer something that happened, as the host shows notices. */\n notify?(message: string): void;\n /** Calls `listener` when the page re-rendered or the threads changed. */\n onDidChange(listener: () => void): void;\n}\n"]}
@@ -1,10 +1,6 @@
1
- /** Where a rendered block came from: its `data-ascribe-source` and `data-ascribe-via`. */
2
- export interface Anchor {
3
- /** `<path>:<first>-<last>`. */
4
- source: string;
5
- /** The includes it came through, outermost first, each `<path>:<line>`. */
6
- via: string[];
7
- }
1
+ import type { Anchor } from "../shapes.js";
2
+ /** Where a rendered block came from: its `data-ascribe-source` and `data-ascribe-via`, as `ascribe diff` writes them. */
3
+ export type { Anchor };
8
4
  /** A block's source, parsed. `path` is decoded. */
9
5
  export interface SourceRange {
10
6
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.js","sourceRoot":"","sources":["../../src/place/anchor.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mEAAmE;AACnE,4EAA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AAE,CAAC,IAAI,EAAE,EAAE;QACrD,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;YAClC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7D,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACZ;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Source anchors: `<path>:<first>-<last>` for a block, `<path>:<line>` for an\n// include. The path is a content path, `/`-separated, each segment\n// percent-encoded except for ASCII letters, digits, `-`, `.`, `_`, and `~`.\n\n/** Where a rendered block came from: its `data-ascribe-source` and `data-ascribe-via`. */\nexport interface Anchor {\n /** `<path>:<first>-<last>`. */\n source: string;\n /** The includes it came through, outermost first, each `<path>:<line>`. */\n via: string[];\n}\n\n/** A block's source, parsed. `path` is decoded. */\nexport interface SourceRange {\n path: string;\n first: number;\n last: number;\n}\n\n/** Parses `<path>:<first>-<last>`, or returns `undefined` if it isn't one. */\nexport function parseSource(source: string): SourceRange | undefined {\n const colon = source.lastIndexOf(\":\");\n if (colon <= 0) return undefined;\n const match = /^(\\d+)-(\\d+)$/.exec(source.slice(colon + 1));\n if (match === null) return undefined;\n const first = Number(match[1]);\n const last = Number(match[2]);\n if (first < 1 || last < first) return undefined;\n let path: string;\n try {\n path = decodePath(source.slice(0, colon));\n } catch {\n return undefined;\n }\n return { path, first, last };\n}\n\n/** Writes a block's source for a decoded content path. */\nexport function formatSource(range: SourceRange): string {\n return `${encodePath(range.path)}:${range.first}-${range.last}`;\n}\n\n/** Percent-encodes each segment of a `/`-separated path, as anchors do. */\nexport function encodePath(path: string): string {\n return path\n .split(\"/\")\n .map((segment) =>\n Array.from(new TextEncoder().encode(segment), (byte) => {\n const char = String.fromCharCode(byte);\n return /[A-Za-z0-9\\-._~]/.test(char)\n ? char\n : `%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`;\n }).join(\"\"),\n )\n .join(\"/\");\n}\n\n/** The inverse of `encodePath`. */\nexport function decodePath(path: string): string {\n return path.split(\"/\").map(decodeURIComponent).join(\"/\");\n}\n\n/** A string that identifies an anchor, `via` included. */\nexport function anchorKey(anchor: Anchor): string {\n return [anchor.source, ...anchor.via].join(\" \");\n}\n"]}
1
+ {"version":3,"file":"anchor.js","sourceRoot":"","sources":["../../src/place/anchor.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mEAAmE;AACnE,4EAA4E;AAc5E,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,CAA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AAY;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Source anchors: `<path>:<first>-<last>` for a block, `<path>:<line>` for an\n// include. The path is a content path, `/`-separated, each segment\n// percent-encoded except for ASCII letters, digits, `-`, `.`, `_`, and `~`.\n\nimport type { Anchor } from \"../shapes.js\";\n\n/** Where a rendered block came from: its `data-ascribe-source` and `data-ascribe-via`, as `ascribe diff` writes them. */\nexport type { Anchor };\n\n/** A block's source, parsed. `path` is decoded. */\nexport interface SourceRange {\n path: string;\n first: number;\n last: number;\n}\n\n/** Parses `<path>:<first>-<last>`, or returns `undefined` if it isn't one. */\nexport function parseSource(source: string): SourceRange | undefined {\n const colon = source.lastIndexOf(\":\");\n if (colon <= 0) return undefined;\n const match = /^(\\d+)-(\\d+)$/.exec(source.slice(colon + 1));\n if (match === null) return undefined;\n const first = Number(match[1]);\n const last = Number(match[2]);\n if (first < 1 || last < first) return undefined;\n let path: string;\n try {\n path = decodePath(source.slice(0, colon));\n } catch {\n return undefined;\n }\n return { path, first, last };\n}\n\n/** Writes a block's source for a decoded content path. */\nexport function formatSource(range: SourceRange): string {\n return `${encodePath(range.path)}:${range.first}-${range.last}`;\n}\n\n/** Percent-encodes each segment of a `/`-separated path, as anchors do. */\nexport function encodePath(path: string): string {\n return path\n .split(\"/\")\n .map((segment) =>\n Array.from(new TextEncoder().encode(segment), (byte) => {\n const char = String.fromCharCode(byte);\n return /[A-Za-z0-9\\-._~]/.test(char)\n ? char\n : `%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`;\n }).join(\"\"),\n )\n .join(\"/\");\n}\n\n/** The inverse of `encodePath`. */\nexport function decodePath(path: string): string {\n return path.split(\"/\").map(decodeURIComponent).join(\"/\");\n}\n\n/** A string that identifies an anchor, `via` included. */\nexport function anchorKey(anchor: Anchor): string {\n return [anchor.source, ...anchor.via].join(\" \");\n}\n"]}
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Where a block's text is written: the README's anchor grammar, the same
3
+ * string the rendered page carries in `data-ascribe-source` and
4
+ * `data-ascribe-via`.
5
+ */
6
+ export interface Anchor {
7
+ /**
8
+ * `<path>:<first>-<last>`: the file's content path, percent-encoded by
9
+ * segment, and the block's first and last lines, from 1.
10
+ */
11
+ source: string;
12
+ /**
13
+ * The includes the block came through, outermost first, each
14
+ * `<path>:<line>`. Empty for a block written in the page itself.
15
+ */
16
+ via: string[];
17
+ }
18
+ /** The base of a comparison, in the report. */
19
+ export interface BaseInfo {
20
+ /** The revision asked for, or the default branch used. */
21
+ requested: string;
22
+ /** The commit it names. */
23
+ commit: string;
24
+ /**
25
+ * The merge base of that commit and `HEAD`, which the comparison reads;
26
+ * `null` with `--base-exact`, which reads `commit`.
27
+ */
28
+ merge_base: string | null;
29
+ }
30
+ /** One build's changed pages. */
31
+ export interface BuildData {
32
+ /** The build's name. */
33
+ build: string;
34
+ /** Its changed pages, in path order. */
35
+ pages: PageData[];
36
+ }
37
+ /** What changed in one build. */
38
+ export interface BuildDiff {
39
+ /** The build's name. */
40
+ build: string;
41
+ /** The pages that changed, in path order. */
42
+ pages: PageDiff[];
43
+ }
44
+ /** One block's change. */
45
+ export interface Change {
46
+ /** What happened to it. */
47
+ kind: ChangeKind;
48
+ /**
49
+ * For a removed block, and a moved block's old place: the block of the
50
+ * new version it came after, among its siblings. Absent when it was
51
+ * first.
52
+ */
53
+ after?: Anchor;
54
+ /** Where it's written now: every kind but `removed`. */
55
+ now?: Anchor;
56
+ /**
57
+ * For a removed block, and a moved block's old place: the block of the
58
+ * new version it was inside. Absent at the top of the page.
59
+ */
60
+ parent?: Anchor;
61
+ /**
62
+ * For a removed block, its text, whitespace collapsed, so it can be
63
+ * shown where it was.
64
+ */
65
+ text?: string;
66
+ /** Where it was written: every kind but `added`. */
67
+ was?: Anchor;
68
+ /** For changed prose, the words that differ. */
69
+ words?: Words;
70
+ }
71
+ /** The kinds of block change. */
72
+ export type ChangeKind = "changed" | "added" | "removed" | "moved";
73
+ /** How many changes of each kind a page has. */
74
+ export interface Counts {
75
+ /** Blocks whose content changed. */
76
+ changed: number;
77
+ /** Blocks only in the new version. */
78
+ added: number;
79
+ /** Blocks only in the old version. */
80
+ removed: number;
81
+ /** Blocks in both, somewhere else. */
82
+ moved: number;
83
+ }
84
+ /** The whole report, as `ascribe diff --format json` writes it. */
85
+ export interface DiffReport {
86
+ /** `SCHEMA_VERSION`. */
87
+ schema_version: number;
88
+ /** The version of Ascribe that wrote it. */
89
+ ascribe_version: string;
90
+ /** What was compared with. */
91
+ base: BaseInfo;
92
+ /** Where the project is. */
93
+ repository: RepositoryInfo;
94
+ /**
95
+ * How many errors `ascribe check` finds in the working tree, for the
96
+ * builds compared. The comparison runs regardless, but a page with an
97
+ * error may not render as it will once it's fixed, so a reviewer should
98
+ * know. `diff_project` sets it; `Report::new` leaves it zero.
99
+ */
100
+ working_tree_errors: number;
101
+ /** What changed, per build, in the order asked for. */
102
+ builds: BuildDiff[];
103
+ }
104
+ /**
105
+ * A piece of a formatted value, as the JSON output writes it:
106
+ * `{ "type": "text" | "code", "value": … }`. Other JSON that shows a
107
+ * formatted title, such as the review report's, writes it the same way.
108
+ */
109
+ export interface FormattedPiece {
110
+ /** What the piece is. */
111
+ type: PieceKind;
112
+ /** Its text: a code span's content without its backticks. */
113
+ value: string;
114
+ }
115
+ /** An image a page refers to. */
116
+ export interface ImageRef {
117
+ /** The image's source file. */
118
+ path: string;
119
+ /** Its size, when it's too large to include. */
120
+ bytes?: number;
121
+ /** Its key in `images`, when it's included. */
122
+ image?: string;
123
+ }
124
+ /** How many changed pages a report renders, and how many it left out. */
125
+ export interface Limit {
126
+ /** The most it renders. */
127
+ pages: number;
128
+ /** How many it left out. */
129
+ omitted: number;
130
+ }
131
+ /** One changed page: `ascribe diff --format json`'s, and its renderings. */
132
+ export interface PageData {
133
+ /** The page's content path. */
134
+ path: string;
135
+ /** Its route: the new one, or for a removed page the old one. */
136
+ route: string;
137
+ /**
138
+ * Whether the build publishes it only now, only before, or in both
139
+ * with a difference.
140
+ */
141
+ status: PageStatus;
142
+ /** Whether the page's own file changed (or exists on one side only). */
143
+ own_file_changed: boolean;
144
+ /**
145
+ * The other changed files the page's change can come from: fragments it
146
+ * includes and pages its links take a title or a heading from, in path
147
+ * order; then the snippets whose code changed, by address
148
+ * (`code:app.py#main`); and `ascribe.toml` (last) when the content model
149
+ * is a cause.
150
+ */
151
+ because: string[];
152
+ /**
153
+ * What changed about the page itself besides its blocks, in this
154
+ * order: `title`, `frontmatter`, `availability` (the page-level one),
155
+ * and `route`. Empty for an added or removed page.
156
+ */
157
+ page_changed: string[];
158
+ /** How many changes of each kind. */
159
+ counts: Counts;
160
+ /**
161
+ * The block-level changes, in the page's order, a removed block where
162
+ * it was. Empty for an added or removed page.
163
+ */
164
+ changes: Change[];
165
+ /** Its title, when the build has one. */
166
+ title: string | null;
167
+ /**
168
+ * Its title formatted, when its field sets `inline = "code"`: for the
169
+ * page list and the page's heading. `title` stays the plain text.
170
+ */
171
+ formatted_title: FormattedPiece[] | null;
172
+ /** The page now, as a key of `pages`; `null` when there's none. */
173
+ now: string | null;
174
+ /** The page before, as a key of `pages`; `null` when there's none. */
175
+ was: string | null;
176
+ /** Whether it's beyond the limit, so not rendered. */
177
+ omitted: boolean;
178
+ }
179
+ /** What changed on one page of a build. */
180
+ export interface PageDiff {
181
+ /** The page's content path. */
182
+ path: string;
183
+ /** Its route: the new one, or for a removed page the old one. */
184
+ route: string;
185
+ /**
186
+ * Whether the build publishes it only now, only before, or in both
187
+ * with a difference.
188
+ */
189
+ status: PageStatus;
190
+ /** Whether the page's own file changed (or exists on one side only). */
191
+ own_file_changed: boolean;
192
+ /**
193
+ * The other changed files the page's change can come from: fragments it
194
+ * includes and pages its links take a title or a heading from, in path
195
+ * order; then the snippets whose code changed, by address
196
+ * (`code:app.py#main`); and `ascribe.toml` (last) when the content model
197
+ * is a cause.
198
+ */
199
+ because: string[];
200
+ /**
201
+ * What changed about the page itself besides its blocks, in this
202
+ * order: `title`, `frontmatter`, `availability` (the page-level one),
203
+ * and `route`. Empty for an added or removed page.
204
+ */
205
+ page_changed: string[];
206
+ /** How many changes of each kind. */
207
+ counts: Counts;
208
+ /**
209
+ * The block-level changes, in the page's order, a removed block where
210
+ * it was. Empty for an added or removed page.
211
+ */
212
+ changes: Change[];
213
+ }
214
+ /** Whether a page is new, gone, or different. */
215
+ export type PageStatus = "added" | "removed" | "changed";
216
+ /** What a piece of a formatted value is. */
217
+ export type PieceKind = "text" | "code";
218
+ /** A page rendered: its HTML, and what each image reference in it is. */
219
+ export interface RenderedPage {
220
+ /** The page's content, rendered with source anchors. */
221
+ html: string;
222
+ /** Each image reference the HTML writes, and what it is. */
223
+ images: Record<string, ImageRef>;
224
+ }
225
+ /**
226
+ * The data the report's script draws from. Its keys, like the JSON
227
+ * report's, are snake_case.
228
+ */
229
+ export interface ReportData {
230
+ /** The version of Ascribe that wrote it. */
231
+ ascribe_version: string;
232
+ /** What was compared with. */
233
+ base: BaseInfo;
234
+ /** How many errors `ascribe check` finds in the working tree. */
235
+ working_tree_errors: number;
236
+ /** What changed, per build. */
237
+ builds: BuildData[];
238
+ /** Each rendered page, once however many builds render it alike. */
239
+ pages: Record<string, RenderedPage>;
240
+ /** Each image, as a `data:` URL, once however many pages use it. */
241
+ images: Record<string, string>;
242
+ /** How many changed pages the report renders, and how many it left out. */
243
+ limit: Limit;
244
+ /** The size, in bytes, above which an image isn't included. */
245
+ image_limit: number;
246
+ }
247
+ /** The repository, in the report. */
248
+ export interface RepositoryInfo {
249
+ /** The repository's top-level directory, as git prints it. */
250
+ root: string;
251
+ /**
252
+ * The project's folder inside it, with a trailing `/`, or empty when
253
+ * the project is at the repository's root.
254
+ */
255
+ project_prefix: string;
256
+ }
257
+ /**
258
+ * The words that differ inside a changed block of prose. Ranges are
259
+ * `[start, end)` in characters (Unicode scalar values) of each side's
260
+ * `text`, which is the block's text with whitespace collapsed.
261
+ */
262
+ export interface Words {
263
+ /** Ranges in `now_text`: words added or replacing others. */
264
+ now: [number, number][];
265
+ /** Ranges in `was_text`: words removed or replaced. */
266
+ was: [number, number][];
267
+ /** The block's text now. */
268
+ now_text: string;
269
+ /** The block's text before. */
270
+ was_text: string;
271
+ }
package/dist/shapes.js ADDED
@@ -0,0 +1,9 @@
1
+ // The JSON Ascribe writes that this package reads, as TypeScript types.
2
+ // Generated from the Rust types that write it, through the JSON Schemas in
3
+ // schemas/, by crates/ascribe-cli/src/shapes.rs. Change the Rust types, then
4
+ // run `ASCRIBE_BLESS=1 cargo test -p ascribe-cli shapes`. Don't edit it.
5
+ //
6
+ // - DiffReport (`ascribe diff --format json`)
7
+ // - ReportData (`ascribe diff --format html`, for the report's script)
8
+ export {};
9
+ //# sourceMappingURL=shapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapes.js","sourceRoot":"","sources":["../src/shapes.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,EAAE;AACF,8CAA8C;AAC9C,uEAAuE","sourcesContent":["// The JSON Ascribe writes that this package reads, as TypeScript types.\n// Generated from the Rust types that write it, through the JSON Schemas in\n// schemas/, by crates/ascribe-cli/src/shapes.rs. Change the Rust types, then\n// run `ASCRIBE_BLESS=1 cargo test -p ascribe-cli shapes`. Don't edit it.\n//\n// - DiffReport (`ascribe diff --format json`)\n// - ReportData (`ascribe diff --format html`, for the report's script)\n\n/**\n * Where a block's text is written: the README's anchor grammar, the same\n * string the rendered page carries in `data-ascribe-source` and\n * `data-ascribe-via`.\n */\nexport interface Anchor {\n /**\n * `<path>:<first>-<last>`: the file's content path, percent-encoded by\n * segment, and the block's first and last lines, from 1.\n */\n source: string;\n /**\n * The includes the block came through, outermost first, each\n * `<path>:<line>`. Empty for a block written in the page itself.\n */\n via: string[];\n}\n\n/** The base of a comparison, in the report. */\nexport interface BaseInfo {\n /** The revision asked for, or the default branch used. */\n requested: string;\n /** The commit it names. */\n commit: string;\n /**\n * The merge base of that commit and `HEAD`, which the comparison reads;\n * `null` with `--base-exact`, which reads `commit`.\n */\n merge_base: string | null;\n}\n\n/** One build's changed pages. */\nexport interface BuildData {\n /** The build's name. */\n build: string;\n /** Its changed pages, in path order. */\n pages: PageData[];\n}\n\n/** What changed in one build. */\nexport interface BuildDiff {\n /** The build's name. */\n build: string;\n /** The pages that changed, in path order. */\n pages: PageDiff[];\n}\n\n/** One block's change. */\nexport interface Change {\n /** What happened to it. */\n kind: ChangeKind;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it came after, among its siblings. Absent when it was\n * first.\n */\n after?: Anchor;\n /** Where it's written now: every kind but `removed`. */\n now?: Anchor;\n /**\n * For a removed block, and a moved block's old place: the block of the\n * new version it was inside. Absent at the top of the page.\n */\n parent?: Anchor;\n /**\n * For a removed block, its text, whitespace collapsed, so it can be\n * shown where it was.\n */\n text?: string;\n /** Where it was written: every kind but `added`. */\n was?: Anchor;\n /** For changed prose, the words that differ. */\n words?: Words;\n}\n\n/** The kinds of block change. */\nexport type ChangeKind = \"changed\" | \"added\" | \"removed\" | \"moved\";\n\n/** How many changes of each kind a page has. */\nexport interface Counts {\n /** Blocks whose content changed. */\n changed: number;\n /** Blocks only in the new version. */\n added: number;\n /** Blocks only in the old version. */\n removed: number;\n /** Blocks in both, somewhere else. */\n moved: number;\n}\n\n/** The whole report, as `ascribe diff --format json` writes it. */\nexport interface DiffReport {\n /** `SCHEMA_VERSION`. */\n schema_version: number;\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** Where the project is. */\n repository: RepositoryInfo;\n /**\n * How many errors `ascribe check` finds in the working tree, for the\n * builds compared. The comparison runs regardless, but a page with an\n * error may not render as it will once it's fixed, so a reviewer should\n * know. `diff_project` sets it; `Report::new` leaves it zero.\n */\n working_tree_errors: number;\n /** What changed, per build, in the order asked for. */\n builds: BuildDiff[];\n}\n\n/**\n * A piece of a formatted value, as the JSON output writes it:\n * `{ \"type\": \"text\" | \"code\", \"value\": … }`. Other JSON that shows a\n * formatted title, such as the review report's, writes it the same way.\n */\nexport interface FormattedPiece {\n /** What the piece is. */\n type: PieceKind;\n /** Its text: a code span's content without its backticks. */\n value: string;\n}\n\n/** An image a page refers to. */\nexport interface ImageRef {\n /** The image's source file. */\n path: string;\n /** Its size, when it's too large to include. */\n bytes?: number;\n /** Its key in `images`, when it's included. */\n image?: string;\n}\n\n/** How many changed pages a report renders, and how many it left out. */\nexport interface Limit {\n /** The most it renders. */\n pages: number;\n /** How many it left out. */\n omitted: number;\n}\n\n/** One changed page: `ascribe diff --format json`'s, and its renderings. */\nexport interface PageData {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); and `ascribe.toml` (last) when the content model\n * is a cause.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page.\n */\n changes: Change[];\n /** Its title, when the build has one. */\n title: string | null;\n /**\n * Its title formatted, when its field sets `inline = \"code\"`: for the\n * page list and the page's heading. `title` stays the plain text.\n */\n formatted_title: FormattedPiece[] | null;\n /** The page now, as a key of `pages`; `null` when there's none. */\n now: string | null;\n /** The page before, as a key of `pages`; `null` when there's none. */\n was: string | null;\n /** Whether it's beyond the limit, so not rendered. */\n omitted: boolean;\n}\n\n/** What changed on one page of a build. */\nexport interface PageDiff {\n /** The page's content path. */\n path: string;\n /** Its route: the new one, or for a removed page the old one. */\n route: string;\n /**\n * Whether the build publishes it only now, only before, or in both\n * with a difference.\n */\n status: PageStatus;\n /** Whether the page's own file changed (or exists on one side only). */\n own_file_changed: boolean;\n /**\n * The other changed files the page's change can come from: fragments it\n * includes and pages its links take a title or a heading from, in path\n * order; then the snippets whose code changed, by address\n * (`code:app.py#main`); and `ascribe.toml` (last) when the content model\n * is a cause.\n */\n because: string[];\n /**\n * What changed about the page itself besides its blocks, in this\n * order: `title`, `frontmatter`, `availability` (the page-level one),\n * and `route`. Empty for an added or removed page.\n */\n page_changed: string[];\n /** How many changes of each kind. */\n counts: Counts;\n /**\n * The block-level changes, in the page's order, a removed block where\n * it was. Empty for an added or removed page.\n */\n changes: Change[];\n}\n\n/** Whether a page is new, gone, or different. */\nexport type PageStatus = \"added\" | \"removed\" | \"changed\";\n\n/** What a piece of a formatted value is. */\nexport type PieceKind = \"text\" | \"code\";\n\n/** A page rendered: its HTML, and what each image reference in it is. */\nexport interface RenderedPage {\n /** The page's content, rendered with source anchors. */\n html: string;\n /** Each image reference the HTML writes, and what it is. */\n images: Record<string, ImageRef>;\n}\n\n/**\n * The data the report's script draws from. Its keys, like the JSON\n * report's, are snake_case.\n */\nexport interface ReportData {\n /** The version of Ascribe that wrote it. */\n ascribe_version: string;\n /** What was compared with. */\n base: BaseInfo;\n /** How many errors `ascribe check` finds in the working tree. */\n working_tree_errors: number;\n /** What changed, per build. */\n builds: BuildData[];\n /** Each rendered page, once however many builds render it alike. */\n pages: Record<string, RenderedPage>;\n /** Each image, as a `data:` URL, once however many pages use it. */\n images: Record<string, string>;\n /** How many changed pages the report renders, and how many it left out. */\n limit: Limit;\n /** The size, in bytes, above which an image isn't included. */\n image_limit: number;\n}\n\n/** The repository, in the report. */\nexport interface RepositoryInfo {\n /** The repository's top-level directory, as git prints it. */\n root: string;\n /**\n * The project's folder inside it, with a trailing `/`, or empty when\n * the project is at the repository's root.\n */\n project_prefix: string;\n}\n\n/**\n * The words that differ inside a changed block of prose. Ranges are\n * `[start, end)` in characters (Unicode scalar values) of each side's\n * `text`, which is the block's text with whitespace collapsed.\n */\nexport interface Words {\n /** Ranges in `now_text`: words added or replacing others. */\n now: [number, number][];\n /** Ranges in `was_text`: words removed or replaced. */\n was: [number, number][];\n /** The block's text now. */\n now_text: string;\n /** The block's text before. */\n was_text: string;\n}\n"]}