{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "article-editor-toolbar",
  "title": "Article Editor Toolbar",
  "type": "registry:page",
  "files": [
    {
      "path": "packages/registry-react/blocks/article-editor-toolbar/ArticleEditorToolbar.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport {\n  AlignCenter,\n  AlignLeft,\n  AlignRight,\n  AlertTriangle,\n  ArrowLeft,\n  ArrowUpRight,\n  Bold,\n  Bookmark,\n  BookOpen,\n  Check,\n  CheckCheck,\n  ChevronDown,\n  Cloud,\n  Code,\n  Copy,\n  ExternalLink,\n  Eye,\n  FileCode,\n  Heart,\n  HelpCircle,\n  ImageIcon,\n  Info,\n  Italic,\n  Layers,\n  Lightbulb,\n  Link2,\n  List,\n  ListOrdered,\n  Maximize2,\n  MessageSquare,\n  Minus,\n  MoreHorizontal,\n  PenLine,\n  Plus,\n  Quote,\n  Redo2,\n  RotateCcw,\n  Send,\n  Share2,\n  Sparkles,\n  Strikethrough,\n  Tag,\n  Terminal,\n  Type,\n  Underline,\n  Undo2,\n  Upload,\n  Volume2,\n  X,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Input } from '@/components/ui/input'\nimport { Separator } from '@/components/ui/separator'\nimport { Textarea } from '@/components/ui/textarea'\n\nexport interface ArticleEditorToolbarProps {\n  className?: string\n}\n\ntype TextStyle = 'paragraph' | 'h1' | 'h2' | 'h3'\ntype CalloutType = 'tip' | 'warning' | 'info'\n\nexport function ArticleEditorToolbar({ className }: ArticleEditorToolbarProps) {\n  // View Mode\n  const [isPreviewMode, setIsPreviewMode] = React.useState(false)\n\n  // Story Content State\n  const [articleTitle, setArticleTitle] = React.useState('The Death of the Monolithic Component Package')\n  const [articleSubtitle, setArticleSubtitle] = React.useState(\n    'Why the unbundled registry architecture is replacing npm packages for UI systems.',\n  )\n  const [topicTag, setTopicTag] = React.useState('Architecture & UI')\n  const [authorName] = React.useState('Alex Rivera')\n  const [authorHandle] = React.useState('@arivera_eng')\n  const [publicationName] = React.useState('The Engineering Digest')\n  const [lastSavedText, setLastSavedText] = React.useState('Draft Saved 2m ago')\n  const [isAutosaving, setIsAutosaving] = React.useState(false)\n\n  // Reader Engagement State\n  const [clapCount, setClapCount] = React.useState(342)\n  const [isBookmarked, setIsBookmarked] = React.useState(false)\n  const [isFollowing, setIsFollowing] = React.useState(false)\n  const [readerFontSize, setReaderFontSize] = React.useState<'normal' | 'large'>('normal')\n\n  // Toolbar Formatter State\n  const [activeTextStyle, setActiveTextStyle] = React.useState<TextStyle>('paragraph')\n  const [isStyleDropdownOpen, setIsStyleDropdownOpen] = React.useState(false)\n\n  const [isBoldActive, setIsBoldActive] = React.useState(false)\n  const [isItalicActive, setIsItalicActive] = React.useState(false)\n  const [isUnderlineActive, setIsUnderlineActive] = React.useState(false)\n  const [isStrikeActive, setIsStrikeActive] = React.useState(false)\n  const [isInlineCodeActive, setIsInlineCodeActive] = React.useState(false)\n\n  // Active Block Elements in Canvas\n  const [calloutType, setCalloutType] = React.useState<CalloutType>('tip')\n  const [isCodeBlockCopied, setIsCodeBlockCopied] = React.useState(false)\n  const [activeCodeTab, setActiveCodeTab] = React.useState<'json' | 'bash'>('json')\n\n  // Modals / Drawers\n  const [isPublishModalOpen, setIsPublishModalOpen] = React.useState(false)\n  const [isLinkModalOpen, setIsLinkModalOpen] = React.useState(false)\n  const [isPublishedSuccess, setIsPublishedSuccess] = React.useState(false)\n  const [linkUrl, setLinkUrl] = React.useState('https://uipkge.dev')\n  const [linkText, setLinkText] = React.useState('unbundled registry architecture')\n\n  // Publish Settings State\n  const [publishTags, setPublishTags] = React.useState([\n    'Web Development',\n    'Design Systems',\n    'Vue',\n    'React',\n    'Frontend',\n  ])\n  const [newTagInput, setNewTagInput] = React.useState('')\n  const [canonicalUrl, setCanonicalUrl] = React.useState('https://theengineeringdigest.io/p/unbundled-ui-registries')\n  const [seoDescription, setSeoDescription] = React.useState(\n    'A deep dive into why copy-paste UI component registries like shadcn and uipkge are displacing monolithic npm component libraries across engineering teams.',\n  )\n  const [sendNewsletter, setSendNewsletter] = React.useState(true)\n  const [publishSchedule, setPublishSchedule] = React.useState<'now' | 'schedule'>('now')\n\n  // Toast Feedback\n  const [toastMessage, setToastMessage] = React.useState<string | null>(null)\n  const toastTimerRef = React.useRef<any>(null)\n\n  const showToast = React.useCallback((msg: string) => {\n    if (toastTimerRef.current) clearTimeout(toastTimerRef.current)\n    setToastMessage(msg)\n    toastTimerRef.current = setTimeout(() => {\n      setToastMessage(null)\n    }, 3000)\n  }, [])\n\n  // Word Count and Reading Metrics Calculation\n  const wordCount = React.useMemo(() => {\n    const fullText = `${articleTitle} ${articleSubtitle} For nearly a decade the standard recipe for building a frontend design system was predictable spin up a private or public npm monorepo bundle fifty UI components with Rollup or Vite and force every application team to install as a heavyweight runtime dependency The component registry model inverts this entire dynamic Instead of consuming a closed npm black box developers pull atomic clean TypeScript source files directly into their repository Zero Runtime Overhead Direct Accessibility Ownership Native Token Sync`\n    const words = fullText.trim().split(/\\s+/).filter(Boolean)\n    return words.length + 1380\n  }, [articleTitle, articleSubtitle])\n\n  const readingTimeMinutes = React.useMemo(() => {\n    return Math.max(1, Math.ceil(wordCount / 220))\n  }, [wordCount])\n\n  function triggerManualSave() {\n    setIsAutosaving(true)\n    setLastSavedText('Saving changes...')\n    setTimeout(() => {\n      setIsAutosaving(false)\n      setLastSavedText('Draft Saved just now')\n      showToast('All draft changes saved to cloud.')\n    }, 600)\n  }\n\n  function handleAddTag() {\n    const trimmed = newTagInput.trim()\n    if (trimmed && !publishTags.includes(trimmed)) {\n      setPublishTags((prev) => [...prev, trimmed])\n      setNewTagInput('')\n    }\n  }\n\n  function handleRemoveTag(tagToRemove: string) {\n    setPublishTags((prev) => prev.filter((t) => t !== tagToRemove))\n  }\n\n  function copyCodeSnippet() {\n    setIsCodeBlockCopied(true)\n    showToast('Code snippet copied to clipboard!')\n    setTimeout(() => {\n      setIsCodeBlockCopied(false)\n    }, 2000)\n  }\n\n  function handlePublish() {\n    setIsPublishModalOpen(false)\n    setIsPublishedSuccess(true)\n    showToast('🎉 Story published successfully to The Engineering Digest!')\n  }\n\n  function insertCallout(type: CalloutType) {\n    setCalloutType(type)\n    showToast(`Applied ${type.toUpperCase()} callout formatting.`)\n  }\n\n  function handleAiAssist() {\n    showToast('✨ AI polished paragraph for conciseness and punchy cadence.')\n  }\n\n  return (\n    <div data-slot=\"article-editor-toolbar\" className={cn('bg-background text-foreground min-h-screen', className)}>\n      {/* Top Sticky Application Header Bar */}\n      <header className=\"border-border bg-background/95 sticky top-0 z-40 border-b backdrop-blur-md\">\n        <div className=\"mx-auto flex h-14 max-w-6xl items-center justify-between gap-2 overflow-x-auto px-4 sm:px-6\">\n          {/* Left: Publication & Save Status */}\n          <div className=\"flex items-center gap-3\">\n            <div className=\"flex items-center gap-2\">\n              <div className=\"bg-primary/10 text-primary flex size-7 items-center justify-center rounded-md\">\n                <BookOpen className=\"size-4\" />\n              </div>\n              <div className=\"hidden min-w-0 truncate whitespace-nowrap sm:block\">\n                <span className=\"text-foreground text-sm font-semibold tracking-tight\">{publicationName}</span>\n                <span className=\"text-muted-foreground ml-1.5 text-xs\">/ Editor</span>\n              </div>\n            </div>\n\n            <Separator orientation=\"vertical\" className=\"hidden h-4 sm:block\" />\n\n            {/* Autosave Status Badge */}\n            <button\n              type=\"button\"\n              className=\"hover:bg-muted/60 text-muted-foreground hover:text-foreground flex min-h-6 items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors\"\n              onClick={triggerManualSave}\n              title=\"Click to save now\"\n            >\n              {!isAutosaving ? (\n                <Cloud className=\"text-success size-3.5\" />\n              ) : (\n                <RotateCcw className=\"text-warning size-3.5 animate-spin\" />\n              )}\n              <span className=\"hidden md:inline\">{lastSavedText}</span>\n              <span className=\"md:hidden\">Saved</span>\n            </button>\n          </div>\n\n          {/* Center: Live Story Statistics */}\n          <div className=\"text-muted-foreground hidden items-center gap-2 text-xs md:flex\">\n            <Badge variant=\"outline\" className=\"font-normal\">\n              {wordCount.toLocaleString()} words\n            </Badge>\n            <span>·</span>\n            <span>{readingTimeMinutes} min read</span>\n          </div>\n\n          {/* Right: Actions & Publishing Controls */}\n          <div className=\"flex items-center gap-2\">\n            {/* Undo / Redo controls */}\n            <div className=\"hidden items-center gap-0.5 sm:flex\">\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Undo action')}\n                title=\"Undo (⌘Z)\"\n              >\n                <Undo2 className=\"size-4\" />\n              </Button>\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Redo action')}\n                title=\"Redo (⇧⌘Z)\"\n              >\n                <Redo2 className=\"size-4\" />\n              </Button>\n            </div>\n\n            <Separator orientation=\"vertical\" className=\"hidden h-4 sm:block\" />\n\n            {/* Preview Toggle Button */}\n            <Button\n              variant=\"outline\"\n              size=\"sm\"\n              className={cn(\n                'h-8 gap-1.5 text-xs font-medium',\n                isPreviewMode && 'bg-secondary text-secondary-foreground border-primary/40',\n              )}\n              onClick={() => setIsPreviewMode(!isPreviewMode)}\n            >\n              <Eye className=\"size-3.5\" />\n              <span>{isPreviewMode ? 'Edit Story' : 'Preview Article'}</span>\n            </Button>\n\n            {/* Publish Story Primary Button */}\n            <Button\n              aria-label=\"Close publish modal\"\n              size=\"sm\"\n              className=\"h-8 gap-1.5 text-xs font-semibold shadow-xs\"\n              onClick={() => setIsPublishModalOpen(true)}\n            >\n              <Send className=\"size-3.5\" />\n              <span>Publish Story</span>\n            </Button>\n          </div>\n        </div>\n      </header>\n\n      {/* Floating / Sticky Formatting Toolbar (Only in Editor Mode) */}\n      {!isPreviewMode && (\n        <div className=\"sticky top-16 z-30 mx-auto mt-4 max-w-3xl px-4 transition-colors duration-200\">\n          <div className=\"border-border bg-card/95 flex flex-wrap items-center justify-between gap-1 rounded-xl border p-1.5 shadow-sm backdrop-blur-md\">\n            {/* Group 1: Typography Block Selector */}\n            <div className=\"flex items-center gap-1\">\n              <div className=\"relative\">\n                <Button\n                  variant=\"ghost\"\n                  size=\"sm\"\n                  className=\"text-foreground hover:bg-muted h-8 gap-1 px-2 text-xs font-medium\"\n                  onClick={() => setIsStyleDropdownOpen(!isStyleDropdownOpen)}\n                >\n                  <Type className=\"text-muted-foreground size-3.5\" />\n                  <span className=\"capitalize\">\n                    {activeTextStyle === 'paragraph' ? 'Normal Text' : activeTextStyle.toUpperCase()}\n                  </span>\n                  <ChevronDown className=\"text-muted-foreground size-3\" />\n                </Button>\n\n                {/* Text Style Dropdown */}\n                {isStyleDropdownOpen && (\n                  <div className=\"border-border bg-popover absolute top-full left-0 z-50 mt-1.5 w-40 rounded-lg border p-1 shadow-md\">\n                    <button\n                      type=\"button\"\n                      className={cn(\n                        'hover:bg-muted flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-xs transition-colors',\n                        activeTextStyle === 'paragraph'\n                          ? 'text-primary bg-muted/60 font-semibold'\n                          : 'text-popover-foreground',\n                      )}\n                      onClick={() => {\n                        setActiveTextStyle('paragraph')\n                        setIsStyleDropdownOpen(false)\n                      }}\n                    >\n                      <span>Paragraph</span>\n                      <span className=\"text-muted-foreground text-xs uppercase\">Body</span>\n                    </button>\n                    <button\n                      type=\"button\"\n                      className={cn(\n                        'hover:bg-muted flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-xs transition-colors',\n                        activeTextStyle === 'h1' ? 'text-primary bg-muted/60 font-semibold' : 'text-popover-foreground',\n                      )}\n                      onClick={() => {\n                        setActiveTextStyle('h1')\n                        setIsStyleDropdownOpen(false)\n                      }}\n                    >\n                      <span className=\"text-sm font-bold\">Heading 1</span>\n                      <span className=\"text-muted-foreground text-xs\">H1</span>\n                    </button>\n                    <button\n                      type=\"button\"\n                      className={cn(\n                        'hover:bg-muted flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-xs transition-colors',\n                        activeTextStyle === 'h2' ? 'text-primary bg-muted/60 font-semibold' : 'text-popover-foreground',\n                      )}\n                      onClick={() => {\n                        setActiveTextStyle('h2')\n                        setIsStyleDropdownOpen(false)\n                      }}\n                    >\n                      <span className=\"text-xs font-semibold\">Heading 2</span>\n                      <span className=\"text-muted-foreground text-xs\">H2</span>\n                    </button>\n                    <button\n                      type=\"button\"\n                      className={cn(\n                        'hover:bg-muted flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-xs transition-colors',\n                        activeTextStyle === 'h3' ? 'text-primary bg-muted/60 font-semibold' : 'text-popover-foreground',\n                      )}\n                      onClick={() => {\n                        setActiveTextStyle('h3')\n                        setIsStyleDropdownOpen(false)\n                      }}\n                    >\n                      <span className=\"text-xs font-medium\">Heading 3</span>\n                      <span className=\"text-muted-foreground text-xs\">H3</span>\n                    </button>\n                  </div>\n                )}\n              </div>\n\n              <Separator orientation=\"vertical\" className=\"mx-0.5 h-4\" />\n\n              {/* Group 2: Inline Formatting */}\n              <div className=\"flex items-center gap-0.5\">\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className={cn(\n                    'size-8',\n                    isBoldActive ? 'bg-muted text-primary font-bold' : 'text-muted-foreground hover:text-foreground',\n                  )}\n                  onClick={() => {\n                    setIsBoldActive(!isBoldActive)\n                    showToast(!isBoldActive ? 'Bold applied' : 'Bold removed')\n                  }}\n                  title=\"Bold (⌘B)\"\n                >\n                  <Bold className=\"size-3.5\" />\n                </Button>\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className={cn(\n                    'size-8',\n                    isItalicActive ? 'bg-muted text-primary' : 'text-muted-foreground hover:text-foreground',\n                  )}\n                  onClick={() => {\n                    setIsItalicActive(!isItalicActive)\n                    showToast(!isItalicActive ? 'Italic applied' : 'Italic removed')\n                  }}\n                  title=\"Italic (⌘I)\"\n                >\n                  <Italic className=\"size-3.5\" />\n                </Button>\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className={cn(\n                    'size-8',\n                    isUnderlineActive ? 'bg-muted text-primary' : 'text-muted-foreground hover:text-foreground',\n                  )}\n                  onClick={() => {\n                    setIsUnderlineActive(!isUnderlineActive)\n                    showToast(!isUnderlineActive ? 'Underline applied' : 'Underline removed')\n                  }}\n                  title=\"Underline (⌘U)\"\n                >\n                  <Underline className=\"size-3.5\" />\n                </Button>\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className={cn(\n                    'size-8',\n                    isStrikeActive ? 'bg-muted text-primary' : 'text-muted-foreground hover:text-foreground',\n                  )}\n                  onClick={() => {\n                    setIsStrikeActive(!isStrikeActive)\n                    showToast('Strikethrough toggled')\n                  }}\n                  title=\"Strikethrough (⇧⌘X)\"\n                >\n                  <Strikethrough className=\"size-3.5\" />\n                </Button>\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className={cn(\n                    'size-8',\n                    isInlineCodeActive\n                      ? 'bg-muted text-primary font-mono'\n                      : 'text-muted-foreground hover:text-foreground',\n                  )}\n                  onClick={() => {\n                    setIsInlineCodeActive(!isInlineCodeActive)\n                    showToast('Inline code toggled')\n                  }}\n                  title=\"Inline Code (⌘E)\"\n                >\n                  <Code className=\"size-3.5\" />\n                </Button>\n                <Button\n                  variant=\"ghost\"\n                  size=\"icon\"\n                  className=\"text-muted-foreground hover:text-foreground size-8\"\n                  onClick={() => setIsLinkModalOpen(true)}\n                  title=\"Insert Link (⌘K)\"\n                >\n                  <Link2 className=\"size-3.5\" />\n                </Button>\n              </div>\n            </div>\n\n            {/* Group 3: Block Elements & Media */}\n            <div className=\"flex items-center gap-1\">\n              <Separator orientation=\"vertical\" className=\"mx-0.5 h-4\" />\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Blockquote formatted')}\n                title=\"Blockquote (⌘⇧.)\"\n              >\n                <Quote className=\"size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() =>\n                  insertCallout(calloutType === 'tip' ? 'warning' : calloutType === 'warning' ? 'info' : 'tip')\n                }\n                title=\"Toggle Callout Box\"\n              >\n                <Lightbulb className=\"text-warning size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Code block activated')}\n                title=\"Code Block (```)\"\n              >\n                <FileCode className=\"size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Bullet list toggled')}\n                title=\"Bullet List (⌘⇧8)\"\n              >\n                <List className=\"size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Numbered list toggled')}\n                title=\"Numbered List (⌘⇧7)\"\n              >\n                <ListOrdered className=\"size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Horizontal divider inserted')}\n                title=\"Divider (---)\"\n              >\n                <Minus className=\"size-3.5\" />\n              </Button>\n\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Image upload dialog simulated')}\n                title=\"Upload Media\"\n              >\n                <ImageIcon className=\"size-3.5\" />\n              </Button>\n\n              <Separator orientation=\"vertical\" className=\"mx-0.5 h-4\" />\n\n              {/* AI Polish Action */}\n              <Button\n                variant=\"ghost\"\n                size=\"sm\"\n                className=\"text-primary hover:bg-primary/10 h-8 gap-1 px-2 text-xs font-medium\"\n                onClick={handleAiAssist}\n                title=\"AI Writing Assistant\"\n              >\n                <Sparkles className=\"size-3.5\" />\n                <span className=\"hidden sm:inline\">AI Assist</span>\n              </Button>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* MAIN ARTICLE DRAFTING CANVAS / READER PREVIEW */}\n      <main className=\"mx-auto max-w-3xl px-4 py-8 sm:px-6 sm:py-12\">\n        {/* PUBLISHED SUCCESS BANNER */}\n        {isPublishedSuccess && (\n          <div className=\"border-success/30 bg-success/10 text-success mb-8 flex items-center justify-between rounded-lg border p-4\">\n            <div className=\"flex items-center gap-3\">\n              <CheckCheck className=\"text-success size-5\" />\n              <div>\n                <p className=\"text-sm font-semibold\">Story Live on The Engineering Digest</p>\n                <p className=\"text-muted-foreground text-xs\">URL: {canonicalUrl}</p>\n              </div>\n            </div>\n            <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs\" onClick={() => setIsPublishedSuccess(false)}>\n              Dismiss\n            </Button>\n          </div>\n        )}\n\n        {/* ARTICLE HEADER */}\n        <article className=\"space-y-6\">\n          {/* Topic Category Tag */}\n          <div className=\"flex items-center justify-between\">\n            <Badge variant=\"secondary\" className=\"gap-1 px-2.5 py-0.5 text-xs font-medium tracking-wide\">\n              <Tag className=\"text-muted-foreground size-3\" />\n              {topicTag}\n            </Badge>\n\n            {isPreviewMode && (\n              <div className=\"flex items-center gap-1.5\">\n                <Button\n                  variant=\"ghost\"\n                  size=\"sm\"\n                  className={cn(\n                    'text-muted-foreground h-7 text-xs',\n                    readerFontSize === 'large' && 'bg-muted text-foreground',\n                  )}\n                  onClick={() => setReaderFontSize(readerFontSize === 'normal' ? 'large' : 'normal')}\n                >\n                  <Type className=\"mr-1 size-3\" />\n                  {readerFontSize === 'large' ? 'Standard text' : 'Larger text'}\n                </Button>\n              </div>\n            )}\n          </div>\n\n          {/* Article Title */}\n          {!isPreviewMode ? (\n            <div className=\"space-y-2\">\n              <Textarea\n                value={articleTitle}\n                onValueChange={(v) => setArticleTitle(v)}\n                rows={2}\n                className=\"text-foreground placeholder:text-muted-foreground/40 w-full resize-none border-0 bg-transparent p-0 text-3xl font-bold tracking-tight focus-visible:ring-0 focus-visible:outline-hidden sm:text-4xl lg:text-5xl\"\n                placeholder=\"Title...\"\n              />\n            </div>\n          ) : (\n            <h1\n              className={cn(\n                'text-foreground text-3xl leading-tight font-bold tracking-tight sm:text-4xl lg:text-5xl',\n                readerFontSize === 'large' && 'text-4xl sm:text-5xl lg:text-6xl',\n              )}\n            >\n              {articleTitle}\n            </h1>\n          )}\n\n          {/* Article Subtitle */}\n          {!isPreviewMode ? (\n            <div>\n              <Textarea\n                value={articleSubtitle}\n                onValueChange={(v) => setArticleSubtitle(v)}\n                rows={2}\n                className=\"text-muted-foreground placeholder:text-muted-foreground/40 w-full resize-none border-0 bg-transparent p-0 text-lg font-normal focus-visible:ring-0 focus-visible:outline-hidden sm:text-xl\"\n                placeholder=\"Add a subtitle...\"\n              />\n            </div>\n          ) : (\n            <p\n              className={cn(\n                'text-muted-foreground text-lg leading-relaxed font-normal sm:text-xl',\n                readerFontSize === 'large' && 'text-xl sm:text-2xl',\n              )}\n            >\n              {articleSubtitle}\n            </p>\n          )}\n\n          {/* Author / Byline Bar */}\n          <div className=\"flex flex-wrap items-center justify-between gap-4 py-2\">\n            <div className=\"flex items-center gap-3\">\n              <div className=\"bg-primary/15 text-primary flex size-10 items-center justify-center rounded-full text-sm font-semibold\">\n                AR\n              </div>\n              <div>\n                <div className=\"flex items-center gap-2\">\n                  <span className=\"text-foreground text-sm font-semibold\">{authorName}</span>\n                  <span className=\"text-muted-foreground text-xs\">{authorHandle}</span>\n                  {isPreviewMode && (\n                    <Button\n                      variant=\"ghost\"\n                      size=\"sm\"\n                      className=\"text-primary hover:bg-primary/10 h-6 px-2 text-xs\"\n                      onClick={() => {\n                        setIsFollowing(!isFollowing)\n                        showToast(!isFollowing ? 'Following Alex Rivera' : 'Unfollowed')\n                      }}\n                    >\n                      {isFollowing ? 'Following' : 'Follow'}\n                    </Button>\n                  )}\n                </div>\n                <p className=\"text-muted-foreground text-xs\">\n                  Published in <span className=\"text-foreground font-medium\">{publicationName}</span> · Oct 24, 2024 ·{' '}\n                  {readingTimeMinutes} min read\n                </p>\n              </div>\n            </div>\n\n            {/* Social / Reader actions */}\n            <div className=\"flex items-center gap-1\">\n              <Button\n                variant=\"ghost\"\n                size=\"sm\"\n                className=\"text-muted-foreground hover:text-foreground h-8 gap-1.5 text-xs\"\n                onClick={() => showToast('Audio version playing (6 min narration)')}\n              >\n                <Volume2 className=\"size-3.5\" />\n                <span className=\"hidden sm:inline\">Listen</span>\n              </Button>\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className={cn('text-muted-foreground hover:text-foreground size-8', isBookmarked && 'text-primary')}\n                onClick={() => {\n                  setIsBookmarked(!isBookmarked)\n                  showToast(!isBookmarked ? 'Saved to bookmarks' : 'Removed from bookmarks')\n                }}\n                title=\"Bookmark story\"\n              >\n                <Bookmark className=\"size-4\" />\n              </Button>\n              <Button\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => showToast('Link copied to clipboard')}\n                title=\"Share article\"\n              >\n                <Share2 className=\"size-4\" />\n              </Button>\n            </div>\n          </div>\n\n          <Separator className=\"my-6\" />\n\n          {/* ARTICLE BODY PROSE */}\n          <div\n            className={cn(\n              'text-foreground space-y-6 leading-relaxed',\n              readerFontSize === 'large' ? 'text-lg sm:text-xl' : 'text-base sm:text-lg',\n            )}\n          >\n            {/* Paragraph 1 */}\n            <p>\n              For nearly a decade, the standard recipe for building a frontend design system was predictable: spin up a\n              private or public npm monorepo, bundle fifty UI components with Rollup or Vite, and force every\n              application team to install{' '}\n              <code className=\"bg-muted text-foreground rounded px-1.5 py-0.5 font-mono text-xs\">\n                @acme/design-system\n              </code>{' '}\n              as a heavyweight runtime dependency.\n            </p>\n\n            {/* Stylized Callout Box */}\n            <div\n              className={cn(\n                'my-8 rounded-xl border p-4.5 transition-colors sm:p-5',\n                calloutType === 'tip'\n                  ? 'text-foreground border-warning/30 bg-warning/10'\n                  : calloutType === 'warning'\n                    ? 'text-foreground border-destructive/30 bg-destructive/10'\n                    : 'text-foreground border-info/30 bg-info/10',\n              )}\n            >\n              <div className=\"flex items-start gap-3\">\n                <div className=\"mt-0.5 shrink-0\">\n                  {calloutType === 'tip' ? (\n                    <Lightbulb className=\"text-warning size-5\" />\n                  ) : calloutType === 'warning' ? (\n                    <AlertTriangle className=\"text-destructive size-5\" />\n                  ) : (\n                    <Info className=\"text-info size-5\" />\n                  )}\n                </div>\n                <div className=\"space-y-1\">\n                  <div className=\"flex items-center justify-between\">\n                    <h4 className=\"text-sm font-semibold tracking-tight\">\n                      {calloutType === 'tip'\n                        ? 'Key Architectural Takeaway'\n                        : calloutType === 'warning'\n                          ? 'Dependency Fragility Warning'\n                          : 'Registry Distribution Note'}\n                    </h4>\n                    {!isPreviewMode && (\n                      <div className=\"flex items-center gap-1\">\n                        <button\n                          type=\"button\"\n                          className={cn(\n                            'text-muted-foreground hover:text-foreground min-h-6 rounded px-1.5 py-0.5 text-xs',\n                            calloutType === 'tip' && 'text-foreground font-semibold',\n                          )}\n                          onClick={() => setCalloutType('tip')}\n                        >\n                          Tip\n                        </button>\n                        <button\n                          type=\"button\"\n                          className={cn(\n                            'text-muted-foreground hover:text-foreground min-h-6 rounded px-1.5 py-0.5 text-xs',\n                            calloutType === 'warning' && 'text-foreground font-semibold',\n                          )}\n                          onClick={() => setCalloutType('warning')}\n                        >\n                          Warn\n                        </button>\n                        <button\n                          type=\"button\"\n                          className={cn(\n                            'text-muted-foreground hover:text-foreground min-h-6 rounded px-1.5 py-0.5 text-xs',\n                            calloutType === 'info' && 'text-foreground font-semibold',\n                          )}\n                          onClick={() => setCalloutType('info')}\n                        >\n                          Info\n                        </button>\n                      </div>\n                    )}\n                  </div>\n                  <p className=\"text-muted-foreground text-sm leading-normal\">\n                    When UI primitives are distributed via semver npm packages, updating a single button variant\n                    requires a patch release, a dependency bump, and a potential cascade of peer-dependency conflicts\n                    across twenty consuming micro-frontends.\n                  </p>\n                </div>\n              </div>\n            </div>\n\n            {/* Subheading (H2) */}\n            <h2 className=\"text-foreground pt-4 text-2xl font-bold tracking-tight sm:text-3xl\">\n              1. The \"Own Your Code\" Revolution\n            </h2>\n\n            <p>\n              The{' '}\n              <a\n                href={linkUrl}\n                target=\"_blank\"\n                rel=\"noreferrer\"\n                className=\"text-primary hover:text-primary/80 font-medium underline underline-offset-4 transition-colors\"\n              >\n                {linkText}\n              </a>{' '}\n              inverts this dynamic completely. Instead of consuming a closed npm black box, developers pull atomic,\n              clean TypeScript source files directly into their repository via CLI tools like{' '}\n              <code className=\"bg-muted text-foreground rounded px-1.5 py-0.5 font-mono text-xs\">shadcn-vue</code> or{' '}\n              <code className=\"bg-muted text-foreground rounded px-1.5 py-0.5 font-mono text-xs\">uipkge</code>.\n            </p>\n\n            {/* Syntax-Highlighted Code Block */}\n            <div className=\"border-border bg-muted/40 my-6 overflow-hidden rounded-xl border font-mono text-xs shadow-xs\">\n              {/* Code Block Header */}\n              <div className=\"border-border bg-card flex items-center justify-between border-b px-4 py-2\">\n                <div className=\"flex items-center gap-2\">\n                  <button\n                    type=\"button\"\n                    className={cn(\n                      'flex min-h-6 items-center gap-1.5 rounded px-2 py-1 text-xs font-medium transition-colors',\n                      activeCodeTab === 'json'\n                        ? 'bg-muted text-foreground'\n                        : 'text-muted-foreground hover:text-foreground',\n                    )}\n                    onClick={() => setActiveCodeTab('json')}\n                  >\n                    <FileCode className=\"text-warning size-3.5\" />\n                    components.json\n                  </button>\n                  <button\n                    type=\"button\"\n                    className={cn(\n                      'flex min-h-6 items-center gap-1.5 rounded px-2 py-1 text-xs font-medium transition-colors',\n                      activeCodeTab === 'bash'\n                        ? 'bg-muted text-foreground'\n                        : 'text-muted-foreground hover:text-foreground',\n                    )}\n                    onClick={() => setActiveCodeTab('bash')}\n                  >\n                    <Terminal className=\"text-success size-3.5\" />\n                    Terminal CLI\n                  </button>\n                </div>\n\n                <div className=\"flex items-center gap-2\">\n                  <Badge variant=\"outline\" className=\"h-5 px-1.5 font-mono text-xs uppercase\">\n                    {activeCodeTab === 'json' ? 'JSON' : 'BASH'}\n                  </Badge>\n                  <Button\n                    variant=\"ghost\"\n                    size=\"sm\"\n                    className=\"text-muted-foreground hover:text-foreground h-7 gap-1 px-2 text-xs\"\n                    onClick={copyCodeSnippet}\n                  >\n                    {isCodeBlockCopied ? <Check className=\"text-success size-3\" /> : <Copy className=\"size-3\" />}\n                    <span>{isCodeBlockCopied ? 'Copied' : 'Copy'}</span>\n                  </Button>\n                </div>\n              </div>\n\n              {/* Code Content Area */}\n              <div className=\"overflow-x-auto p-4 leading-relaxed\">\n                {activeCodeTab === 'json' ? (\n                  <pre className=\"text-foreground/90\">\n                    <code>\n                      <span className=\"text-muted-foreground\">{'{'}</span>\n                      {'\\n  '}\n                      <span className=\"text-primary font-semibold\">\"$schema\"</span>:{' '}\n                      <span className=\"text-success\">\"https://uipkge.dev/schema.json\"</span>,{'\\n  '}\n                      <span className=\"text-primary font-semibold\">\"style\"</span>:{' '}\n                      <span className=\"text-success\">\"new-york\"</span>,{'\\n  '}\n                      <span className=\"text-primary font-semibold\">\"rsc\"</span>:{' '}\n                      <span className=\"text-warning\">true</span>,{'\\n  '}\n                      <span className=\"text-primary font-semibold\">\"aliases\"</span>:{' '}\n                      <span className=\"text-muted-foreground\">{'{'}</span>\n                      {'\\n    '}\n                      <span className=\"text-primary\">\"components\"</span>:{' '}\n                      <span className=\"text-success\">\"@/components/ui\"</span>,{'\\n    '}\n                      <span className=\"text-primary\">\"utils\"</span>: <span className=\"text-success\">\"@/lib/utils\"</span>\n                      ,{'\\n    '}\n                      <span className=\"text-primary\">\"blocks\"</span>:{' '}\n                      <span className=\"text-success\">\"@/components/blocks\"</span>\n                      {'\\n  '}\n                      <span className=\"text-muted-foreground\">{'}'}</span>\n                      {'\\n'}\n                      <span className=\"text-muted-foreground\">{'}'}</span>\n                    </code>\n                  </pre>\n                ) : (\n                  <pre className=\"text-foreground/90\">\n                    <code>\n                      <span className=\"text-muted-foreground\"># Add rich article drafting block to your project</span>\n                      {'\\n'}\n                      <span className=\"text-primary font-semibold\">npx</span> shadcn-vue@latest add\n                      https://uipkge.dev/r/vue/article-editor-toolbar.json <span className=\"text-success\">-y</span>\n                    </code>\n                  </pre>\n                )}\n              </div>\n            </div>\n\n            {/* Stylized Blockquote */}\n            <blockquote className=\"border-primary bg-muted/20 my-8 rounded-r-lg border-l-4 py-3 pr-4 pl-6 italic\">\n              <p className=\"text-foreground/90 text-base font-medium sm:text-lg\">\n                \"The component registry model inverts the dependency tree. Instead of depending on an external\n                maintainer's release cadence, your team owns every line of component markup, adapting it to your\n                product's exact accessibility and branding needs without vendor lock-in.\"\n              </p>\n              <footer className=\"text-muted-foreground mt-2 text-xs font-normal not-italic\">\n                — Guillermo Rauch, CEO at Vercel\n              </footer>\n            </blockquote>\n\n            {/* Subheading (H2) */}\n            <h2 className=\"text-foreground pt-4 text-2xl font-semibold tracking-tight sm:text-3xl\">\n              2. Core Architectural Advantages\n            </h2>\n\n            <p>\n              When evaluating the switch from packaged distributions to registry generation, teams consistently report\n              three major velocity unlocks:\n            </p>\n\n            {/* Numbered List */}\n            <ol className=\"space-y-3 pl-1\">\n              <li className=\"flex items-start gap-3\">\n                <span className=\"bg-primary/10 text-primary flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold\">\n                  1\n                </span>\n                <div>\n                  <strong className=\"text-foreground font-semibold\">Zero Runtime Overhead:</strong>\n                  <span className=\"text-muted-foreground ml-1\">\n                    Unused component variants and dead code branches are automatically pruned during application\n                    tree-shaking.\n                  </span>\n                </div>\n              </li>\n              <li className=\"flex items-start gap-3\">\n                <span className=\"bg-primary/10 text-primary flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold\">\n                  2\n                </span>\n                <div>\n                  <strong className=\"text-foreground font-semibold\">Direct Source Control:</strong>\n                  <span className=\"text-muted-foreground ml-1\">\n                    Audit, modify, and patch WCAG accessibility tags directly inside your repository without waiting for\n                    upstream PR merges.\n                  </span>\n                </div>\n              </li>\n              <li className=\"flex items-start gap-3\">\n                <span className=\"bg-primary/10 text-primary flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold\">\n                  3\n                </span>\n                <div>\n                  <strong className=\"text-foreground font-semibold\">Native OKLCH Token Integration:</strong>\n                  <span className=\"text-muted-foreground ml-1\">\n                    Colors and elevation variables adapt directly across modern Tailwind CSS v4 design systems.\n                  </span>\n                </div>\n              </li>\n            </ol>\n\n            {/* Embedded Media Figure */}\n            <div className=\"border-border bg-card my-8 overflow-hidden rounded-xl border shadow-xs\">\n              <div className=\"from-primary/10 via-muted to-primary/5 relative flex h-52 items-center justify-center bg-gradient-to-br sm:h-64\">\n                <div className=\"space-y-2 p-6 text-center\">\n                  <div className=\"bg-card border-border text-primary inline-flex size-12 items-center justify-center rounded-xl border shadow-xs\">\n                    <Layers className=\"size-6\" />\n                  </div>\n                  <h4 className=\"text-foreground text-sm font-semibold\">Unbundled Registry Architecture Flow</h4>\n                  <p className=\"text-muted-foreground max-w-sm text-xs\">\n                    Registry CLI pulls atomic SFC files directly into src/components/ui\n                  </p>\n                </div>\n                <div className=\"absolute top-3 right-3 flex items-center gap-1.5\">\n                  <Badge variant=\"outline\" className=\"bg-card text-xs\">\n                    Figure 1.0\n                  </Badge>\n                  <Button\n                    aria-label=\"Expand media view\"\n                    variant=\"ghost\"\n                    size=\"icon\"\n                    className=\"bg-card hover:bg-muted size-7 transition-[colors,transform] duration-150 active:scale-95\"\n                    onClick={() => showToast('Expanded media view')}\n                  >\n                    <Maximize2 className=\"size-3.5\" />\n                  </Button>\n                </div>\n              </div>\n              <div className=\"border-border bg-card border-t p-3\">\n                <p className=\"text-muted-foreground text-center text-xs italic\">\n                  Figure 1: Monolithic npm package distribution vs. direct registry source ownership.\n                </p>\n              </div>\n            </div>\n\n            {/* Section Divider */}\n            <div className=\"text-muted-foreground my-10 flex items-center justify-center gap-2\">\n              <span className=\"bg-border size-1 rounded-full\" />\n              <span className=\"bg-muted-foreground/40 size-1.5 rounded-full\" />\n              <span className=\"bg-border size-1 rounded-full\" />\n            </div>\n\n            {/* Summary Conclusion */}\n            <p>\n              The shift from monolithic npm packages to unbundled UI registries is not just a tooling trend; it\n              represents a fundamental re-alignment of software ownership, empowering engineering teams to build\n              resilient interfaces that evolve with their product.\n            </p>\n          </div>\n        </article>\n\n        {/* READER PREVIEW ENGAGEMENT FOOTER (When Preview Mode is Active) */}\n        {isPreviewMode && (\n          <div className=\"border-border bg-card/95 sticky bottom-6 z-30 mx-auto mt-12 max-w-lg rounded-full border p-2 shadow-lg backdrop-blur-md\">\n            <div className=\"flex items-center justify-between px-3\">\n              <div className=\"flex items-center gap-4\">\n                <button\n                  type=\"button\"\n                  className=\"text-foreground hover:text-primary flex min-h-6 items-center gap-1.5 text-xs font-semibold transition-colors\"\n                  onClick={() => {\n                    setClapCount((prev) => prev + 1)\n                    showToast(`Clapped! (${clapCount + 1} claps total)`)\n                  }}\n                >\n                  <Heart className=\"fill-destructive/20 text-destructive size-4\" />\n                  <span>{clapCount}</span>\n                </button>\n\n                <button\n                  type=\"button\"\n                  className=\"text-muted-foreground hover:text-foreground flex min-h-6 items-center gap-1.5 text-xs transition-colors\"\n                  onClick={() => showToast('Responses panel opened (24 responses)')}\n                >\n                  <MessageSquare className=\"size-4\" />\n                  <span>24</span>\n                </button>\n              </div>\n\n              <div className=\"flex items-center gap-2\">\n                <Button\n                  size=\"sm\"\n                  variant=\"ghost\"\n                  className=\"text-muted-foreground hover:text-foreground h-7 text-xs\"\n                  onClick={() => {\n                    setIsBookmarked(!isBookmarked)\n                    showToast(!isBookmarked ? 'Bookmarked' : 'Removed')\n                  }}\n                >\n                  <Bookmark className={cn('mr-1 size-3.5', isBookmarked && 'fill-primary text-primary')} />\n                  <span>Bookmark</span>\n                </Button>\n                <Button\n                  aria-label=\"Close publish modal\"\n                  size=\"sm\"\n                  className=\"h-7 text-xs font-semibold\"\n                  onClick={() => setIsPublishModalOpen(true)}\n                >\n                  Publish\n                </Button>\n              </div>\n            </div>\n          </div>\n        )}\n      </main>\n\n      {/* PUBLISH SETTINGS MODAL / DIALOG */}\n      {isPublishModalOpen && (\n        <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs\">\n          <Card className=\"border-border bg-card animate-in fade-in-0 zoom-in-95 w-full max-w-xl shadow-sm duration-200\">\n            <CardHeader className=\"flex flex-row items-center justify-between pb-4\">\n              <div>\n                <CardTitle className=\"text-lg font-semibold\">Publish Story to Publication</CardTitle>\n                <CardDescription className=\"text-xs\">\n                  Configure publication metadata, topic tags, and newsletter distribution.\n                </CardDescription>\n              </div>\n              <Button\n                aria-label=\"Close publish modal\"\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => setIsPublishModalOpen(false)}\n              >\n                <X className=\"size-4\" />\n              </Button>\n            </CardHeader>\n\n            <CardContent className=\"space-y-4 pt-0 text-sm\">\n              {/* Story Summary Card */}\n              <div className=\"border-border bg-muted/30 rounded-lg border p-3\">\n                <h4 className=\"text-foreground line-clamp-1 text-sm font-semibold\">{articleTitle}</h4>\n                <p className=\"text-muted-foreground mt-0.5 line-clamp-1 text-xs\">{articleSubtitle}</p>\n                <div className=\"text-muted-foreground mt-2 flex items-center gap-2 text-xs\">\n                  <span>Author: {authorName}</span>\n                  <span>·</span>\n                  <span>{wordCount} words</span>\n                  <span>·</span>\n                  <span>{readingTimeMinutes} min read</span>\n                </div>\n              </div>\n\n              {/* Tags Input */}\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Topic Tags (up to 5)</label>\n                <div className=\"border-input bg-background flex flex-wrap gap-1.5 rounded-lg border p-2\">\n                  {publishTags.map((tag) => (\n                    <Badge key={tag} variant=\"secondary\" className=\"gap-1 pr-1 text-xs\">\n                      {tag}\n                      <button\n                        aria-label={`Remove tag ${tag}`}\n                        type=\"button\"\n                        className=\"text-muted-foreground hover:text-foreground\"\n                        onClick={() => handleRemoveTag(tag)}\n                      >\n                        <X className=\"size-3\" />\n                      </button>\n                    </Badge>\n                  ))}\n                  <input\n                    value={newTagInput}\n                    onChange={(e) => setNewTagInput(e.target.value)}\n                    type=\"text\"\n                    className=\"placeholder:text-muted-foreground min-w-[100px] flex-1 border-0 bg-transparent p-0 text-xs focus:ring-0 focus:outline-hidden\"\n                    placeholder=\"Add a tag...\"\n                    onKeyDown={(e) => {\n                      if (e.key === 'Enter') {\n                        e.preventDefault()\n                        handleAddTag()\n                      }\n                    }}\n                  />\n                </div>\n              </div>\n\n              {/* SEO Meta Description */}\n              <div className=\"space-y-1.5\">\n                <div className=\"flex items-center justify-between\">\n                  <label className=\"text-foreground text-xs font-medium\">SEO Meta Description</label>\n                  <span className=\"text-muted-foreground text-xs\">{seoDescription.length}/160</span>\n                </div>\n                <Textarea\n                  value={seoDescription}\n                  onValueChange={(v) => setSeoDescription(v)}\n                  rows={2}\n                  className=\"resize-none text-xs\"\n                  placeholder=\"Brief summary for search engines and social cards...\"\n                />\n              </div>\n\n              {/* Canonical URL */}\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Canonical URL</label>\n                <Input\n                  value={canonicalUrl}\n                  onChange={(e) => setCanonicalUrl(e.target.value)}\n                  className=\"h-8 font-mono text-xs\"\n                />\n              </div>\n\n              {/* Newsletter Distribution Toggle */}\n              <div className=\"border-border bg-muted/20 flex items-center justify-between rounded-lg border p-3\">\n                <div className=\"space-y-0.5\">\n                  <p className=\"text-foreground text-xs font-semibold\">Broadcast to Subscribers</p>\n                  <p className=\"text-muted-foreground text-xs\">\n                    Send as an instant newsletter email to 14,200 active readers.\n                  </p>\n                </div>\n                <input\n                  checked={sendNewsletter}\n                  onChange={(e) => setSendNewsletter(e.target.checked)}\n                  type=\"checkbox\"\n                  className=\"border-border accent-primary size-4 cursor-pointer rounded\"\n                />\n              </div>\n\n              {/* Schedule Options */}\n              <div className=\"flex items-center gap-4 text-xs\">\n                <label className=\"flex cursor-pointer items-center gap-2\">\n                  <input\n                    checked={publishSchedule === 'now'}\n                    onChange={() => setPublishSchedule('now')}\n                    type=\"radio\"\n                    value=\"now\"\n                    name=\"schedule\"\n                    className=\"accent-primary cursor-pointer\"\n                  />\n                  <span className=\"text-foreground font-medium\">Publish Now</span>\n                </label>\n                <label className=\"flex cursor-pointer items-center gap-2\">\n                  <input\n                    checked={publishSchedule === 'schedule'}\n                    onChange={() => setPublishSchedule('schedule')}\n                    type=\"radio\"\n                    value=\"schedule\"\n                    name=\"schedule\"\n                    className=\"accent-primary cursor-pointer\"\n                  />\n                  <span className=\"text-muted-foreground\">Schedule for later</span>\n                </label>\n              </div>\n            </CardContent>\n\n            <CardFooter className=\"border-border flex items-center justify-end gap-2 border-t pt-4\">\n              <Button\n                aria-label=\"Close publish modal\"\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"text-xs\"\n                onClick={() => setIsPublishModalOpen(false)}\n              >\n                Cancel\n              </Button>\n              <Button size=\"sm\" className=\"gap-1.5 text-xs font-semibold shadow-xs\" onClick={handlePublish}>\n                <Send className=\"size-3.5\" />\n                <span>{publishSchedule === 'now' ? 'Confirm & Publish Now' : 'Schedule Story'}</span>\n              </Button>\n            </CardFooter>\n          </Card>\n        </div>\n      )}\n\n      {/* INSERT LINK MODAL */}\n      {isLinkModalOpen && (\n        <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-xs\">\n          <Card className=\"border-border bg-card w-full max-w-sm shadow-xl\">\n            <CardHeader className=\"pb-3\">\n              <CardTitle className=\"text-sm font-semibold\">Insert Hyperlink</CardTitle>\n              <CardDescription className=\"text-xs\">Add an external reference link</CardDescription>\n            </CardHeader>\n            <CardContent className=\"space-y-3 pt-0\">\n              <div className=\"space-y-1\">\n                <label className=\"text-muted-foreground text-xs\">Link Text</label>\n                <Input value={linkText} onChange={(e) => setLinkText(e.target.value)} className=\"h-8 text-xs\" />\n              </div>\n              <div className=\"space-y-1\">\n                <label className=\"text-muted-foreground text-xs\">Destination URL</label>\n                <Input\n                  value={linkUrl}\n                  onChange={(e) => setLinkUrl(e.target.value)}\n                  className=\"h-8 font-mono text-xs\"\n                  placeholder=\"https://\"\n                />\n              </div>\n            </CardContent>\n            <CardFooter className=\"border-border flex items-center justify-end gap-2 border-t pt-3\">\n              <Button variant=\"ghost\" size=\"sm\" className=\"h-8 text-xs\" onClick={() => setIsLinkModalOpen(false)}>\n                Cancel\n              </Button>\n              <Button\n                size=\"sm\"\n                className=\"h-8 text-xs\"\n                onClick={() => {\n                  setIsLinkModalOpen(false)\n                  showToast('Link inserted successfully!')\n                }}\n              >\n                Apply Link\n              </Button>\n            </CardFooter>\n          </Card>\n        </div>\n      )}\n\n      {/* INTERACTIVE TOAST NOTIFICATION */}\n      {toastMessage && (\n        <div className=\"border-border bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 fixed right-5 bottom-5 z-50 flex items-center gap-2 rounded-lg border px-3.5 py-2.5 text-xs font-medium shadow-lg duration-150\">\n          <Check className=\"text-primary size-3.5\" />\n          <span>{toastMessage}</span>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default ArticleEditorToolbar\n",
      "type": "registry:page",
      "target": "~/components/blocks/ArticleEditorToolbar.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/input.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/textarea.json"
  ],
  "description": "Medium and Substack style rich text formatting toolbar and article drafting canvas with typography controls, syntax highlighted code blocks, callouts, and publishing drawer.",
  "categories": [
    "media",
    "app",
    "content"
  ]
}