{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A long read in one reading column, or beside a table of contents that links to the sections.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  A long read: sections with headings, text and an optional pull quote, in one reading column or beside a table\n  of contents that links to each section. Axes: layout (column, toc), quotes (show, hide), tone. Highlighting\n  the section being read is a port contract.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { Section } from \"./article-body.types\";\n\n  export type ArticleBodyProps = {\n    id: string;\n    title: string;\n    sections: Section[];\n    empty?: string;\n    tocTitle: string;\n    layout?: \"column\" | \"toc\";\n    quotes?: \"show\" | \"hide\";\n    tone?: \"default\" | \"muted\";\n    landmarkLabel?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Link from \"../compose/Link.svelte\";\n  import List from \"../compose/List.svelte\";\n  import ListItem from \"../compose/ListItem.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import Title from \"../compose/Title.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import NavBlock from \"../components/nav-block.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import { cn, tpl, uniqLabel, urlOf } from \"../utils\";\n\n  let {\n    id,\n    title,\n    sections,\n    empty = \"\",\n    tocTitle,\n    layout = \"column\",\n    quotes = \"show\",\n    tone = \"default\",\n    landmarkLabel,\n  }: ArticleBodyProps = $props();\n</script>\n\n<SectionFrame id={id} title={title} tone={tone} landmarkLabel={landmarkLabel}>\n  {#if ((sections?.length ?? 0) === 0)}\n    <EmptyState icon=\"file-text\" title={empty} />\n  {:else}\n    <Grid\n      cols=\"1\"\n      class={cn(\n        \"items-start gap-8\",\n        (((layout as string) === \"toc\") ? \"md:grid-cols-[14rem_minmax(0,1fr)]\" : \"\")\n      )}\n    >\n      {#if ((layout as string) === \"toc\")}\n        <NavBlock\n          label={(landmarkLabel ? uniqLabel(tpl(\"{0}, {1}\", tocTitle, landmarkLabel)) : tocTitle)}\n          class=\"md:sticky md:top-4\"\n          testid=\"toc\"\n        >\n          <Stack gap=\"2\">\n            <Text size=\"sm\" weight=\"semibold\">\n              {tocTitle}\n            </Text>\n            <List class=\"m-0 flex list-none flex-col gap-2 p-0\">\n              {#each sections as s (s.id)}\n                <ListItem data-slot=\"sections-row\">\n                  <Link\n                    href={urlOf(tpl(\"#{0}-{1}\", id, s.id))}\n                    variant=\"default\"\n                    class=\"text-sm text-muted-foreground\"\n                    data-slot=\"toc-link\"\n                  >\n                    {s.title}\n                  </Link>\n                </ListItem>\n              {/each}\n            </List>\n          </Stack>\n        </NavBlock>\n      {/if}\n      <Stack gap=\"8\" align=\"stretch\" class=\"mx-auto w-full max-w-2xl min-w-0\" data-slot=\"article\">\n        {#each sections as s (s.id)}\n          <Box class=\"flex flex-col gap-4\" id={tpl(\"{0}-{1}\", id, s.id)} data-slot=\"item\">\n            <Title as={3} size=\"2xl\" weight=\"bold\">\n              {s.title}\n            </Title>\n            <Text size=\"base\">\n              {s.text}\n            </Text>\n            {#if ((quotes as string) === \"show\")}\n              {#if s.quote}\n                <Text tag=\"blockquote\" class=\"m-0 border-l border-border pl-4 text-lg\" data-slot=\"quote\">\n                  {s.quote}\n                </Text>\n              {/if}\n            {/if}\n          </Box>\n        {/each}\n      </Stack>\n    </Grid>\n  {/if}\n</SectionFrame>\n",
      "path": "blocks/article-body.svelte",
      "target": "blocks/article-body.svelte"
    },
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type Section = {\n  id: string;\n  title: string;\n  text: string;\n  quote: string;\n};\n",
      "path": "blocks/article-body.types.ts",
      "target": "blocks/article-body.types.ts"
    }
  ],
  "meta": {
    "category": "content",
    "group": "blog",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "article-body",
  "registryDependencies": [
    "box",
    "empty-state",
    "grid",
    "link",
    "list",
    "list-item",
    "nav-block",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Article Body",
  "type": "registry:block"
}
