@ascribed/astro 0.4.1-next.28 → 0.4.2-next.29

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/dist/project.js CHANGED
@@ -20,16 +20,18 @@ export function readProject(dir) {
20
20
  const outputDir = typeof project["output-dir"] === "string" ? project["output-dir"] : ".ascribe/build";
21
21
  const contentDir = typeof project["content-root"] === "string" ? project["content-root"] : "docs";
22
22
  const trailingSlash = consumer["trailing-slash"] === "never" ? "never" : "always";
23
+ const site = typeof consumer["site"] === "string" ? consumer["site"] : undefined;
23
24
  return {
24
25
  dir,
25
26
  configPath,
26
27
  contentRoot: path.resolve(dir, contentDir),
27
28
  outputRoot: path.resolve(dir, outputDir),
28
29
  consumer: {
29
- site: typeof consumer["site"] === "string" ? consumer["site"] : undefined,
30
+ site,
30
31
  basePath: normalizeBase(typeof consumer["base-path"] === "string" ? consumer["base-path"] : "/"),
31
32
  trailingSlash,
32
- agents: consumer["agents"] === true,
33
+ // `true` with a site unless it says otherwise, as the binary reads it.
34
+ agents: typeof consumer["agents"] === "boolean" ? consumer["agents"] : site !== undefined,
33
35
  headers: consumer["headers"] === "netlify" ? "netlify" : undefined,
34
36
  },
35
37
  builds: Object.keys(section(table, "builds")),
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,oDAAoD;AACpD,yBAAyB;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AA8BlC,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAClD,IAAI,KAA8B,CAAC;IACnC,IAAI,CAAC;QACH,K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AAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["// What the integration needs from `ascribe.toml`: where a build's site output\n// goes, and the consumer settings that must agree with `astro.config`.\n// The compiler validates the whole file; this reads\n// only what it compiled.\nimport { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { parse } from \"smol-toml\";\n\n/** The parts of an Ascribe project the integration reads. */\nexport interface ProjectInfo {\n /** The directory holding `ascribe.toml`. */\n dir: string;\n /** The path of `ascribe.toml`. */\n configPath: string;\n /** Source files and assets watched during development. */\n contentRoot: string;\n /** Generated output, never treated as a source change. */\n outputRoot: string;\n /** `[consumer]`, with the profile's defaults. */\n consumer: {\n site: string | undefined;\n basePath: string;\n trailingSlash: \"always\" | \"never\";\n /** Whether builds publish what agents read: `llms.txt` and each page's Markdown, in the plain output. */\n agents: boolean;\n /** The host whose format the site's response headers are written in: `\"netlify\"`, or none. */\n headers: \"netlify\" | undefined;\n };\n /** The names of `[builds]`'s tables, in order: empty when there are none, and the one build is `site`. */\n builds: string[];\n /** The site output's root for a build: `<output-dir>/<build>/site`. */\n siteRoot(build: string): string;\n /** The plain output's root for a build: `<output-dir>/<build>/plain`. */\n plainRoot(build: string): string;\n}\n\n/** Reads `ascribe.toml` in `dir`. Throws a readable error if it can't be read. */\nexport function readProject(dir: string): ProjectInfo {\n const configPath = path.join(dir, \"ascribe.toml\");\n let table: Record<string, unknown>;\n try {\n table = parse(readFileSync(configPath, \"utf8\"));\n } catch (error) {\n throw new Error(\n `@ascribed/astro can't read ${configPath}: ${error instanceof Error ? error.message : String(error)}`,\n { cause: error },\n );\n }\n const project = section(table, \"project\");\n const consumer = section(table, \"consumer\");\n const outputDir =\n typeof project[\"output-dir\"] === \"string\" ? project[\"output-dir\"] : \".ascribe/build\";\n const contentDir = typeof project[\"content-root\"] === \"string\" ? project[\"content-root\"] : \"docs\";\n const trailingSlash = consumer[\"trailing-slash\"] === \"never\" ? \"never\" : \"always\";\n return {\n dir,\n configPath,\n contentRoot: path.resolve(dir, contentDir),\n outputRoot: path.resolve(dir, outputDir),\n consumer: {\n site: typeof consumer[\"site\"] === \"string\" ? consumer[\"site\"] : undefined,\n basePath: normalizeBase(\n typeof consumer[\"base-path\"] === \"string\" ? consumer[\"base-path\"] : \"/\",\n ),\n trailingSlash,\n agents: consumer[\"agents\"] === true,\n headers: consumer[\"headers\"] === \"netlify\" ? \"netlify\" : undefined,\n },\n builds: Object.keys(section(table, \"builds\")),\n siteRoot: (build) => path.resolve(dir, outputDir, build, \"site\"),\n plainRoot: (build) => path.resolve(dir, outputDir, build, \"plain\"),\n };\n}\n\nfunction section(table: Record<string, unknown>, name: string): Record<string, unknown> {\n const value = table[name];\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\n/** A base path with a leading and a trailing `/`, as Ascribe's router has it. */\nexport function normalizeBase(base: string): string {\n let result = base.trim();\n if (!result.startsWith(\"/\")) result = `/${result}`;\n if (!result.endsWith(\"/\")) result += \"/\";\n return result;\n}\n\n/**\n * The route of a base path, ending the way `trailingSlash` says the site's\n * routes do: the site's root for Astro's `base`, a project's root for its\n * `[consumer] base-path`. (`import.meta.env.BASE_URL` isn't replaced in a\n * package's components.)\n */\nexport function homeRoute(base: string, trailingSlash: \"always\" | \"never\" | \"ignore\"): string {\n const root = normalizeBase(base);\n return trailingSlash === \"never\" && root !== \"/\" ? root.slice(0, -1) : root;\n}\n\n/** Astro's routing settings, as the integration reads and supplies them. */\nexport interface AstroRouting {\n base: string;\n trailingSlash: \"always\" | \"never\" | \"ignore\";\n site: string | undefined;\n}\n\n/**\n * Astro's routing with what astro.config leaves unset taken from `[consumer]`,\n * and the settings taken, for `updateConfig`. Astro gives an integration its\n * configuration with its defaults filled in, so unset is the default: no\n * `site`, `trailingSlash: \"ignore\"`, and `base: \"/\"`. `site` and\n * `trailingSlash` come from the first project that has them, since every\n * project must agree with them anyway. `base` comes from the first project's\n * `base-path` only with `supplyBase`, as with one project; with several, it\n * stays the site's, the root every base path is under. A base Astro has is\n * rewritten to end the way a supplied `trailingSlash` says, as Astro writes\n * it when the setting is its own.\n */\nexport function supplyRouting(\n projects: readonly ProjectInfo[],\n astro: AstroRouting,\n supplyBase: boolean,\n): { routing: AstroRouting; supplied: Partial<AstroRouting> } {\n const supplied: Partial<AstroRouting> = {};\n if (astro.site === undefined) {\n const site = projects.find((project) => project.consumer.site !== undefined)?.consumer.site;\n if (site !== undefined) supplied.site = site;\n }\n const first = projects[0];\n if (first === undefined) return { routing: astro, supplied };\n if (astro.trailingSlash === \"ignore\") supplied.trailingSlash = first.consumer.trailingSlash;\n const trailingSlash = supplied.trailingSlash ?? astro.trailingSlash;\n const base = homeRoute(\n supplyBase && normalizeBase(astro.base) === \"/\" ? first.consumer.basePath : astro.base,\n trailingSlash,\n );\n if (base !== astro.base) supplied.base = base;\n return { routing: { ...astro, ...supplied }, supplied };\n}\n\n/**\n * The ways `ascribe.toml`'s `[consumer]` disagrees with Astro's configuration,\n * as sentences. Ascribe writes every link with its own settings, so a site\n * whose routes differ would have broken links.\n */\nexport function consumerMismatches(\n project: ProjectInfo,\n astro: { base: string; trailingSlash: string; site: string | undefined },\n): string[] {\n const problems: string[] = [];\n const { basePath, trailingSlash, site } = project.consumer;\n // A base path under Astro's `base` leaves the rest of the site to other pages, such as a home page.\n if (!basePath.startsWith(normalizeBase(astro.base))) {\n problems.push(\n `[consumer] base-path is \"${basePath}\", but Astro's \\`base\\` is \"${astro.base}\". Set base-path to that path or a path under it.`,\n );\n }\n // Astro's \"ignore\" serves both forms, so Ascribe's links work either way.\n if (astro.trailingSlash !== \"ignore\" && astro.trailingSlash !== trailingSlash) {\n problems.push(\n `[consumer] trailing-slash is \"${trailingSlash}\", but Astro's \\`trailingSlash\\` is \"${astro.trailingSlash}\".`,\n );\n }\n if (site !== undefined && astro.site !== undefined && origin(site) !== origin(astro.site)) {\n problems.push(`[consumer] site is \"${site}\", but Astro's \\`site\\` is \"${astro.site}\".`);\n }\n return problems;\n}\n\nfunction origin(url: string): string {\n try {\n return new URL(url).origin;\n } catch {\n return url;\n }\n}\n"]}
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,oDAAoD;AACpD,yBAAyB;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AA8BlC,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAClD,IAAI,KAA8B,CAAC;IACnC,IAAI,CAAC;QACH,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,8BAA8B,UAAU,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACrG,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC5C,MAAM,SAAS,GACb,OAAO,OAAO,CAAC,YAAY,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACvF,MAAM,UAAU,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAA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DAAmD,CACjI,CAAC;IACJ,CAAC;IACD,0EAA0E;IAC1E,IAAI,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,aAAa,KAAK,aAAa,EAAE,CAAC;QAC9E,QAAQ,CAAC,IAAI,CACX,iCAAiC,aAAa,wCAAwC,KAAK,CAAC,aAAa,IAAI,CAC9G,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1F,QAAQ,CAAC,IAAI,CAAC,uBAAuB,IAAI,+BAA+B,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["// What the integration needs from `ascribe.toml`: where a build's site output\n// goes, and the consumer settings that must agree with `astro.config`.\n// The compiler validates the whole file; this reads\n// only what it compiled.\nimport { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { parse } from \"smol-toml\";\n\n/** The parts of an Ascribe project the integration reads. */\nexport interface ProjectInfo {\n /** The directory holding `ascribe.toml`. */\n dir: string;\n /** The path of `ascribe.toml`. */\n configPath: string;\n /** Source files and assets watched during development. */\n contentRoot: string;\n /** Generated output, never treated as a source change. */\n outputRoot: string;\n /** `[consumer]`, with the profile's defaults. */\n consumer: {\n site: string | undefined;\n basePath: string;\n trailingSlash: \"always\" | \"never\";\n /** Whether builds publish what agents read: `llms.txt` and each page's Markdown, in the plain output. */\n agents: boolean;\n /** The host whose format the site's response headers are written in: `\"netlify\"`, or none. */\n headers: \"netlify\" | undefined;\n };\n /** The names of `[builds]`'s tables, in order: empty when there are none, and the one build is `site`. */\n builds: string[];\n /** The site output's root for a build: `<output-dir>/<build>/site`. */\n siteRoot(build: string): string;\n /** The plain output's root for a build: `<output-dir>/<build>/plain`. */\n plainRoot(build: string): string;\n}\n\n/** Reads `ascribe.toml` in `dir`. Throws a readable error if it can't be read. */\nexport function readProject(dir: string): ProjectInfo {\n const configPath = path.join(dir, \"ascribe.toml\");\n let table: Record<string, unknown>;\n try {\n table = parse(readFileSync(configPath, \"utf8\"));\n } catch (error) {\n throw new Error(\n `@ascribed/astro can't read ${configPath}: ${error instanceof Error ? error.message : String(error)}`,\n { cause: error },\n );\n }\n const project = section(table, \"project\");\n const consumer = section(table, \"consumer\");\n const outputDir =\n typeof project[\"output-dir\"] === \"string\" ? project[\"output-dir\"] : \".ascribe/build\";\n const contentDir = typeof project[\"content-root\"] === \"string\" ? project[\"content-root\"] : \"docs\";\n const trailingSlash = consumer[\"trailing-slash\"] === \"never\" ? \"never\" : \"always\";\n const site = typeof consumer[\"site\"] === \"string\" ? consumer[\"site\"] : undefined;\n return {\n dir,\n configPath,\n contentRoot: path.resolve(dir, contentDir),\n outputRoot: path.resolve(dir, outputDir),\n consumer: {\n site,\n basePath: normalizeBase(\n typeof consumer[\"base-path\"] === \"string\" ? consumer[\"base-path\"] : \"/\",\n ),\n trailingSlash,\n // `true` with a site unless it says otherwise, as the binary reads it.\n agents: typeof consumer[\"agents\"] === \"boolean\" ? consumer[\"agents\"] : site !== undefined,\n headers: consumer[\"headers\"] === \"netlify\" ? \"netlify\" : undefined,\n },\n builds: Object.keys(section(table, \"builds\")),\n siteRoot: (build) => path.resolve(dir, outputDir, build, \"site\"),\n plainRoot: (build) => path.resolve(dir, outputDir, build, \"plain\"),\n };\n}\n\nfunction section(table: Record<string, unknown>, name: string): Record<string, unknown> {\n const value = table[name];\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\n/** A base path with a leading and a trailing `/`, as Ascribe's router has it. */\nexport function normalizeBase(base: string): string {\n let result = base.trim();\n if (!result.startsWith(\"/\")) result = `/${result}`;\n if (!result.endsWith(\"/\")) result += \"/\";\n return result;\n}\n\n/**\n * The route of a base path, ending the way `trailingSlash` says the site's\n * routes do: the site's root for Astro's `base`, a project's root for its\n * `[consumer] base-path`. (`import.meta.env.BASE_URL` isn't replaced in a\n * package's components.)\n */\nexport function homeRoute(base: string, trailingSlash: \"always\" | \"never\" | \"ignore\"): string {\n const root = normalizeBase(base);\n return trailingSlash === \"never\" && root !== \"/\" ? root.slice(0, -1) : root;\n}\n\n/** Astro's routing settings, as the integration reads and supplies them. */\nexport interface AstroRouting {\n base: string;\n trailingSlash: \"always\" | \"never\" | \"ignore\";\n site: string | undefined;\n}\n\n/**\n * Astro's routing with what astro.config leaves unset taken from `[consumer]`,\n * and the settings taken, for `updateConfig`. Astro gives an integration its\n * configuration with its defaults filled in, so unset is the default: no\n * `site`, `trailingSlash: \"ignore\"`, and `base: \"/\"`. `site` and\n * `trailingSlash` come from the first project that has them, since every\n * project must agree with them anyway. `base` comes from the first project's\n * `base-path` only with `supplyBase`, as with one project; with several, it\n * stays the site's, the root every base path is under. A base Astro has is\n * rewritten to end the way a supplied `trailingSlash` says, as Astro writes\n * it when the setting is its own.\n */\nexport function supplyRouting(\n projects: readonly ProjectInfo[],\n astro: AstroRouting,\n supplyBase: boolean,\n): { routing: AstroRouting; supplied: Partial<AstroRouting> } {\n const supplied: Partial<AstroRouting> = {};\n if (astro.site === undefined) {\n const site = projects.find((project) => project.consumer.site !== undefined)?.consumer.site;\n if (site !== undefined) supplied.site = site;\n }\n const first = projects[0];\n if (first === undefined) return { routing: astro, supplied };\n if (astro.trailingSlash === \"ignore\") supplied.trailingSlash = first.consumer.trailingSlash;\n const trailingSlash = supplied.trailingSlash ?? astro.trailingSlash;\n const base = homeRoute(\n supplyBase && normalizeBase(astro.base) === \"/\" ? first.consumer.basePath : astro.base,\n trailingSlash,\n );\n if (base !== astro.base) supplied.base = base;\n return { routing: { ...astro, ...supplied }, supplied };\n}\n\n/**\n * The ways `ascribe.toml`'s `[consumer]` disagrees with Astro's configuration,\n * as sentences. Ascribe writes every link with its own settings, so a site\n * whose routes differ would have broken links.\n */\nexport function consumerMismatches(\n project: ProjectInfo,\n astro: { base: string; trailingSlash: string; site: string | undefined },\n): string[] {\n const problems: string[] = [];\n const { basePath, trailingSlash, site } = project.consumer;\n // A base path under Astro's `base` leaves the rest of the site to other pages, such as a home page.\n if (!basePath.startsWith(normalizeBase(astro.base))) {\n problems.push(\n `[consumer] base-path is \"${basePath}\", but Astro's \\`base\\` is \"${astro.base}\". Set base-path to that path or a path under it.`,\n );\n }\n // Astro's \"ignore\" serves both forms, so Ascribe's links work either way.\n if (astro.trailingSlash !== \"ignore\" && astro.trailingSlash !== trailingSlash) {\n problems.push(\n `[consumer] trailing-slash is \"${trailingSlash}\", but Astro's \\`trailingSlash\\` is \"${astro.trailingSlash}\".`,\n );\n }\n if (site !== undefined && astro.site !== undefined && origin(site) !== origin(astro.site)) {\n problems.push(`[consumer] site is \"${site}\", but Astro's \\`site\\` is \"${astro.site}\".`);\n }\n return problems;\n}\n\nfunction origin(url: string): string {\n try {\n return new URL(url).origin;\n } catch {\n return url;\n }\n}\n"]}
@@ -1 +1 @@
1
- export declare const PANEL_CSS = "\n.panel {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, light. */\n --ink: #22272e;\n --muted: #676c75;\n --win: #ffffff;\n --side: #f7f9fd;\n --line: #e3e6ec;\n --accent: #5962e8;\n --accent-ink: #ffffff;\n --notice: #fef5eb;\n --ui: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #f0f3f7;\n --muted: #a5a9b2;\n --win: #0c0f16;\n --side: #13171f;\n --line: #393d46;\n --accent: #91a1fe;\n --accent-ink: #0c0f16;\n --notice: #2b1a03;\n /* End of generated panel. */\n }\n}\n.panel[data-scheme=\"dark\"] {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #f0f3f7;\n --muted: #a5a9b2;\n --win: #0c0f16;\n --side: #13171f;\n --line: #393d46;\n --accent: #91a1fe;\n --accent-ink: #0c0f16;\n --notice: #2b1a03;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: shadow, light. */\n box-shadow: 0 8px 28px rgb(0 0 0 / 0.3);\n /* End of generated shadow. */\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";
1
+ export declare const PANEL_CSS = "\n.panel {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, light. */\n --ink: #0b1824;\n --muted: #47606f;\n --win: #f2f7f9;\n --side: #ffffff;\n --line: #ccdce4;\n --accent: #0b6f8e;\n --accent-ink: #ffffff;\n --focus: #b4530f;\n --notice: #fdf1d8;\n --ui: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #e3f1f7;\n --muted: #8aa6b8;\n --win: #0b1824;\n --side: #112233;\n --line: #263a4b;\n --accent: #56d0f0;\n --accent-ink: #0b1824;\n --focus: #f0a35e;\n --notice: #32240a;\n /* End of generated panel. */\n }\n}\n.panel[data-scheme=\"dark\"] {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #e3f1f7;\n --muted: #8aa6b8;\n --win: #0b1824;\n --side: #112233;\n --line: #263a4b;\n --accent: #56d0f0;\n --accent-ink: #0b1824;\n --focus: #f0a35e;\n --notice: #32240a;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: shadow, light. */\n box-shadow: 0 8px 28px rgb(0 0 0 / 0.3);\n /* End of generated shadow. */\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(--focus);\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";
@@ -3,14 +3,15 @@
3
3
  export const PANEL_CSS = `
4
4
  .panel {
5
5
  /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, light. */
6
- --ink: #22272e;
7
- --muted: #676c75;
8
- --win: #ffffff;
9
- --side: #f7f9fd;
10
- --line: #e3e6ec;
11
- --accent: #5962e8;
6
+ --ink: #0b1824;
7
+ --muted: #47606f;
8
+ --win: #f2f7f9;
9
+ --side: #ffffff;
10
+ --line: #ccdce4;
11
+ --accent: #0b6f8e;
12
12
  --accent-ink: #ffffff;
13
- --notice: #fef5eb;
13
+ --focus: #b4530f;
14
+ --notice: #fdf1d8;
14
15
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
15
16
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
16
17
  /* End of generated panel. */
@@ -19,27 +20,29 @@ export const PANEL_CSS = `
19
20
  @media (prefers-color-scheme: dark) {
20
21
  .panel:not([data-scheme="light"]) {
21
22
  /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */
22
- --ink: #f0f3f7;
23
- --muted: #a5a9b2;
24
- --win: #0c0f16;
25
- --side: #13171f;
26
- --line: #393d46;
27
- --accent: #91a1fe;
28
- --accent-ink: #0c0f16;
29
- --notice: #2b1a03;
23
+ --ink: #e3f1f7;
24
+ --muted: #8aa6b8;
25
+ --win: #0b1824;
26
+ --side: #112233;
27
+ --line: #263a4b;
28
+ --accent: #56d0f0;
29
+ --accent-ink: #0b1824;
30
+ --focus: #f0a35e;
31
+ --notice: #32240a;
30
32
  /* End of generated panel. */
31
33
  }
32
34
  }
33
35
  .panel[data-scheme="dark"] {
34
36
  /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */
35
- --ink: #f0f3f7;
36
- --muted: #a5a9b2;
37
- --win: #0c0f16;
38
- --side: #13171f;
39
- --line: #393d46;
40
- --accent: #91a1fe;
41
- --accent-ink: #0c0f16;
42
- --notice: #2b1a03;
37
+ --ink: #e3f1f7;
38
+ --muted: #8aa6b8;
39
+ --win: #0b1824;
40
+ --side: #112233;
41
+ --line: #263a4b;
42
+ --accent: #56d0f0;
43
+ --accent-ink: #0b1824;
44
+ --focus: #f0a35e;
45
+ --notice: #32240a;
43
46
  /* End of generated panel. */
44
47
  }
45
48
  .panel {
@@ -183,7 +186,7 @@ button:disabled {
183
186
  }
184
187
  button:focus-visible,
185
188
  a:focus-visible {
186
- outline: 2px solid var(--accent);
189
+ outline: 2px solid var(--focus);
187
190
  outline-offset: 1px;
188
191
  }
189
192
  .ghost {
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8PxB,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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, light. */\n --ink: #22272e;\n --muted: #676c75;\n --win: #ffffff;\n --side: #f7f9fd;\n --line: #e3e6ec;\n --accent: #5962e8;\n --accent-ink: #ffffff;\n --notice: #fef5eb;\n --ui: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #f0f3f7;\n --muted: #a5a9b2;\n --win: #0c0f16;\n --side: #13171f;\n --line: #393d46;\n --accent: #91a1fe;\n --accent-ink: #0c0f16;\n --notice: #2b1a03;\n /* End of generated panel. */\n }\n}\n.panel[data-scheme=\"dark\"] {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #f0f3f7;\n --muted: #a5a9b2;\n --win: #0c0f16;\n --side: #13171f;\n --line: #393d46;\n --accent: #91a1fe;\n --accent-ink: #0c0f16;\n --notice: #2b1a03;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: shadow, light. */\n box-shadow: 0 8px 28px rgb(0 0 0 / 0.3);\n /* End of generated shadow. */\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"]}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/toolbar/style.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQxB,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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, light. */\n --ink: #0b1824;\n --muted: #47606f;\n --win: #f2f7f9;\n --side: #ffffff;\n --line: #ccdce4;\n --accent: #0b6f8e;\n --accent-ink: #ffffff;\n --focus: #b4530f;\n --notice: #fdf1d8;\n --ui: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --mono: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #e3f1f7;\n --muted: #8aa6b8;\n --win: #0b1824;\n --side: #112233;\n --line: #263a4b;\n --accent: #56d0f0;\n --accent-ink: #0b1824;\n --focus: #f0a35e;\n --notice: #32240a;\n /* End of generated panel. */\n }\n}\n.panel[data-scheme=\"dark\"] {\n /* Generated from design/tokens.toml by scripts/design/tokens.ts: panel, dark. */\n --ink: #e3f1f7;\n --muted: #8aa6b8;\n --win: #0b1824;\n --side: #112233;\n --line: #263a4b;\n --accent: #56d0f0;\n --accent-ink: #0b1824;\n --focus: #f0a35e;\n --notice: #32240a;\n /* End of generated panel. */\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 /* Generated from design/tokens.toml by scripts/design/tokens.ts: shadow, light. */\n box-shadow: 0 8px 28px rgb(0 0 0 / 0.3);\n /* End of generated shadow. */\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(--focus);\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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ascribed/astro",
3
- "version": "0.4.1-next.28",
4
- "description": "The Astro integration for Ascribe.",
3
+ "version": "0.4.2-next.29",
4
+ "description": "A toolchain for documentation written as code. This package is its Astro integration, which publishes a project's pages as a site.",
5
5
  "type": "module",
6
6
  "license": "MPL-2.0",
7
7
  "author": "Bryo Studio <hello@bryostudio.com> (https://bryostudio.com)",
@@ -10,7 +10,15 @@
10
10
  "url": "git+https://github.com/ascribed-dev/ascribe.git",
11
11
  "directory": "packages/astro"
12
12
  },
13
- "homepage": "https://github.com/ascribed-dev/ascribe/tree/main/packages/astro#readme",
13
+ "keywords": [
14
+ "ascribe",
15
+ "documentation",
16
+ "markdown",
17
+ "docs-as-code",
18
+ "astro",
19
+ "astro-integration"
20
+ ],
21
+ "homepage": "https://ascribed-dev.com/go/astro-guide/",
14
22
  "bugs": "https://github.com/ascribed-dev/ascribe/issues",
15
23
  "sideEffects": false,
16
24
  "bin": {
@@ -59,9 +67,9 @@
59
67
  "node": ">=24"
60
68
  },
61
69
  "dependencies": {
62
- "@ascribed/cli": "0.4.1-next.28",
63
- "@ascribed/elements": "0.4.1-next.28",
64
- "@ascribed/review": "0.4.1-next.28",
70
+ "@ascribed/cli": "0.4.2-next.29",
71
+ "@ascribed/elements": "0.4.2-next.29",
72
+ "@ascribed/review": "0.4.2-next.29",
65
73
  "github-slugger": "^2.0.0",
66
74
  "property-information": "^7.2.0",
67
75
  "smol-toml": "^1.9.1"
@@ -82,9 +90,9 @@
82
90
  "devDependencies": {
83
91
  "@types/hast": "^3.0.4",
84
92
  "@types/node": "^24.19.2",
85
- "astro": "7.3.8",
93
+ "astro": "7.4.0",
86
94
  "hast-util-from-html": "^2.0.3",
87
- "jsdom": "^30.1.2",
95
+ "jsdom": "^30.1.3",
88
96
  "rehype-raw": "^7.0.0",
89
97
  "rehype-stringify": "^10.0.1",
90
98
  "remark-gfm": "^4.0.1",
@@ -97,7 +105,7 @@
97
105
  "publishConfig": {
98
106
  "access": "public"
99
107
  },
100
- "gitHead": "f3adada5e86ae0828ac2610d5f812e402fa1425d",
108
+ "gitHead": "dbe916f4a1448d9587e1185c32399b422da94607",
101
109
  "scripts": {
102
110
  "build": "tsc -p tsconfig.build.json",
103
111
  "typecheck": "tsc --noEmit",