Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687<script module lang="ts"> import { defineMeta } from "@storybook/addon-svelte-csf"; import StringView from "$lib/components/strings/StringView.svelte";
const codeRecord = { $type: "sh.tangled.string" as const, filename: "main.rs", description: "A fast greeting snippet written in Rust", createdAt: "2026-05-01T12:00:00Z", contents: 'fn main() {\n\tprintln!("hello from tangled strings!");\n}' };
const codeBlob = { ref: "3l7abc", path: "main.rs", kind: "code" as const, sizeLabel: "54 B", lines: 3, contents: codeRecord.contents, renderedHtml: null, fileTooLarge: false, defaultView: "code" as const, submodule: null, lastCommit: null };
const markdownRecord = { $type: "sh.tangled.string" as const, filename: "notes.md", description: "Architecture notes", createdAt: "2026-05-01T12:00:00Z", contents: "# Architecture\n\nStrings are lightweight snippets powered by ATProto." };
const markdownBlob = { ref: "3l7xyz", path: "notes.md", kind: "markup" as const, sizeLabel: "68 B", lines: 3, contents: markdownRecord.contents, renderedHtml: "<h1>Architecture</h1><p>Strings are lightweight snippets powered by ATProto.</p>", fileTooLarge: false, defaultView: "rendered" as const, submodule: null, lastCommit: null };
const { Story } = defineMeta({ title: "Strings/StringView", component: StringView, tags: ["autodocs"], args: { ownerHandle: "alice.tangled.org", ownerDid: "did:plc:alice", rkey: "3l7abc", string: codeRecord, blob: codeBlob, isOwner: true, uri: "at://did:plc:alice/sh.tangled.string/3l7abc", starCount: 5, viewerStarRkey: null } });</script>
<Story name="CodeFile"> {#snippet template(args)} <div class="mx-auto w-full max-w-page py-xl"> <StringView {...args} /> </div> {/snippet}</Story>
<Story name="MarkdownSkeletonFixture" args={{ rkey: "3l7xyz", string: markdownRecord, blob: markdownBlob, uri: "at://did:plc:alice/sh.tangled.string/3l7xyz" }}/>
<Story name="NonOwner" args={{ isOwner: false }} />