import type { BlockEditProps, BlockReadProps, BlockSpec, } from "@agent-native/core/blocks"; import { builderCodeBlockConfig, builderCodeSnippetsV2BlockConfig, builderRawBlockConfig, builderSymbolBlockConfig, builderTabbedContentBlockConfig, builderTextBlockConfig, type BuilderCodeBlockData, type BuilderCodeSnippetsV2Data, type BuilderRawBlockData, type BuilderSymbolData, type BuilderTabbedContentData, type BuilderTextData, } from "@shared/builder-docs-blocks"; import { IconBox, IconCode, IconFileText, IconLayout, IconPuzzle, } from "@tabler/icons-react"; import { useState } from "react"; import { ContentReferencePreview } from "@/components/editor/ContentReferencePreview"; function SidecarBadge({ rawRef }: { rawRef: string }) { return (
{rawRef}
); } export function BuilderTextRead({ data, blockId, ctx, }: BlockReadProps) { return (
{ctx.renderMarkdown?.(data.body) ?? (
{data.body}
)}
); } export function BuilderTextEdit({ data, onChange, editable, blockId, ctx, }: BlockEditProps) { return (
{ctx.renderMarkdownEditor?.({ value: data.body, onChange: (body) => onChange({ ...data, body }), editable, blockId, }) ?? (