@iclips/ui 2.0.3 → 3.0.0
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/MIGRATION-v3.md +244 -0
- package/dist/alert-theme.css +20 -79
- package/dist/components/ui/charts/donut-chart.cjs +1 -1
- package/dist/components/ui/charts/donut-chart.cjs.map +1 -1
- package/dist/components/ui/charts/donut-chart.js +39 -60
- package/dist/components/ui/charts/donut-chart.js.map +1 -1
- package/dist/components/ui/charts/kpi-card.cjs +1 -1
- package/dist/components/ui/charts/kpi-card.cjs.map +1 -1
- package/dist/components/ui/charts/kpi-card.js +19 -19
- package/dist/components/ui/charts/kpi-card.js.map +1 -1
- package/dist/components/ui/data/comment-system.cjs +1 -1
- package/dist/components/ui/data/comment-system.cjs.map +1 -1
- package/dist/components/ui/data/comment-system.js +67 -67
- package/dist/components/ui/data/comment-system.js.map +1 -1
- package/dist/components/ui/data/data-table.cjs +1 -1
- package/dist/components/ui/data/data-table.cjs.map +1 -1
- package/dist/components/ui/data/data-table.js +112 -101
- package/dist/components/ui/data/data-table.js.map +1 -1
- package/dist/components/ui/data/editorial-calendar.cjs +1 -1
- package/dist/components/ui/data/editorial-calendar.cjs.map +1 -1
- package/dist/components/ui/data/editorial-calendar.js +291 -291
- package/dist/components/ui/data/editorial-calendar.js.map +1 -1
- package/dist/components/ui/data/filter-builder.cjs +1 -1
- package/dist/components/ui/data/filter-builder.cjs.map +1 -1
- package/dist/components/ui/data/filter-builder.js +1 -1
- package/dist/components/ui/data/filter-builder.js.map +1 -1
- package/dist/components/ui/feedback/empty-state.cjs +1 -1
- package/dist/components/ui/feedback/empty-state.cjs.map +1 -1
- package/dist/components/ui/feedback/empty-state.js +14 -14
- package/dist/components/ui/feedback/empty-state.js.map +1 -1
- package/dist/components/ui/feedback/toast.cjs +1 -1
- package/dist/components/ui/feedback/toast.cjs.map +1 -1
- package/dist/components/ui/feedback/toast.js +53 -22
- package/dist/components/ui/feedback/toast.js.map +1 -1
- package/dist/components/ui/forms/calendar.cjs +1 -1
- package/dist/components/ui/forms/calendar.cjs.map +1 -1
- package/dist/components/ui/forms/calendar.js +16 -16
- package/dist/components/ui/forms/calendar.js.map +1 -1
- package/dist/components/ui/forms/combobox.cjs +1 -1
- package/dist/components/ui/forms/combobox.cjs.map +1 -1
- package/dist/components/ui/forms/combobox.js +78 -76
- package/dist/components/ui/forms/combobox.js.map +1 -1
- package/dist/components/ui/forms/file-attachment-list.cjs +1 -1
- package/dist/components/ui/forms/file-attachment-list.cjs.map +1 -1
- package/dist/components/ui/forms/file-attachment-list.js +4 -4
- package/dist/components/ui/forms/file-attachment-list.js.map +1 -1
- package/dist/components/ui/forms/file-upload-zone.cjs +2 -2
- package/dist/components/ui/forms/file-upload-zone.cjs.map +1 -1
- package/dist/components/ui/forms/file-upload-zone.js +55 -49
- package/dist/components/ui/forms/file-upload-zone.js.map +1 -1
- package/dist/components/ui/forms/form.cjs +1 -1
- package/dist/components/ui/forms/form.cjs.map +1 -1
- package/dist/components/ui/forms/form.js +11 -11
- package/dist/components/ui/forms/form.js.map +1 -1
- package/dist/components/ui/forms/input-validation.cjs +1 -1
- package/dist/components/ui/forms/input-validation.cjs.map +1 -1
- package/dist/components/ui/forms/input-validation.js +20 -20
- package/dist/components/ui/forms/input-validation.js.map +1 -1
- package/dist/components/ui/forms/multi-select.cjs +1 -1
- package/dist/components/ui/forms/multi-select.cjs.map +1 -1
- package/dist/components/ui/forms/multi-select.js +69 -67
- package/dist/components/ui/forms/multi-select.js.map +1 -1
- package/dist/components/ui/forms/radio-group.cjs +1 -1
- package/dist/components/ui/forms/radio-group.cjs.map +1 -1
- package/dist/components/ui/forms/radio-group.js +19 -19
- package/dist/components/ui/forms/radio-group.js.map +1 -1
- package/dist/components/ui/forms/social-button.cjs +1 -1
- package/dist/components/ui/forms/social-button.cjs.map +1 -1
- package/dist/components/ui/forms/social-button.js +6 -6
- package/dist/components/ui/forms/social-button.js.map +1 -1
- package/dist/components/ui/forms/toggle.cjs +1 -1
- package/dist/components/ui/forms/toggle.cjs.map +1 -1
- package/dist/components/ui/forms/toggle.js +7 -7
- package/dist/components/ui/forms/toggle.js.map +1 -1
- package/dist/components/ui/navigation/navigation-menu.cjs +1 -1
- package/dist/components/ui/navigation/navigation-menu.cjs.map +1 -1
- package/dist/components/ui/navigation/navigation-menu.js +14 -14
- package/dist/components/ui/navigation/navigation-menu.js.map +1 -1
- package/dist/components/ui/navigation/sidebar.cjs +1 -1
- package/dist/components/ui/navigation/sidebar.cjs.map +1 -1
- package/dist/components/ui/navigation/sidebar.js +44 -44
- package/dist/components/ui/navigation/sidebar.js.map +1 -1
- package/dist/components/ui/overlays/context-menu.cjs +1 -1
- package/dist/components/ui/overlays/context-menu.cjs.map +1 -1
- package/dist/components/ui/overlays/context-menu.js +1 -1
- package/dist/components/ui/overlays/context-menu.js.map +1 -1
- package/dist/components/ui/overlays/dropdown-menu.cjs +1 -1
- package/dist/components/ui/overlays/dropdown-menu.cjs.map +1 -1
- package/dist/components/ui/overlays/dropdown-menu.js +5 -5
- package/dist/components/ui/overlays/dropdown-menu.js.map +1 -1
- package/dist/components/ui/overlays/menubar.cjs +1 -1
- package/dist/components/ui/overlays/menubar.cjs.map +1 -1
- package/dist/components/ui/overlays/menubar.js +29 -29
- package/dist/components/ui/overlays/menubar.js.map +1 -1
- package/dist/components/ui/overlays/tooltip.cjs +1 -1
- package/dist/components/ui/overlays/tooltip.cjs.map +1 -1
- package/dist/components/ui/overlays/tooltip.js +12 -12
- package/dist/components/ui/overlays/tooltip.js.map +1 -1
- package/dist/components/ui/primitives/avatar.cjs +1 -1
- package/dist/components/ui/primitives/avatar.cjs.map +1 -1
- package/dist/components/ui/primitives/avatar.js +20 -27
- package/dist/components/ui/primitives/avatar.js.map +1 -1
- package/dist/components/ui/primitives/badge.cjs +1 -1
- package/dist/components/ui/primitives/badge.cjs.map +1 -1
- package/dist/components/ui/primitives/badge.js +13 -13
- package/dist/components/ui/primitives/badge.js.map +1 -1
- package/dist/components/ui/primitives/button.cjs +1 -1
- package/dist/components/ui/primitives/button.cjs.map +1 -1
- package/dist/components/ui/primitives/button.js +11 -8
- package/dist/components/ui/primitives/button.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +34 -35
- package/dist/index.js.map +1 -1
- package/dist/preset.css +1 -2
- package/dist/toast-theme.css +100 -64
- package/dist/tokens.css +59 -159
- package/package.json +5 -3
- package/scripts/check-colors.mjs +208 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment-system.cjs","sources":["../../../../src/components/ui/data/comment-system.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { ptBR } from \"date-fns/locale\";\nimport { cn } from \"../utils\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../primitives/avatar\";\nimport { Button } from \"../primitives/button\";\nimport { Badge } from \"../primitives/badge\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../overlays/tooltip\";\nimport { Separator } from \"../primitives/separator\";\nimport { \n Bold, \n Italic, \n Underline as UnderlineIcon, \n List, \n ListOrdered, \n Link as LinkIcon,\n Send,\n Paperclip,\n AlertCircle,\n MoreHorizontal,\n Trash2,\n Type,\n X,\n Smile,\n Plus\n} from \"lucide-react\";\n\n// Tiptap Imports\nimport { useEditor, EditorContent, Editor, ReactRenderer } from '@tiptap/react';\nimport type { Instance as TippyInstance } from 'tippy.js';\nimport StarterKit from '@tiptap/starter-kit';\nimport Underline from '@tiptap/extension-underline';\nimport Link from '@tiptap/extension-link';\nimport TiptapImage from '@tiptap/extension-image';\nimport Mention from '@tiptap/extension-mention';\nimport tippy from 'tippy.js';\nimport { MentionList } from './mention-list';\nimport Picker from 'emoji-picker-react';\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlays/popover\";\n\n// ==========================================\n// TIPOS\n// ==========================================\n\nexport type UserRole = 'internal' | 'client' | 'freelancer';\n\nexport interface CommentUser {\n id: string;\n name: string;\n avatar?: string;\n role: UserRole;\n}\n\nexport interface CommentReaction {\n emoji: string;\n users: string[]; // Array de IDs de usuários que reagiram\n}\n\nexport interface CommentAttachment {\n id: string;\n url: string;\n name: string;\n type: 'image' | 'file';\n}\n\nexport interface Comment {\n id: string;\n content: string; // Conteúdo HTML\n user: CommentUser;\n createdAt: Date;\n isRevisionRequest?: boolean;\n attachments?: CommentAttachment[];\n reactions?: CommentReaction[];\n}\n\nexport interface CommentSystemProps {\n comments: Comment[];\n currentUser: CommentUser;\n users?: CommentUser[]; // Lista de usuários mencionáveis\n onAddComment: (comment: Omit<Comment, \"id\" | \"createdAt\">) => void;\n onDeleteComment?: (id: string) => void;\n onReact?: (commentId: string, emoji: string) => void;\n className?: string;\n}\n\n// ==========================================\n// COMPONENTES AUXILIARES\n// ==========================================\n\nconst RoleBadge = ({ role }: { role: UserRole }) => {\n const config = {\n internal: { label: \"Equipe iClips\", className: \"bg-primary/10 text-primary hover:bg-primary/20 border-primary/20\" },\n client: { label: \"Cliente\", className: \"bg-info/10 text-info-emphasis hover:bg-info/20 border-info/20\" },\n freelancer: { label: \"Freelancer\", className: \"bg-warning/10 text-warning-emphasis hover:bg-warning/20 border-warning/20\" },\n };\n\n const { label, className } = config[role];\n\n return (\n <Badge variant=\"outline\" className={cn(\"text-[10px] h-5 px-1.5 font-medium border-0\", className)}>\n {label}\n </Badge>\n );\n};\n\n// ==========================================\n// EDITOR TOOLBAR\n// ==========================================\n\nconst EditorToolbar = ({ editor, visible }: { editor: Editor | null, visible: boolean }) => {\n if (!editor) return null;\n\n if (!visible) return null;\n\n return (\n <div className=\"flex items-center gap-1 border-b p-1 bg-muted/20 animate-in slide-in-from-bottom-2 duration-200\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('bold') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleBold().run()}\n title=\"Negrito (Ctrl+B)\"\n aria-label=\"Negrito\"\n >\n <Bold className=\"h-3.5 w-3.5\" />\n </Button>\n \n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('italic') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleItalic().run()}\n title=\"Itálico (Ctrl+I)\"\n aria-label=\"Itálico\"\n >\n <Italic className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('underline') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n title=\"Sublinhado (Ctrl+U)\"\n aria-label=\"Sublinhado\"\n >\n <UnderlineIcon className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"h-4 mx-1\" />\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('bulletList') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n aria-label=\"Lista com marcadores\"\n >\n <List className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('orderedList') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n aria-label=\"Lista numerada\"\n >\n <ListOrdered className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"h-4 mx-1\" />\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('link') && \"bg-muted text-primary\")}\n aria-label=\"Inserir link\"\n onClick={() => {\n const previousUrl = editor.getAttributes('link').href;\n const url = window.prompt('URL', previousUrl);\n if (url === null) return;\n if (url === '') {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n return;\n }\n editor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n }}\n >\n <LinkIcon className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n );\n};\n\n// ==========================================\n// COMMENT EDITOR AREA\n// ==========================================\n\nconst CommentEditor = ({ \n currentUser, \n onSubmit,\n users = []\n}: { \n currentUser: CommentUser;\n onSubmit: (data: { content: string; isRevisionRequest: boolean; attachments: CommentAttachment[] }) => void;\n users?: CommentUser[];\n}) => {\n const [isRevision, setIsRevision] = React.useState(false);\n const [showToolbar, setShowToolbar] = React.useState(false);\n const [attachments, setAttachments] = React.useState<CommentAttachment[]>([]);\n const [isEditorEmpty, setIsEditorEmpty] = React.useState(true);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const extensions = React.useMemo(() => [\n StarterKit.configure({\n // @ts-ignore\n link: false,\n // @ts-ignore\n underline: false,\n }),\n Underline,\n Link.configure({\n openOnClick: false,\n }),\n TiptapImage,\n Mention.configure({\n HTMLAttributes: {\n class: 'bg-accent text-accent-foreground rounded-sm px-1 py-0.5 font-medium decoration-clone',\n },\n suggestion: {\n items: ({ query }: { query: string }) => {\n return users\n .filter(item => item.name.toLowerCase().startsWith(query.toLowerCase()))\n .slice(0, 5);\n },\n render: () => {\n // Formato mínimo dos props do ciclo de vida do suggestion do tiptap\n // (o tipo completo `SuggestionProps` vive em `@tiptap/suggestion`, dep\n // transitiva sem entrada direta no package.json).\n type MentionRenderProps = {\n editor: Editor;\n clientRect?: (() => DOMRect | null) | null;\n event?: KeyboardEvent;\n };\n let component: ReactRenderer | null = null;\n let popup: TippyInstance[] | null = null;\n\n return {\n onStart: (props: MentionRenderProps) => {\n component = new ReactRenderer(MentionList, {\n props,\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n // tiptap tipa como `() => DOMRect | null`; tippy exige não-nulo.\n getReferenceClientRect: props.clientRect as () => DOMRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'bottom-start',\n });\n },\n onUpdate(props: MentionRenderProps) {\n component?.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup?.[0].setProps({\n getReferenceClientRect: props.clientRect as () => DOMRect,\n });\n },\n onKeyDown(props: { event: KeyboardEvent }) {\n if (props.event.key === 'Escape') {\n popup?.[0].hide();\n\n return true;\n }\n\n return Boolean(\n (component?.ref as { onKeyDown?: (p: { event: KeyboardEvent }) => boolean } | undefined)?.onKeyDown?.(props),\n );\n },\n onExit() {\n popup?.[0].destroy();\n component?.destroy();\n },\n };\n },\n },\n }),\n ], [users]);\n\n const editor = useEditor({\n extensions,\n content: '',\n onUpdate: ({ editor }) => {\n setIsEditorEmpty(editor.isEmpty);\n },\n editorProps: {\n attributes: {\n class: 'prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[80px] px-3 py-2 text-sm',\n },\n },\n });\n\n const handleAttach = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files[0]) {\n const file = e.target.files[0];\n const url = URL.createObjectURL(file);\n \n const newAttachment: CommentAttachment = {\n id: Math.random().toString(36).substr(2, 9),\n name: file.name,\n url,\n type: file.type.startsWith('image/') ? 'image' : 'file'\n };\n \n setAttachments([...attachments, newAttachment]);\n // Reset input\n e.target.value = '';\n }\n };\n\n const removeAttachment = (id: string) => {\n setAttachments(attachments.filter(a => a.id !== id));\n };\n\n const handleSubmit = () => {\n if (!editor || (editor.isEmpty && attachments.length === 0)) return;\n \n onSubmit({\n content: editor.getHTML(),\n isRevisionRequest: isRevision,\n attachments\n });\n\n editor.commands.clearContent();\n setAttachments([]);\n setIsRevision(false);\n // Manually reset empty state since clearContent triggers update but we want to be sure\n setIsEditorEmpty(true);\n };\n\n return (\n <div className=\"flex gap-3 items-start\">\n <Avatar className=\"h-8 w-8 mt-1 border\">\n <AvatarImage src={currentUser.avatar} />\n <AvatarFallback>{currentUser.name.substring(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n\n <div className={cn(\n \"flex-1 rounded-xl border bg-background shadow-sm overflow-hidden transition-colors\",\n isRevision && \"border-destructive/40 ring-1 ring-destructive/20\"\n )}>\n <EditorToolbar editor={editor} visible={showToolbar} />\n \n <EditorContent editor={editor} />\n\n {/* Attachments Preview Area */}\n {attachments.length > 0 && (\n <div className=\"px-3 pb-2 flex flex-wrap gap-2\">\n {attachments.map(att => (\n <div key={att.id} className=\"relative group\">\n {att.type === 'image' ? (\n <div className=\"h-16 w-16 rounded-md border overflow-hidden relative\">\n <img src={att.url} alt={att.name} className=\"h-full w-full object-cover\" />\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-md border bg-muted flex items-center justify-center\">\n <Paperclip className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n <button \n onClick={() => removeAttachment(att.id)}\n className=\"absolute -top-1.5 -right-1.5 bg-destructive text-destructive-foreground rounded-full p-0.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-sm\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n <div className=\"flex items-center justify-between p-2 bg-muted/10 border-t\">\n <div className=\"flex items-center gap-2\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className={cn(\n \"h-8 w-8 transition-colors\",\n showToolbar ? \"bg-muted text-foreground\" : \"text-muted-foreground hover:text-foreground\"\n )}\n onClick={() => setShowToolbar(!showToolbar)}\n aria-label=\"Opções de formatação\"\n >\n <Type className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Opções de formatação</TooltipContent>\n </Tooltip>\n\n <div className=\"w-px h-4 bg-border mx-1\" />\n\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n aria-label=\"Inserir emoji\"\n >\n <Smile className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"start\" side=\"top\">\n <Picker \n onEmojiClick={(emojiData) => editor?.chain().focus().insertContent(emojiData.emoji).run()}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n\n <input \n type=\"file\" \n className=\"hidden\" \n ref={fileInputRef}\n onChange={handleAttach}\n accept=\"image/*,.pdf,.doc,.docx\"\n />\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n onClick={() => fileInputRef.current?.click()}\n aria-label=\"Anexar arquivo\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anexar arquivo</TooltipContent>\n </Tooltip>\n\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"sm\" \n className={cn(\n \"h-8 gap-2 px-2 transition-colors\",\n isRevision\n ? \"bg-destructive/10 text-destructive-emphasis hover:bg-destructive/20\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n onClick={() => setIsRevision(!isRevision)}\n >\n <AlertCircle className=\"h-4 w-4\" />\n <span className=\"text-xs font-medium\">Solicitar Refação</span>\n </Button>\n </TooltipTrigger>\n <TooltipContent>Marca este comentário como um pedido de alteração</TooltipContent>\n </Tooltip>\n </div>\n\n <Button\n size=\"sm\"\n onClick={handleSubmit}\n disabled={isEditorEmpty && attachments.length === 0}\n >\n Enviar <Send className=\"h-3.5 w-3.5 ml-2\" />\n </Button>\n </div>\n </div>\n </div>\n );\n};\n\n// ==========================================\n// SINGLE COMMENT ITEM\n// ==========================================\n\nconst CommentItem = ({ \n comment, \n currentUserId,\n onDelete, \n onReact \n}: { \n comment: Comment; \n currentUserId: string;\n onDelete?: (id: string) => void;\n onReact?: (commentId: string, emoji: string) => void;\n}) => {\n const isRevision = comment.isRevisionRequest;\n\n return (\n <div className={cn(\n \"group flex gap-3 p-4 rounded-lg transition-colors\",\n isRevision ? \"bg-destructive/5 border border-destructive/20\" : \"hover:bg-muted/20\"\n )}>\n <Avatar className=\"h-8 w-8 mt-0.5 border\">\n <AvatarImage src={comment.user.avatar} />\n <AvatarFallback>{comment.user.name.substring(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n\n <div className=\"flex-1 min-w-0\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-1.5\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-semibold text-sm text-foreground\">{comment.user.name}</span>\n <RoleBadge role={comment.user.role} />\n <span className=\"text-xs text-foreground/65\">\n {format(comment.createdAt, \"dd MMM 'às' HH:mm\", { locale: ptBR })}\n </span>\n </div>\n \n <div className=\"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity\">\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 text-muted-foreground hover:text-foreground\"\n aria-label=\"Reagir com emoji\"\n >\n <Smile className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"end\">\n <Picker \n onEmojiClick={(emojiData) => onReact?.(comment.id, emojiData.emoji)}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n\n {onDelete && (\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className=\"h-6 w-6 text-muted-foreground hover:text-destructive\"\n onClick={() => onDelete(comment.id)}\n aria-label=\"Excluir comentário\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Button>\n )}\n </div>\n </div>\n\n {/* Revision Badge */}\n {isRevision && (\n <div className=\"inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-destructive/10 text-destructive-emphasis text-xs font-medium mb-2\">\n <AlertCircle className=\"h-3.5 w-3.5\" />\n Solicitação de Refação\n </div>\n )}\n\n {/* Content */}\n <div \n className=\"prose prose-sm dark:prose-invert max-w-none text-sm text-foreground/90 leading-relaxed break-words [&_p]:mb-2 [&_p:last-child]:mb-0\"\n dangerouslySetInnerHTML={{ __html: comment.content }}\n />\n\n {/* Attachments Display */}\n {comment.attachments && comment.attachments.length > 0 && (\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {comment.attachments.map(att => (\n <div \n key={att.id} \n className=\"group/att relative rounded-lg border overflow-hidden bg-background hover:shadow-sm transition-all cursor-pointer\"\n onClick={() => window.open(att.url, '_blank')}\n >\n {att.type === 'image' ? (\n <div className=\"h-32 aspect-[4/3]\">\n <img src={att.url} alt={att.name} className=\"h-full w-full object-cover\" />\n <div className=\"absolute inset-0 bg-foreground/0 group-hover/att:bg-foreground/10 transition-colors\" />\n </div>\n ) : (\n <div className=\"h-12 px-3 flex items-center gap-2 bg-muted/30\">\n <Paperclip className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-xs font-medium truncate max-w-[150px]\">{att.name}</span>\n </div>\n )}\n </div>\n ))}\n </div>\n )}\n\n {/* Reactions */}\n <div className=\"mt-3 flex flex-wrap gap-2 items-center\">\n {comment.reactions?.map((reaction) => (\n <button\n key={reaction.emoji}\n onClick={() => onReact?.(comment.id, reaction.emoji)}\n className={cn(\n \"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium border transition-colors\",\n reaction.users.includes(currentUserId)\n ? \"bg-accent border-accent text-accent-foreground\"\n : \"bg-muted/30 border-transparent hover:bg-muted/50 text-muted-foreground\"\n )}\n >\n <span>{reaction.emoji}</span>\n <span>{reaction.users.length}</span>\n </button>\n ))}\n \n {onReact && (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/50\"\n aria-label=\"Adicionar reação\"\n >\n <Plus className=\"h-3.5 w-3.5\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"start\">\n <Picker \n onEmojiClick={(emojiData) => onReact(comment.id, emojiData.emoji)}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n )}\n </div>\n </div>\n </div>\n );\n};\n\n// ==========================================\n// MAIN COMPONENT\n// ==========================================\n\nexport const CommentSystem = ({ \n comments, \n currentUser, \n users = [],\n onAddComment, \n onDeleteComment,\n onReact,\n className \n}: CommentSystemProps) => {\n \n const handleSubmit = (data: { content: string; isRevisionRequest: boolean; attachments: CommentAttachment[] }) => {\n onAddComment({\n content: data.content,\n user: currentUser,\n isRevisionRequest: data.isRevisionRequest,\n attachments: data.attachments\n });\n };\n\n return (\n <div className={cn(\"flex flex-col h-full\", className)}>\n {/* Header */}\n <div className=\"px-4 py-3 border-b flex items-center justify-between bg-card\">\n <h3 className=\"font-semibold text-base\">Comentários da Atividade</h3>\n <Badge variant=\"secondary\" className=\"bg-muted text-muted-foreground hover:bg-muted\">\n {comments.length}\n </Badge>\n </div>\n\n {/* Scrollable List */}\n <div className=\"flex-1 overflow-y-auto p-4 space-y-2 bg-muted/5\">\n {comments.length === 0 ? (\n <div className=\"h-full flex flex-col items-center justify-center text-muted-foreground min-h-[200px]\">\n <div className=\"bg-muted rounded-full p-3 mb-3\">\n <MoreHorizontal className=\"h-6 w-6\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-sm font-medium text-foreground/70\">Nenhum comentário ainda</p>\n <p className=\"text-xs\">Inicie a conversa sobre esta tarefa</p>\n </div>\n ) : (\n comments.map((comment) => (\n <CommentItem \n key={comment.id} \n comment={comment} \n currentUserId={currentUser.id}\n onDelete={onDeleteComment} \n onReact={onReact}\n />\n ))\n )}\n </div>\n\n {/* Input Area */}\n <div className=\"p-4 border-t bg-card\">\n <CommentEditor \n currentUser={currentUser} \n onSubmit={handleSubmit}\n users={users}\n />\n </div>\n </div>\n );\n};\n\nexport default CommentSystem;"],"names":["RoleBadge","role","config","label","className","jsx","Badge","cn","EditorToolbar","editor","visible","jsxs","Button","Bold","Italic","UnderlineIcon","Separator","List","ListOrdered","previousUrl","url","LinkIcon","CommentEditor","currentUser","onSubmit","users","isRevision","setIsRevision","React","showToolbar","setShowToolbar","attachments","setAttachments","isEditorEmpty","setIsEditorEmpty","fileInputRef","extensions","StarterKit","Underline","Link","TiptapImage","Mention","query","item","component","popup","props","ReactRenderer","MentionList","tippy","_b","_a","useEditor","handleAttach","e","file","newAttachment","removeAttachment","id","handleSubmit","Avatar","AvatarImage","AvatarFallback","EditorContent","att","Paperclip","X","Tooltip","TooltipTrigger","Type","TooltipContent","Popover","PopoverTrigger","Smile","PopoverContent","Picker","emojiData","AlertCircle","Send","CommentItem","comment","currentUserId","onDelete","onReact","format","ptBR","Trash2","reaction","Plus","CommentSystem","comments","onAddComment","onDeleteComment","data","MoreHorizontal"],"mappings":"whCAyFMA,EAAY,CAAC,CAAE,KAAAC,KAA+B,CAClD,MAAMC,EAAS,CACb,SAAU,CAAE,MAAO,gBAAiB,UAAW,kEAAA,EAC/C,OAAQ,CAAE,MAAO,UAAW,UAAW,+DAAA,EACvC,WAAY,CAAE,MAAO,aAAc,UAAW,2EAAA,CAA4E,EAGtH,CAAE,MAAAC,EAAO,UAAAC,GAAcF,EAAOD,CAAI,EAExC,OACEI,MAACC,EAAAA,OAAM,QAAQ,UAAU,UAAWC,EAAAA,GAAG,8CAA+CH,CAAS,EAC5F,SAAAD,CAAA,CACH,CAEJ,EAMMK,EAAgB,CAAC,CAAE,OAAAC,EAAQ,QAAAC,KAC3B,CAACD,GAED,CAACC,EAAgB,KAGnBC,EAAAA,KAAC,MAAA,CAAI,UAAU,kGACb,SAAA,CAAAN,EAAAA,IAACO,EAAAA,OAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAWL,EAAAA,GAAG,UAAWE,EAAO,SAAS,MAAM,GAAK,uBAAuB,EAC3E,QAAS,IAAMA,EAAO,MAAA,EAAQ,QAAQ,WAAA,EAAa,IAAA,EACnD,MAAM,mBACN,aAAW,UAEX,SAAAJ,EAAAA,IAACQ,EAAAA,KAAA,CAAK,UAAU,aAAA,CAAc,CAAA,CAAA,EAGhCR,EAAAA,IAACO,EAAAA,OAAA,CACC,QAAQ,QACR,KAA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
|
1
|
+
{"version":3,"file":"comment-system.cjs","sources":["../../../../src/components/ui/data/comment-system.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { ptBR } from \"date-fns/locale\";\nimport { cn } from \"../utils\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../primitives/avatar\";\nimport { Button } from \"../primitives/button\";\nimport { Badge } from \"../primitives/badge\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../overlays/tooltip\";\nimport { Separator } from \"../primitives/separator\";\nimport { \n Bold, \n Italic, \n Underline as UnderlineIcon, \n List, \n ListOrdered, \n Link as LinkIcon,\n Send,\n Paperclip,\n AlertCircle,\n MoreHorizontal,\n Trash2,\n Type,\n X,\n Smile,\n Plus\n} from \"lucide-react\";\n\n// Tiptap Imports\nimport { useEditor, EditorContent, Editor, ReactRenderer } from '@tiptap/react';\nimport type { Instance as TippyInstance } from 'tippy.js';\nimport StarterKit from '@tiptap/starter-kit';\nimport Underline from '@tiptap/extension-underline';\nimport Link from '@tiptap/extension-link';\nimport TiptapImage from '@tiptap/extension-image';\nimport Mention from '@tiptap/extension-mention';\nimport tippy from 'tippy.js';\nimport { MentionList } from './mention-list';\nimport Picker from 'emoji-picker-react';\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlays/popover\";\n\n// ==========================================\n// TIPOS\n// ==========================================\n\nexport type UserRole = 'internal' | 'client' | 'freelancer';\n\nexport interface CommentUser {\n id: string;\n name: string;\n avatar?: string;\n role: UserRole;\n}\n\nexport interface CommentReaction {\n emoji: string;\n users: string[]; // Array de IDs de usuários que reagiram\n}\n\nexport interface CommentAttachment {\n id: string;\n url: string;\n name: string;\n type: 'image' | 'file';\n}\n\nexport interface Comment {\n id: string;\n content: string; // Conteúdo HTML\n user: CommentUser;\n createdAt: Date;\n isRevisionRequest?: boolean;\n attachments?: CommentAttachment[];\n reactions?: CommentReaction[];\n}\n\nexport interface CommentSystemProps {\n comments: Comment[];\n currentUser: CommentUser;\n users?: CommentUser[]; // Lista de usuários mencionáveis\n onAddComment: (comment: Omit<Comment, \"id\" | \"createdAt\">) => void;\n onDeleteComment?: (id: string) => void;\n onReact?: (commentId: string, emoji: string) => void;\n className?: string;\n}\n\n// ==========================================\n// COMPONENTES AUXILIARES\n// ==========================================\n\nconst RoleBadge = ({ role }: { role: UserRole }) => {\n const config = {\n internal: { label: \"Equipe iClips\", className: \"bg-primary/10 text-primary border-primary/20\" },\n client: { label: \"Cliente\", className: \"bg-info/10 text-info-emphasis border-info/20\" },\n freelancer: { label: \"Freelancer\", className: \"bg-warning/10 text-warning-emphasis border-warning/20\" },\n };\n\n const { label, className } = config[role];\n\n return (\n <Badge variant=\"outline\" className={cn(\"text-[10px] h-5 px-1.5 font-medium border-0\", className)}>\n {label}\n </Badge>\n );\n};\n\n// ==========================================\n// EDITOR TOOLBAR\n// ==========================================\n\nconst EditorToolbar = ({ editor, visible }: { editor: Editor | null, visible: boolean }) => {\n if (!editor) return null;\n\n if (!visible) return null;\n\n return (\n <div className=\"flex items-center gap-1 border-b p-1 bg-muted/20 animate-in slide-in-from-bottom-2 duration-200\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('bold') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleBold().run()}\n title=\"Negrito (Ctrl+B)\"\n aria-label=\"Negrito\"\n >\n <Bold className=\"h-3.5 w-3.5\" />\n </Button>\n \n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('italic') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleItalic().run()}\n title=\"Itálico (Ctrl+I)\"\n aria-label=\"Itálico\"\n >\n <Italic className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('underline') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n title=\"Sublinhado (Ctrl+U)\"\n aria-label=\"Sublinhado\"\n >\n <UnderlineIcon className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"h-4 mx-1\" />\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('bulletList') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n aria-label=\"Lista com marcadores\"\n >\n <List className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('orderedList') && \"bg-muted text-primary\")}\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n aria-label=\"Lista numerada\"\n >\n <ListOrdered className=\"h-3.5 w-3.5\" />\n </Button>\n\n <Separator orientation=\"vertical\" className=\"h-4 mx-1\" />\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", editor.isActive('link') && \"bg-muted text-primary\")}\n aria-label=\"Inserir link\"\n onClick={() => {\n const previousUrl = editor.getAttributes('link').href;\n const url = window.prompt('URL', previousUrl);\n if (url === null) return;\n if (url === '') {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n return;\n }\n editor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n }}\n >\n <LinkIcon className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n );\n};\n\n// ==========================================\n// COMMENT EDITOR AREA\n// ==========================================\n\nconst CommentEditor = ({ \n currentUser, \n onSubmit,\n users = []\n}: { \n currentUser: CommentUser;\n onSubmit: (data: { content: string; isRevisionRequest: boolean; attachments: CommentAttachment[] }) => void;\n users?: CommentUser[];\n}) => {\n const [isRevision, setIsRevision] = React.useState(false);\n const [showToolbar, setShowToolbar] = React.useState(false);\n const [attachments, setAttachments] = React.useState<CommentAttachment[]>([]);\n const [isEditorEmpty, setIsEditorEmpty] = React.useState(true);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const extensions = React.useMemo(() => [\n StarterKit.configure({\n // @ts-ignore\n link: false,\n // @ts-ignore\n underline: false,\n }),\n Underline,\n Link.configure({\n openOnClick: false,\n }),\n TiptapImage,\n Mention.configure({\n HTMLAttributes: {\n class: 'bg-secondary text-secondary-foreground rounded-sm px-1 py-0.5 font-medium decoration-clone',\n },\n suggestion: {\n items: ({ query }: { query: string }) => {\n return users\n .filter(item => item.name.toLowerCase().startsWith(query.toLowerCase()))\n .slice(0, 5);\n },\n render: () => {\n // Formato mínimo dos props do ciclo de vida do suggestion do tiptap\n // (o tipo completo `SuggestionProps` vive em `@tiptap/suggestion`, dep\n // transitiva sem entrada direta no package.json).\n type MentionRenderProps = {\n editor: Editor;\n clientRect?: (() => DOMRect | null) | null;\n event?: KeyboardEvent;\n };\n let component: ReactRenderer | null = null;\n let popup: TippyInstance[] | null = null;\n\n return {\n onStart: (props: MentionRenderProps) => {\n component = new ReactRenderer(MentionList, {\n props,\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n // tiptap tipa como `() => DOMRect | null`; tippy exige não-nulo.\n getReferenceClientRect: props.clientRect as () => DOMRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'bottom-start',\n });\n },\n onUpdate(props: MentionRenderProps) {\n component?.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup?.[0].setProps({\n getReferenceClientRect: props.clientRect as () => DOMRect,\n });\n },\n onKeyDown(props: { event: KeyboardEvent }) {\n if (props.event.key === 'Escape') {\n popup?.[0].hide();\n\n return true;\n }\n\n return Boolean(\n (component?.ref as { onKeyDown?: (p: { event: KeyboardEvent }) => boolean } | undefined)?.onKeyDown?.(props),\n );\n },\n onExit() {\n popup?.[0].destroy();\n component?.destroy();\n },\n };\n },\n },\n }),\n ], [users]);\n\n const editor = useEditor({\n extensions,\n content: '',\n onUpdate: ({ editor }) => {\n setIsEditorEmpty(editor.isEmpty);\n },\n editorProps: {\n attributes: {\n class: 'prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[80px] px-3 py-2 text-sm',\n },\n },\n });\n\n const handleAttach = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files[0]) {\n const file = e.target.files[0];\n const url = URL.createObjectURL(file);\n \n const newAttachment: CommentAttachment = {\n id: Math.random().toString(36).substr(2, 9),\n name: file.name,\n url,\n type: file.type.startsWith('image/') ? 'image' : 'file'\n };\n \n setAttachments([...attachments, newAttachment]);\n // Reset input\n e.target.value = '';\n }\n };\n\n const removeAttachment = (id: string) => {\n setAttachments(attachments.filter(a => a.id !== id));\n };\n\n const handleSubmit = () => {\n if (!editor || (editor.isEmpty && attachments.length === 0)) return;\n \n onSubmit({\n content: editor.getHTML(),\n isRevisionRequest: isRevision,\n attachments\n });\n\n editor.commands.clearContent();\n setAttachments([]);\n setIsRevision(false);\n // Manually reset empty state since clearContent triggers update but we want to be sure\n setIsEditorEmpty(true);\n };\n\n return (\n <div className=\"flex gap-3 items-start\">\n <Avatar className=\"h-8 w-8 mt-1 border\">\n <AvatarImage src={currentUser.avatar} />\n <AvatarFallback>{currentUser.name.substring(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n\n <div className={cn(\n \"flex-1 rounded-xl border bg-background shadow-sm overflow-hidden transition-colors\",\n isRevision && \"border-destructive/40 ring-1 ring-destructive/20\"\n )}>\n <EditorToolbar editor={editor} visible={showToolbar} />\n \n <EditorContent editor={editor} />\n\n {/* Attachments Preview Area */}\n {attachments.length > 0 && (\n <div className=\"px-3 pb-2 flex flex-wrap gap-2\">\n {attachments.map(att => (\n <div key={att.id} className=\"relative group\">\n {att.type === 'image' ? (\n <div className=\"h-16 w-16 rounded-md border overflow-hidden relative\">\n <img src={att.url} alt={att.name} className=\"h-full w-full object-cover\" />\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-md border bg-muted flex items-center justify-center\">\n <Paperclip className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n <button \n onClick={() => removeAttachment(att.id)}\n className=\"absolute -top-1.5 -right-1.5 border bg-background text-destructive-emphasis hover:bg-destructive/10 rounded-full p-0.5 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity shadow-sm\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n <div className=\"flex items-center justify-between p-2 bg-muted/10 border-t\">\n <div className=\"flex items-center gap-2\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className={cn(\n \"h-8 w-8 transition-colors\",\n showToolbar ? \"bg-muted text-foreground\" : \"text-muted-foreground hover:text-foreground\"\n )}\n onClick={() => setShowToolbar(!showToolbar)}\n aria-label=\"Opções de formatação\"\n >\n <Type className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Opções de formatação</TooltipContent>\n </Tooltip>\n\n <div className=\"w-px h-4 bg-border mx-1\" />\n\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n aria-label=\"Inserir emoji\"\n >\n <Smile className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"start\" side=\"top\">\n <Picker \n onEmojiClick={(emojiData) => editor?.chain().focus().insertContent(emojiData.emoji).run()}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n\n <input \n type=\"file\" \n className=\"hidden\" \n ref={fileInputRef}\n onChange={handleAttach}\n accept=\"image/*,.pdf,.doc,.docx\"\n />\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n onClick={() => fileInputRef.current?.click()}\n aria-label=\"Anexar arquivo\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Anexar arquivo</TooltipContent>\n </Tooltip>\n\n <Tooltip>\n <TooltipTrigger asChild>\n <Button \n variant=\"ghost\" \n size=\"sm\" \n className={cn(\n \"h-8 gap-2 px-2 transition-colors\",\n isRevision\n ? \"bg-destructive/10 text-destructive-emphasis hover:bg-destructive/20\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n onClick={() => setIsRevision(!isRevision)}\n >\n <AlertCircle className=\"h-4 w-4\" />\n <span className=\"text-xs font-medium\">Solicitar Refação</span>\n </Button>\n </TooltipTrigger>\n <TooltipContent>Marca este comentário como um pedido de alteração</TooltipContent>\n </Tooltip>\n </div>\n\n <Button\n size=\"sm\"\n onClick={handleSubmit}\n disabled={isEditorEmpty && attachments.length === 0}\n >\n Enviar <Send className=\"h-3.5 w-3.5 ml-2\" />\n </Button>\n </div>\n </div>\n </div>\n );\n};\n\n// ==========================================\n// SINGLE COMMENT ITEM\n// ==========================================\n\nconst CommentItem = ({ \n comment, \n currentUserId,\n onDelete, \n onReact \n}: { \n comment: Comment; \n currentUserId: string;\n onDelete?: (id: string) => void;\n onReact?: (commentId: string, emoji: string) => void;\n}) => {\n const isRevision = comment.isRevisionRequest;\n\n return (\n <div className={cn(\n \"group flex gap-3 p-4 rounded-lg transition-colors\",\n isRevision ? \"bg-destructive/5 border border-destructive/20\" : \"hover:bg-muted/20\"\n )}>\n <Avatar className=\"h-8 w-8 mt-0.5 border\">\n <AvatarImage src={comment.user.avatar} />\n <AvatarFallback>{comment.user.name.substring(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n\n <div className=\"flex-1 min-w-0\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-1.5\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-semibold text-sm text-foreground\">{comment.user.name}</span>\n <RoleBadge role={comment.user.role} />\n <span className=\"text-xs text-foreground/65\">\n {format(comment.createdAt, \"dd MMM 'às' HH:mm\", { locale: ptBR })}\n </span>\n </div>\n \n <div className=\"flex items-center gap-2 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity has-[[data-state=open]]:opacity-100\">\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 relative before:absolute before:-inset-1 before:content-[''] text-muted-foreground hover:text-foreground\"\n aria-label=\"Reagir com emoji\"\n >\n <Smile className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"end\">\n <Picker \n onEmojiClick={(emojiData) => onReact?.(comment.id, emojiData.emoji)}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n\n {onDelete && (\n <Button \n variant=\"ghost\" \n size=\"icon\" \n className=\"h-6 w-6 relative before:absolute before:-inset-1 before:content-[''] text-muted-foreground hover:text-destructive-emphasis\"\n onClick={() => onDelete(comment.id)}\n aria-label=\"Excluir comentário\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Button>\n )}\n </div>\n </div>\n\n {/* Revision Badge */}\n {isRevision && (\n <div className=\"inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-destructive/10 text-destructive-emphasis text-xs font-medium mb-2\">\n <AlertCircle className=\"h-3.5 w-3.5\" />\n Solicitação de Refação\n </div>\n )}\n\n {/* Content */}\n <div \n className=\"prose prose-sm dark:prose-invert max-w-none text-sm text-foreground/90 leading-relaxed break-words [&_p]:mb-2 [&_p:last-child]:mb-0\"\n dangerouslySetInnerHTML={{ __html: comment.content }}\n />\n\n {/* Attachments Display */}\n {comment.attachments && comment.attachments.length > 0 && (\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {comment.attachments.map(att => (\n <div \n key={att.id} \n className=\"group/att relative rounded-lg border overflow-hidden bg-background hover:shadow-sm transition-all cursor-pointer\"\n onClick={() => window.open(att.url, '_blank')}\n >\n {att.type === 'image' ? (\n <div className=\"h-32 aspect-[4/3]\">\n <img src={att.url} alt={att.name} className=\"h-full w-full object-cover\" />\n <div className=\"absolute inset-0 bg-foreground/0 group-hover/att:bg-foreground/10 transition-colors\" />\n </div>\n ) : (\n <div className=\"h-12 px-3 flex items-center gap-2 bg-muted/30\">\n <Paperclip className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-xs font-medium truncate max-w-[150px]\">{att.name}</span>\n </div>\n )}\n </div>\n ))}\n </div>\n )}\n\n {/* Reactions */}\n <div className=\"mt-3 flex flex-wrap gap-2 items-center\">\n {comment.reactions?.map((reaction) => (\n <button\n key={reaction.emoji}\n onClick={() => onReact?.(comment.id, reaction.emoji)}\n className={cn(\n \"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium border transition-colors\",\n reaction.users.includes(currentUserId)\n ? \"bg-secondary border-secondary text-secondary-foreground\"\n : \"bg-muted/30 border-transparent hover:bg-muted/50 text-muted-foreground\"\n )}\n >\n <span>{reaction.emoji}</span>\n <span>{reaction.users.length}</span>\n </button>\n ))}\n \n {onReact && (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/50\"\n aria-label=\"Adicionar reação\"\n >\n <Plus className=\"h-3.5 w-3.5\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 border-none\" align=\"start\">\n <Picker \n onEmojiClick={(emojiData) => onReact(comment.id, emojiData.emoji)}\n width={300}\n height={350}\n />\n </PopoverContent>\n </Popover>\n )}\n </div>\n </div>\n </div>\n );\n};\n\n// ==========================================\n// MAIN COMPONENT\n// ==========================================\n\nexport const CommentSystem = ({ \n comments, \n currentUser, \n users = [],\n onAddComment, \n onDeleteComment,\n onReact,\n className \n}: CommentSystemProps) => {\n \n const handleSubmit = (data: { content: string; isRevisionRequest: boolean; attachments: CommentAttachment[] }) => {\n onAddComment({\n content: data.content,\n user: currentUser,\n isRevisionRequest: data.isRevisionRequest,\n attachments: data.attachments\n });\n };\n\n return (\n <div className={cn(\"flex flex-col h-full\", className)}>\n {/* Header */}\n <div className=\"px-4 py-3 border-b flex items-center justify-between bg-card\">\n <h3 className=\"font-semibold text-base\">Comentários da Atividade</h3>\n <Badge variant=\"secondary\" className=\"bg-muted text-muted-foreground hover:bg-muted\">\n {comments.length}\n </Badge>\n </div>\n\n {/* Scrollable List */}\n <div className=\"flex-1 overflow-y-auto p-4 space-y-2 bg-muted/5\">\n {comments.length === 0 ? (\n <div className=\"h-full flex flex-col items-center justify-center text-muted-foreground min-h-[200px]\">\n <div className=\"bg-muted rounded-full p-3 mb-3\">\n <MoreHorizontal className=\"h-6 w-6\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-sm font-medium text-foreground/70\">Nenhum comentário ainda</p>\n <p className=\"text-xs\">Inicie a conversa sobre esta tarefa</p>\n </div>\n ) : (\n comments.map((comment) => (\n <CommentItem \n key={comment.id} \n comment={comment} \n currentUserId={currentUser.id}\n onDelete={onDeleteComment} \n onReact={onReact}\n />\n ))\n )}\n </div>\n\n {/* Input Area */}\n <div className=\"p-4 border-t bg-card\">\n <CommentEditor \n currentUser={currentUser} \n onSubmit={handleSubmit}\n users={users}\n />\n </div>\n </div>\n );\n};\n\nexport default CommentSystem;"],"names":["RoleBadge","role","config","label","className","jsx","Badge","cn","EditorToolbar","editor","visible","jsxs","Button","Bold","Italic","UnderlineIcon","Separator","List","ListOrdered","previousUrl","url","LinkIcon","CommentEditor","currentUser","onSubmit","users","isRevision","setIsRevision","React","showToolbar","setShowToolbar","attachments","setAttachments","isEditorEmpty","setIsEditorEmpty","fileInputRef","extensions","StarterKit","Underline","Link","TiptapImage","Mention","query","item","component","popup","props","ReactRenderer","MentionList","tippy","_b","_a","useEditor","handleAttach","e","file","newAttachment","removeAttachment","id","a","handleSubmit","Avatar","AvatarImage","AvatarFallback","EditorContent","att","Paperclip","X","Tooltip","TooltipTrigger","Type","TooltipContent","Popover","PopoverTrigger","Smile","PopoverContent","Picker","emojiData","AlertCircle","Send","CommentItem","comment","currentUserId","onDelete","onReact","format","ptBR","Trash2","reaction","Plus","CommentSystem","comments","onAddComment","onDeleteComment","data","MoreHorizontal"],"mappings":"whCAyFMA,EAAY,CAAC,CAAE,KAAAC,KAA+B,CAClD,MAAMC,EAAS,CACb,SAAU,CAAE,MAAO,gBAAiB,UAAW,8CAAA,EAC/C,OAAQ,CAAE,MAAO,UAAW,UAAW,8CAAA,EACvC,WAAY,CAAE,MAAO,aAAc,UAAW,uDAAA,CAAwD,EAGlG,CAAE,MAAAC,EAAO,UAAAC,GAAcF,EAAOD,CAAI,EAExC,OACEI,MAACC,EAAAA,OAAM,QAAQ,UAAU,UAAWC,EAAAA,GAAG,8CAA+CH,CAAS,EAC5F,SAAAD,CAAA,CACH,CAEJ,EAMMK,EAAgB,CAAC,CAAE,OAAAC,EAAQ,QAAAC,KAC3B,CAACD,GAED,CAACC,EAAgB,KAGnBC,EAAAA,KAAC,MAAA,CAAI,UAAU,kGACb,SAAA,CAAAN,EAAAA,IAACO,EAAAA,OAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAWL,EAAAA,GAAG,UAAWE,EAAO,SAAS,MAAM,GAAK,uBAAuB,EAC3E,QAAS,IAAMA,EAAO,MAAA,EAAQ,QAAQ,WAAA,EAAa,IAAA,EACnD,MAAM,mBACN,aAAW,UAEX,SAAAJ,EAAAA,IAACQ,EAAAA,KAAA,CAAK,UAAU,aAAA,CAAc,CAAA,CAAA,EAGhCR,EAAAA,IAACO,EAAAA,OAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAWL,EAAAA,GAAG,UAAWE,EAAO,SAAS,QAAQ,GAAK,uBAAuB,EAC7E,QAAS,IAAMA,EAAO,MAAA,EAAQ,QAAQ,aAAA,EAAe,IAAA,EACrD,MAAM,mBACN,aAAW,UAEX,SAAAJ,EAAAA,IAACS,EAAAA,OAAA,CAAO,UAAU,aAAA,CAAc,CAAA,CAAA,EAGlCT,EAAAA,I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AaA,EAAK,WAAA,CACnB,CACH,EAEA,cACG,MAAA,CAAI,UAAWvF,EAAAA,GAAG,uBAAwBH,CAAS,EAElD,SAAA,CAAAO,EAAAA,KAAC,MAAA,CAAI,UAAU,+DACb,SAAA,CAAAN,EAAAA,IAAC,KAAA,CAAG,UAAU,0BAA0B,SAAA,2BAAwB,QAC/DC,EAAAA,MAAA,CAAM,QAAQ,YAAY,UAAU,gDAClC,WAAS,MAAA,CACZ,CAAA,EACF,EAGAD,EAAAA,IAAC,MAAA,CAAI,UAAU,kDACZ,SAAAsF,EAAS,SAAW,EACnBhF,EAAAA,KAAC,MAAA,CAAI,UAAU,uFACb,SAAA,CAAAN,EAAAA,IAAC,MAAA,CAAI,UAAU,iCACb,SAAAA,EAAAA,IAAC0F,kBAAe,UAAU,UAAU,cAAY,MAAA,CAAO,CAAA,CACzD,EACA1F,EAAAA,IAAC,IAAA,CAAE,UAAU,yCAAyC,SAAA,0BAAuB,EAC7EA,EAAAA,IAAC,IAAA,CAAE,UAAU,UAAU,SAAA,qCAAA,CAAmC,CAAA,CAAA,CAC5D,EAEAsF,EAAS,IAAKV,GACZ5E,EAAAA,IAAC2E,EAAA,CAEC,QAAAC,EACA,cAAe1D,EAAY,GAC3B,SAAUsE,EACV,QAAAT,CAAA,EAJKH,EAAQ,EAAA,CAMhB,EAEL,EAGA5E,EAAAA,IAAC,MAAA,CAAI,UAAU,uBACb,SAAAA,EAAAA,IAACiB,EAAA,CACC,YAAAC,EACA,SAAUqC,EACV,MAAAnC,CAAA,CAAA,CACF,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -4,16 +4,16 @@ import { format as K } from "date-fns";
|
|
|
4
4
|
import { ptBR as D } from "date-fns/locale";
|
|
5
5
|
import { cn as c } from "../utils.js";
|
|
6
6
|
import { Avatar as I, AvatarImage as z, AvatarFallback as T } from "../primitives/avatar.js";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as o } from "../primitives/button.js";
|
|
8
8
|
import { Badge as M } from "../primitives/badge.js";
|
|
9
9
|
import { Tooltip as x, TooltipTrigger as N, TooltipContent as w } from "../overlays/tooltip.js";
|
|
10
10
|
import { Separator as E } from "../primitives/separator.js";
|
|
11
11
|
import { MoreHorizontal as F, Smile as U, Trash2 as W, AlertCircle as B, Paperclip as y, Plus as $, X, Type as G, Send as J, Bold as Q, Italic as V, Underline as Y, List as Z, ListOrdered as ee, Link as te } from "lucide-react";
|
|
12
12
|
import { ReactRenderer as re, useEditor as ie, EditorContent as ae } from "@tiptap/react";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import se from "@tiptap/starter-kit";
|
|
14
|
+
import ne from "@tiptap/extension-underline";
|
|
15
|
+
import oe from "@tiptap/extension-link";
|
|
16
|
+
import le from "@tiptap/extension-image";
|
|
17
17
|
import ce from "@tiptap/extension-mention";
|
|
18
18
|
import de from "tippy.js";
|
|
19
19
|
import { MentionList as me } from "./mention-list.js";
|
|
@@ -21,14 +21,14 @@ import C from "emoji-picker-react";
|
|
|
21
21
|
import { Popover as k, PopoverTrigger as R, PopoverContent as L } from "../overlays/popover.js";
|
|
22
22
|
const ue = ({ role: t }) => {
|
|
23
23
|
const d = {
|
|
24
|
-
internal: { label: "Equipe iClips", className: "bg-primary/10 text-primary
|
|
25
|
-
client: { label: "Cliente", className: "bg-info/10 text-info-emphasis
|
|
26
|
-
freelancer: { label: "Freelancer", className: "bg-warning/10 text-warning-emphasis
|
|
24
|
+
internal: { label: "Equipe iClips", className: "bg-primary/10 text-primary border-primary/20" },
|
|
25
|
+
client: { label: "Cliente", className: "bg-info/10 text-info-emphasis border-info/20" },
|
|
26
|
+
freelancer: { label: "Freelancer", className: "bg-warning/10 text-warning-emphasis border-warning/20" }
|
|
27
27
|
}, { label: m, className: a } = d[t];
|
|
28
28
|
return /* @__PURE__ */ e(M, { variant: "outline", className: c("text-[10px] h-5 px-1.5 font-medium border-0", a), children: m });
|
|
29
29
|
}, he = ({ editor: t, visible: d }) => !t || !d ? null : /* @__PURE__ */ i("div", { className: "flex items-center gap-1 border-b p-1 bg-muted/20 animate-in slide-in-from-bottom-2 duration-200", children: [
|
|
30
30
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
o,
|
|
32
32
|
{
|
|
33
33
|
variant: "ghost",
|
|
34
34
|
size: "icon",
|
|
@@ -40,7 +40,7 @@ const ue = ({ role: t }) => {
|
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
42
|
/* @__PURE__ */ e(
|
|
43
|
-
|
|
43
|
+
o,
|
|
44
44
|
{
|
|
45
45
|
variant: "ghost",
|
|
46
46
|
size: "icon",
|
|
@@ -52,7 +52,7 @@ const ue = ({ role: t }) => {
|
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
|
-
|
|
55
|
+
o,
|
|
56
56
|
{
|
|
57
57
|
variant: "ghost",
|
|
58
58
|
size: "icon",
|
|
@@ -65,7 +65,7 @@ const ue = ({ role: t }) => {
|
|
|
65
65
|
),
|
|
66
66
|
/* @__PURE__ */ e(E, { orientation: "vertical", className: "h-4 mx-1" }),
|
|
67
67
|
/* @__PURE__ */ e(
|
|
68
|
-
|
|
68
|
+
o,
|
|
69
69
|
{
|
|
70
70
|
variant: "ghost",
|
|
71
71
|
size: "icon",
|
|
@@ -76,7 +76,7 @@ const ue = ({ role: t }) => {
|
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ e(
|
|
79
|
-
|
|
79
|
+
o,
|
|
80
80
|
{
|
|
81
81
|
variant: "ghost",
|
|
82
82
|
size: "icon",
|
|
@@ -88,7 +88,7 @@ const ue = ({ role: t }) => {
|
|
|
88
88
|
),
|
|
89
89
|
/* @__PURE__ */ e(E, { orientation: "vertical", className: "h-4 mx-1" }),
|
|
90
90
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
91
|
+
o,
|
|
92
92
|
{
|
|
93
93
|
variant: "ghost",
|
|
94
94
|
size: "icon",
|
|
@@ -112,34 +112,34 @@ const ue = ({ role: t }) => {
|
|
|
112
112
|
onSubmit: d,
|
|
113
113
|
users: m = []
|
|
114
114
|
}) => {
|
|
115
|
-
const [a, p] = v.useState(!1), [f,
|
|
116
|
-
|
|
115
|
+
const [a, p] = v.useState(!1), [f, s] = v.useState(!1), [h, u] = v.useState([]), [P, j] = v.useState(!0), A = v.useRef(null), q = v.useMemo(() => [
|
|
116
|
+
se.configure({
|
|
117
117
|
// @ts-ignore
|
|
118
118
|
link: !1,
|
|
119
119
|
// @ts-ignore
|
|
120
120
|
underline: !1
|
|
121
121
|
}),
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
ne,
|
|
123
|
+
oe.configure({
|
|
124
124
|
openOnClick: !1
|
|
125
125
|
}),
|
|
126
|
-
|
|
126
|
+
le,
|
|
127
127
|
ce.configure({
|
|
128
128
|
HTMLAttributes: {
|
|
129
|
-
class: "bg-
|
|
129
|
+
class: "bg-secondary text-secondary-foreground rounded-sm px-1 py-0.5 font-medium decoration-clone"
|
|
130
130
|
},
|
|
131
131
|
suggestion: {
|
|
132
|
-
items: ({ query: r }) => m.filter((
|
|
132
|
+
items: ({ query: r }) => m.filter((n) => n.name.toLowerCase().startsWith(r.toLowerCase())).slice(0, 5),
|
|
133
133
|
render: () => {
|
|
134
|
-
let r = null,
|
|
134
|
+
let r = null, n = null;
|
|
135
135
|
return {
|
|
136
|
-
onStart: (
|
|
136
|
+
onStart: (l) => {
|
|
137
137
|
r = new re(me, {
|
|
138
|
-
props:
|
|
139
|
-
editor:
|
|
140
|
-
}),
|
|
138
|
+
props: l,
|
|
139
|
+
editor: l.editor
|
|
140
|
+
}), l.clientRect && (n = de("body", {
|
|
141
141
|
// tiptap tipa como `() => DOMRect | null`; tippy exige não-nulo.
|
|
142
|
-
getReferenceClientRect:
|
|
142
|
+
getReferenceClientRect: l.clientRect,
|
|
143
143
|
appendTo: () => document.body,
|
|
144
144
|
content: r.element,
|
|
145
145
|
showOnCreate: !0,
|
|
@@ -148,17 +148,17 @@ const ue = ({ role: t }) => {
|
|
|
148
148
|
placement: "bottom-start"
|
|
149
149
|
}));
|
|
150
150
|
},
|
|
151
|
-
onUpdate(
|
|
152
|
-
r == null || r.updateProps(
|
|
153
|
-
getReferenceClientRect:
|
|
151
|
+
onUpdate(l) {
|
|
152
|
+
r == null || r.updateProps(l), l.clientRect && (n == null || n[0].setProps({
|
|
153
|
+
getReferenceClientRect: l.clientRect
|
|
154
154
|
}));
|
|
155
155
|
},
|
|
156
|
-
onKeyDown(
|
|
156
|
+
onKeyDown(l) {
|
|
157
157
|
var b, S;
|
|
158
|
-
return
|
|
158
|
+
return l.event.key === "Escape" ? (n == null || n[0].hide(), !0) : !!((S = (b = r == null ? void 0 : r.ref) == null ? void 0 : b.onKeyDown) != null && S.call(b, l));
|
|
159
159
|
},
|
|
160
160
|
onExit() {
|
|
161
|
-
|
|
161
|
+
n == null || n[0].destroy(), r == null || r.destroy();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
@@ -177,16 +177,16 @@ const ue = ({ role: t }) => {
|
|
|
177
177
|
}
|
|
178
178
|
}), O = (r) => {
|
|
179
179
|
if (r.target.files && r.target.files[0]) {
|
|
180
|
-
const
|
|
180
|
+
const n = r.target.files[0], l = URL.createObjectURL(n), b = {
|
|
181
181
|
id: Math.random().toString(36).substr(2, 9),
|
|
182
|
-
name:
|
|
183
|
-
url:
|
|
184
|
-
type:
|
|
182
|
+
name: n.name,
|
|
183
|
+
url: l,
|
|
184
|
+
type: n.type.startsWith("image/") ? "image" : "file"
|
|
185
185
|
};
|
|
186
186
|
u([...h, b]), r.target.value = "";
|
|
187
187
|
}
|
|
188
188
|
}, H = (r) => {
|
|
189
|
-
u(h.filter((
|
|
189
|
+
u(h.filter((n) => n.id !== r));
|
|
190
190
|
}, _ = () => {
|
|
191
191
|
!g || g.isEmpty && h.length === 0 || (d({
|
|
192
192
|
content: g.getHTML(),
|
|
@@ -211,7 +211,7 @@ const ue = ({ role: t }) => {
|
|
|
211
211
|
"button",
|
|
212
212
|
{
|
|
213
213
|
onClick: () => H(r.id),
|
|
214
|
-
className: "absolute -top-1.5 -right-1.5 bg-
|
|
214
|
+
className: "absolute -top-1.5 -right-1.5 border bg-background text-destructive-emphasis hover:bg-destructive/10 rounded-full p-0.5 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity shadow-sm",
|
|
215
215
|
children: /* @__PURE__ */ e(X, { className: "h-3 w-3" })
|
|
216
216
|
}
|
|
217
217
|
)
|
|
@@ -220,7 +220,7 @@ const ue = ({ role: t }) => {
|
|
|
220
220
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
221
221
|
/* @__PURE__ */ i(x, { children: [
|
|
222
222
|
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
|
|
223
|
-
|
|
223
|
+
o,
|
|
224
224
|
{
|
|
225
225
|
variant: "ghost",
|
|
226
226
|
size: "icon",
|
|
@@ -228,7 +228,7 @@ const ue = ({ role: t }) => {
|
|
|
228
228
|
"h-8 w-8 transition-colors",
|
|
229
229
|
f ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
230
230
|
),
|
|
231
|
-
onClick: () =>
|
|
231
|
+
onClick: () => s(!f),
|
|
232
232
|
"aria-label": "Opções de formatação",
|
|
233
233
|
children: /* @__PURE__ */ e(G, { className: "h-4 w-4" })
|
|
234
234
|
}
|
|
@@ -238,7 +238,7 @@ const ue = ({ role: t }) => {
|
|
|
238
238
|
/* @__PURE__ */ e("div", { className: "w-px h-4 bg-border mx-1" }),
|
|
239
239
|
/* @__PURE__ */ i(k, { children: [
|
|
240
240
|
/* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e(
|
|
241
|
-
|
|
241
|
+
o,
|
|
242
242
|
{
|
|
243
243
|
variant: "ghost",
|
|
244
244
|
size: "icon",
|
|
@@ -268,7 +268,7 @@ const ue = ({ role: t }) => {
|
|
|
268
268
|
),
|
|
269
269
|
/* @__PURE__ */ i(x, { children: [
|
|
270
270
|
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
|
|
271
|
-
|
|
271
|
+
o,
|
|
272
272
|
{
|
|
273
273
|
variant: "ghost",
|
|
274
274
|
size: "icon",
|
|
@@ -285,7 +285,7 @@ const ue = ({ role: t }) => {
|
|
|
285
285
|
] }),
|
|
286
286
|
/* @__PURE__ */ i(x, { children: [
|
|
287
287
|
/* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ i(
|
|
288
|
-
|
|
288
|
+
o,
|
|
289
289
|
{
|
|
290
290
|
variant: "ghost",
|
|
291
291
|
size: "sm",
|
|
@@ -304,7 +304,7 @@ const ue = ({ role: t }) => {
|
|
|
304
304
|
] })
|
|
305
305
|
] }),
|
|
306
306
|
/* @__PURE__ */ i(
|
|
307
|
-
|
|
307
|
+
o,
|
|
308
308
|
{
|
|
309
309
|
size: "sm",
|
|
310
310
|
onClick: _,
|
|
@@ -341,14 +341,14 @@ const ue = ({ role: t }) => {
|
|
|
341
341
|
/* @__PURE__ */ e(ue, { role: t.user.role }),
|
|
342
342
|
/* @__PURE__ */ e("span", { className: "text-xs text-foreground/65", children: K(t.createdAt, "dd MMM 'às' HH:mm", { locale: D }) })
|
|
343
343
|
] }),
|
|
344
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity", children: [
|
|
344
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 transition-opacity has-[[data-state=open]]:opacity-100", children: [
|
|
345
345
|
/* @__PURE__ */ i(k, { children: [
|
|
346
346
|
/* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e(
|
|
347
|
-
|
|
347
|
+
o,
|
|
348
348
|
{
|
|
349
349
|
variant: "ghost",
|
|
350
350
|
size: "icon",
|
|
351
|
-
className: "h-6 w-6 text-muted-foreground hover:text-foreground",
|
|
351
|
+
className: "h-6 w-6 relative before:absolute before:-inset-1 before:content-[''] text-muted-foreground hover:text-foreground",
|
|
352
352
|
"aria-label": "Reagir com emoji",
|
|
353
353
|
children: /* @__PURE__ */ e(U, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
354
354
|
}
|
|
@@ -356,18 +356,18 @@ const ue = ({ role: t }) => {
|
|
|
356
356
|
/* @__PURE__ */ e(L, { className: "w-auto p-0 border-none", align: "end", children: /* @__PURE__ */ e(
|
|
357
357
|
C,
|
|
358
358
|
{
|
|
359
|
-
onEmojiClick: (
|
|
359
|
+
onEmojiClick: (s) => a == null ? void 0 : a(t.id, s.emoji),
|
|
360
360
|
width: 300,
|
|
361
361
|
height: 350
|
|
362
362
|
}
|
|
363
363
|
) })
|
|
364
364
|
] }),
|
|
365
365
|
m && /* @__PURE__ */ e(
|
|
366
|
-
|
|
366
|
+
o,
|
|
367
367
|
{
|
|
368
368
|
variant: "ghost",
|
|
369
369
|
size: "icon",
|
|
370
|
-
className: "h-6 w-6 text-muted-foreground hover:text-destructive",
|
|
370
|
+
className: "h-6 w-6 relative before:absolute before:-inset-1 before:content-[''] text-muted-foreground hover:text-destructive-emphasis",
|
|
371
371
|
onClick: () => m(t.id),
|
|
372
372
|
"aria-label": "Excluir comentário",
|
|
373
373
|
children: /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
@@ -386,40 +386,40 @@ const ue = ({ role: t }) => {
|
|
|
386
386
|
dangerouslySetInnerHTML: { __html: t.content }
|
|
387
387
|
}
|
|
388
388
|
),
|
|
389
|
-
t.attachments && t.attachments.length > 0 && /* @__PURE__ */ e("div", { className: "mt-3 flex flex-wrap gap-2", children: t.attachments.map((
|
|
389
|
+
t.attachments && t.attachments.length > 0 && /* @__PURE__ */ e("div", { className: "mt-3 flex flex-wrap gap-2", children: t.attachments.map((s) => /* @__PURE__ */ e(
|
|
390
390
|
"div",
|
|
391
391
|
{
|
|
392
392
|
className: "group/att relative rounded-lg border overflow-hidden bg-background hover:shadow-sm transition-all cursor-pointer",
|
|
393
|
-
onClick: () => window.open(
|
|
394
|
-
children:
|
|
395
|
-
/* @__PURE__ */ e("img", { src:
|
|
393
|
+
onClick: () => window.open(s.url, "_blank"),
|
|
394
|
+
children: s.type === "image" ? /* @__PURE__ */ i("div", { className: "h-32 aspect-[4/3]", children: [
|
|
395
|
+
/* @__PURE__ */ e("img", { src: s.url, alt: s.name, className: "h-full w-full object-cover" }),
|
|
396
396
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-foreground/0 group-hover/att:bg-foreground/10 transition-colors" })
|
|
397
397
|
] }) : /* @__PURE__ */ i("div", { className: "h-12 px-3 flex items-center gap-2 bg-muted/30", children: [
|
|
398
398
|
/* @__PURE__ */ e(y, { className: "h-4 w-4 text-muted-foreground" }),
|
|
399
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-medium truncate max-w-[150px]", children:
|
|
399
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-medium truncate max-w-[150px]", children: s.name })
|
|
400
400
|
] })
|
|
401
401
|
},
|
|
402
|
-
|
|
402
|
+
s.id
|
|
403
403
|
)) }),
|
|
404
404
|
/* @__PURE__ */ i("div", { className: "mt-3 flex flex-wrap gap-2 items-center", children: [
|
|
405
|
-
(f = t.reactions) == null ? void 0 : f.map((
|
|
405
|
+
(f = t.reactions) == null ? void 0 : f.map((s) => /* @__PURE__ */ i(
|
|
406
406
|
"button",
|
|
407
407
|
{
|
|
408
|
-
onClick: () => a == null ? void 0 : a(t.id,
|
|
408
|
+
onClick: () => a == null ? void 0 : a(t.id, s.emoji),
|
|
409
409
|
className: c(
|
|
410
410
|
"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium border transition-colors",
|
|
411
|
-
|
|
411
|
+
s.users.includes(d) ? "bg-secondary border-secondary text-secondary-foreground" : "bg-muted/30 border-transparent hover:bg-muted/50 text-muted-foreground"
|
|
412
412
|
),
|
|
413
413
|
children: [
|
|
414
|
-
/* @__PURE__ */ e("span", { children:
|
|
415
|
-
/* @__PURE__ */ e("span", { children:
|
|
414
|
+
/* @__PURE__ */ e("span", { children: s.emoji }),
|
|
415
|
+
/* @__PURE__ */ e("span", { children: s.users.length })
|
|
416
416
|
]
|
|
417
417
|
},
|
|
418
|
-
|
|
418
|
+
s.emoji
|
|
419
419
|
)),
|
|
420
420
|
a && /* @__PURE__ */ i(k, { children: [
|
|
421
421
|
/* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e(
|
|
422
|
-
|
|
422
|
+
o,
|
|
423
423
|
{
|
|
424
424
|
variant: "ghost",
|
|
425
425
|
size: "icon",
|
|
@@ -431,7 +431,7 @@ const ue = ({ role: t }) => {
|
|
|
431
431
|
/* @__PURE__ */ e(L, { className: "w-auto p-0 border-none", align: "start", children: /* @__PURE__ */ e(
|
|
432
432
|
C,
|
|
433
433
|
{
|
|
434
|
-
onEmojiClick: (
|
|
434
|
+
onEmojiClick: (s) => a(t.id, s.emoji),
|
|
435
435
|
width: 300,
|
|
436
436
|
height: 350
|
|
437
437
|
}
|
|
@@ -447,7 +447,7 @@ const ue = ({ role: t }) => {
|
|
|
447
447
|
onAddComment: a,
|
|
448
448
|
onDeleteComment: p,
|
|
449
449
|
onReact: f,
|
|
450
|
-
className:
|
|
450
|
+
className: s
|
|
451
451
|
}) => {
|
|
452
452
|
const h = (u) => {
|
|
453
453
|
a({
|
|
@@ -457,7 +457,7 @@ const ue = ({ role: t }) => {
|
|
|
457
457
|
attachments: u.attachments
|
|
458
458
|
});
|
|
459
459
|
};
|
|
460
|
-
return /* @__PURE__ */ i("div", { className: c("flex flex-col h-full",
|
|
460
|
+
return /* @__PURE__ */ i("div", { className: c("flex flex-col h-full", s), children: [
|
|
461
461
|
/* @__PURE__ */ i("div", { className: "px-4 py-3 border-b flex items-center justify-between bg-card", children: [
|
|
462
462
|
/* @__PURE__ */ e("h3", { className: "font-semibold text-base", children: "Comentários da Atividade" }),
|
|
463
463
|
/* @__PURE__ */ e(M, { variant: "secondary", className: "bg-muted text-muted-foreground hover:bg-muted", children: t.length })
|