@ascribed/astro 0.1.2-next.5 → 0.1.2-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/attributes.d.ts +2 -2
- package/dist/attributes.js +29 -5
- package/dist/attributes.js.map +1 -1
- package/dist/binary.js.map +1 -1
- package/dist/code-titles.d.ts +11 -0
- package/dist/code-titles.js +37 -0
- package/dist/code-titles.js.map +1 -0
- package/dist/content.js.map +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/files.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/project.js.map +1 -1
- package/dist/rehype.js.map +1 -1
- package/dist/review/devfile.js.map +1 -1
- package/dist/review/diff.js.map +1 -1
- package/dist/review/github.js.map +1 -1
- package/dist/review/protocol.js.map +1 -1
- package/dist/review/routes.js.map +1 -1
- package/dist/review/server.js.map +1 -1
- package/dist/run.d.ts +5 -0
- package/dist/run.js +9 -0
- package/dist/run.js.map +1 -1
- package/dist/satteri.js.map +1 -1
- package/dist/schema.d.ts +7 -0
- package/dist/schema.js +31 -0
- package/dist/schema.js.map +1 -0
- package/dist/toolbar/app.js.map +1 -1
- package/dist/toolbar/page.js.map +1 -1
- package/dist/toolbar/style.js.map +1 -1
- package/dist/toolbar/text.js.map +1 -1
- package/package.json +8 -6
- package/src/Availability.astro +43 -0
package/dist/toolbar/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/toolbar/page.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAShE,+EAA+E;AAC/E,MAAM,UAAU,cAAc,CAAC,GAAa;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,C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C;IACtB,MAAM,KAAK,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACpE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,iEAAiE;AACjE,SAAS,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAuC;IACjE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE;QAC3B,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAClB,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;IACjE,CAAC,CAAC;IACF,OAAO,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["// What the toolbar app reads from the page the dev server rendered: its\n// anchored blocks, the element that holds them, the page's own file, and\n// whether the anchors arrived. Apart from the app so it can be tested in a\n// DOM by itself.\nimport { findBlock, parseSource } from \"@ascribed/review/marks\";\nimport type { Change } from \"../review/protocol.js\";\n\n/** An anchor, as the marks and the overlay take it. */\nexport interface Anchor {\n source: string;\n via: string[];\n}\n\n/** The page's anchored blocks, in order, leaving out review's own elements. */\nexport function anchoredBlocks(doc: Document): HTMLElement[] {\n return Array.from(doc.querySelectorAll<HTMLElement>(\"[data-ascribe-source]\")).filter(\n (element) => element.closest(\"[data-ascribe-ui]\") === null,\n );\n}\n\n/**\n * The element holding the page's content: the innermost one holding every\n * anchored block, and not a block itself. `undefined` with none.\n */\nexport function contentRoot(blocks: readonly HTMLElement[]): HTMLElement | undefined {\n const first = blocks[0];\n if (first === undefined) return undefined;\n let root: HTMLElement | null = first.parentElement;\n while (root && !blocks.every((block) => root?.contains(block))) root = root.parentElement;\n while (root?.hasAttribute(\"data-ascribe-source\")) root = root.parentElement;\n if (!root || root === first.ownerDocument.documentElement) return first.ownerDocument.body;\n return root;\n}\n\n/**\n * The page's own file, as a content path: the file of the first block\n * written in the page itself (with no includes). `null` when no block is.\n */\nexport function pageFile(blocks: readonly HTMLElement[]): string | null {\n for (const block of blocks) {\n if ((block.getAttribute(\"data-ascribe-via\") ?? \"\").trim() !== \"\") continue;\n const parsed = parseSource(block.getAttribute(\"data-ascribe-source\") ?? \"\");\n if (parsed) return parsed.path;\n }\n return null;\n}\n\n/** An element's anchor. */\nexport function anchorOf(element: Element): Anchor {\n return {\n source: element.getAttribute(\"data-ascribe-source\") ?? \"\",\n via: (element.getAttribute(\"data-ascribe-via\") ?? \"\").split(\" \").filter(Boolean),\n };\n}\n\n/**\n * Whether the page's anchors arrived: false when the page has changes but\n * no anchored blocks, or when fewer than half of its changed blocks can be\n * found. A layout or component that rebuilds the content's elements drops\n * their attributes, and then nothing can be placed.\n */\nexport function anchorsArrived(\n root: ParentNode,\n blocks: number,\n changes: readonly Change[],\n): boolean {\n // A removed block is found by the block it came after, or the one it was in.\n const anchors = changes\n .map((change) => change.now ?? change.after ?? change.parent)\n .filter((anchor) => anchor !== undefined);\n if (anchors.length === 0) return true;\n if (blocks === 0) return false;\n const found = anchors.filter((anchor) => findBlock(root, anchor) !== null).length;\n return found * 2 >= anchors.length;\n}\n\n/** Where a block's source is, for opening it: `guides/install.md`, line 12. */\nexport function sourceLocation(source: string): { path: string; line: number } | undefined {\n const parsed = parseSource(source);\n return parsed ? { path: parsed.path, line: parsed.first } : undefined;\n}\n\n/**\n * Whether the page looks light or dark, from its own colors: the first\n * background that isn't see-through, from `element` up, or else its text's\n * color, or else the canvas, which the root's `color-scheme` picks (`prefersDark` says which\n * one \"light dark\" picks). Review's colors follow it, not the reader's\n * system, since a site may be light only.\n */\nexport function pageScheme(element: Element, prefersDark: boolean): \"light\" | \"dark\" {\n const view = element.ownerDocument.defaultView;\n if (!view) return prefersDark ? \"dark\" : \"light\";\n for (let at: Element | null = element; at; at = at.parentElement) {\n const color = parseRgb(view.getComputedStyle(at).backgroundColor);\n if (color && color.alpha >= 0.5) return luminance(color) < 0.18 ? \"dark\" : \"light\";\n }\n // No background color: it may be an image or a gradient. Light text means a dark page.\n const text = parseRgb(view.getComputedStyle(element).color);\n if (text && text.alpha >= 0.5) return luminance(text) > 0.4 ? \"dark\" : \"light\";\n const scheme = view\n .getComputedStyle(element.ownerDocument.documentElement)\n .colorScheme.split(/\\s+/);\n const dark = scheme.includes(\"dark\");\n return dark && (!scheme.includes(\"light\") || prefersDark) ? \"dark\" : \"light\";\n}\n\n/** `rgb(…)` or `rgba(…)`, as computed styles give colors; `undefined` for anything else. */\nfunction parseRgb(color: string): { r: number; g: number; b: number; alpha: number } | undefined {\n const match = /^rgba?\\(([^)]*)\\)$/.exec(color.trim());\n if (!match?.[1]) return undefined;\n const parts = match[1].split(/[\\s,/]+/).filter(Boolean);\n const [r, g, b] = parts.slice(0, 3).map(Number);\n if (r === undefined || g === undefined || b === undefined) return undefined;\n const last = parts[3];\n const alpha = last === undefined ? 1 : last.endsWith(\"%\") ? parseFloat(last) / 100 : Number(last);\n if ([r, g, b, alpha].some((n) => Number.isNaN(n))) return undefined;\n return { r, g, b, alpha };\n}\n\n/** A color's relative luminance, from 0 (black) to 1 (white). */\nfunction luminance({ r, g, b }: { r: number; g: number; b: number }): number {\n const linear = (c: number) => {\n const s = c / 255;\n return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n };\n return 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/toolbar/style.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsPxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/toolbar/style.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsPxB,CAAC","sourcesContent":["// The toolbar app's panel, in the app's own shadow root: the page's styles\n// don't reach it, and its don't reach the page.\nexport const PANEL_CSS = `\n.panel {\n --ink: #1d2330;\n --muted: #5b6475;\n --win: #ffffff;\n --side: #f5f7fb;\n --line: #d3d8e0;\n --accent: #1f6feb;\n --accent-ink: #ffffff;\n --notice: #fff1c2;\n --ui: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n}\n/* Light or dark as the page is (data-scheme), else as the reader's system is. */\n@media (prefers-color-scheme: dark) {\n .panel:not([data-scheme=\"light\"]) {\n --ink: #d9dde5;\n --muted: #929bab;\n --win: #1e2026;\n --side: #23262d;\n --line: #343a45;\n --accent: #5aa2ff;\n --accent-ink: #0b1220;\n --notice: #3a2f0d;\n }\n}\n.panel[data-scheme=\"dark\"] {\n --ink: #d9dde5;\n --muted: #929bab;\n --win: #1e2026;\n --side: #23262d;\n --line: #343a45;\n --accent: #5aa2ff;\n --accent-ink: #0b1220;\n --notice: #3a2f0d;\n}\n.panel {\n position: fixed;\n left: 50%;\n bottom: 72px;\n transform: translateX(-50%);\n width: min(960px, calc(100vw - 20px));\n box-sizing: border-box;\n max-height: 300px;\n overflow-y: auto;\n background: var(--win);\n color: var(--ink);\n border: 1px solid var(--ink);\n border-radius: 8px;\n box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);\n font: 12.5px/1.45 var(--ui);\n z-index: 1;\n}\n.ttl {\n display: flex;\n gap: 10px;\n align-items: center;\n padding: 4px 10px;\n font-size: 11px;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n font-weight: 700;\n background: var(--ink);\n color: var(--win);\n position: sticky;\n top: 0;\n}\n.ttl .grow {\n flex: 1;\n}\n.ttl button {\n border: 0;\n background: transparent;\n color: var(--win);\n padding: 0;\n font: inherit;\n text-transform: none;\n letter-spacing: 0;\n font-weight: 400;\n cursor: pointer;\n}\n.row,\n.notice,\n.unsent {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n align-items: center;\n padding: 6px 10px;\n border-bottom: 1px solid var(--line);\n font-size: 12px;\n}\n.row {\n background: var(--side);\n}\n.row .grow {\n flex: 1;\n min-width: 160px;\n color: var(--muted);\n}\n.row b {\n color: var(--ink);\n font-weight: 600;\n}\n.legend {\n flex-basis: 100%;\n color: var(--muted);\n font-size: 11.5px;\n}\n.notice,\n.unsent {\n background: var(--notice);\n font-size: 12.5px;\n}\n.notice code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.95em;\n}\n.spacer {\n flex: 1;\n}\n.body {\n padding: 8px 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n border-bottom: 1px solid var(--line);\n}\n.body:last-child,\n.row:last-child,\n.notice:last-child,\n.unsent:last-child {\n border-bottom: 0;\n}\n.hint {\n color: var(--muted);\n font-size: 11.5px;\n}\nul {\n margin: 0;\n padding-left: 18px;\n}\nli + li {\n margin-top: 2px;\n}\n.thread {\n border: 1px solid var(--line);\n border-radius: 6px;\n padding: 6px 8px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.thread .where {\n color: var(--muted);\n font-size: 11.5px;\n}\n.thread .comment p {\n margin: 0;\n}\ncode {\n font-family: var(--mono);\n font-size: 0.92em;\n}\nbutton {\n font: inherit;\n cursor: pointer;\n color: inherit;\n}\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\nbutton:focus-visible,\na:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 1px;\n}\n.ghost {\n border: 1px solid var(--line);\n background: var(--win);\n border-radius: 5px;\n padding: 2px 8px;\n font-size: 12px;\n}\n.ghost:hover {\n border-color: var(--accent);\n color: var(--accent);\n}\n.square {\n min-width: 28px;\n min-height: 24px;\n}\n.primary {\n border: 1px solid var(--accent);\n background: var(--accent);\n color: var(--accent-ink);\n border-radius: 5px;\n padding: 2px 10px;\n font-size: 12.5px;\n font-weight: 600;\n}\n.link,\na {\n border: 0;\n background: transparent;\n color: var(--accent);\n padding: 0;\n font-size: inherit;\n text-decoration: none;\n}\n.link:hover,\na:hover {\n text-decoration: underline;\n}\n.position {\n white-space: nowrap;\n}\n.segmented {\n display: inline-flex;\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}\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-ink);\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n`;\n"]}
|
package/dist/toolbar/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/toolbar/text.ts"],"names":[],"mappings":"AAIA,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,EAAU;IAChD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,yBAAyB,CAAC;IAClD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK;QAAE,OAAO,GAAG,EAAE,GAAG,CAAC,OAAO,KAAK,eAAe,CAAC;IACvE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,KAAK,uBAAuB,CAAC;AACjF,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK,GAA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AI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;IACnE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,IAAI,OAAO,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACpE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7F,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["// What the toolbar app says, apart from the DOM so it can be tested by itself.\nimport type { LocatedThread } from \"@ascribed/review/overlay\";\nimport type { ChangedPage, Counts, DiffPage, PageView, ThreadsState } from \"../review/protocol.js\";\n\n/** \"10 changes on this page\", or \"3 of 10 on this page\" while stepping through them. */\nexport function position(total: number, at: number): string {\n if (total === 0) return \"No changes on this page\";\n if (at >= 0 && at < total) return `${at + 1} of ${total} on this page`;\n return total === 1 ? \"1 change on this page\" : `${total} changes on this page`;\n}\n\n/** \"5 changed · 3 added · 1 removed · 1 moved\", leaving out kinds with none. */\nexport function countsText(counts: Counts): string {\n const parts: string[] = [];\n if (counts.changed > 0) parts.push(`${counts.changed} changed`);\n if (counts.added > 0) parts.push(`${counts.added} added`);\n if (counts.removed > 0) parts.push(`${counts.removed} removed`);\n if (counts.moved > 0) parts.push(`${counts.moved} moved`);\n return parts.join(\" · \");\n}\n\n/** A changed page's line in the list: its counts, or what happened to it. */\nexport function pageDetail(page: Omit<DiffPage, \"changes\">): string {\n if (page.status === \"added\") return \"new page\";\n if (page.status === \"removed\") return \"removed\";\n const counts = countsText(page.counts);\n if (counts !== \"\") return counts;\n return page.page_changed.length > 0 ? `${page.page_changed.join(\", \")} changed` : \"changed\";\n}\n\n/**\n * The notice about the working tree's errors, or `undefined` with none: a\n * page with an error may render oddly, which shouldn't read as the change.\n */\nexport function errorsNotice(errors: number): string | undefined {\n if (errors <= 0) return undefined;\n const one = errors === 1;\n return (\n `The working tree has ${one ? \"1 error\" : `${errors} errors`}, so a page may not show as ` +\n `it will once ${one ? \"it's\" : \"they're\"} fixed. \\`ascribe check\\` lists ${one ? \"it\" : \"them\"}.`\n );\n}\n\n/** \"1 unsent comment\", \"2 unsent comments\". */\nexport function unsentText(count: number): string {\n return count === 1 ? \"1 unsent comment\" : `${count} unsent comments`;\n}\n\n/** The toolbar button's label: \"Ascribe review\", with the unsent count when there is one. */\nexport function buttonLabel(unsent: number): string {\n return unsent > 0 ? `Ascribe review · ${unsentText(unsent)}` : \"Ascribe review\";\n}\n\n/** The base's name and the pull request, as the panel's first words: \"#128 against main\". */\nexport function againstText(view: PageView): { pullRequest: string | null; base: string | null } {\n const pullRequest = view.threads.state === \"on\" ? `#${view.threads.pullRequest.number}` : null;\n const requested = view.base?.requested ?? null;\n // The pull request's base by its name (\"main\"), not the remote branch compared with (\"origin/main\").\n const name = view.threads.state === \"on\" ? view.threads.pullRequest.baseRefName : undefined;\n const base =\n requested !== null && name !== undefined && requested.endsWith(`/${name}`) ? name : requested;\n return { pullRequest, base };\n}\n\n/** A sentence about the threads: why there are none, or how the checkout differs. */\nexport function threadsNotice(threads: ThreadsState): string | undefined {\n if (threads.state !== \"on\") return threads.message;\n const { local, pullRequest } = threads;\n const name = `#${pullRequest.number}`;\n const commits = (n: number) => (n === 1 ? \"1 commit\" : `${n} commits`);\n switch (local.state) {\n case \"same\":\n return undefined;\n case \"behind\":\n return `Your checkout is ${commits(local.behind)} behind ${name}, so some comments may be on lines you don't have. Pull to see the latest.`;\n case \"ahead\":\n return `You have ${commits(local.ahead)} that ${local.ahead === 1 ? \"isn't\" : \"aren't\"} pushed. You can comment only on lines that are on GitHub.`;\n case \"diverged\":\n return `Your checkout and ${name} have both moved on (${local.behind} behind, ${local.ahead} ahead). Some comments may be on lines you don't have, and you can comment only on lines that are on GitHub.`;\n case \"missing\":\n return `Your checkout doesn't have ${name}'s latest commit, so some comments may be on lines you don't have. Fetch to see the latest.`;\n }\n}\n\n/**\n * The changed page to offer after `current` (a content path): the next in\n * path order, or past the last, the first (`first`). Removed pages are\n * skipped. `null` when no other page changed.\n */\nexport function nextChangedPage<P extends Omit<DiffPage, \"changes\">>(\n pages: readonly P[],\n current: string | null,\n): { page: P; first: boolean } | null {\n const open = pages.filter((p) => p.status !== \"removed\" && p.path !== current);\n const first = open[0];\n if (first === undefined) return null;\n const after = current === null ? undefined : open.find((p) => p.path > current);\n return after ? { page: after, first: false } : { page: first, first: true };\n}\n\n/** The button past the last change: \"Next changed page: Install Loom\", by title as the page preview says it. */\nexport function nextPageText(next: { page: ChangedPage; first: boolean }): string {\n return `${next.first ? \"First\" : \"Next\"} changed page: ${next.page.title ?? next.page.route}`;\n}\n\n/**\n * Where a listed thread is, as the overlay's cards say it: its file's name\n * and lines (`Options.md:16`), or for a thread on removed text, only the\n * file's name, since its lines are the base's.\n */\nexport function threadLocation(thread: LocatedThread): { label: string; removed: boolean } {\n const file = thread.path.slice(thread.path.lastIndexOf(\"/\") + 1);\n const removed = thread.kind === \"review\" && thread.side === \"LEFT\";\n const lines = thread.lines;\n if (removed || lines === undefined) return { label: file, removed };\n const range = lines.first === lines.last ? `${lines.first}` : `${lines.first}-${lines.last}`;\n return { label: `${file}:${range}`, removed };\n}\n\n/** The hash that tells a page to go to a thread once it's drawn. */\nexport const THREAD_HASH = \"#ascribe-thread=\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ascribed/astro",
|
|
3
|
-
"version": "0.1.2-next.
|
|
3
|
+
"version": "0.1.2-next.7",
|
|
4
4
|
"description": "The Astro integration for Ascribe.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"src/Elements.astro"
|
|
17
|
+
"src/Elements.astro",
|
|
18
|
+
"src/Availability.astro"
|
|
18
19
|
],
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"default": "./dist/satteri.js"
|
|
31
32
|
},
|
|
32
33
|
"./Elements.astro": "./src/Elements.astro",
|
|
34
|
+
"./Availability.astro": "./src/Availability.astro",
|
|
33
35
|
"./content": {
|
|
34
36
|
"types": "./dist/content.d.ts",
|
|
35
37
|
"default": "./dist/content.js"
|
|
@@ -39,9 +41,9 @@
|
|
|
39
41
|
"node": ">=24"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@ascribed/cli": "0.1.2-next.
|
|
43
|
-
"@ascribed/elements": "0.1.2-next.
|
|
44
|
-
"@ascribed/review": "0.1.2-next.
|
|
44
|
+
"@ascribed/cli": "0.1.2-next.7",
|
|
45
|
+
"@ascribed/elements": "0.1.2-next.7",
|
|
46
|
+
"@ascribed/review": "0.1.2-next.7",
|
|
45
47
|
"property-information": "^7.2.0",
|
|
46
48
|
"smol-toml": "^1.9.0"
|
|
47
49
|
},
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
"publishConfig": {
|
|
67
69
|
"access": "public"
|
|
68
70
|
},
|
|
69
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0bd81c5fbd7e4fb79f501cb86a7b93beb3e1b421",
|
|
70
72
|
"scripts": {
|
|
71
73
|
"build": "tsc -p tsconfig.build.json",
|
|
72
74
|
"typecheck": "tsc --noEmit",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
// A page's availability (its `available` frontmatter, `entry.data.available`)
|
|
3
|
+
// as the badge the element library styles: the markup the site output gives a
|
|
4
|
+
// section's `@available` (element contract §4), with `scope="page"`.
|
|
5
|
+
//
|
|
6
|
+
// import Availability from "@ascribed/astro/Availability.astro";
|
|
7
|
+
// <Availability available={entry.data.available} />
|
|
8
|
+
//
|
|
9
|
+
// It renders nothing when the page has no availability.
|
|
10
|
+
interface Props {
|
|
11
|
+
available:
|
|
12
|
+
| readonly {
|
|
13
|
+
target: string;
|
|
14
|
+
dimension: string;
|
|
15
|
+
states: readonly string[];
|
|
16
|
+
versions?: readonly string[] | undefined;
|
|
17
|
+
text: string;
|
|
18
|
+
}[]
|
|
19
|
+
| undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { available } = Astro.props;
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
available && available.length > 0 && (
|
|
27
|
+
<ascribe-availability scope="page">
|
|
28
|
+
{available.map((item, i) => (
|
|
29
|
+
<>
|
|
30
|
+
{i > 0 && "; "}
|
|
31
|
+
<ascribe-availability-target
|
|
32
|
+
target={item.target}
|
|
33
|
+
dimension={item.dimension}
|
|
34
|
+
states={item.states.join(" ")}
|
|
35
|
+
versions={item.versions?.join(" ")}
|
|
36
|
+
>
|
|
37
|
+
{item.text}
|
|
38
|
+
</ascribe-availability-target>
|
|
39
|
+
</>
|
|
40
|
+
))}
|
|
41
|
+
</ascribe-availability>
|
|
42
|
+
)
|
|
43
|
+
}
|