Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103<script module lang="ts"> import { defineMeta } from "@storybook/addon-svelte-csf"; import StringView from "#lib/components/strings/StringView.svelte";
const textFile = (name: string, $link: string, size: number) => ({ $type: "org.tangled.snippet.string#textFile" as const, name, content: { $type: "blob" as const, ref: { $link }, mimeType: "text/plain", size } });
const codeContents = 'fn main() {\n\tprintln!("hello from tangled strings!");\n}'; const codeRecord = { $type: "org.tangled.snippet.string" as const, snippet: textFile( "main.rs", "bafkreifqrrwn3ioqkrquhibb3csu6i3kogd76uk6ktptc7s5exim6rfu6u", 54 ), description: "A fast greeting snippet written in Rust", createdAt: "2026-05-01T12:00:00Z" };
const codeBlob = { ref: "3l7abc", path: "main.rs", kind: "code" as const, sizeLabel: "54 B", lines: 3, contents: codeContents, renderedHtml: null, fileTooLarge: false, defaultView: "code" as const, submodule: null, lastCommit: null };
const markdownContents = "# Architecture\n\nStrings are lightweight snippets powered by ATProto."; const markdownRecord = { $type: "org.tangled.snippet.string" as const, snippet: textFile( "notes.md", "bafkreieify5bix4cmrj4iuxiceb6srr2boltkbbf7yizwtgwurqv42sltm", 68 ), description: "Architecture notes", createdAt: "2026-05-01T12:00:00Z" };
const markdownBlob = { ref: "3l7xyz", path: "notes.md", kind: "markup" as const, sizeLabel: "68 B", lines: 3, contents: markdownContents, 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"], parameters: { auth: true }, args: { ownerHandle: "alice.tangled.org", ownerDid: "did:plc:alice", rkey: "3l7abc", string: codeRecord, blob: codeBlob, isOwner: true, uri: "at://did:plc:alice/org.tangled.snippet.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/org.tangled.snippet.string/3l7xyz" }}/>
<Story name="NonOwner" args={{ isOwner: false }} />