@agimon-ai/doompi-web-components 0.0.1-alpha.71 → 0.0.1-alpha.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/packages/core/doompi-web-components/src/components/MessageItem.d.mts +3 -0
- package/dist/packages/core/doompi-web-components/src/components/MessageItem.d.mts.map +1 -1
- package/dist/packages/core/doompi-web-components/src/components/MessageItem.mjs +1 -1
- package/dist/packages/core/doompi-web-components/src/components/MessageItem.mjs.map +1 -1
- package/dist/src/components/MessageItem.cjs +1 -1
- package/dist/src/components/MessageItem.cjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("./src/icons/icons.cjs");const e=require("./src/lib/cn.cjs"),t=require("./src/components/Accordion.cjs"),n=require("./src/lib/ansiSpans.cjs"),r=require("./src/components/AnsiText.cjs"),i=require("./src/components/Avatar.cjs"),a=require("./src/components/Badge.cjs"),o=require("./src/components/Tooltip.cjs"),s=require("./src/components/Breadcrumb.cjs"),ee=require("./src/components/Spinner.cjs"),c=require("./src/components/Button.cjs"),l=require("./src/components/Dialog.cjs"),u=require("./src/lib/review.cjs"),d=require("./src/components/DiffView.cjs"),f=require("./src/components/Dot.cjs"),te=require("./src/components/Drawer.cjs"),p=require("./src/components/DropdownMenu.cjs"),ne=require("./src/components/Checkbox.cjs"),re=require("./src/lib/editorLanguage.cjs"),m=require("./src/lib/syntaxHighlight.cjs"),h=require("./src/components/SyntaxText.cjs"),g=require("./src/components/CodeBlock.cjs"),_=require("./src/components/Skeleton.cjs"),v=require("./src/components/CodeEditor.cjs"),y=require("./src/components/Collapsible.cjs"),b=require("./src/components/Input.cjs"),x=require("./src/lib/optionList.cjs"),S=require("./src/components/OptionList.cjs"),C=require("./src/components/Command.cjs"),ie=require("./src/components/EmptyState.cjs"),w=require("./src/lib/hashlineHighlight.cjs"),ae=require("./src/components/HashlineLines.cjs"),T=require("./src/components/Kbd.cjs"),E=require("./src/components/McpToolWidget.cjs"),D=require("./src/components/Label.cjs"),O=require("./src/components/Markdown.cjs"),k=require("./src/lib/media.cjs"),A=require("./src/components/PdfPreview.cjs"),oe=require("./src/components/MediaPreview.cjs"),j=require("./src/components/StatusBadge.cjs"),M=require("./src/components/MessageItem.cjs"),N=require("./src/components/MessageLines.cjs"),P=require("./src/components/Panel.cjs"),F=require("./src/components/Popover.cjs"),I=require("./src/components/Progress.cjs"),L=require("./src/components/RadioGroup.cjs"),R=require("./src/components/Textarea.cjs"),z=require("./src/components/ReviewCommentDraft.cjs"),B=require("./src/components/ScrollArea.cjs"),V=require("./src/components/SectionLabel.cjs"),H=require("./src/components/Select.cjs"),U=require("./src/components/Separator.cjs"),W=require("./src/components/Sheet.cjs"),G=require("./src/components/StreamCursor.cjs"),K=require("./src/components/Switch.cjs"),q=require("./src/components/Tabs.cjs"),se=require("./src/components/TerminalView.cjs"),J=require("./src/components/Toast.cjs"),ce=require("./src/components/ToolPathLink.cjs"),le=require("./src/lib/collapse.cjs"),Y=require("./src/lib/hashlineView.cjs"),X=require("./src/lib/pathGroups.cjs"),Z=require("./src/lib/tone.cjs"),ue=require("./src/types/editor.cjs"),Q=require("./src/types/tone.cjs");let $=require("lucide-react");exports.ACCENT_TONES=Q.ACCENT_TONES,exports.Accordion=t.Accordion,exports.AccordionContent=t.AccordionContent,exports.AccordionItem=t.AccordionItem,exports.AccordionTrigger=t.AccordionTrigger,Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return $.Activity}}),Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return $.CircleAlert}}),exports.AnsiLine=r.AnsiLine,exports.AnsiText=r.AnsiText,Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return $.AudioLines}}),exports.Avatar=i.Avatar,exports.AvatarFallback=i.AvatarFallback,exports.AvatarImage=i.AvatarImage,exports.BREADCRUMB_ELLIPSIS=s.BREADCRUMB_ELLIPSIS,exports.Badge=a.Badge,Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return $.BookmarkPlus}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return $.GitBranch}}),exports.Breadcrumb=s.Breadcrumb,exports.Button=c.Button,exports.CHIP_TONES=Q.CHIP_TONES,exports.CHIP_TO_STATUS=Z.CHIP_TO_STATUS,Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return $.Check}}),exports.Checkbox=ne.Checkbox,Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return $.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return $.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return $.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return $.X}}),exports.CodeBlock=g.CodeBlock,exports.CodeEditor=v.CodeEditor,exports.Collapsible=y.Collapsible,exports.CollapsibleContent=y.CollapsibleContent,exports.CollapsibleTrigger=y.CollapsibleTrigger,exports.CommandDialog=C.CommandDialog,exports.CommandEmpty=C.CommandEmpty,exports.CommandFooter=C.CommandFooter,exports.CommandGroup=C.CommandGroup,exports.CommandGroupLabel=C.CommandGroupLabel,exports.CommandHeader=C.CommandHeader,exports.CommandInput=C.CommandInput,exports.CommandItem=C.CommandItem,exports.CommandItemLabel=C.CommandItemLabel,exports.CommandList=C.CommandList,Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return $.Copy}}),exports.DOT_TONES=Q.DOT_TONES,exports.Dialog=l.Dialog,exports.DialogBody=l.DialogBody,exports.DialogClose=l.DialogClose,exports.DialogContent=l.DialogContent,exports.DialogDescription=l.DialogDescription,exports.DialogFooter=l.DialogFooter,exports.DialogHeader=l.DialogHeader,exports.DialogTitle=l.DialogTitle,exports.DialogTrigger=l.DialogTrigger,exports.DiffView=d.DiffView,exports.Dot=f.Dot,exports.Drawer=te.Drawer,exports.DropdownMenu=p.DropdownMenu,exports.DropdownMenuCheckboxItem=p.DropdownMenuCheckboxItem,exports.DropdownMenuContent=p.DropdownMenuContent,exports.DropdownMenuGroup=p.DropdownMenuGroup,exports.DropdownMenuItem=p.DropdownMenuItem,exports.DropdownMenuLabel=p.DropdownMenuLabel,exports.DropdownMenuRadioGroup=p.DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=p.DropdownMenuRadioItem,exports.DropdownMenuSeparator=p.DropdownMenuSeparator,exports.DropdownMenuShortcut=p.DropdownMenuShortcut,exports.DropdownMenuSub=p.DropdownMenuSub,exports.DropdownMenuSubContent=p.DropdownMenuSubContent,exports.DropdownMenuSubTrigger=p.DropdownMenuSubTrigger,exports.DropdownMenuTrigger=p.DropdownMenuTrigger,Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return $.Pencil}}),exports.EmptyState=ie.EmptyState,Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return $.CornerDownLeft}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return $.ExternalLink}}),Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return $.FileText}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return $.GitFork}}),exports.GREP_COLLAPSED_LINES=Y.GREP_COLLAPSED_LINES,Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return $.Settings}}),exports.HashlineLines=ae.HashlineLines,exports.Input=b.Input,exports.Kbd=T.Kbd,Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return $.MoreVertical}}),exports.LINE_TONE_TO_STATUS=Z.LINE_TONE_TO_STATUS,exports.Label=D.Label,Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return $.Loader2}}),exports.MAX_DIGIT_SHORTCUT=x.MAX_DIGIT_SHORTCUT,exports.MEDIA_KINDS=ue.MEDIA_KINDS,exports.MESSAGE_LINE_TONES=Q.MESSAGE_LINE_TONES,exports.Markdown=O.Markdown,exports.McpToolFields=E.McpToolFields,exports.McpToolFrame=E.McpToolFrame,exports.McpToolOutput=E.McpToolOutput,exports.MediaPreview=oe.MediaPreview,Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return $.MessageCircle}}),exports.MessageItem=M.MessageItem,exports.MessageItemBody=M.MessageItemBody,exports.MessageItemGroup=M.MessageItemGroup,exports.MessageItemHeader=M.MessageItemHeader,exports.MessageItemStatus=M.MessageItemStatus,exports.MessageLines=N.MessageLines,Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return $.Mic}}),exports.NavTab=q.NavTab,exports.NavTabBadge=q.NavTabBadge,exports.OptionLabel=S.OptionLabel,exports.OptionList=S.OptionList,exports.OptionRow=S.OptionRow,Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return $.Palette}}),exports.Panel=P.Panel,exports.PanelBody=P.PanelBody,exports.PanelHeader=P.PanelHeader,exports.PdfPreview=A.PdfPreview,Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return $.Plus}}),exports.Popover=F.Popover,exports.PopoverAnchor=F.PopoverAnchor,exports.PopoverClose=F.PopoverClose,exports.PopoverContent=F.PopoverContent,exports.PopoverFooter=F.PopoverFooter,exports.PopoverHeader=F.PopoverHeader,exports.PopoverTrigger=F.PopoverTrigger,exports.Progress=I.Progress,Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return $.Quote}}),exports.READ_COLLAPSED_LINES=Y.READ_COLLAPSED_LINES,exports.RadioGroup=L.RadioGroup,exports.RadioGroupCard=L.RadioGroupCard,exports.RadioGroupItem=L.RadioGroupItem,Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return $.RefreshCw}}),exports.ReviewCommentDraft=z.ReviewCommentDraft,Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return $.Rewind}}),exports.STATUS_EDGE=j.STATUS_EDGE,exports.STATUS_GLYPH=M.STATUS_GLYPH,exports.STATUS_LABEL=M.STATUS_LABEL,exports.STATUS_TONES=Q.STATUS_TONES,exports.STATUS_TO_CHIP=Z.STATUS_TO_CHIP,exports.STATUS_TO_DOT=Z.STATUS_TO_DOT,exports.ScrollArea=B.ScrollArea,exports.ScrollBar=B.ScrollBar,Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return $.Search}}),exports.SectionLabel=V.SectionLabel,exports.Select=H.Select,exports.SelectContent=H.SelectContent,exports.SelectGroup=H.SelectGroup,exports.SelectItem=H.SelectItem,exports.SelectLabel=H.SelectLabel,exports.SelectSeparator=H.SelectSeparator,exports.SelectTrigger=H.SelectTrigger,exports.SelectValue=H.SelectValue,Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return $.Send}}),exports.Separator=U.Separator,exports.Sheet=W.Sheet,exports.SheetBody=W.SheetBody,exports.SheetClose=W.SheetClose,exports.SheetContent=W.SheetContent,exports.SheetDescription=W.SheetDescription,exports.SheetFooter=W.SheetFooter,exports.SheetHeader=W.SheetHeader,exports.SheetOverlay=W.SheetOverlay,exports.SheetTitle=W.SheetTitle,exports.SheetTrigger=W.SheetTrigger,Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return $.ShieldCheck}}),exports.Skeleton=_.Skeleton,exports.Spinner=ee.Spinner,exports.StatusBadge=j.StatusBadge,Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return $.Square}}),exports.StreamCursor=G.StreamCursor,exports.Switch=K.Switch,exports.SyntaxLine=h.SyntaxLine,exports.SyntaxText=h.SyntaxText,exports.Tabs=q.Tabs,exports.TabsContent=q.TabsContent,exports.TabsList=q.TabsList,exports.TabsTrigger=q.TabsTrigger,exports.TerminalView=se.TerminalView,exports.Textarea=R.Textarea,exports.Toast=J.Toast,exports.ToastAction=J.ToastAction,exports.ToastClose=J.ToastClose,exports.ToastDescription=J.ToastDescription,exports.ToastProvider=J.ToastProvider,exports.ToastTitle=J.ToastTitle,exports.ToastViewport=J.ToastViewport,exports.ToolPathLink=ce.ToolPathLink,exports.Tooltip=o.Tooltip,exports.TooltipContent=o.TooltipContent,exports.TooltipProvider=o.TooltipProvider,exports.TooltipTrigger=o.TooltipTrigger,Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return $.Trash2}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return $.UserRound}}),Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return $.Volume2}}),exports.ansiSpans=n.ansiSpans,exports.badgeVariants=a.badgeVariants,exports.breadcrumbSegments=s.breadcrumbSegments,exports.buildReviewPrompt=u.buildReviewPrompt,exports.buttonVariants=c.buttonVariants,exports.cn=e.cn,exports.collapseLines=le.collapseLines,exports.compactDetails=Y.compactDetails,exports.defaultReviewHeading=u.defaultReviewHeading,exports.detectGrammar=m.detectGrammar,exports.dialogFooterVariants=l.dialogFooterVariants,exports.diffGutterWidth=u.diffGutterWidth,exports.diffRangeOf=u.diffRangeOf,exports.dotVariants=f.dotVariants,exports.dropdownMenuItemVariants=p.dropdownMenuItemVariants,exports.fieldVariants=b.fieldVariants,exports.grammarKeyOf=re.grammarKeyOf,exports.groupByDirectory=X.groupByDirectory,exports.groupRowLabel=X.groupRowLabel,exports.handleOptionListKey=x.handleOptionListKey,exports.hashlineBody=Y.hashlineBody,exports.hashlineGroups=w.hashlineGroups,exports.hashlineGroupsKey=w.hashlineGroupsKey,exports.highlightToLines=m.highlightToLines,exports.mediaKindOf=k.mediaKindOf,exports.messageItemRowVariants=M.messageItemRowVariants,exports.messageItemStatusVariants=M.messageItemStatusVariants,exports.messageItemVariants=M.messageItemVariants,exports.messageLineVariants=N.messageLineVariants,exports.optionListHint=x.optionListHint,exports.optionListVariants=S.optionListVariants,exports.optionMarker=x.optionMarker,exports.optionMarkerVariants=S.optionMarkerVariants,exports.optionRowVariants=S.optionRowVariants,exports.parseFileHeader=Y.parseFileHeader,exports.parseTaggedLine=Y.parseTaggedLine,exports.presentHashlineLines=Y.presentHashlineLines,exports.resolvePdfViewportRegion=A.resolvePdfViewportRegion,exports.resultTextLines=Y.resultTextLines,exports.reviewCommentAnchor=u.reviewCommentAnchor,exports.statusBadgeVariants=j.statusBadgeVariants,exports.syntaxStyleOf=m.syntaxStyleOf,exports.tabBadgeVariants=q.tabBadgeVariants,exports.tabVariants=q.tabVariants,exports.takeTrailingNotice=Y.takeTrailingNotice,exports.toastVariants=J.toastVariants,exports.toolTone=M.toolTone,exports.trimSnippet=u.trimSnippet,exports.useMessageItem=M.useMessageItem,exports.useSyntaxLines=h.useSyntaxLines;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("./src/icons/icons.cjs");const e=require("./src/lib/cn.cjs"),t=require("./src/components/Accordion.cjs"),n=require("./src/lib/ansiSpans.cjs"),r=require("./src/components/AnsiText.cjs"),i=require("./src/components/Avatar.cjs"),a=require("./src/components/Badge.cjs"),o=require("./src/components/Tooltip.cjs"),s=require("./src/components/Breadcrumb.cjs"),ee=require("./src/components/Spinner.cjs"),c=require("./src/components/Button.cjs"),l=require("./src/components/Dialog.cjs"),u=require("./src/lib/review.cjs"),d=require("./src/components/DiffView.cjs"),f=require("./src/components/Dot.cjs"),te=require("./src/components/Drawer.cjs"),p=require("./src/components/DropdownMenu.cjs"),ne=require("./src/components/Checkbox.cjs"),re=require("./src/lib/editorLanguage.cjs"),m=require("./src/lib/syntaxHighlight.cjs"),h=require("./src/components/SyntaxText.cjs"),g=require("./src/components/CodeBlock.cjs"),_=require("./src/components/Skeleton.cjs"),v=require("./src/components/CodeEditor.cjs"),y=require("./src/components/Collapsible.cjs"),b=require("./src/components/Input.cjs"),x=require("./src/lib/optionList.cjs"),S=require("./src/components/OptionList.cjs"),C=require("./src/components/Command.cjs"),ie=require("./src/components/EmptyState.cjs"),w=require("./src/lib/hashlineHighlight.cjs"),ae=require("./src/components/HashlineLines.cjs"),T=require("./src/components/Kbd.cjs"),E=require("./src/components/McpToolWidget.cjs"),D=require("./src/components/Label.cjs"),O=require("./src/components/Markdown.cjs"),k=require("./src/lib/media.cjs"),A=require("./src/components/PdfPreview.cjs"),oe=require("./src/components/MediaPreview.cjs"),j=require("./src/components/StatusBadge.cjs"),M=require("./src/components/MessageItem.cjs"),N=require("./src/components/MessageLines.cjs"),P=require("./src/components/Panel.cjs"),F=require("./src/components/Popover.cjs"),I=require("./src/components/Progress.cjs"),L=require("./src/components/RadioGroup.cjs"),R=require("./src/components/Textarea.cjs"),z=require("./src/components/ReviewCommentDraft.cjs"),B=require("./src/components/ScrollArea.cjs"),V=require("./src/components/SectionLabel.cjs"),H=require("./src/components/Select.cjs"),U=require("./src/components/Separator.cjs"),W=require("./src/components/Sheet.cjs"),G=require("./src/components/StreamCursor.cjs"),K=require("./src/components/Switch.cjs"),q=require("./src/components/Tabs.cjs"),se=require("./src/components/TerminalView.cjs"),J=require("./src/components/Toast.cjs"),ce=require("./src/components/ToolPathLink.cjs"),le=require("./src/lib/collapse.cjs"),Y=require("./src/lib/hashlineView.cjs"),X=require("./src/lib/pathGroups.cjs"),Z=require("./src/lib/tone.cjs"),ue=require("./src/types/editor.cjs"),Q=require("./src/types/tone.cjs");let $=require("lucide-react");exports.ACCENT_TONES=Q.ACCENT_TONES,exports.Accordion=t.Accordion,exports.AccordionContent=t.AccordionContent,exports.AccordionItem=t.AccordionItem,exports.AccordionTrigger=t.AccordionTrigger,Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return $.Activity}}),Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return $.CircleAlert}}),exports.AnsiLine=r.AnsiLine,exports.AnsiText=r.AnsiText,Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return $.AudioLines}}),exports.Avatar=i.Avatar,exports.AvatarFallback=i.AvatarFallback,exports.AvatarImage=i.AvatarImage,exports.BREADCRUMB_ELLIPSIS=s.BREADCRUMB_ELLIPSIS,exports.Badge=a.Badge,Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return $.BookmarkPlus}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return $.GitBranch}}),exports.Breadcrumb=s.Breadcrumb,exports.Button=c.Button,exports.CHIP_TONES=Q.CHIP_TONES,exports.CHIP_TO_STATUS=Z.CHIP_TO_STATUS,Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return $.Check}}),exports.Checkbox=ne.Checkbox,Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return $.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return $.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return $.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return $.X}}),exports.CodeBlock=g.CodeBlock,exports.CodeEditor=v.CodeEditor,exports.Collapsible=y.Collapsible,exports.CollapsibleContent=y.CollapsibleContent,exports.CollapsibleTrigger=y.CollapsibleTrigger,exports.CommandDialog=C.CommandDialog,exports.CommandEmpty=C.CommandEmpty,exports.CommandFooter=C.CommandFooter,exports.CommandGroup=C.CommandGroup,exports.CommandGroupLabel=C.CommandGroupLabel,exports.CommandHeader=C.CommandHeader,exports.CommandInput=C.CommandInput,exports.CommandItem=C.CommandItem,exports.CommandItemLabel=C.CommandItemLabel,exports.CommandList=C.CommandList,Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return $.Copy}}),exports.DOT_TONES=Q.DOT_TONES,exports.Dialog=l.Dialog,exports.DialogBody=l.DialogBody,exports.DialogClose=l.DialogClose,exports.DialogContent=l.DialogContent,exports.DialogDescription=l.DialogDescription,exports.DialogFooter=l.DialogFooter,exports.DialogHeader=l.DialogHeader,exports.DialogTitle=l.DialogTitle,exports.DialogTrigger=l.DialogTrigger,exports.DiffView=d.DiffView,exports.Dot=f.Dot,exports.Drawer=te.Drawer,exports.DropdownMenu=p.DropdownMenu,exports.DropdownMenuCheckboxItem=p.DropdownMenuCheckboxItem,exports.DropdownMenuContent=p.DropdownMenuContent,exports.DropdownMenuGroup=p.DropdownMenuGroup,exports.DropdownMenuItem=p.DropdownMenuItem,exports.DropdownMenuLabel=p.DropdownMenuLabel,exports.DropdownMenuRadioGroup=p.DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=p.DropdownMenuRadioItem,exports.DropdownMenuSeparator=p.DropdownMenuSeparator,exports.DropdownMenuShortcut=p.DropdownMenuShortcut,exports.DropdownMenuSub=p.DropdownMenuSub,exports.DropdownMenuSubContent=p.DropdownMenuSubContent,exports.DropdownMenuSubTrigger=p.DropdownMenuSubTrigger,exports.DropdownMenuTrigger=p.DropdownMenuTrigger,Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return $.Pencil}}),exports.EmptyState=ie.EmptyState,Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return $.CornerDownLeft}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return $.ExternalLink}}),Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return $.FileText}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return $.GitFork}}),exports.GREP_COLLAPSED_LINES=Y.GREP_COLLAPSED_LINES,Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return $.Settings}}),exports.HashlineLines=ae.HashlineLines,exports.Input=b.Input,exports.Kbd=T.Kbd,Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return $.MoreVertical}}),exports.LINE_TONE_TO_STATUS=Z.LINE_TONE_TO_STATUS,exports.Label=D.Label,Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return $.Loader2}}),exports.MAX_DIGIT_SHORTCUT=x.MAX_DIGIT_SHORTCUT,exports.MEDIA_KINDS=ue.MEDIA_KINDS,exports.MESSAGE_LINE_TONES=Q.MESSAGE_LINE_TONES,exports.Markdown=O.Markdown,exports.McpToolFields=E.McpToolFields,exports.McpToolFrame=E.McpToolFrame,exports.McpToolOutput=E.McpToolOutput,exports.MediaPreview=oe.MediaPreview,Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return $.MessageCircle}}),exports.MessageItem=M.MessageItem,exports.MessageItemBody=M.MessageItemBody,exports.MessageItemGroup=M.MessageItemGroup,exports.MessageItemHeader=M.MessageItemHeader,exports.MessageItemHeaderAccessoryContext=M.MessageItemHeaderAccessoryContext,exports.MessageItemStatus=M.MessageItemStatus,exports.MessageLines=N.MessageLines,Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return $.Mic}}),exports.NavTab=q.NavTab,exports.NavTabBadge=q.NavTabBadge,exports.OptionLabel=S.OptionLabel,exports.OptionList=S.OptionList,exports.OptionRow=S.OptionRow,Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return $.Palette}}),exports.Panel=P.Panel,exports.PanelBody=P.PanelBody,exports.PanelHeader=P.PanelHeader,exports.PdfPreview=A.PdfPreview,Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return $.Plus}}),exports.Popover=F.Popover,exports.PopoverAnchor=F.PopoverAnchor,exports.PopoverClose=F.PopoverClose,exports.PopoverContent=F.PopoverContent,exports.PopoverFooter=F.PopoverFooter,exports.PopoverHeader=F.PopoverHeader,exports.PopoverTrigger=F.PopoverTrigger,exports.Progress=I.Progress,Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return $.Quote}}),exports.READ_COLLAPSED_LINES=Y.READ_COLLAPSED_LINES,exports.RadioGroup=L.RadioGroup,exports.RadioGroupCard=L.RadioGroupCard,exports.RadioGroupItem=L.RadioGroupItem,Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return $.RefreshCw}}),exports.ReviewCommentDraft=z.ReviewCommentDraft,Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return $.Rewind}}),exports.STATUS_EDGE=j.STATUS_EDGE,exports.STATUS_GLYPH=M.STATUS_GLYPH,exports.STATUS_LABEL=M.STATUS_LABEL,exports.STATUS_TONES=Q.STATUS_TONES,exports.STATUS_TO_CHIP=Z.STATUS_TO_CHIP,exports.STATUS_TO_DOT=Z.STATUS_TO_DOT,exports.ScrollArea=B.ScrollArea,exports.ScrollBar=B.ScrollBar,Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return $.Search}}),exports.SectionLabel=V.SectionLabel,exports.Select=H.Select,exports.SelectContent=H.SelectContent,exports.SelectGroup=H.SelectGroup,exports.SelectItem=H.SelectItem,exports.SelectLabel=H.SelectLabel,exports.SelectSeparator=H.SelectSeparator,exports.SelectTrigger=H.SelectTrigger,exports.SelectValue=H.SelectValue,Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return $.Send}}),exports.Separator=U.Separator,exports.Sheet=W.Sheet,exports.SheetBody=W.SheetBody,exports.SheetClose=W.SheetClose,exports.SheetContent=W.SheetContent,exports.SheetDescription=W.SheetDescription,exports.SheetFooter=W.SheetFooter,exports.SheetHeader=W.SheetHeader,exports.SheetOverlay=W.SheetOverlay,exports.SheetTitle=W.SheetTitle,exports.SheetTrigger=W.SheetTrigger,Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return $.ShieldCheck}}),exports.Skeleton=_.Skeleton,exports.Spinner=ee.Spinner,exports.StatusBadge=j.StatusBadge,Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return $.Square}}),exports.StreamCursor=G.StreamCursor,exports.Switch=K.Switch,exports.SyntaxLine=h.SyntaxLine,exports.SyntaxText=h.SyntaxText,exports.Tabs=q.Tabs,exports.TabsContent=q.TabsContent,exports.TabsList=q.TabsList,exports.TabsTrigger=q.TabsTrigger,exports.TerminalView=se.TerminalView,exports.Textarea=R.Textarea,exports.Toast=J.Toast,exports.ToastAction=J.ToastAction,exports.ToastClose=J.ToastClose,exports.ToastDescription=J.ToastDescription,exports.ToastProvider=J.ToastProvider,exports.ToastTitle=J.ToastTitle,exports.ToastViewport=J.ToastViewport,exports.ToolPathLink=ce.ToolPathLink,exports.Tooltip=o.Tooltip,exports.TooltipContent=o.TooltipContent,exports.TooltipProvider=o.TooltipProvider,exports.TooltipTrigger=o.TooltipTrigger,Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return $.Trash2}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return $.UserRound}}),Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return $.Volume2}}),exports.ansiSpans=n.ansiSpans,exports.badgeVariants=a.badgeVariants,exports.breadcrumbSegments=s.breadcrumbSegments,exports.buildReviewPrompt=u.buildReviewPrompt,exports.buttonVariants=c.buttonVariants,exports.cn=e.cn,exports.collapseLines=le.collapseLines,exports.compactDetails=Y.compactDetails,exports.defaultReviewHeading=u.defaultReviewHeading,exports.detectGrammar=m.detectGrammar,exports.dialogFooterVariants=l.dialogFooterVariants,exports.diffGutterWidth=u.diffGutterWidth,exports.diffRangeOf=u.diffRangeOf,exports.dotVariants=f.dotVariants,exports.dropdownMenuItemVariants=p.dropdownMenuItemVariants,exports.fieldVariants=b.fieldVariants,exports.grammarKeyOf=re.grammarKeyOf,exports.groupByDirectory=X.groupByDirectory,exports.groupRowLabel=X.groupRowLabel,exports.handleOptionListKey=x.handleOptionListKey,exports.hashlineBody=Y.hashlineBody,exports.hashlineGroups=w.hashlineGroups,exports.hashlineGroupsKey=w.hashlineGroupsKey,exports.highlightToLines=m.highlightToLines,exports.mediaKindOf=k.mediaKindOf,exports.messageItemRowVariants=M.messageItemRowVariants,exports.messageItemStatusVariants=M.messageItemStatusVariants,exports.messageItemVariants=M.messageItemVariants,exports.messageLineVariants=N.messageLineVariants,exports.optionListHint=x.optionListHint,exports.optionListVariants=S.optionListVariants,exports.optionMarker=x.optionMarker,exports.optionMarkerVariants=S.optionMarkerVariants,exports.optionRowVariants=S.optionRowVariants,exports.parseFileHeader=Y.parseFileHeader,exports.parseTaggedLine=Y.parseTaggedLine,exports.presentHashlineLines=Y.presentHashlineLines,exports.resolvePdfViewportRegion=A.resolvePdfViewportRegion,exports.resultTextLines=Y.resultTextLines,exports.reviewCommentAnchor=u.reviewCommentAnchor,exports.statusBadgeVariants=j.statusBadgeVariants,exports.syntaxStyleOf=m.syntaxStyleOf,exports.tabBadgeVariants=q.tabBadgeVariants,exports.tabVariants=q.tabVariants,exports.takeTrailingNotice=Y.takeTrailingNotice,exports.toastVariants=J.toastVariants,exports.toolTone=M.toolTone,exports.trimSnippet=u.trimSnippet,exports.useMessageItem=M.useMessageItem,exports.useSyntaxLines=h.useSyntaxLines;
|
package/dist/index.d.mts
CHANGED
|
@@ -29,7 +29,7 @@ import { Markdown } from "./packages/core/doompi-web-components/src/components/M
|
|
|
29
29
|
import { PdfNormalizedRectangle, PdfPageRegion, PdfPageState, PdfPreview, PdfPreviewController, PdfPreviewProps, resolvePdfViewportRegion } from "./packages/core/doompi-web-components/src/components/PdfPreview.mjs";
|
|
30
30
|
import { MediaFrameCapture, MediaFrameMetadata, MediaIntrinsicSize, MediaPlaybackState, MediaPreview, MediaPreviewController, MediaPreviewProps } from "./packages/core/doompi-web-components/src/components/MediaPreview.mjs";
|
|
31
31
|
import { STATUS_EDGE, StatusBadge, StatusBadgeProps, StatusTone, statusBadgeVariants } from "./packages/core/doompi-web-components/src/components/StatusBadge.mjs";
|
|
32
|
-
import { MessageItem, MessageItemBody, MessageItemGroup, MessageItemGroupProps, MessageItemHeader, MessageItemHeaderProps, MessageItemProps, MessageItemState, MessageItemStatus, MessageItemStatusProps, STATUS_GLYPH, STATUS_LABEL, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, toolTone, useMessageItem } from "./packages/core/doompi-web-components/src/components/MessageItem.mjs";
|
|
32
|
+
import { MessageItem, MessageItemBody, MessageItemGroup, MessageItemGroupProps, MessageItemHeader, MessageItemHeaderAccessoryContext, MessageItemHeaderProps, MessageItemProps, MessageItemState, MessageItemStatus, MessageItemStatusProps, STATUS_GLYPH, STATUS_LABEL, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, toolTone, useMessageItem } from "./packages/core/doompi-web-components/src/components/MessageItem.mjs";
|
|
33
33
|
import { MessageLine, MessageLineTone, MessageLines, MessageLinesProps, messageLineVariants } from "./packages/core/doompi-web-components/src/components/MessageLines.mjs";
|
|
34
34
|
import { Panel, PanelBody, PanelHeader, PanelProps } from "./packages/core/doompi-web-components/src/components/Panel.mjs";
|
|
35
35
|
import { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger } from "./packages/core/doompi-web-components/src/components/Popover.mjs";
|
|
@@ -64,4 +64,4 @@ import { buildReviewPrompt, defaultReviewHeading, diffGutterWidth, diffRangeOf,
|
|
|
64
64
|
import { MAX_DIGIT_SHORTCUT, handleOptionListKey, optionListHint, optionMarker } from "./packages/core/doompi-web-components/src/lib/optionList.mjs";
|
|
65
65
|
import { CHIP_TO_STATUS, LINE_TONE_TO_STATUS, STATUS_TO_CHIP, STATUS_TO_DOT } from "./packages/core/doompi-web-components/src/lib/tone.mjs";
|
|
66
66
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./packages/core/doompi-web-components/src/components/Tooltip.mjs";
|
|
67
|
-
export { ACCENT_TONES, type AccentTone, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityIcon, AlertIcon, AnsiLine, type AnsiLineProps, type AnsiSpan, AnsiText, type AnsiTextProps, AudioLinesIcon, Avatar, AvatarFallback, AvatarImage, BREADCRUMB_ELLIPSIS, Badge, type BadgeProps, type BadgeTone, BookmarkPlusIcon, BranchIcon, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHIP_TONES, CHIP_TO_STATUS, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, type ChipTone, CloseIcon, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorController, type CodeEditorProps, type CollapsedLines, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandDialog, type CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList, CopyIcon, DOT_TONES, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogTitle, DialogTrigger, type DiffHunk, type DiffMarker, type DiffRow, type DiffSelection, type DiffSide, DiffView, type DiffViewProps, Dot, type DotProps, type DotTone, Drawer, type DrawerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditIcon, type EditorEdit, type EditorMarkedRange, type EditorSelectionRange, type EditorTextRange, type EditorViewportRectangle, EmptyState, type EmptyStateProps, EnterIcon, ExternalLinkIcon, type FieldSize, type FieldVariant, FileIcon, ForkIcon, GREP_COLLAPSED_LINES, GearIcon, type GrammarKey, type GrammarQuery, type HashlineBody, type HashlineGroup, HashlineLines, type HashlineLinesProps, type HashlineResult, type HashlineResultKind, Input, type InputProps, Kbd, KebabIcon, LINE_TONE_TO_STATUS, Label, LoaderIcon, MAX_DIGIT_SHORTCUT, MEDIA_KINDS, MESSAGE_LINE_TONES, Markdown, McpToolFields, McpToolFrame, McpToolOutput, type MediaFrameCapture, type MediaFrameMetadata, type MediaIntrinsicSize, type MediaKind, type MediaPlaybackState, MediaPreview, type MediaPreviewController, type MediaPreviewProps, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, type MessageItemHeaderProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, type MessageLine, type MessageLineTone, MessageLines, type MessageLinesProps, MicIcon, NavTab, NavTabBadge, type NavTabProps, OptionLabel, OptionList, type OptionListProps, OptionRow, type OptionRowProps, PaletteIcon, Panel, PanelBody, PanelHeader, type PanelProps, type PathGroup, type PdfNormalizedRectangle, type PdfPageRegion, type PdfPageState, PdfPreview, type PdfPreviewController, type PdfPreviewProps, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, type PresentedLine, Progress, QuoteIcon, READ_COLLAPSED_LINES, RadioGroup, RadioGroupCard, RadioGroupItem, RefreshIcon, type ReviewComment, ReviewCommentDraft, type ReviewCommentDraftProps, RewindIcon, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, STATUS_TONES, STATUS_TO_CHIP, STATUS_TO_DOT, ScrollArea, ScrollBar, SearchIcon, SectionLabel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SendIcon, Separator, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetOverlay, SheetTitle, SheetTrigger, ShieldIcon, Skeleton, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusTone, StopIcon, StreamCursor, Switch, SyntaxLine, type SyntaxLineProps, type SyntaxLines, type SyntaxQuery, type SyntaxSpan, SyntaxText, type SyntaxTextProps, type SyntaxToken, Tabs, TabsContent, TabsList, TabsTrigger, type TaggedLine, type TaggedLineMarker, type TerminalHandle, TerminalView, type TerminalViewProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, ToolPathLink, type ToolPathLinkProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TrashIcon, UserIcon, VolumeIcon, ansiSpans, badgeVariants, breadcrumbSegments, buildReviewPrompt, buttonVariants, cn, collapseLines, compactDetails, defaultReviewHeading, detectGrammar, dialogFooterVariants, diffGutterWidth, diffRangeOf, dotVariants, dropdownMenuItemVariants, fieldVariants, grammarKeyOf, groupByDirectory, groupRowLabel, handleOptionListKey, hashlineBody, hashlineGroups, hashlineGroupsKey, highlightToLines, mediaKindOf, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, messageLineVariants, optionListHint, optionListVariants, optionMarker, optionMarkerVariants, optionRowVariants, parseFileHeader, parseTaggedLine, presentHashlineLines, resolvePdfViewportRegion, resultTextLines, reviewCommentAnchor, statusBadgeVariants, syntaxStyleOf, tabBadgeVariants, tabVariants, takeTrailingNotice, toastVariants, toolTone, trimSnippet, useMessageItem, useSyntaxLines };
|
|
67
|
+
export { ACCENT_TONES, type AccentTone, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityIcon, AlertIcon, AnsiLine, type AnsiLineProps, type AnsiSpan, AnsiText, type AnsiTextProps, AudioLinesIcon, Avatar, AvatarFallback, AvatarImage, BREADCRUMB_ELLIPSIS, Badge, type BadgeProps, type BadgeTone, BookmarkPlusIcon, BranchIcon, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHIP_TONES, CHIP_TO_STATUS, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, type ChipTone, CloseIcon, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorController, type CodeEditorProps, type CollapsedLines, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandDialog, type CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList, CopyIcon, DOT_TONES, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogTitle, DialogTrigger, type DiffHunk, type DiffMarker, type DiffRow, type DiffSelection, type DiffSide, DiffView, type DiffViewProps, Dot, type DotProps, type DotTone, Drawer, type DrawerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditIcon, type EditorEdit, type EditorMarkedRange, type EditorSelectionRange, type EditorTextRange, type EditorViewportRectangle, EmptyState, type EmptyStateProps, EnterIcon, ExternalLinkIcon, type FieldSize, type FieldVariant, FileIcon, ForkIcon, GREP_COLLAPSED_LINES, GearIcon, type GrammarKey, type GrammarQuery, type HashlineBody, type HashlineGroup, HashlineLines, type HashlineLinesProps, type HashlineResult, type HashlineResultKind, Input, type InputProps, Kbd, KebabIcon, LINE_TONE_TO_STATUS, Label, LoaderIcon, MAX_DIGIT_SHORTCUT, MEDIA_KINDS, MESSAGE_LINE_TONES, Markdown, McpToolFields, McpToolFrame, McpToolOutput, type MediaFrameCapture, type MediaFrameMetadata, type MediaIntrinsicSize, type MediaKind, type MediaPlaybackState, MediaPreview, type MediaPreviewController, type MediaPreviewProps, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, MessageItemHeaderAccessoryContext, type MessageItemHeaderProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, type MessageLine, type MessageLineTone, MessageLines, type MessageLinesProps, MicIcon, NavTab, NavTabBadge, type NavTabProps, OptionLabel, OptionList, type OptionListProps, OptionRow, type OptionRowProps, PaletteIcon, Panel, PanelBody, PanelHeader, type PanelProps, type PathGroup, type PdfNormalizedRectangle, type PdfPageRegion, type PdfPageState, PdfPreview, type PdfPreviewController, type PdfPreviewProps, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, type PresentedLine, Progress, QuoteIcon, READ_COLLAPSED_LINES, RadioGroup, RadioGroupCard, RadioGroupItem, RefreshIcon, type ReviewComment, ReviewCommentDraft, type ReviewCommentDraftProps, RewindIcon, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, STATUS_TONES, STATUS_TO_CHIP, STATUS_TO_DOT, ScrollArea, ScrollBar, SearchIcon, SectionLabel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SendIcon, Separator, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetOverlay, SheetTitle, SheetTrigger, ShieldIcon, Skeleton, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusTone, StopIcon, StreamCursor, Switch, SyntaxLine, type SyntaxLineProps, type SyntaxLines, type SyntaxQuery, type SyntaxSpan, SyntaxText, type SyntaxTextProps, type SyntaxToken, Tabs, TabsContent, TabsList, TabsTrigger, type TaggedLine, type TaggedLineMarker, type TerminalHandle, TerminalView, type TerminalViewProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, ToolPathLink, type ToolPathLinkProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TrashIcon, UserIcon, VolumeIcon, ansiSpans, badgeVariants, breadcrumbSegments, buildReviewPrompt, buttonVariants, cn, collapseLines, compactDetails, defaultReviewHeading, detectGrammar, dialogFooterVariants, diffGutterWidth, diffRangeOf, dotVariants, dropdownMenuItemVariants, fieldVariants, grammarKeyOf, groupByDirectory, groupRowLabel, handleOptionListKey, hashlineBody, hashlineGroups, hashlineGroupsKey, highlightToLines, mediaKindOf, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, messageLineVariants, optionListHint, optionListVariants, optionMarker, optionMarkerVariants, optionRowVariants, parseFileHeader, parseTaggedLine, presentHashlineLines, resolvePdfViewportRegion, resultTextLines, reviewCommentAnchor, statusBadgeVariants, syntaxStyleOf, tabBadgeVariants, tabVariants, takeTrailingNotice, toastVariants, toolTone, trimSnippet, useMessageItem, useSyntaxLines };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityIcon as e,AlertIcon as t,AudioLinesIcon as n,BookmarkPlusIcon as r,BranchIcon as i,CheckIcon as a,ChevronDownIcon as o,ChevronRightIcon as s,ChevronUpIcon as c,CloseIcon as l,CopyIcon as u,EditIcon as d,EnterIcon as f,ExternalLinkIcon as p,FileIcon as m,ForkIcon as h,GearIcon as g,KebabIcon as _,LoaderIcon as v,MessageIcon as y,MicIcon as b,PaletteIcon as x,PlusIcon as S,QuoteIcon as C,RefreshIcon as w,RewindIcon as T,SearchIcon as E,SendIcon as D,ShieldIcon as O,StopIcon as k,TrashIcon as A,UserIcon as j,VolumeIcon as M}from"./packages/core/doompi-web-components/src/icons/icons.mjs";import{cn as N}from"./packages/core/doompi-web-components/src/lib/cn.mjs";import{Accordion as P,AccordionContent as F,AccordionItem as I,AccordionTrigger as L}from"./packages/core/doompi-web-components/src/components/Accordion.mjs";import{ansiSpans as R}from"./packages/core/doompi-web-components/src/lib/ansiSpans.mjs";import{AnsiLine as z,AnsiText as B}from"./packages/core/doompi-web-components/src/components/AnsiText.mjs";import{Avatar as V,AvatarFallback as H,AvatarImage as U}from"./packages/core/doompi-web-components/src/components/Avatar.mjs";import{Badge as W,badgeVariants as G}from"./packages/core/doompi-web-components/src/components/Badge.mjs";import{Tooltip as K,TooltipContent as q,TooltipProvider as J,TooltipTrigger as Y}from"./packages/core/doompi-web-components/src/components/Tooltip.mjs";import{BREADCRUMB_ELLIPSIS as X,Breadcrumb as Z,breadcrumbSegments as Q}from"./packages/core/doompi-web-components/src/components/Breadcrumb.mjs";import{Spinner as $}from"./packages/core/doompi-web-components/src/components/Spinner.mjs";import{Button as ee,buttonVariants as te}from"./packages/core/doompi-web-components/src/components/Button.mjs";import{Dialog as ne,DialogBody as re,DialogClose as ie,DialogContent as ae,DialogDescription as oe,DialogFooter as se,DialogHeader as ce,DialogTitle as le,DialogTrigger as ue,dialogFooterVariants as de}from"./packages/core/doompi-web-components/src/components/Dialog.mjs";import{buildReviewPrompt as fe,defaultReviewHeading as pe,diffGutterWidth as me,diffRangeOf as he,reviewCommentAnchor as ge,trimSnippet as _e}from"./packages/core/doompi-web-components/src/lib/review.mjs";import{DiffView as ve}from"./packages/core/doompi-web-components/src/components/DiffView.mjs";import{Dot as ye,dotVariants as be}from"./packages/core/doompi-web-components/src/components/Dot.mjs";import{Drawer as xe}from"./packages/core/doompi-web-components/src/components/Drawer.mjs";import{DropdownMenu as Se,DropdownMenuCheckboxItem as Ce,DropdownMenuContent as we,DropdownMenuGroup as Te,DropdownMenuItem as Ee,DropdownMenuLabel as De,DropdownMenuRadioGroup as Oe,DropdownMenuRadioItem as ke,DropdownMenuSeparator as Ae,DropdownMenuShortcut as je,DropdownMenuSub as Me,DropdownMenuSubContent as Ne,DropdownMenuSubTrigger as Pe,DropdownMenuTrigger as Fe,dropdownMenuItemVariants as Ie}from"./packages/core/doompi-web-components/src/components/DropdownMenu.mjs";import{Checkbox as Le}from"./packages/core/doompi-web-components/src/components/Checkbox.mjs";import{grammarKeyOf as Re}from"./packages/core/doompi-web-components/src/lib/editorLanguage.mjs";import{detectGrammar as ze,highlightToLines as Be,syntaxStyleOf as Ve}from"./packages/core/doompi-web-components/src/lib/syntaxHighlight.mjs";import{SyntaxLine as He,SyntaxText as Ue,useSyntaxLines as We}from"./packages/core/doompi-web-components/src/components/SyntaxText.mjs";import{CodeBlock as Ge}from"./packages/core/doompi-web-components/src/components/CodeBlock.mjs";import{Skeleton as Ke}from"./packages/core/doompi-web-components/src/components/Skeleton.mjs";import{CodeEditor as qe}from"./packages/core/doompi-web-components/src/components/CodeEditor.mjs";import{Collapsible as Je,CollapsibleContent as Ye,CollapsibleTrigger as Xe}from"./packages/core/doompi-web-components/src/components/Collapsible.mjs";import{Input as Ze,fieldVariants as Qe}from"./packages/core/doompi-web-components/src/components/Input.mjs";import{MAX_DIGIT_SHORTCUT as $e,handleOptionListKey as et,optionListHint as tt,optionMarker as nt}from"./packages/core/doompi-web-components/src/lib/optionList.mjs";import{OptionLabel as rt,OptionList as it,OptionRow as at,optionListVariants as ot,optionMarkerVariants as st,optionRowVariants as ct}from"./packages/core/doompi-web-components/src/components/OptionList.mjs";import{CommandDialog as lt,CommandEmpty as ut,CommandFooter as dt,CommandGroup as ft,CommandGroupLabel as pt,CommandHeader as mt,CommandInput as ht,CommandItem as gt,CommandItemLabel as _t,CommandList as vt}from"./packages/core/doompi-web-components/src/components/Command.mjs";import{EmptyState as yt}from"./packages/core/doompi-web-components/src/components/EmptyState.mjs";import{hashlineGroups as bt,hashlineGroupsKey as xt}from"./packages/core/doompi-web-components/src/lib/hashlineHighlight.mjs";import{HashlineLines as St}from"./packages/core/doompi-web-components/src/components/HashlineLines.mjs";import{Kbd as Ct}from"./packages/core/doompi-web-components/src/components/Kbd.mjs";import{McpToolFields as wt,McpToolFrame as Tt,McpToolOutput as Et}from"./packages/core/doompi-web-components/src/components/McpToolWidget.mjs";import{Label as Dt}from"./packages/core/doompi-web-components/src/components/Label.mjs";import{Markdown as Ot}from"./packages/core/doompi-web-components/src/components/Markdown.mjs";import{mediaKindOf as kt}from"./packages/core/doompi-web-components/src/lib/media.mjs";import{PdfPreview as At,resolvePdfViewportRegion as jt}from"./packages/core/doompi-web-components/src/components/PdfPreview.mjs";import{MediaPreview as Mt}from"./packages/core/doompi-web-components/src/components/MediaPreview.mjs";import{STATUS_EDGE as Nt,StatusBadge as Pt,statusBadgeVariants as Ft}from"./packages/core/doompi-web-components/src/components/StatusBadge.mjs";import{MessageItem as It,MessageItemBody as Lt,MessageItemGroup as Rt,MessageItemHeader as zt,MessageItemStatus as Bt,STATUS_GLYPH as Vt,STATUS_LABEL as Ht,messageItemRowVariants as Ut,messageItemStatusVariants as Wt,messageItemVariants as Gt,toolTone as Kt,useMessageItem as qt}from"./packages/core/doompi-web-components/src/components/MessageItem.mjs";import{MessageLines as Jt,messageLineVariants as Yt}from"./packages/core/doompi-web-components/src/components/MessageLines.mjs";import{Panel as Xt,PanelBody as Zt,PanelHeader as Qt}from"./packages/core/doompi-web-components/src/components/Panel.mjs";import{Popover as $t,PopoverAnchor as en,PopoverClose as tn,PopoverContent as nn,PopoverFooter as rn,PopoverHeader as an,PopoverTrigger as on}from"./packages/core/doompi-web-components/src/components/Popover.mjs";import{Progress as sn}from"./packages/core/doompi-web-components/src/components/Progress.mjs";import{RadioGroup as cn,RadioGroupCard as ln,RadioGroupItem as un}from"./packages/core/doompi-web-components/src/components/RadioGroup.mjs";import{Textarea as dn}from"./packages/core/doompi-web-components/src/components/Textarea.mjs";import{ReviewCommentDraft as fn}from"./packages/core/doompi-web-components/src/components/ReviewCommentDraft.mjs";import{ScrollArea as pn,ScrollBar as mn}from"./packages/core/doompi-web-components/src/components/ScrollArea.mjs";import{SectionLabel as hn}from"./packages/core/doompi-web-components/src/components/SectionLabel.mjs";import{Select as gn,SelectContent as _n,SelectGroup as vn,SelectItem as yn,SelectLabel as bn,SelectSeparator as xn,SelectTrigger as Sn,SelectValue as Cn}from"./packages/core/doompi-web-components/src/components/Select.mjs";import{Separator as wn}from"./packages/core/doompi-web-components/src/components/Separator.mjs";import{Sheet as Tn,SheetBody as En,SheetClose as Dn,SheetContent as On,SheetDescription as kn,SheetFooter as An,SheetHeader as jn,SheetOverlay as Mn,SheetTitle as Nn,SheetTrigger as Pn}from"./packages/core/doompi-web-components/src/components/Sheet.mjs";import{StreamCursor as Fn}from"./packages/core/doompi-web-components/src/components/StreamCursor.mjs";import{Switch as In}from"./packages/core/doompi-web-components/src/components/Switch.mjs";import{NavTab as Ln,NavTabBadge as Rn,Tabs as zn,TabsContent as Bn,TabsList as Vn,TabsTrigger as Hn,tabBadgeVariants as Un,tabVariants as Wn}from"./packages/core/doompi-web-components/src/components/Tabs.mjs";import{TerminalView as Gn}from"./packages/core/doompi-web-components/src/components/TerminalView.mjs";import{Toast as Kn,ToastAction as qn,ToastClose as Jn,ToastDescription as Yn,ToastProvider as Xn,ToastTitle as Zn,ToastViewport as Qn,toastVariants as $n}from"./packages/core/doompi-web-components/src/components/Toast.mjs";import{ToolPathLink as er}from"./packages/core/doompi-web-components/src/components/ToolPathLink.mjs";import{collapseLines as tr}from"./packages/core/doompi-web-components/src/lib/collapse.mjs";import{GREP_COLLAPSED_LINES as nr,READ_COLLAPSED_LINES as rr,compactDetails as ir,hashlineBody as ar,parseFileHeader as or,parseTaggedLine as sr,presentHashlineLines as cr,resultTextLines as lr,takeTrailingNotice as ur}from"./packages/core/doompi-web-components/src/lib/hashlineView.mjs";import{groupByDirectory as dr,groupRowLabel as fr}from"./packages/core/doompi-web-components/src/lib/pathGroups.mjs";import{CHIP_TO_STATUS as pr,LINE_TONE_TO_STATUS as mr,STATUS_TO_CHIP as hr,STATUS_TO_DOT as gr}from"./packages/core/doompi-web-components/src/lib/tone.mjs";import{MEDIA_KINDS as _r}from"./packages/core/doompi-web-components/src/types/editor.mjs";import{ACCENT_TONES as vr,CHIP_TONES as yr,DOT_TONES as br,MESSAGE_LINE_TONES as xr,STATUS_TONES as Sr}from"./packages/core/doompi-web-components/src/types/tone.mjs";export{vr as ACCENT_TONES,P as Accordion,F as AccordionContent,I as AccordionItem,L as AccordionTrigger,e as ActivityIcon,t as AlertIcon,z as AnsiLine,B as AnsiText,n as AudioLinesIcon,V as Avatar,H as AvatarFallback,U as AvatarImage,X as BREADCRUMB_ELLIPSIS,W as Badge,r as BookmarkPlusIcon,i as BranchIcon,Z as Breadcrumb,ee as Button,yr as CHIP_TONES,pr as CHIP_TO_STATUS,a as CheckIcon,Le as Checkbox,o as ChevronDownIcon,s as ChevronRightIcon,c as ChevronUpIcon,l as CloseIcon,Ge as CodeBlock,qe as CodeEditor,Je as Collapsible,Ye as CollapsibleContent,Xe as CollapsibleTrigger,lt as CommandDialog,ut as CommandEmpty,dt as CommandFooter,ft as CommandGroup,pt as CommandGroupLabel,mt as CommandHeader,ht as CommandInput,gt as CommandItem,_t as CommandItemLabel,vt as CommandList,u as CopyIcon,br as DOT_TONES,ne as Dialog,re as DialogBody,ie as DialogClose,ae as DialogContent,oe as DialogDescription,se as DialogFooter,ce as DialogHeader,le as DialogTitle,ue as DialogTrigger,ve as DiffView,ye as Dot,xe as Drawer,Se as DropdownMenu,Ce as DropdownMenuCheckboxItem,we as DropdownMenuContent,Te as DropdownMenuGroup,Ee as DropdownMenuItem,De as DropdownMenuLabel,Oe as DropdownMenuRadioGroup,ke as DropdownMenuRadioItem,Ae as DropdownMenuSeparator,je as DropdownMenuShortcut,Me as DropdownMenuSub,Ne as DropdownMenuSubContent,Pe as DropdownMenuSubTrigger,Fe as DropdownMenuTrigger,d as EditIcon,yt as EmptyState,f as EnterIcon,p as ExternalLinkIcon,m as FileIcon,h as ForkIcon,nr as GREP_COLLAPSED_LINES,g as GearIcon,St as HashlineLines,Ze as Input,Ct as Kbd,_ as KebabIcon,mr as LINE_TONE_TO_STATUS,Dt as Label,v as LoaderIcon,$e as MAX_DIGIT_SHORTCUT,_r as MEDIA_KINDS,xr as MESSAGE_LINE_TONES,Ot as Markdown,wt as McpToolFields,Tt as McpToolFrame,Et as McpToolOutput,Mt as MediaPreview,y as MessageIcon,It as MessageItem,Lt as MessageItemBody,Rt as MessageItemGroup,zt as MessageItemHeader,Bt as MessageItemStatus,Jt as MessageLines,b as MicIcon,Ln as NavTab,Rn as NavTabBadge,rt as OptionLabel,it as OptionList,at as OptionRow,x as PaletteIcon,Xt as Panel,Zt as PanelBody,Qt as PanelHeader,At as PdfPreview,S as PlusIcon,$t as Popover,en as PopoverAnchor,tn as PopoverClose,nn as PopoverContent,rn as PopoverFooter,an as PopoverHeader,on as PopoverTrigger,sn as Progress,C as QuoteIcon,rr as READ_COLLAPSED_LINES,cn as RadioGroup,ln as RadioGroupCard,un as RadioGroupItem,w as RefreshIcon,fn as ReviewCommentDraft,T as RewindIcon,Nt as STATUS_EDGE,Vt as STATUS_GLYPH,Ht as STATUS_LABEL,Sr as STATUS_TONES,hr as STATUS_TO_CHIP,gr as STATUS_TO_DOT,pn as ScrollArea,mn as ScrollBar,E as SearchIcon,hn as SectionLabel,gn as Select,_n as SelectContent,vn as SelectGroup,yn as SelectItem,bn as SelectLabel,xn as SelectSeparator,Sn as SelectTrigger,Cn as SelectValue,D as SendIcon,wn as Separator,Tn as Sheet,En as SheetBody,Dn as SheetClose,On as SheetContent,kn as SheetDescription,An as SheetFooter,jn as SheetHeader,Mn as SheetOverlay,Nn as SheetTitle,Pn as SheetTrigger,O as ShieldIcon,Ke as Skeleton,$ as Spinner,Pt as StatusBadge,k as StopIcon,Fn as StreamCursor,In as Switch,He as SyntaxLine,Ue as SyntaxText,zn as Tabs,Bn as TabsContent,Vn as TabsList,Hn as TabsTrigger,Gn as TerminalView,dn as Textarea,Kn as Toast,qn as ToastAction,Jn as ToastClose,Yn as ToastDescription,Xn as ToastProvider,Zn as ToastTitle,Qn as ToastViewport,er as ToolPathLink,K as Tooltip,q as TooltipContent,J as TooltipProvider,Y as TooltipTrigger,A as TrashIcon,j as UserIcon,M as VolumeIcon,R as ansiSpans,G as badgeVariants,Q as breadcrumbSegments,fe as buildReviewPrompt,te as buttonVariants,N as cn,tr as collapseLines,ir as compactDetails,pe as defaultReviewHeading,ze as detectGrammar,de as dialogFooterVariants,me as diffGutterWidth,he as diffRangeOf,be as dotVariants,Ie as dropdownMenuItemVariants,Qe as fieldVariants,Re as grammarKeyOf,dr as groupByDirectory,fr as groupRowLabel,et as handleOptionListKey,ar as hashlineBody,bt as hashlineGroups,xt as hashlineGroupsKey,Be as highlightToLines,kt as mediaKindOf,Ut as messageItemRowVariants,Wt as messageItemStatusVariants,Gt as messageItemVariants,Yt as messageLineVariants,tt as optionListHint,ot as optionListVariants,nt as optionMarker,st as optionMarkerVariants,ct as optionRowVariants,or as parseFileHeader,sr as parseTaggedLine,cr as presentHashlineLines,jt as resolvePdfViewportRegion,lr as resultTextLines,ge as reviewCommentAnchor,Ft as statusBadgeVariants,Ve as syntaxStyleOf,Un as tabBadgeVariants,Wn as tabVariants,ur as takeTrailingNotice,$n as toastVariants,Kt as toolTone,_e as trimSnippet,qt as useMessageItem,We as useSyntaxLines};
|
|
1
|
+
import{ActivityIcon as e,AlertIcon as t,AudioLinesIcon as n,BookmarkPlusIcon as r,BranchIcon as i,CheckIcon as a,ChevronDownIcon as o,ChevronRightIcon as s,ChevronUpIcon as c,CloseIcon as l,CopyIcon as u,EditIcon as d,EnterIcon as f,ExternalLinkIcon as p,FileIcon as m,ForkIcon as h,GearIcon as g,KebabIcon as _,LoaderIcon as v,MessageIcon as y,MicIcon as b,PaletteIcon as x,PlusIcon as S,QuoteIcon as C,RefreshIcon as w,RewindIcon as T,SearchIcon as E,SendIcon as D,ShieldIcon as O,StopIcon as k,TrashIcon as A,UserIcon as j,VolumeIcon as M}from"./packages/core/doompi-web-components/src/icons/icons.mjs";import{cn as N}from"./packages/core/doompi-web-components/src/lib/cn.mjs";import{Accordion as P,AccordionContent as F,AccordionItem as I,AccordionTrigger as L}from"./packages/core/doompi-web-components/src/components/Accordion.mjs";import{ansiSpans as R}from"./packages/core/doompi-web-components/src/lib/ansiSpans.mjs";import{AnsiLine as z,AnsiText as B}from"./packages/core/doompi-web-components/src/components/AnsiText.mjs";import{Avatar as V,AvatarFallback as H,AvatarImage as U}from"./packages/core/doompi-web-components/src/components/Avatar.mjs";import{Badge as W,badgeVariants as G}from"./packages/core/doompi-web-components/src/components/Badge.mjs";import{Tooltip as K,TooltipContent as q,TooltipProvider as J,TooltipTrigger as Y}from"./packages/core/doompi-web-components/src/components/Tooltip.mjs";import{BREADCRUMB_ELLIPSIS as X,Breadcrumb as Z,breadcrumbSegments as Q}from"./packages/core/doompi-web-components/src/components/Breadcrumb.mjs";import{Spinner as $}from"./packages/core/doompi-web-components/src/components/Spinner.mjs";import{Button as ee,buttonVariants as te}from"./packages/core/doompi-web-components/src/components/Button.mjs";import{Dialog as ne,DialogBody as re,DialogClose as ie,DialogContent as ae,DialogDescription as oe,DialogFooter as se,DialogHeader as ce,DialogTitle as le,DialogTrigger as ue,dialogFooterVariants as de}from"./packages/core/doompi-web-components/src/components/Dialog.mjs";import{buildReviewPrompt as fe,defaultReviewHeading as pe,diffGutterWidth as me,diffRangeOf as he,reviewCommentAnchor as ge,trimSnippet as _e}from"./packages/core/doompi-web-components/src/lib/review.mjs";import{DiffView as ve}from"./packages/core/doompi-web-components/src/components/DiffView.mjs";import{Dot as ye,dotVariants as be}from"./packages/core/doompi-web-components/src/components/Dot.mjs";import{Drawer as xe}from"./packages/core/doompi-web-components/src/components/Drawer.mjs";import{DropdownMenu as Se,DropdownMenuCheckboxItem as Ce,DropdownMenuContent as we,DropdownMenuGroup as Te,DropdownMenuItem as Ee,DropdownMenuLabel as De,DropdownMenuRadioGroup as Oe,DropdownMenuRadioItem as ke,DropdownMenuSeparator as Ae,DropdownMenuShortcut as je,DropdownMenuSub as Me,DropdownMenuSubContent as Ne,DropdownMenuSubTrigger as Pe,DropdownMenuTrigger as Fe,dropdownMenuItemVariants as Ie}from"./packages/core/doompi-web-components/src/components/DropdownMenu.mjs";import{Checkbox as Le}from"./packages/core/doompi-web-components/src/components/Checkbox.mjs";import{grammarKeyOf as Re}from"./packages/core/doompi-web-components/src/lib/editorLanguage.mjs";import{detectGrammar as ze,highlightToLines as Be,syntaxStyleOf as Ve}from"./packages/core/doompi-web-components/src/lib/syntaxHighlight.mjs";import{SyntaxLine as He,SyntaxText as Ue,useSyntaxLines as We}from"./packages/core/doompi-web-components/src/components/SyntaxText.mjs";import{CodeBlock as Ge}from"./packages/core/doompi-web-components/src/components/CodeBlock.mjs";import{Skeleton as Ke}from"./packages/core/doompi-web-components/src/components/Skeleton.mjs";import{CodeEditor as qe}from"./packages/core/doompi-web-components/src/components/CodeEditor.mjs";import{Collapsible as Je,CollapsibleContent as Ye,CollapsibleTrigger as Xe}from"./packages/core/doompi-web-components/src/components/Collapsible.mjs";import{Input as Ze,fieldVariants as Qe}from"./packages/core/doompi-web-components/src/components/Input.mjs";import{MAX_DIGIT_SHORTCUT as $e,handleOptionListKey as et,optionListHint as tt,optionMarker as nt}from"./packages/core/doompi-web-components/src/lib/optionList.mjs";import{OptionLabel as rt,OptionList as it,OptionRow as at,optionListVariants as ot,optionMarkerVariants as st,optionRowVariants as ct}from"./packages/core/doompi-web-components/src/components/OptionList.mjs";import{CommandDialog as lt,CommandEmpty as ut,CommandFooter as dt,CommandGroup as ft,CommandGroupLabel as pt,CommandHeader as mt,CommandInput as ht,CommandItem as gt,CommandItemLabel as _t,CommandList as vt}from"./packages/core/doompi-web-components/src/components/Command.mjs";import{EmptyState as yt}from"./packages/core/doompi-web-components/src/components/EmptyState.mjs";import{hashlineGroups as bt,hashlineGroupsKey as xt}from"./packages/core/doompi-web-components/src/lib/hashlineHighlight.mjs";import{HashlineLines as St}from"./packages/core/doompi-web-components/src/components/HashlineLines.mjs";import{Kbd as Ct}from"./packages/core/doompi-web-components/src/components/Kbd.mjs";import{McpToolFields as wt,McpToolFrame as Tt,McpToolOutput as Et}from"./packages/core/doompi-web-components/src/components/McpToolWidget.mjs";import{Label as Dt}from"./packages/core/doompi-web-components/src/components/Label.mjs";import{Markdown as Ot}from"./packages/core/doompi-web-components/src/components/Markdown.mjs";import{mediaKindOf as kt}from"./packages/core/doompi-web-components/src/lib/media.mjs";import{PdfPreview as At,resolvePdfViewportRegion as jt}from"./packages/core/doompi-web-components/src/components/PdfPreview.mjs";import{MediaPreview as Mt}from"./packages/core/doompi-web-components/src/components/MediaPreview.mjs";import{STATUS_EDGE as Nt,StatusBadge as Pt,statusBadgeVariants as Ft}from"./packages/core/doompi-web-components/src/components/StatusBadge.mjs";import{MessageItem as It,MessageItemBody as Lt,MessageItemGroup as Rt,MessageItemHeader as zt,MessageItemHeaderAccessoryContext as Bt,MessageItemStatus as Vt,STATUS_GLYPH as Ht,STATUS_LABEL as Ut,messageItemRowVariants as Wt,messageItemStatusVariants as Gt,messageItemVariants as Kt,toolTone as qt,useMessageItem as Jt}from"./packages/core/doompi-web-components/src/components/MessageItem.mjs";import{MessageLines as Yt,messageLineVariants as Xt}from"./packages/core/doompi-web-components/src/components/MessageLines.mjs";import{Panel as Zt,PanelBody as Qt,PanelHeader as $t}from"./packages/core/doompi-web-components/src/components/Panel.mjs";import{Popover as en,PopoverAnchor as tn,PopoverClose as nn,PopoverContent as rn,PopoverFooter as an,PopoverHeader as on,PopoverTrigger as sn}from"./packages/core/doompi-web-components/src/components/Popover.mjs";import{Progress as cn}from"./packages/core/doompi-web-components/src/components/Progress.mjs";import{RadioGroup as ln,RadioGroupCard as un,RadioGroupItem as dn}from"./packages/core/doompi-web-components/src/components/RadioGroup.mjs";import{Textarea as fn}from"./packages/core/doompi-web-components/src/components/Textarea.mjs";import{ReviewCommentDraft as pn}from"./packages/core/doompi-web-components/src/components/ReviewCommentDraft.mjs";import{ScrollArea as mn,ScrollBar as hn}from"./packages/core/doompi-web-components/src/components/ScrollArea.mjs";import{SectionLabel as gn}from"./packages/core/doompi-web-components/src/components/SectionLabel.mjs";import{Select as _n,SelectContent as vn,SelectGroup as yn,SelectItem as bn,SelectLabel as xn,SelectSeparator as Sn,SelectTrigger as Cn,SelectValue as wn}from"./packages/core/doompi-web-components/src/components/Select.mjs";import{Separator as Tn}from"./packages/core/doompi-web-components/src/components/Separator.mjs";import{Sheet as En,SheetBody as Dn,SheetClose as On,SheetContent as kn,SheetDescription as An,SheetFooter as jn,SheetHeader as Mn,SheetOverlay as Nn,SheetTitle as Pn,SheetTrigger as Fn}from"./packages/core/doompi-web-components/src/components/Sheet.mjs";import{StreamCursor as In}from"./packages/core/doompi-web-components/src/components/StreamCursor.mjs";import{Switch as Ln}from"./packages/core/doompi-web-components/src/components/Switch.mjs";import{NavTab as Rn,NavTabBadge as zn,Tabs as Bn,TabsContent as Vn,TabsList as Hn,TabsTrigger as Un,tabBadgeVariants as Wn,tabVariants as Gn}from"./packages/core/doompi-web-components/src/components/Tabs.mjs";import{TerminalView as Kn}from"./packages/core/doompi-web-components/src/components/TerminalView.mjs";import{Toast as qn,ToastAction as Jn,ToastClose as Yn,ToastDescription as Xn,ToastProvider as Zn,ToastTitle as Qn,ToastViewport as $n,toastVariants as er}from"./packages/core/doompi-web-components/src/components/Toast.mjs";import{ToolPathLink as tr}from"./packages/core/doompi-web-components/src/components/ToolPathLink.mjs";import{collapseLines as nr}from"./packages/core/doompi-web-components/src/lib/collapse.mjs";import{GREP_COLLAPSED_LINES as rr,READ_COLLAPSED_LINES as ir,compactDetails as ar,hashlineBody as or,parseFileHeader as sr,parseTaggedLine as cr,presentHashlineLines as lr,resultTextLines as ur,takeTrailingNotice as dr}from"./packages/core/doompi-web-components/src/lib/hashlineView.mjs";import{groupByDirectory as fr,groupRowLabel as pr}from"./packages/core/doompi-web-components/src/lib/pathGroups.mjs";import{CHIP_TO_STATUS as mr,LINE_TONE_TO_STATUS as hr,STATUS_TO_CHIP as gr,STATUS_TO_DOT as _r}from"./packages/core/doompi-web-components/src/lib/tone.mjs";import{MEDIA_KINDS as vr}from"./packages/core/doompi-web-components/src/types/editor.mjs";import{ACCENT_TONES as yr,CHIP_TONES as br,DOT_TONES as xr,MESSAGE_LINE_TONES as Sr,STATUS_TONES as Cr}from"./packages/core/doompi-web-components/src/types/tone.mjs";export{yr as ACCENT_TONES,P as Accordion,F as AccordionContent,I as AccordionItem,L as AccordionTrigger,e as ActivityIcon,t as AlertIcon,z as AnsiLine,B as AnsiText,n as AudioLinesIcon,V as Avatar,H as AvatarFallback,U as AvatarImage,X as BREADCRUMB_ELLIPSIS,W as Badge,r as BookmarkPlusIcon,i as BranchIcon,Z as Breadcrumb,ee as Button,br as CHIP_TONES,mr as CHIP_TO_STATUS,a as CheckIcon,Le as Checkbox,o as ChevronDownIcon,s as ChevronRightIcon,c as ChevronUpIcon,l as CloseIcon,Ge as CodeBlock,qe as CodeEditor,Je as Collapsible,Ye as CollapsibleContent,Xe as CollapsibleTrigger,lt as CommandDialog,ut as CommandEmpty,dt as CommandFooter,ft as CommandGroup,pt as CommandGroupLabel,mt as CommandHeader,ht as CommandInput,gt as CommandItem,_t as CommandItemLabel,vt as CommandList,u as CopyIcon,xr as DOT_TONES,ne as Dialog,re as DialogBody,ie as DialogClose,ae as DialogContent,oe as DialogDescription,se as DialogFooter,ce as DialogHeader,le as DialogTitle,ue as DialogTrigger,ve as DiffView,ye as Dot,xe as Drawer,Se as DropdownMenu,Ce as DropdownMenuCheckboxItem,we as DropdownMenuContent,Te as DropdownMenuGroup,Ee as DropdownMenuItem,De as DropdownMenuLabel,Oe as DropdownMenuRadioGroup,ke as DropdownMenuRadioItem,Ae as DropdownMenuSeparator,je as DropdownMenuShortcut,Me as DropdownMenuSub,Ne as DropdownMenuSubContent,Pe as DropdownMenuSubTrigger,Fe as DropdownMenuTrigger,d as EditIcon,yt as EmptyState,f as EnterIcon,p as ExternalLinkIcon,m as FileIcon,h as ForkIcon,rr as GREP_COLLAPSED_LINES,g as GearIcon,St as HashlineLines,Ze as Input,Ct as Kbd,_ as KebabIcon,hr as LINE_TONE_TO_STATUS,Dt as Label,v as LoaderIcon,$e as MAX_DIGIT_SHORTCUT,vr as MEDIA_KINDS,Sr as MESSAGE_LINE_TONES,Ot as Markdown,wt as McpToolFields,Tt as McpToolFrame,Et as McpToolOutput,Mt as MediaPreview,y as MessageIcon,It as MessageItem,Lt as MessageItemBody,Rt as MessageItemGroup,zt as MessageItemHeader,Bt as MessageItemHeaderAccessoryContext,Vt as MessageItemStatus,Yt as MessageLines,b as MicIcon,Rn as NavTab,zn as NavTabBadge,rt as OptionLabel,it as OptionList,at as OptionRow,x as PaletteIcon,Zt as Panel,Qt as PanelBody,$t as PanelHeader,At as PdfPreview,S as PlusIcon,en as Popover,tn as PopoverAnchor,nn as PopoverClose,rn as PopoverContent,an as PopoverFooter,on as PopoverHeader,sn as PopoverTrigger,cn as Progress,C as QuoteIcon,ir as READ_COLLAPSED_LINES,ln as RadioGroup,un as RadioGroupCard,dn as RadioGroupItem,w as RefreshIcon,pn as ReviewCommentDraft,T as RewindIcon,Nt as STATUS_EDGE,Ht as STATUS_GLYPH,Ut as STATUS_LABEL,Cr as STATUS_TONES,gr as STATUS_TO_CHIP,_r as STATUS_TO_DOT,mn as ScrollArea,hn as ScrollBar,E as SearchIcon,gn as SectionLabel,_n as Select,vn as SelectContent,yn as SelectGroup,bn as SelectItem,xn as SelectLabel,Sn as SelectSeparator,Cn as SelectTrigger,wn as SelectValue,D as SendIcon,Tn as Separator,En as Sheet,Dn as SheetBody,On as SheetClose,kn as SheetContent,An as SheetDescription,jn as SheetFooter,Mn as SheetHeader,Nn as SheetOverlay,Pn as SheetTitle,Fn as SheetTrigger,O as ShieldIcon,Ke as Skeleton,$ as Spinner,Pt as StatusBadge,k as StopIcon,In as StreamCursor,Ln as Switch,He as SyntaxLine,Ue as SyntaxText,Bn as Tabs,Vn as TabsContent,Hn as TabsList,Un as TabsTrigger,Kn as TerminalView,fn as Textarea,qn as Toast,Jn as ToastAction,Yn as ToastClose,Xn as ToastDescription,Zn as ToastProvider,Qn as ToastTitle,$n as ToastViewport,tr as ToolPathLink,K as Tooltip,q as TooltipContent,J as TooltipProvider,Y as TooltipTrigger,A as TrashIcon,j as UserIcon,M as VolumeIcon,R as ansiSpans,G as badgeVariants,Q as breadcrumbSegments,fe as buildReviewPrompt,te as buttonVariants,N as cn,nr as collapseLines,ar as compactDetails,pe as defaultReviewHeading,ze as detectGrammar,de as dialogFooterVariants,me as diffGutterWidth,he as diffRangeOf,be as dotVariants,Ie as dropdownMenuItemVariants,Qe as fieldVariants,Re as grammarKeyOf,fr as groupByDirectory,pr as groupRowLabel,et as handleOptionListKey,or as hashlineBody,bt as hashlineGroups,xt as hashlineGroupsKey,Be as highlightToLines,kt as mediaKindOf,Wt as messageItemRowVariants,Gt as messageItemStatusVariants,Kt as messageItemVariants,Xt as messageLineVariants,tt as optionListHint,ot as optionListVariants,nt as optionMarker,st as optionMarkerVariants,ct as optionRowVariants,sr as parseFileHeader,cr as parseTaggedLine,lr as presentHashlineLines,jt as resolvePdfViewportRegion,ur as resultTextLines,ge as reviewCommentAnchor,Ft as statusBadgeVariants,Ve as syntaxStyleOf,Wn as tabBadgeVariants,Gn as tabVariants,dr as takeTrailingNotice,er as toastVariants,qt as toolTone,_e as trimSnippet,Jt as useMessageItem,We as useSyntaxLines};
|
|
@@ -10,8 +10,11 @@ import { VariantProps } from "class-variance-authority";
|
|
|
10
10
|
* this, and so is the cockpit's own fallback item, which is what keeps them
|
|
11
11
|
* looking alike.
|
|
12
12
|
*/
|
|
13
|
+
/** The next item captures this accessory for its header, without passing it to nested items. */
|
|
14
|
+
export declare const MessageItemHeaderAccessoryContext: import("react").Context<ReactNode>;
|
|
13
15
|
export interface MessageItemState {
|
|
14
16
|
tone: StatusTone;
|
|
17
|
+
headerAccessory?: ReactNode;
|
|
15
18
|
/** Whether the header offers the toggle; an item that hides nothing offers none. */
|
|
16
19
|
expandable: boolean;
|
|
17
20
|
expanded: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageItem.d.mts","names":[],"sources":["../../../../../../src/components/MessageItem.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageItem.d.mts","names":[],"sources":["../../../../../../src/components/MessageItem.tsx"],"mappings":";;;;;;;;;;;;;qBAkBa,mDAAiC,QAAA;iBAE7B;EACf,MAAM;EACN,kBAAkB;;EAElB;EACA;EACA;;;wBAWc,kBAAkB;;qBAarB,sBAAmB;;6CAG9B;;qBAGW,yBAAsB;;6CAGjC;iBAEe,yBACP,KAAK,oCAAoC,oBAAoB;;EAErE;EACA;;EAEA;EACA,oBAAoB;;EAEpB,WAAW,cAAc,OAAO,qBAAqB;;wBAGvC,cACd,WACA,MACA,YACA,iBACA,UACA,kBACA,aACG,SACF,mCAAgB,IAAA;iBAkCF,8BACP,KAAK,iCAAiC,oBAAoB;;EAElE,OAAO;;EAEP,UAAU;;EAEV,QAAQ;EACR,WAAW;;;;;;;;;;;;wBAaG,mBACd,WACA,MACA,OACA,SACA,OACA,aACG,SACF,wCAAqB,IAAA;;wBAiBR,SAAS;EAAS;EAAkB;IAAqB;;qBAK5D,cAAc,SAAS,OAAO;iBAS1B,+BAA+B,KAAK;;EAEnD,OAAO;;EAEP,QAAQ;;EAER,WAAW;;;;;;;;;;;wBAeG,oBAAoB,WAAW,OAAO,OAAO,aAAa,SAAS,yCAAsB,IAAA;;wBAuCzF,kBAAkB,cAAc,SAAS,wCAAqB,IAAA;;qBAWjE,cAAc,SAAS,OAAO;qBAS9B,4BAAyB;;6CAYpC;iBAEe,+BAA+B,wBAAwB,oBAAoB;;EAE1F;;EAEA;;;wBAIc,oBACd,WACA,MACA,OACA,SACA,aACG,SACF,yCAAsB,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ChevronDownIcon as e,ChevronUpIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Button as r}from"./Button.mjs";import{STATUS_EDGE as i,StatusBadge as a}from"./StatusBadge.mjs";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{createContext as l,useContext as u,useState as d}from"react";import{cva as f}from"class-variance-authority";const p=l({tone:`neutral`,expandable:!1,expanded:!1,toggle:()=>void 0});function
|
|
1
|
+
import{ChevronDownIcon as e,ChevronUpIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Button as r}from"./Button.mjs";import{STATUS_EDGE as i,StatusBadge as a}from"./StatusBadge.mjs";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{createContext as l,useContext as u,useState as d}from"react";import{cva as f}from"class-variance-authority";const p=l(null),m=l({tone:`neutral`,expandable:!1,expanded:!1,toggle:()=>void 0});function h(){return u(m)}const g=l(null),_=f(`overflow-hidden rounded-md border bg-doom-panel transition-colors`,{variants:{tone:i},defaultVariants:{tone:`neutral`}}),v=f(`overflow-hidden border-l-2 transition-colors`,{variants:{tone:i},defaultVariants:{tone:`neutral`}});function y({className:e,tone:t,expandable:r=!1,defaultExpanded:i=!1,expanded:a,onExpandedChange:o,children:c,...l}){let[f,h]=d(i),y=u(g),b=u(p),x=y!==null,S=a??f,C={tone:t??`neutral`,headerAccessory:b,expandable:r,expanded:S,toggle:()=>{let e=!S;a===void 0&&h(e),o?.(e)}};return/* @__PURE__ */ s(m.Provider,{value:C,children:/* @__PURE__ */ s(p,{value:null,children:/* @__PURE__ */ s(`div`,{"data-slot":`message-item`,"data-expanded":S,"data-grouped":x,className:n(x?v({tone:t}):_({tone:t}),e),...l,children:typeof c==`function`?c(C):c})})})}function b({className:e,tone:t,title:r,summary:i,badge:o,children:l,...u}){let d=o===void 0?S[t??`neutral`]:o;return/* @__PURE__ */ s(g.Provider,{value:{tone:t??`neutral`},children:/* @__PURE__ */ c(`div`,{"data-slot":`message-item-group`,className:n(_({tone:t}),e),...u,children:[/* @__PURE__ */ c(`div`,{className:`flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim`,children:[/* @__PURE__ */ s(`span`,{className:`shrink-0 font-bold text-doom-hi`,children:r}),/* @__PURE__ */ s(`span`,{className:`min-w-0 flex-1 truncate text-doom-faint`,children:i}),d!==null&&d!==``?/* @__PURE__ */ s(a,{tone:t??`neutral`,children:d}):null]}),/* @__PURE__ */ s(`div`,{className:`flex flex-col divide-y divide-doom-border-soft`,children:l})]})})}function x(e){return e.running?`running`:e.isError?`error`:`ok`}const S={neutral:``,running:`RUNNING`,ok:`OK`,error:`ERROR`,info:`INFO`,accent:`NOTE`},C=/* @__PURE__ */ new Set([`ok`,`neutral`]);function w({className:i,title:o,badge:l,children:d,...f}){let{headerAccessory:p,tone:m,expandable:_,expanded:v,toggle:y}=h(),b=u(g),x=b!==null&&C.has(m)?null:S[m],w=l===void 0?x:l;return/* @__PURE__ */ c(`div`,{"data-slot":`message-item-header`,className:n(`flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim`,i),...f,children:[b===null?/* @__PURE__ */ s(`span`,{className:`shrink-0 font-bold text-doom-hi`,children:o}):null,/* @__PURE__ */ s(`div`,{"data-slot":`message-item-summary`,className:`flex min-w-0 flex-1 items-center gap-2`,children:d}),p,w!==null&&w!==``?/* @__PURE__ */ s(a,{tone:m,"data-testid":`tool-status`,children:w}):null,_?/* @__PURE__ */ s(r,{variant:`ghost`,size:`icon`,"data-testid":`tool-expand`,"aria-expanded":v,"aria-label":v?`collapse`:`expand`,onClick:y,className:`text-doom-faint hover:text-doom-blue`,children:s(v?t:e,{className:`h-3 w-3`})}):null]})}function T({className:e,...t}){return/* @__PURE__ */ s(`div`,{"data-slot":`message-item-body`,className:n(`border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim`,e),...t})}const E={neutral:`…`,running:`◐`,ok:`✓`,error:`✗`,info:`●`,accent:`●`},D=f(`shrink-0`,{variants:{tone:{neutral:`text-doom-faint`,running:`text-doom-yellow`,ok:`text-doom-green`,error:`text-doom-red`,info:`text-doom-blue`,accent:`text-doom-magenta`}},defaultVariants:{tone:`neutral`}});function O({className:e,tone:t,glyph:r,expands:i=!1,children:a,...l}){let{toggle:u}=h(),d=/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ s(`span`,{className:D({tone:t}),children:r??E[t??`neutral`]}),/* @__PURE__ */ s(`span`,{children:a})]});return i?/* @__PURE__ */ s(`button`,{type:`button`,"data-slot":`message-item-status`,"data-testid":`tool-more`,onClick:u,className:n(`flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue`,e),children:d}):/* @__PURE__ */ s(`span`,{"data-slot":`message-item-status`,className:n(`flex items-center gap-1.5 text-doom-faint`,e),...l,children:d})}export{y as MessageItem,T as MessageItemBody,b as MessageItemGroup,w as MessageItemHeader,p as MessageItemHeaderAccessoryContext,O as MessageItemStatus,E as STATUS_GLYPH,S as STATUS_LABEL,v as messageItemRowVariants,D as messageItemStatusVariants,_ as messageItemVariants,x as toolTone,h as useMessageItem};
|
|
2
2
|
//# sourceMappingURL=MessageItem.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageItem.mjs","names":["MessageItemContext","createContext","useMessageItem","useContext","MessageItemGroupContext","messageItemVariants","cva","STATUS_EDGE","messageItemRowVariants","MessageItem","props","own","setOwn","useState","defaultExpanded","grouped","current","expanded","state","tone","next","onExpandedChange","cn","className","children","MessageItemGroup","label","badge","STATUS_LABEL","title","summary","StatusBadge","toolTone","SILENT_IN_GROUP","MessageItemHeader","group","defaultLabel","expandable","Button","toggle","jsx","ChevronUpIcon","ChevronDownIcon","MessageItemBody","STATUS_GLYPH","messageItemStatusVariants","MessageItemStatus","content","Fragment","glyph","expands"],"sources":["../../../../../../src/components/MessageItem.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, type ReactNode, useContext, useState } from 'react';\n\nimport { ChevronDownIcon, ChevronUpIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\nimport { STATUS_EDGE, StatusBadge, type StatusTone } from './StatusBadge';\n\n/**\n * The message item: the timeline card a tool call, a run, or a notice sits\n * in. The item owns its outcome tone and its expand state; the header, body,\n * and status parts read both from it, so a card composes the parts and never\n * threads `expanded` by hand. A tool message in a web plugin is built from\n * this, and so is the cockpit's own fallback item, which is what keeps them\n * looking alike.\n */\n\nexport interface MessageItemState {\n tone: StatusTone;\n /** Whether the header offers the toggle; an item that hides nothing offers none. */\n expandable: boolean;\n expanded: boolean;\n toggle: () => void;\n}\n\nconst MessageItemContext = createContext<MessageItemState>({\n tone: 'neutral',\n expandable: false,\n expanded: false,\n toggle: () => undefined,\n});\n\n/** The enclosing item's state, for a part that lives deeper than the item's render prop. */\nexport function useMessageItem(): MessageItemState {\n return useContext(MessageItemContext);\n}\n\n/**\n * The group an item is a row of, or null for an item that is a card of its\n * own. A row drops the frame the group already draws and keeps its tone as an\n * edge down its left side, and it stops repeating what the group's header has\n * said once: the tool's name, and an outcome the whole run shares.\n */\nconst MessageItemGroupContext = createContext<{ tone: StatusTone } | null>(null);\n\n/** The frame, wearing the edge STATUS_EDGE names for the tone, so the two never drift apart. */\nexport const messageItemVariants = cva('overflow-hidden rounded-md border bg-doom-panel transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\n/** The same tone as a row: no card, one coloured edge, and the group's separators between rows. */\nexport const messageItemRowVariants = cva('overflow-hidden border-l-2 transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemProps\n extends Omit<ComponentProps<'div'>, 'children'>, VariantProps<typeof messageItemVariants> {\n /** Whether the header offers the expand toggle. A toggle that reveals nothing reads as broken, so the card decides. */\n expandable?: boolean;\n defaultExpanded?: boolean;\n /** Controlled mode; pair with onExpandedChange. Omit it and the item keeps its own state. */\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Plain content, or a function of the item's state for a card that picks its lines by `expanded`. */\n children?: ReactNode | ((state: MessageItemState) => ReactNode);\n}\n\nexport function MessageItem({\n className,\n tone,\n expandable = false,\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n children,\n ...props\n}: MessageItemProps) {\n const [own, setOwn] = useState(defaultExpanded);\n const group = useContext(MessageItemGroupContext);\n const grouped = group !== null;\n const current = expanded ?? own;\n const state: MessageItemState = {\n tone: tone ?? 'neutral',\n expandable,\n expanded: current,\n toggle: () => {\n const next = !current;\n if (expanded === undefined) setOwn(next);\n onExpandedChange?.(next);\n },\n };\n return (\n <MessageItemContext.Provider value={state}>\n <div\n data-slot=\"message-item\"\n data-expanded={current}\n data-grouped={grouped}\n className={cn(grouped ? messageItemRowVariants({ tone }) : messageItemVariants({ tone }), className)}\n {...props}\n >\n {typeof children === 'function' ? children(state) : children}\n </div>\n </MessageItemContext.Provider>\n );\n}\n\nexport interface MessageItemGroupProps\n extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof messageItemVariants> {\n /** The bold label at the left of the group header: the tool the run belongs to. */\n title: ReactNode;\n /** The line beside it, such as how many calls the group holds. */\n summary?: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n children?: ReactNode;\n}\n\n/**\n * One frame around a run of items that belong together.\n *\n * A transcript that calls the same tool five times in a row is five identical\n * frames, five gutter labels and five gaps, and the repetition reads louder\n * than the commands do. The group draws the frame once and each item inside it\n * becomes a row: same header, same expand, no card of its own. The tone still\n * belongs to the row, as an edge, so a failure in the middle of a run is not\n * flattened into the group's own outcome.\n */\nexport function MessageItemGroup({\n className,\n tone,\n title,\n summary,\n badge,\n children,\n ...props\n}: MessageItemGroupProps) {\n const label = badge === undefined ? STATUS_LABEL[tone ?? 'neutral'] : badge;\n return (\n <MessageItemGroupContext.Provider value={{ tone: tone ?? 'neutral' }}>\n <div data-slot=\"message-item-group\" className={cn(messageItemVariants({ tone }), className)} {...props}>\n <div className=\"flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim\">\n <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-faint\">{summary}</span>\n {label !== null && label !== '' ? <StatusBadge tone={tone ?? 'neutral'}>{label}</StatusBadge> : null}\n </div>\n <div className=\"flex flex-col divide-y divide-doom-border-soft\">{children}</div>\n </div>\n </MessageItemGroupContext.Provider>\n );\n}\n\n/** The tone a tool call's item wears: running while the tool runs, then its outcome. */\nexport function toolTone(state: { running: boolean; isError: boolean }): StatusTone {\n return state.running ? 'running' : state.isError ? 'error' : 'ok';\n}\n\n/** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */\nexport const STATUS_LABEL: Readonly<Record<StatusTone, string>> = {\n neutral: '',\n running: 'RUNNING',\n ok: 'OK',\n error: 'ERROR',\n info: 'INFO',\n accent: 'NOTE',\n};\n\nexport interface MessageItemHeaderProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** The bold label at the left: the tool name. */\n title: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n /** The summary beside the title; it gets the remaining width. */\n children?: ReactNode;\n}\n\n/** Inside a group these two are the quiet outcome: the group's header has already said it. */\nconst SILENT_IN_GROUP: ReadonlySet<StatusTone> = new Set<StatusTone>(['ok', 'neutral']);\n\n/**\n * The title row: label, summary, the tone's badge, and the expand toggle when\n * the item is expandable.\n *\n * A row inside a group says less. The group's header has already named the\n * tool and stated the run's outcome, so the row drops its title and speaks up\n * only when something went wrong or is still going: five OK badges down a run\n * of five are noise, and the one ERROR among them is the point.\n */\nexport function MessageItemHeader({ className, title, badge, children, ...props }: MessageItemHeaderProps) {\n const { tone, expandable, expanded, toggle } = useMessageItem();\n const group = useContext(MessageItemGroupContext);\n const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];\n const label = badge === undefined ? defaultLabel : badge;\n return (\n <div\n data-slot=\"message-item-header\"\n className={cn('flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim', className)}\n {...props}\n >\n {group === null ? <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span> : null}\n <div data-slot=\"message-item-summary\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n {children}\n </div>\n {label !== null && label !== '' ? (\n <StatusBadge tone={tone} data-testid=\"tool-status\">\n {label}\n </StatusBadge>\n ) : null}\n {expandable ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"tool-expand\"\n aria-expanded={expanded}\n aria-label={expanded ? 'collapse' : 'expand'}\n onClick={toggle}\n className=\"text-doom-faint hover:text-doom-blue\"\n >\n {expanded ? <ChevronUpIcon className=\"h-3 w-3\" /> : <ChevronDownIcon className=\"h-3 w-3\" />}\n </Button>\n ) : null}\n </div>\n );\n}\n\n/** The recessed body under the header. */\nexport function MessageItemBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"message-item-body\"\n className={cn('border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim', className)}\n {...props}\n />\n );\n}\n\n/** The glyph a tone reads as in a status line. */\nexport const STATUS_GLYPH: Readonly<Record<StatusTone, string>> = {\n neutral: '…',\n running: '◐',\n ok: '✓',\n error: '✗',\n info: '●',\n accent: '●',\n};\n\nexport const messageItemStatusVariants = cva('shrink-0', {\n variants: {\n tone: {\n neutral: 'text-doom-faint',\n running: 'text-doom-yellow',\n ok: 'text-doom-green',\n error: 'text-doom-red',\n info: 'text-doom-blue',\n accent: 'text-doom-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemStatusProps extends ComponentProps<'span'>, VariantProps<typeof messageItemStatusVariants> {\n /** Replaces the tone's glyph. */\n glyph?: string;\n /** Renders as a button that expands the item: the \"N more line(s)\" hint. Only className carries over. */\n expands?: boolean;\n}\n\n/** The one-line status under a body: `◐ running`, `✗ failed`, `✓ done`, or the hint that more is hidden. */\nexport function MessageItemStatus({\n className,\n tone,\n glyph,\n expands = false,\n children,\n ...props\n}: MessageItemStatusProps) {\n const { toggle } = useMessageItem();\n const content = (\n <>\n <span className={messageItemStatusVariants({ tone })}>{glyph ?? STATUS_GLYPH[tone ?? 'neutral']}</span>\n <span>{children}</span>\n </>\n );\n if (expands) {\n return (\n <button\n type=\"button\"\n data-slot=\"message-item-status\"\n data-testid=\"tool-more\"\n onClick={toggle}\n className={cn(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue',\n className,\n )}\n >\n {content}\n </button>\n );\n }\n return (\n <span\n data-slot=\"message-item-status\"\n className={cn('flex items-center gap-1.5 text-doom-faint', className)}\n {...props}\n >\n {content}\n </span>\n );\n}\n"],"mappings":"qYAyBA,MAAMA,EAAqBC,EAAgC,CACzD,KAAM,UACN,WAAY,GACZ,SAAU,GACV,WAAc,IAAA,EAChB,CAAC,EAGD,SAAgBC,GAAmC,CACjD,OAAOC,EAAWH,CAAkB,CACtC,CAQA,MAAMI,EAA0BH,EAA2C,IAAI,EAGlEI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f,aAAYA,EAAW,WAAa,SACpC,QAASsB,EACT,UAAU,uCAET,SAAWC,EAAXvB,EAAYwB,EAAwCC,EAAzC,CAAe,UAAU,SAAW,CAA0C,CACpF,CAAA,EACN,IACD,GAET,CAGA,SAAgBC,EAAgB,CAAE,YAAW,GAAGjC,GAAgC,CAC9E,MACE,kBAAC,MAAD,CACE,YAAU,oBACV,UAAWY,EAAG,gFAAiFC,CAAS,EACxG,GAAIb,CACL,CAAA,CAEL,CAGA,MAAakC,EAAqD,CAChE,QAAS,IACT,QAAS,IACT,GAAI,IACJ,MAAO,IACP,KAAM,IACN,OAAQ,GACV,EAEaC,EAA4BvC,EAAI,WAAY,CACvD,SAAU,CACR,KAAM,CACJ,QAAS,kBACT,QAAS,mBACT,GAAI,kBACJ,MAAO,gBACP,KAAM,iBACN,OAAQ,mBACV,CACF,EACA,gBAAiB,CAAE,KAAM,SAAU,CACrC,CAAC,EAUD,SAAgBwC,EAAkB,CAChC,YACA,OACA,QACA,UAAU,GACV,WACA,GAAGpC,GACsB,CACzB,GAAM,CAAE,UAAWR,EAAe,EAC5B6C,EACJ,kBAAAC,EAAA,CAAA,SAAA,CACE,kBAAC,OAAD,CAAM,UAAWH,EAA0B,CAAE,MAAK,CAAC,EAAI,SAAAI,GAASL,EAAazB,GAAQ,UAAiB,CAAA,EACtG,kBAAC,OAAD,CAAO,UAAe,CAAA,CACtB,CAAA,CAAA,EAkBJ,OAhBI+B,EAEA,kBAAC,SAAD,CACE,KAAK,SACL,YAAU,sBACV,cAAY,YACZ,QAASX,EACT,UAAWjB,EACT,gGACAC,CACF,EAEC,SAAAwB,CACK,CAAA,EAIV,kBAAC,OAAD,CACE,YAAU,sBACV,UAAWzB,EAAG,4CAA6CC,CAAS,EACpE,GAAIb,EAEH,SAAAqC,CACG,CAAA,CAEV"}
|
|
1
|
+
{"version":3,"file":"MessageItem.mjs","names":["MessageItemHeaderAccessoryContext","createContext","MessageItemContext","useMessageItem","useContext","MessageItemGroupContext","messageItemVariants","cva","STATUS_EDGE","messageItemRowVariants","MessageItem","props","own","setOwn","useState","defaultExpanded","group","headerAccessory","grouped","current","expanded","state","tone","next","onExpandedChange","cn","className","children","MessageItemGroup","label","badge","STATUS_LABEL","title","summary","StatusBadge","toolTone","SILENT_IN_GROUP","MessageItemHeader","defaultLabel","expandable","Button","toggle","jsx","ChevronUpIcon","ChevronDownIcon","MessageItemBody","STATUS_GLYPH","messageItemStatusVariants","MessageItemStatus","content","Fragment","glyph","expands"],"sources":["../../../../../../src/components/MessageItem.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, type ReactNode, useContext, useState } from 'react';\n\nimport { ChevronDownIcon, ChevronUpIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\nimport { STATUS_EDGE, StatusBadge, type StatusTone } from './StatusBadge';\n\n/**\n * The message item: the timeline card a tool call, a run, or a notice sits\n * in. The item owns its outcome tone and its expand state; the header, body,\n * and status parts read both from it, so a card composes the parts and never\n * threads `expanded` by hand. A tool message in a web plugin is built from\n * this, and so is the cockpit's own fallback item, which is what keeps them\n * looking alike.\n */\n\n/** The next item captures this accessory for its header, without passing it to nested items. */\nexport const MessageItemHeaderAccessoryContext = createContext<ReactNode>(null);\n\nexport interface MessageItemState {\n tone: StatusTone;\n headerAccessory?: ReactNode;\n /** Whether the header offers the toggle; an item that hides nothing offers none. */\n expandable: boolean;\n expanded: boolean;\n toggle: () => void;\n}\n\nconst MessageItemContext = createContext<MessageItemState>({\n tone: 'neutral',\n expandable: false,\n expanded: false,\n toggle: () => undefined,\n});\n\n/** The enclosing item's state, for a part that lives deeper than the item's render prop. */\nexport function useMessageItem(): MessageItemState {\n return useContext(MessageItemContext);\n}\n\n/**\n * The group an item is a row of, or null for an item that is a card of its\n * own. A row drops the frame the group already draws and keeps its tone as an\n * edge down its left side, and it stops repeating what the group's header has\n * said once: the tool's name, and an outcome the whole run shares.\n */\nconst MessageItemGroupContext = createContext<{ tone: StatusTone } | null>(null);\n\n/** The frame, wearing the edge STATUS_EDGE names for the tone, so the two never drift apart. */\nexport const messageItemVariants = cva('overflow-hidden rounded-md border bg-doom-panel transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\n/** The same tone as a row: no card, one coloured edge, and the group's separators between rows. */\nexport const messageItemRowVariants = cva('overflow-hidden border-l-2 transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemProps\n extends Omit<ComponentProps<'div'>, 'children'>, VariantProps<typeof messageItemVariants> {\n /** Whether the header offers the expand toggle. A toggle that reveals nothing reads as broken, so the card decides. */\n expandable?: boolean;\n defaultExpanded?: boolean;\n /** Controlled mode; pair with onExpandedChange. Omit it and the item keeps its own state. */\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Plain content, or a function of the item's state for a card that picks its lines by `expanded`. */\n children?: ReactNode | ((state: MessageItemState) => ReactNode);\n}\n\nexport function MessageItem({\n className,\n tone,\n expandable = false,\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n children,\n ...props\n}: MessageItemProps) {\n const [own, setOwn] = useState(defaultExpanded);\n const group = useContext(MessageItemGroupContext);\n const headerAccessory = useContext(MessageItemHeaderAccessoryContext);\n const grouped = group !== null;\n const current = expanded ?? own;\n const state: MessageItemState = {\n tone: tone ?? 'neutral',\n headerAccessory,\n expandable,\n expanded: current,\n toggle: () => {\n const next = !current;\n if (expanded === undefined) setOwn(next);\n onExpandedChange?.(next);\n },\n };\n return (\n <MessageItemContext.Provider value={state}>\n <MessageItemHeaderAccessoryContext value={null}>\n <div\n data-slot=\"message-item\"\n data-expanded={current}\n data-grouped={grouped}\n className={cn(grouped ? messageItemRowVariants({ tone }) : messageItemVariants({ tone }), className)}\n {...props}\n >\n {typeof children === 'function' ? children(state) : children}\n </div>\n </MessageItemHeaderAccessoryContext>\n </MessageItemContext.Provider>\n );\n}\n\nexport interface MessageItemGroupProps\n extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof messageItemVariants> {\n /** The bold label at the left of the group header: the tool the run belongs to. */\n title: ReactNode;\n /** The line beside it, such as how many calls the group holds. */\n summary?: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n children?: ReactNode;\n}\n\n/**\n * One frame around a run of items that belong together.\n *\n * A transcript that calls the same tool five times in a row is five identical\n * frames, five gutter labels and five gaps, and the repetition reads louder\n * than the commands do. The group draws the frame once and each item inside it\n * becomes a row: same header, same expand, no card of its own. The tone still\n * belongs to the row, as an edge, so a failure in the middle of a run is not\n * flattened into the group's own outcome.\n */\nexport function MessageItemGroup({\n className,\n tone,\n title,\n summary,\n badge,\n children,\n ...props\n}: MessageItemGroupProps) {\n const label = badge === undefined ? STATUS_LABEL[tone ?? 'neutral'] : badge;\n return (\n <MessageItemGroupContext.Provider value={{ tone: tone ?? 'neutral' }}>\n <div data-slot=\"message-item-group\" className={cn(messageItemVariants({ tone }), className)} {...props}>\n <div className=\"flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim\">\n <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-faint\">{summary}</span>\n {label !== null && label !== '' ? <StatusBadge tone={tone ?? 'neutral'}>{label}</StatusBadge> : null}\n </div>\n <div className=\"flex flex-col divide-y divide-doom-border-soft\">{children}</div>\n </div>\n </MessageItemGroupContext.Provider>\n );\n}\n\n/** The tone a tool call's item wears: running while the tool runs, then its outcome. */\nexport function toolTone(state: { running: boolean; isError: boolean }): StatusTone {\n return state.running ? 'running' : state.isError ? 'error' : 'ok';\n}\n\n/** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */\nexport const STATUS_LABEL: Readonly<Record<StatusTone, string>> = {\n neutral: '',\n running: 'RUNNING',\n ok: 'OK',\n error: 'ERROR',\n info: 'INFO',\n accent: 'NOTE',\n};\n\nexport interface MessageItemHeaderProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** The bold label at the left: the tool name. */\n title: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n /** The summary beside the title; it gets the remaining width. */\n children?: ReactNode;\n}\n\n/** Inside a group these two are the quiet outcome: the group's header has already said it. */\nconst SILENT_IN_GROUP: ReadonlySet<StatusTone> = new Set<StatusTone>(['ok', 'neutral']);\n\n/**\n * The title row: label, summary, the tone's badge, and the expand toggle when\n * the item is expandable.\n *\n * A row inside a group says less. The group's header has already named the\n * tool and stated the run's outcome, so the row drops its title and speaks up\n * only when something went wrong or is still going: five OK badges down a run\n * of five are noise, and the one ERROR among them is the point.\n */\nexport function MessageItemHeader({ className, title, badge, children, ...props }: MessageItemHeaderProps) {\n const { headerAccessory, tone, expandable, expanded, toggle } = useMessageItem();\n const group = useContext(MessageItemGroupContext);\n const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];\n const label = badge === undefined ? defaultLabel : badge;\n return (\n <div\n data-slot=\"message-item-header\"\n className={cn('flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim', className)}\n {...props}\n >\n {group === null ? <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span> : null}\n <div data-slot=\"message-item-summary\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n {children}\n </div>\n {headerAccessory}\n {label !== null && label !== '' ? (\n <StatusBadge tone={tone} data-testid=\"tool-status\">\n {label}\n </StatusBadge>\n ) : null}\n {expandable ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"tool-expand\"\n aria-expanded={expanded}\n aria-label={expanded ? 'collapse' : 'expand'}\n onClick={toggle}\n className=\"text-doom-faint hover:text-doom-blue\"\n >\n {expanded ? <ChevronUpIcon className=\"h-3 w-3\" /> : <ChevronDownIcon className=\"h-3 w-3\" />}\n </Button>\n ) : null}\n </div>\n );\n}\n\n/** The recessed body under the header. */\nexport function MessageItemBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"message-item-body\"\n className={cn('border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim', className)}\n {...props}\n />\n );\n}\n\n/** The glyph a tone reads as in a status line. */\nexport const STATUS_GLYPH: Readonly<Record<StatusTone, string>> = {\n neutral: '…',\n running: '◐',\n ok: '✓',\n error: '✗',\n info: '●',\n accent: '●',\n};\n\nexport const messageItemStatusVariants = cva('shrink-0', {\n variants: {\n tone: {\n neutral: 'text-doom-faint',\n running: 'text-doom-yellow',\n ok: 'text-doom-green',\n error: 'text-doom-red',\n info: 'text-doom-blue',\n accent: 'text-doom-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemStatusProps extends ComponentProps<'span'>, VariantProps<typeof messageItemStatusVariants> {\n /** Replaces the tone's glyph. */\n glyph?: string;\n /** Renders as a button that expands the item: the \"N more line(s)\" hint. Only className carries over. */\n expands?: boolean;\n}\n\n/** The one-line status under a body: `◐ running`, `✗ failed`, `✓ done`, or the hint that more is hidden. */\nexport function MessageItemStatus({\n className,\n tone,\n glyph,\n expands = false,\n children,\n ...props\n}: MessageItemStatusProps) {\n const { toggle } = useMessageItem();\n const content = (\n <>\n <span className={messageItemStatusVariants({ tone })}>{glyph ?? STATUS_GLYPH[tone ?? 'neutral']}</span>\n <span>{children}</span>\n </>\n );\n if (expands) {\n return (\n <button\n type=\"button\"\n data-slot=\"message-item-status\"\n data-testid=\"tool-more\"\n onClick={toggle}\n className={cn(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue',\n className,\n )}\n >\n {content}\n </button>\n );\n }\n return (\n <span\n data-slot=\"message-item-status\"\n className={cn('flex items-center gap-1.5 text-doom-faint', className)}\n {...props}\n >\n {content}\n </span>\n );\n}\n"],"mappings":"qYAkBA,MAAaA,EAAoCC,EAAyB,IAAI,EAWxEC,EAAq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U,sBACV,cAAY,YACZ,QAASX,EACT,UAAWhB,EACT,gGACAC,CACF,EAEC,SAAAuB,CACK,CAAA,EAIV,kBAAC,OAAD,CACE,YAAU,sBACV,UAAWxB,EAAG,4CAA6CC,CAAS,EACpE,GAAIf,EAEH,SAAAsC,CACG,CAAA,CAEV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./Button.cjs"),n=require("./StatusBadge.cjs");let r=require("react/jsx-runtime"),i=require("react"),a=require("class-variance-authority"),o=require("lucide-react");const s=(0,i.createContext)({tone:`neutral`,expandable:!1,expanded:!1,toggle:()=>void 0});function
|
|
1
|
+
require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./Button.cjs"),n=require("./StatusBadge.cjs");let r=require("react/jsx-runtime"),i=require("react"),a=require("class-variance-authority"),o=require("lucide-react");const s=(0,i.createContext)(null),c=(0,i.createContext)({tone:`neutral`,expandable:!1,expanded:!1,toggle:()=>void 0});function l(){return(0,i.useContext)(c)}const u=(0,i.createContext)(null),d=(0,a.cva)(`overflow-hidden rounded-md border bg-doom-panel transition-colors`,{variants:{tone:n.STATUS_EDGE},defaultVariants:{tone:`neutral`}}),f=(0,a.cva)(`overflow-hidden border-l-2 transition-colors`,{variants:{tone:n.STATUS_EDGE},defaultVariants:{tone:`neutral`}});function p({className:t,tone:n,expandable:a=!1,defaultExpanded:o=!1,expanded:l,onExpandedChange:p,children:m,...h}){let[g,_]=(0,i.useState)(o),v=(0,i.useContext)(u),y=(0,i.useContext)(s),b=v!==null,x=l??g,S={tone:n??`neutral`,headerAccessory:y,expandable:a,expanded:x,toggle:()=>{let e=!x;l===void 0&&_(e),p?.(e)}};return/* @__PURE__ */ (0,r.jsx)(c.Provider,{value:S,children:/* @__PURE__ */ (0,r.jsx)(s,{value:null,children:/* @__PURE__ */ (0,r.jsx)(`div`,{"data-slot":`message-item`,"data-expanded":x,"data-grouped":b,className:e.cn(b?f({tone:n}):d({tone:n}),t),...h,children:typeof m==`function`?m(S):m})})})}function m({className:t,tone:i,title:a,summary:o,badge:s,children:c,...l}){let f=s===void 0?g[i??`neutral`]:s;return/* @__PURE__ */ (0,r.jsx)(u.Provider,{value:{tone:i??`neutral`},children:/* @__PURE__ */ (0,r.jsxs)(`div`,{"data-slot":`message-item-group`,className:e.cn(d({tone:i}),t),...l,children:[/* @__PURE__ */ (0,r.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim`,children:[/* @__PURE__ */ (0,r.jsx)(`span`,{className:`shrink-0 font-bold text-doom-hi`,children:a}),/* @__PURE__ */ (0,r.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-doom-faint`,children:o}),f!==null&&f!==``?/* @__PURE__ */ (0,r.jsx)(n.StatusBadge,{tone:i??`neutral`,children:f}):null]}),/* @__PURE__ */ (0,r.jsx)(`div`,{className:`flex flex-col divide-y divide-doom-border-soft`,children:c})]})})}function h(e){return e.running?`running`:e.isError?`error`:`ok`}const g={neutral:``,running:`RUNNING`,ok:`OK`,error:`ERROR`,info:`INFO`,accent:`NOTE`},_=/* @__PURE__ */ new Set([`ok`,`neutral`]);function v({className:a,title:s,badge:c,children:d,...f}){let{headerAccessory:p,tone:m,expandable:h,expanded:v,toggle:y}=l(),b=(0,i.useContext)(u),x=b!==null&&_.has(m)?null:g[m],S=c===void 0?x:c;return/* @__PURE__ */ (0,r.jsxs)(`div`,{"data-slot":`message-item-header`,className:e.cn(`flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim`,a),...f,children:[b===null?/* @__PURE__ */ (0,r.jsx)(`span`,{className:`shrink-0 font-bold text-doom-hi`,children:s}):null,/* @__PURE__ */ (0,r.jsx)(`div`,{"data-slot":`message-item-summary`,className:`flex min-w-0 flex-1 items-center gap-2`,children:d}),p,S!==null&&S!==``?/* @__PURE__ */ (0,r.jsx)(n.StatusBadge,{tone:m,"data-testid":`tool-status`,children:S}):null,h?/* @__PURE__ */ (0,r.jsx)(t.Button,{variant:`ghost`,size:`icon`,"data-testid":`tool-expand`,"aria-expanded":v,"aria-label":v?`collapse`:`expand`,onClick:y,className:`text-doom-faint hover:text-doom-blue`,children:v?/* @__PURE__ */ (0,r.jsx)(o.ChevronUp,{className:`h-3 w-3`}):/* @__PURE__ */ (0,r.jsx)(o.ChevronDown,{className:`h-3 w-3`})}):null]})}function y({className:t,...n}){return/* @__PURE__ */ (0,r.jsx)(`div`,{"data-slot":`message-item-body`,className:e.cn(`border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim`,t),...n})}const b={neutral:`…`,running:`◐`,ok:`✓`,error:`✗`,info:`●`,accent:`●`},x=(0,a.cva)(`shrink-0`,{variants:{tone:{neutral:`text-doom-faint`,running:`text-doom-yellow`,ok:`text-doom-green`,error:`text-doom-red`,info:`text-doom-blue`,accent:`text-doom-magenta`}},defaultVariants:{tone:`neutral`}});function S({className:t,tone:n,glyph:i,expands:a=!1,children:o,...s}){let{toggle:c}=l(),u=/* @__PURE__ */ (0,r.jsxs)(r.Fragment,{children:[/* @__PURE__ */ (0,r.jsx)(`span`,{className:x({tone:n}),children:i??b[n??`neutral`]}),/* @__PURE__ */ (0,r.jsx)(`span`,{children:o})]});return a?/* @__PURE__ */ (0,r.jsx)(`button`,{type:`button`,"data-slot":`message-item-status`,"data-testid":`tool-more`,onClick:c,className:e.cn(`flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue`,t),children:u}):/* @__PURE__ */ (0,r.jsx)(`span`,{"data-slot":`message-item-status`,className:e.cn(`flex items-center gap-1.5 text-doom-faint`,t),...s,children:u})}exports.MessageItem=p,exports.MessageItemBody=y,exports.MessageItemGroup=m,exports.MessageItemHeader=v,exports.MessageItemHeaderAccessoryContext=s,exports.MessageItemStatus=S,exports.STATUS_GLYPH=b,exports.STATUS_LABEL=g,exports.messageItemRowVariants=f,exports.messageItemStatusVariants=x,exports.messageItemVariants=d,exports.toolTone=h,exports.useMessageItem=l;
|
|
2
2
|
//# sourceMappingURL=MessageItem.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageItem.cjs","names":["createContext","useContext","cva","STATUS_EDGE","useState","cn","StatusBadge","Button","ChevronUpIcon","ChevronDownIcon","require_cn","require_Button","require_StatusBadge","react_jsx_runtime","react","class_variance_authority","lucide_react","MessageItemContext","useMessageItem","MessageItemGroupContext","messageItemVariants","messageItemRowVariants","MessageItem","props","own","setOwn","defaultExpanded","grouped","current","expanded","state","tone","next","onExpandedChange","className","children","MessageItemGroup","label","badge","STATUS_LABEL","title","summary","toolTone","SILENT_IN_GROUP","MessageItemHeader","group","defaultLabel","expandable","toggle","MessageItemBody","STATUS_GLYPH","messageItemStatusVariants","MessageItemStatus","content","glyph","expands"],"sources":["../../../src/components/MessageItem.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, type ReactNode, useContext, useState } from 'react';\n\nimport { ChevronDownIcon, ChevronUpIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\nimport { STATUS_EDGE, StatusBadge, type StatusTone } from './StatusBadge';\n\n/**\n * The message item: the timeline card a tool call, a run, or a notice sits\n * in. The item owns its outcome tone and its expand state; the header, body,\n * and status parts read both from it, so a card composes the parts and never\n * threads `expanded` by hand. A tool message in a web plugin is built from\n * this, and so is the cockpit's own fallback item, which is what keeps them\n * looking alike.\n */\n\nexport interface MessageItemState {\n tone: StatusTone;\n /** Whether the header offers the toggle; an item that hides nothing offers none. */\n expandable: boolean;\n expanded: boolean;\n toggle: () => void;\n}\n\nconst MessageItemContext = createContext<MessageItemState>({\n tone: 'neutral',\n expandable: false,\n expanded: false,\n toggle: () => undefined,\n});\n\n/** The enclosing item's state, for a part that lives deeper than the item's render prop. */\nexport function useMessageItem(): MessageItemState {\n return useContext(MessageItemContext);\n}\n\n/**\n * The group an item is a row of, or null for an item that is a card of its\n * own. A row drops the frame the group already draws and keeps its tone as an\n * edge down its left side, and it stops repeating what the group's header has\n * said once: the tool's name, and an outcome the whole run shares.\n */\nconst MessageItemGroupContext = createContext<{ tone: StatusTone } | null>(null);\n\n/** The frame, wearing the edge STATUS_EDGE names for the tone, so the two never drift apart. */\nexport const messageItemVariants = cva('overflow-hidden rounded-md border bg-doom-panel transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\n/** The same tone as a row: no card, one coloured edge, and the group's separators between rows. */\nexport const messageItemRowVariants = cva('overflow-hidden border-l-2 transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemProps\n extends Omit<ComponentProps<'div'>, 'children'>, VariantProps<typeof messageItemVariants> {\n /** Whether the header offers the expand toggle. A toggle that reveals nothing reads as broken, so the card decides. */\n expandable?: boolean;\n defaultExpanded?: boolean;\n /** Controlled mode; pair with onExpandedChange. Omit it and the item keeps its own state. */\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Plain content, or a function of the item's state for a card that picks its lines by `expanded`. */\n children?: ReactNode | ((state: MessageItemState) => ReactNode);\n}\n\nexport function MessageItem({\n className,\n tone,\n expandable = false,\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n children,\n ...props\n}: MessageItemProps) {\n const [own, setOwn] = useState(defaultExpanded);\n const group = useContext(MessageItemGroupContext);\n const grouped = group !== null;\n const current = expanded ?? own;\n const state: MessageItemState = {\n tone: tone ?? 'neutral',\n expandable,\n expanded: current,\n toggle: () => {\n const next = !current;\n if (expanded === undefined) setOwn(next);\n onExpandedChange?.(next);\n },\n };\n return (\n <MessageItemContext.Provider value={state}>\n <div\n data-slot=\"message-item\"\n data-expanded={current}\n data-grouped={grouped}\n className={cn(grouped ? messageItemRowVariants({ tone }) : messageItemVariants({ tone }), className)}\n {...props}\n >\n {typeof children === 'function' ? children(state) : children}\n </div>\n </MessageItemContext.Provider>\n );\n}\n\nexport interface MessageItemGroupProps\n extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof messageItemVariants> {\n /** The bold label at the left of the group header: the tool the run belongs to. */\n title: ReactNode;\n /** The line beside it, such as how many calls the group holds. */\n summary?: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n children?: ReactNode;\n}\n\n/**\n * One frame around a run of items that belong together.\n *\n * A transcript that calls the same tool five times in a row is five identical\n * frames, five gutter labels and five gaps, and the repetition reads louder\n * than the commands do. The group draws the frame once and each item inside it\n * becomes a row: same header, same expand, no card of its own. The tone still\n * belongs to the row, as an edge, so a failure in the middle of a run is not\n * flattened into the group's own outcome.\n */\nexport function MessageItemGroup({\n className,\n tone,\n title,\n summary,\n badge,\n children,\n ...props\n}: MessageItemGroupProps) {\n const label = badge === undefined ? STATUS_LABEL[tone ?? 'neutral'] : badge;\n return (\n <MessageItemGroupContext.Provider value={{ tone: tone ?? 'neutral' }}>\n <div data-slot=\"message-item-group\" className={cn(messageItemVariants({ tone }), className)} {...props}>\n <div className=\"flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim\">\n <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-faint\">{summary}</span>\n {label !== null && label !== '' ? <StatusBadge tone={tone ?? 'neutral'}>{label}</StatusBadge> : null}\n </div>\n <div className=\"flex flex-col divide-y divide-doom-border-soft\">{children}</div>\n </div>\n </MessageItemGroupContext.Provider>\n );\n}\n\n/** The tone a tool call's item wears: running while the tool runs, then its outcome. */\nexport function toolTone(state: { running: boolean; isError: boolean }): StatusTone {\n return state.running ? 'running' : state.isError ? 'error' : 'ok';\n}\n\n/** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */\nexport const STATUS_LABEL: Readonly<Record<StatusTone, string>> = {\n neutral: '',\n running: 'RUNNING',\n ok: 'OK',\n error: 'ERROR',\n info: 'INFO',\n accent: 'NOTE',\n};\n\nexport interface MessageItemHeaderProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** The bold label at the left: the tool name. */\n title: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n /** The summary beside the title; it gets the remaining width. */\n children?: ReactNode;\n}\n\n/** Inside a group these two are the quiet outcome: the group's header has already said it. */\nconst SILENT_IN_GROUP: ReadonlySet<StatusTone> = new Set<StatusTone>(['ok', 'neutral']);\n\n/**\n * The title row: label, summary, the tone's badge, and the expand toggle when\n * the item is expandable.\n *\n * A row inside a group says less. The group's header has already named the\n * tool and stated the run's outcome, so the row drops its title and speaks up\n * only when something went wrong or is still going: five OK badges down a run\n * of five are noise, and the one ERROR among them is the point.\n */\nexport function MessageItemHeader({ className, title, badge, children, ...props }: MessageItemHeaderProps) {\n const { tone, expandable, expanded, toggle } = useMessageItem();\n const group = useContext(MessageItemGroupContext);\n const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];\n const label = badge === undefined ? defaultLabel : badge;\n return (\n <div\n data-slot=\"message-item-header\"\n className={cn('flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim', className)}\n {...props}\n >\n {group === null ? <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span> : null}\n <div data-slot=\"message-item-summary\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n {children}\n </div>\n {label !== null && label !== '' ? (\n <StatusBadge tone={tone} data-testid=\"tool-status\">\n {label}\n </StatusBadge>\n ) : null}\n {expandable ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"tool-expand\"\n aria-expanded={expanded}\n aria-label={expanded ? 'collapse' : 'expand'}\n onClick={toggle}\n className=\"text-doom-faint hover:text-doom-blue\"\n >\n {expanded ? <ChevronUpIcon className=\"h-3 w-3\" /> : <ChevronDownIcon className=\"h-3 w-3\" />}\n </Button>\n ) : null}\n </div>\n );\n}\n\n/** The recessed body under the header. */\nexport function MessageItemBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"message-item-body\"\n className={cn('border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim', className)}\n {...props}\n />\n );\n}\n\n/** The glyph a tone reads as in a status line. */\nexport const STATUS_GLYPH: Readonly<Record<StatusTone, string>> = {\n neutral: '…',\n running: '◐',\n ok: '✓',\n error: '✗',\n info: '●',\n accent: '●',\n};\n\nexport const messageItemStatusVariants = cva('shrink-0', {\n variants: {\n tone: {\n neutral: 'text-doom-faint',\n running: 'text-doom-yellow',\n ok: 'text-doom-green',\n error: 'text-doom-red',\n info: 'text-doom-blue',\n accent: 'text-doom-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemStatusProps extends ComponentProps<'span'>, VariantProps<typeof messageItemStatusVariants> {\n /** Replaces the tone's glyph. */\n glyph?: string;\n /** Renders as a button that expands the item: the \"N more line(s)\" hint. Only className carries over. */\n expands?: boolean;\n}\n\n/** The one-line status under a body: `◐ running`, `✗ failed`, `✓ done`, or the hint that more is hidden. */\nexport function MessageItemStatus({\n className,\n tone,\n glyph,\n expands = false,\n children,\n ...props\n}: MessageItemStatusProps) {\n const { toggle } = useMessageItem();\n const content = (\n <>\n <span className={messageItemStatusVariants({ tone })}>{glyph ?? STATUS_GLYPH[tone ?? 'neutral']}</span>\n <span>{children}</span>\n </>\n );\n if (expands) {\n return (\n <button\n type=\"button\"\n data-slot=\"message-item-status\"\n data-testid=\"tool-more\"\n onClick={toggle}\n className={cn(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue',\n className,\n )}\n >\n {content}\n </button>\n );\n }\n return (\n <span\n data-slot=\"message-item-status\"\n className={cn('flex items-center gap-1.5 text-doom-faint', className)}\n {...props}\n >\n {content}\n </span>\n );\n}\n"],"mappings":"8OAyBA,MAAMiB,GAAA,EAAqBjB,EAAAA,cAAAA,CAAgC,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,IACJ,MAAO,IACP,KAAM,IACN,OAAQ,GACV,EAEaC,GAAA,EAA4BjD,EAAAA,IAAAA,CAAI,WAAY,CACvD,SAAU,CACR,KAAM,CACJ,QAAS,kBACT,QAAS,mBACT,GAAI,kBACJ,MAAO,gBACP,KAAM,iBACN,OAAQ,mBACV,CACF,EACA,gBAAiB,CAAE,KAAM,SAAU,CACrC,CAAC,EAUD,SAAgBkD,EAAkB,CAChC,YACA,OACA,QACA,UAAU,GACV,WACA,GAAG7B,GACsB,CACzB,GAAM,CAAE,UAAWL,EAAe,EAC5BmC,EACJ,iBAAA,EAAAxC,EAAA,KAAA,CAAAA,EAAA,SAAA,CAAA,SAAA,CACE,iBAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWsC,EAA0B,CAAE,MAAK,CAAC,EAAI,SAAAG,GAASJ,EAAanB,GAAQ,UAAiB,CAAA,EACtG,iBAAA,EAAAlB,EAAA,IAAA,CAAC,OAAD,CAAO,UAAe,CAAA,CACtB,CAAA,CAAA,EAkBJ,OAhBI0C,EAEA,iBAAA,EAAA1C,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,YAAU,sBACV,cAAY,YACZ,QAASmC,EACT,UAAW3C,EAAAA,GACT,gGACA6B,CACF,EAEC,SAAAmB,CACK,CAAA,EAIV,iBAAA,EAAAxC,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,sBACV,UAAWR,EAAAA,GAAG,4CAA6C6B,CAAS,EACpE,GAAIX,EAEH,SAAA8B,CACG,CAAA,CAEV"}
|
|
1
|
+
{"version":3,"file":"MessageItem.cjs","names":["createContext","useContext","cva","STATUS_EDGE","useState","cn","StatusBadge","Button","ChevronUpIcon","ChevronDownIcon","require_cn","require_Button","require_StatusBadge","react_jsx_runtime","react","class_variance_authority","lucide_react","MessageItemHeaderAccessoryContext","MessageItemContext","useMessageItem","MessageItemGroupContext","messageItemVariants","messageItemRowVariants","MessageItem","props","own","setOwn","defaultExpanded","group","headerAccessory","grouped","current","expanded","state","tone","next","onExpandedChange","className","children","MessageItemGroup","label","badge","STATUS_LABEL","title","summary","toolTone","SILENT_IN_GROUP","MessageItemHeader","defaultLabel","expandable","toggle","MessageItemBody","STATUS_GLYPH","messageItemStatusVariants","MessageItemStatus","content","glyph","expands"],"sources":["../../../src/components/MessageItem.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, type ReactNode, useContext, useState } from 'react';\n\nimport { ChevronDownIcon, ChevronUpIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport { Button } from './Button';\nimport { STATUS_EDGE, StatusBadge, type StatusTone } from './StatusBadge';\n\n/**\n * The message item: the timeline card a tool call, a run, or a notice sits\n * in. The item owns its outcome tone and its expand state; the header, body,\n * and status parts read both from it, so a card composes the parts and never\n * threads `expanded` by hand. A tool message in a web plugin is built from\n * this, and so is the cockpit's own fallback item, which is what keeps them\n * looking alike.\n */\n\n/** The next item captures this accessory for its header, without passing it to nested items. */\nexport const MessageItemHeaderAccessoryContext = createContext<ReactNode>(null);\n\nexport interface MessageItemState {\n tone: StatusTone;\n headerAccessory?: ReactNode;\n /** Whether the header offers the toggle; an item that hides nothing offers none. */\n expandable: boolean;\n expanded: boolean;\n toggle: () => void;\n}\n\nconst MessageItemContext = createContext<MessageItemState>({\n tone: 'neutral',\n expandable: false,\n expanded: false,\n toggle: () => undefined,\n});\n\n/** The enclosing item's state, for a part that lives deeper than the item's render prop. */\nexport function useMessageItem(): MessageItemState {\n return useContext(MessageItemContext);\n}\n\n/**\n * The group an item is a row of, or null for an item that is a card of its\n * own. A row drops the frame the group already draws and keeps its tone as an\n * edge down its left side, and it stops repeating what the group's header has\n * said once: the tool's name, and an outcome the whole run shares.\n */\nconst MessageItemGroupContext = createContext<{ tone: StatusTone } | null>(null);\n\n/** The frame, wearing the edge STATUS_EDGE names for the tone, so the two never drift apart. */\nexport const messageItemVariants = cva('overflow-hidden rounded-md border bg-doom-panel transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\n/** The same tone as a row: no card, one coloured edge, and the group's separators between rows. */\nexport const messageItemRowVariants = cva('overflow-hidden border-l-2 transition-colors', {\n variants: { tone: STATUS_EDGE },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemProps\n extends Omit<ComponentProps<'div'>, 'children'>, VariantProps<typeof messageItemVariants> {\n /** Whether the header offers the expand toggle. A toggle that reveals nothing reads as broken, so the card decides. */\n expandable?: boolean;\n defaultExpanded?: boolean;\n /** Controlled mode; pair with onExpandedChange. Omit it and the item keeps its own state. */\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Plain content, or a function of the item's state for a card that picks its lines by `expanded`. */\n children?: ReactNode | ((state: MessageItemState) => ReactNode);\n}\n\nexport function MessageItem({\n className,\n tone,\n expandable = false,\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n children,\n ...props\n}: MessageItemProps) {\n const [own, setOwn] = useState(defaultExpanded);\n const group = useContext(MessageItemGroupContext);\n const headerAccessory = useContext(MessageItemHeaderAccessoryContext);\n const grouped = group !== null;\n const current = expanded ?? own;\n const state: MessageItemState = {\n tone: tone ?? 'neutral',\n headerAccessory,\n expandable,\n expanded: current,\n toggle: () => {\n const next = !current;\n if (expanded === undefined) setOwn(next);\n onExpandedChange?.(next);\n },\n };\n return (\n <MessageItemContext.Provider value={state}>\n <MessageItemHeaderAccessoryContext value={null}>\n <div\n data-slot=\"message-item\"\n data-expanded={current}\n data-grouped={grouped}\n className={cn(grouped ? messageItemRowVariants({ tone }) : messageItemVariants({ tone }), className)}\n {...props}\n >\n {typeof children === 'function' ? children(state) : children}\n </div>\n </MessageItemHeaderAccessoryContext>\n </MessageItemContext.Provider>\n );\n}\n\nexport interface MessageItemGroupProps\n extends Omit<ComponentProps<'div'>, 'title'>, VariantProps<typeof messageItemVariants> {\n /** The bold label at the left of the group header: the tool the run belongs to. */\n title: ReactNode;\n /** The line beside it, such as how many calls the group holds. */\n summary?: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n children?: ReactNode;\n}\n\n/**\n * One frame around a run of items that belong together.\n *\n * A transcript that calls the same tool five times in a row is five identical\n * frames, five gutter labels and five gaps, and the repetition reads louder\n * than the commands do. The group draws the frame once and each item inside it\n * becomes a row: same header, same expand, no card of its own. The tone still\n * belongs to the row, as an edge, so a failure in the middle of a run is not\n * flattened into the group's own outcome.\n */\nexport function MessageItemGroup({\n className,\n tone,\n title,\n summary,\n badge,\n children,\n ...props\n}: MessageItemGroupProps) {\n const label = badge === undefined ? STATUS_LABEL[tone ?? 'neutral'] : badge;\n return (\n <MessageItemGroupContext.Provider value={{ tone: tone ?? 'neutral' }}>\n <div data-slot=\"message-item-group\" className={cn(messageItemVariants({ tone }), className)} {...props}>\n <div className=\"flex min-h-8 items-center gap-2 border-doom-border-soft border-b px-[11px] text-sm text-doom-dim\">\n <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-faint\">{summary}</span>\n {label !== null && label !== '' ? <StatusBadge tone={tone ?? 'neutral'}>{label}</StatusBadge> : null}\n </div>\n <div className=\"flex flex-col divide-y divide-doom-border-soft\">{children}</div>\n </div>\n </MessageItemGroupContext.Provider>\n );\n}\n\n/** The tone a tool call's item wears: running while the tool runs, then its outcome. */\nexport function toolTone(state: { running: boolean; isError: boolean }): StatusTone {\n return state.running ? 'running' : state.isError ? 'error' : 'ok';\n}\n\n/** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */\nexport const STATUS_LABEL: Readonly<Record<StatusTone, string>> = {\n neutral: '',\n running: 'RUNNING',\n ok: 'OK',\n error: 'ERROR',\n info: 'INFO',\n accent: 'NOTE',\n};\n\nexport interface MessageItemHeaderProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** The bold label at the left: the tool name. */\n title: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n /** The summary beside the title; it gets the remaining width. */\n children?: ReactNode;\n}\n\n/** Inside a group these two are the quiet outcome: the group's header has already said it. */\nconst SILENT_IN_GROUP: ReadonlySet<StatusTone> = new Set<StatusTone>(['ok', 'neutral']);\n\n/**\n * The title row: label, summary, the tone's badge, and the expand toggle when\n * the item is expandable.\n *\n * A row inside a group says less. The group's header has already named the\n * tool and stated the run's outcome, so the row drops its title and speaks up\n * only when something went wrong or is still going: five OK badges down a run\n * of five are noise, and the one ERROR among them is the point.\n */\nexport function MessageItemHeader({ className, title, badge, children, ...props }: MessageItemHeaderProps) {\n const { headerAccessory, tone, expandable, expanded, toggle } = useMessageItem();\n const group = useContext(MessageItemGroupContext);\n const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];\n const label = badge === undefined ? defaultLabel : badge;\n return (\n <div\n data-slot=\"message-item-header\"\n className={cn('flex min-h-8 items-center gap-2 px-[11px] text-sm text-doom-dim', className)}\n {...props}\n >\n {group === null ? <span className=\"shrink-0 font-bold text-doom-hi\">{title}</span> : null}\n <div data-slot=\"message-item-summary\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n {children}\n </div>\n {headerAccessory}\n {label !== null && label !== '' ? (\n <StatusBadge tone={tone} data-testid=\"tool-status\">\n {label}\n </StatusBadge>\n ) : null}\n {expandable ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid=\"tool-expand\"\n aria-expanded={expanded}\n aria-label={expanded ? 'collapse' : 'expand'}\n onClick={toggle}\n className=\"text-doom-faint hover:text-doom-blue\"\n >\n {expanded ? <ChevronUpIcon className=\"h-3 w-3\" /> : <ChevronDownIcon className=\"h-3 w-3\" />}\n </Button>\n ) : null}\n </div>\n );\n}\n\n/** The recessed body under the header. */\nexport function MessageItemBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"message-item-body\"\n className={cn('border-t border-doom-border-soft bg-doom-deep px-3 py-2 text-sm text-doom-dim', className)}\n {...props}\n />\n );\n}\n\n/** The glyph a tone reads as in a status line. */\nexport const STATUS_GLYPH: Readonly<Record<StatusTone, string>> = {\n neutral: '…',\n running: '◐',\n ok: '✓',\n error: '✗',\n info: '●',\n accent: '●',\n};\n\nexport const messageItemStatusVariants = cva('shrink-0', {\n variants: {\n tone: {\n neutral: 'text-doom-faint',\n running: 'text-doom-yellow',\n ok: 'text-doom-green',\n error: 'text-doom-red',\n info: 'text-doom-blue',\n accent: 'text-doom-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport interface MessageItemStatusProps extends ComponentProps<'span'>, VariantProps<typeof messageItemStatusVariants> {\n /** Replaces the tone's glyph. */\n glyph?: string;\n /** Renders as a button that expands the item: the \"N more line(s)\" hint. Only className carries over. */\n expands?: boolean;\n}\n\n/** The one-line status under a body: `◐ running`, `✗ failed`, `✓ done`, or the hint that more is hidden. */\nexport function MessageItemStatus({\n className,\n tone,\n glyph,\n expands = false,\n children,\n ...props\n}: MessageItemStatusProps) {\n const { toggle } = useMessageItem();\n const content = (\n <>\n <span className={messageItemStatusVariants({ tone })}>{glyph ?? STATUS_GLYPH[tone ?? 'neutral']}</span>\n <span>{children}</span>\n </>\n );\n if (expands) {\n return (\n <button\n type=\"button\"\n data-slot=\"message-item-status\"\n data-testid=\"tool-more\"\n onClick={toggle}\n className={cn(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 text-doom-faint hover:text-doom-blue',\n className,\n )}\n >\n {content}\n </button>\n );\n }\n return (\n <span\n data-slot=\"message-item-status\"\n className={cn('flex items-center gap-1.5 text-doom-faint', className)}\n {...props}\n >\n {content}\n </span>\n );\n}\n"],"mappings":"8OAkBA,MAAaiB,GAAA,EAAoCjB,EAAAA,cAAAA,CAAyB,IAAI,EAWxEkB,GAAA,EAAqBlB,EAAAA,cAAAA,CAAgC,CACzD,KAAM,UACN,WAAY,GACZ,SAAU,GACV,WAAc,IAAA,EAChB,CAAC,EAGD,SAA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iFgC,CAAS,EACxG,GAAIb,CACL,CAAA,CAEL,CAGA,MAAa4B,EAAqD,CAChE,QAAS,IACT,QAAS,IACT,GAAI,IACJ,MAAO,IACP,KAAM,IACN,OAAQ,GACV,EAEaC,GAAA,EAA4BnD,EAAAA,IAAAA,CAAI,WAAY,CACvD,SAAU,CACR,KAAM,CACJ,QAAS,kBACT,QAAS,mBACT,GAAI,kBACJ,MAAO,gBACP,KAAM,iBACN,OAAQ,mBACV,CACF,EACA,gBAAiB,CAAE,KAAM,SAAU,CACrC,CAAC,EAUD,SAAgBoD,EAAkB,CAChC,YACA,OACA,QACA,UAAU,GACV,WACA,GAAG9B,GACsB,CACzB,GAAM,CAAE,UAAWL,EAAe,EAC5BoC,EACJ,iBAAA,EAAA1C,EAAA,KAAA,CAAAA,EAAA,SAAA,CAAA,SAAA,CACE,iBAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWwC,EAA0B,CAAE,MAAK,CAAC,EAAI,SAAAG,GAASJ,EAAalB,GAAQ,UAAiB,CAAA,EACtG,iBAAA,EAAArB,EAAA,IAAA,CAAC,OAAD,CAAO,UAAe,CAAA,CACtB,CAAA,CAAA,EAkBJ,OAhBI4C,EAEA,iBAAA,EAAA5C,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,YAAU,sBACV,cAAY,YACZ,QAASqC,EACT,UAAW7C,EAAAA,GACT,gGACAgC,CACF,EAEC,SAAAkB,CACK,CAAA,EAIV,iBAAA,EAAA1C,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,sBACV,UAAWR,EAAAA,GAAG,4CAA6CgC,CAAS,EACpE,GAAIb,EAEH,SAAA+B,CACG,CAAA,CAEV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-web-components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.73",
|
|
4
4
|
"description": "Shared web components and theme tokens for the DoomPi cockpit and its web plugins: shadcn-style primitives on Radix, tuned to the Doom palette, with runtime theme configs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -91,17 +91,17 @@
|
|
|
91
91
|
"tailwind-merge": "3.7.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@agimon-ai/doompi-core": "0.0.1-alpha.
|
|
95
|
-
"@agimon-ai/vibe-lint-plugin-doom-web": "0.0.1-alpha.
|
|
96
|
-
"@types/node": "26.6.
|
|
94
|
+
"@agimon-ai/doompi-core": "0.0.1-alpha.115",
|
|
95
|
+
"@agimon-ai/vibe-lint-plugin-doom-web": "0.0.1-alpha.96",
|
|
96
|
+
"@types/node": "26.6.4",
|
|
97
97
|
"@types/react": "19.3.0",
|
|
98
98
|
"@types/react-dom": "19.3.0",
|
|
99
|
-
"@vitest/coverage-v8": "5.0.
|
|
99
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
100
100
|
"react": "19.3.0",
|
|
101
101
|
"react-dom": "19.3.0",
|
|
102
102
|
"tsdown": "0.23.0",
|
|
103
103
|
"typescript": "7.0.2",
|
|
104
|
-
"vitest": "5.0.
|
|
104
|
+
"vitest": "5.0.3"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"react": "^19.0.0",
|