@flowtomic/ui 0.1.14 → 0.2.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/dist/components/_reference/shadcn-ai/prompt-input.d.ts +48 -0
- package/dist/components/_reference/shadcn-ai/prompt-input.d.ts.map +1 -0
- package/dist/components/_reference/shadcn-ai/prompt-input.js +67 -0
- package/dist/components/atoms/actions/badge/badge.d.ts +97 -1
- package/dist/components/atoms/actions/badge/badge.d.ts.map +1 -1
- package/dist/components/atoms/actions/badge/badge.js +83 -0
- package/dist/components/atoms/actions/button/button.d.ts +134 -1
- package/dist/components/atoms/actions/button/button.d.ts.map +1 -1
- package/dist/components/atoms/actions/button/button.js +106 -0
- package/dist/components/atoms/actions/context-menu/context-menu.d.ts +79 -0
- package/dist/components/atoms/actions/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/atoms/actions/context-menu/context-menu.js +55 -0
- package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.d.ts +51 -3
- package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.js +51 -3
- package/dist/components/atoms/animation/encrypted-text/encrypted-text.d.ts.map +1 -1
- package/dist/components/atoms/animation/encrypted-text/encrypted-text.js +3 -1
- package/dist/components/atoms/feedback/alert/alert.d.ts +77 -12
- package/dist/components/atoms/feedback/alert/alert.d.ts.map +1 -1
- package/dist/components/atoms/feedback/alert/alert.js +64 -12
- package/dist/components/atoms/feedback/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/atoms/feedback/dialog/dialog.d.ts +66 -8
- package/dist/components/atoms/feedback/dialog/dialog.d.ts.map +1 -1
- package/dist/components/atoms/feedback/dialog/dialog.js +66 -8
- package/dist/components/atoms/feedback/hover-card/hover-card.d.ts +45 -5
- package/dist/components/atoms/feedback/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/atoms/feedback/hover-card/hover-card.js +45 -5
- package/dist/components/atoms/feedback/inline-citation/inline-citation.d.ts +53 -2
- package/dist/components/atoms/feedback/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/atoms/feedback/inline-citation/inline-citation.js +53 -2
- package/dist/components/atoms/feedback/popover/popover.d.ts +78 -0
- package/dist/components/atoms/feedback/popover/popover.d.ts.map +1 -1
- package/dist/components/atoms/feedback/popover/popover.js +64 -0
- package/dist/components/atoms/feedback/sheet/sheet.d.ts +90 -0
- package/dist/components/atoms/feedback/sheet/sheet.d.ts.map +1 -1
- package/dist/components/atoms/feedback/sheet/sheet.js +78 -0
- package/dist/components/atoms/feedback/sonner/sonner.d.ts +66 -6
- package/dist/components/atoms/feedback/sonner/sonner.d.ts.map +1 -1
- package/dist/components/atoms/feedback/sonner/sonner.js +66 -6
- package/dist/components/atoms/feedback/tooltip/tooltip.d.ts +54 -4
- package/dist/components/atoms/feedback/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/atoms/feedback/tooltip/tooltip.js +63 -5
- package/dist/components/atoms/forms/checkbox/checkbox.d.ts +62 -4
- package/dist/components/atoms/forms/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/atoms/forms/checkbox/checkbox.js +58 -4
- package/dist/components/atoms/forms/field/field.d.ts +67 -0
- package/dist/components/atoms/forms/field/field.d.ts.map +1 -1
- package/dist/components/atoms/forms/field/field.js +47 -0
- package/dist/components/atoms/forms/form/form.d.ts +60 -0
- package/dist/components/atoms/forms/form/form.d.ts.map +1 -1
- package/dist/components/atoms/forms/form/form.js +3 -0
- package/dist/components/atoms/forms/input/input.d.ts +100 -1
- package/dist/components/atoms/forms/input/input.d.ts.map +1 -1
- package/dist/components/atoms/forms/input/input.js +82 -0
- package/dist/components/atoms/forms/input-otp/input-otp.d.ts +62 -0
- package/dist/components/atoms/forms/input-otp/input-otp.d.ts.map +1 -1
- package/dist/components/atoms/forms/input-otp/input-otp.js +50 -0
- package/dist/components/atoms/forms/label/label.d.ts +54 -0
- package/dist/components/atoms/forms/label/label.d.ts.map +1 -1
- package/dist/components/atoms/forms/label/label.js +50 -0
- package/dist/components/atoms/forms/radio-group/radio-group.d.ts +47 -0
- package/dist/components/atoms/forms/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/atoms/forms/radio-group/radio-group.js +43 -0
- package/dist/components/atoms/forms/select/select.d.ts +62 -0
- package/dist/components/atoms/forms/select/select.d.ts.map +1 -1
- package/dist/components/atoms/forms/select/select.js +62 -0
- package/dist/components/atoms/forms/slider/slider.d.ts +60 -0
- package/dist/components/atoms/forms/slider/slider.d.ts.map +1 -1
- package/dist/components/atoms/forms/slider/slider.js +53 -1
- package/dist/components/atoms/forms/switch/switch.d.ts +67 -0
- package/dist/components/atoms/forms/switch/switch.d.ts.map +1 -1
- package/dist/components/atoms/forms/switch/switch.js +63 -0
- package/dist/components/atoms/forms/textarea/textarea.d.ts +66 -0
- package/dist/components/atoms/forms/textarea/textarea.d.ts.map +1 -1
- package/dist/components/atoms/forms/textarea/textarea.js +13 -0
- package/dist/components/atoms/forms/toggle/toggle.d.ts +65 -1
- package/dist/components/atoms/forms/toggle/toggle.d.ts.map +1 -1
- package/dist/components/atoms/forms/toggle/toggle.js +58 -0
- package/dist/components/atoms/index.d.ts +0 -2
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/index.js +0 -1
- package/dist/components/atoms/layout/accordion/accordion.d.ts +84 -0
- package/dist/components/atoms/layout/accordion/accordion.d.ts.map +1 -1
- package/dist/components/atoms/layout/accordion/accordion.js +72 -0
- package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.d.ts +54 -0
- package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.d.ts.map +1 -1
- package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.js +49 -0
- package/dist/components/atoms/layout/collapsible/collapsible.d.ts +47 -5
- package/dist/components/atoms/layout/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/atoms/layout/collapsible/collapsible.js +47 -5
- package/dist/components/atoms/layout/drawer/drawer.d.ts +55 -0
- package/dist/components/atoms/layout/drawer/drawer.d.ts.map +1 -1
- package/dist/components/atoms/layout/index.d.ts +2 -0
- package/dist/components/atoms/layout/index.d.ts.map +1 -1
- package/dist/components/atoms/layout/index.js +1 -0
- package/dist/components/atoms/layout/resizable/resizable.d.ts +77 -2
- package/dist/components/atoms/layout/resizable/resizable.d.ts.map +1 -1
- package/dist/components/atoms/layout/resizable/resizable.js +68 -0
- package/dist/components/atoms/layout/scroll-area/scroll-area.d.ts +34 -2
- package/dist/components/atoms/layout/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/atoms/layout/scroll-area/scroll-area.js +35 -3
- package/dist/components/atoms/layout/sidebar/sidebar.d.ts +66 -1
- package/dist/components/atoms/layout/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/atoms/layout/sidebar/sidebar.js +66 -0
- package/dist/components/atoms/layout/toggle-group/toggle-group.d.ts +73 -0
- package/dist/components/atoms/layout/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/atoms/layout/toggle-group/toggle-group.js +57 -0
- package/dist/components/atoms/layout/widget-resize-handle/index.d.ts +3 -0
- package/dist/components/atoms/layout/widget-resize-handle/index.d.ts.map +1 -0
- package/dist/components/atoms/layout/widget-resize-handle/index.js +1 -0
- package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.d.ts +98 -0
- package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.d.ts.map +1 -0
- package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.js +117 -0
- package/dist/components/atoms/navigation/command/command.d.ts +7 -7
- package/dist/components/molecules/data-display/chat-message/chat-message.d.ts +39 -0
- package/dist/components/molecules/data-display/chat-message/chat-message.d.ts.map +1 -0
- package/dist/components/molecules/data-display/chat-message/chat-message.js +85 -0
- package/dist/components/molecules/data-display/chat-message/index.d.ts +3 -0
- package/dist/components/molecules/data-display/chat-message/index.d.ts.map +1 -0
- package/dist/components/molecules/data-display/chat-message/index.js +1 -0
- package/dist/components/molecules/data-display/message/message.d.ts +22 -6
- package/dist/components/molecules/data-display/message/message.d.ts.map +1 -1
- package/dist/components/molecules/data-display/message/message.js +192 -8
- package/dist/components/molecules/draggable-widget/draggable-widget.d.ts.map +1 -1
- package/dist/components/molecules/draggable-widget/draggable-widget.js +6 -2
- package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.d.ts +20 -0
- package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.d.ts.map +1 -0
- package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.js +65 -0
- package/dist/components/molecules/feedback/edit-chat-message-modal/index.d.ts +3 -0
- package/dist/components/molecules/feedback/edit-chat-message-modal/index.d.ts.map +1 -0
- package/dist/components/molecules/feedback/edit-chat-message-modal/index.js +1 -0
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete-section.js +3 -1
- package/dist/components/molecules/forms/chat-input/chat-input.d.ts +46 -0
- package/dist/components/molecules/forms/chat-input/chat-input.d.ts.map +1 -0
- package/dist/components/molecules/forms/chat-input/chat-input.js +57 -0
- package/dist/components/molecules/forms/chat-input/index.d.ts +3 -0
- package/dist/components/molecules/forms/chat-input/index.d.ts.map +1 -0
- package/dist/components/molecules/forms/chat-input/index.js +1 -0
- package/dist/components/molecules/forms/item/item.d.ts +1 -1
- package/dist/components/molecules/forms/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/molecules/index.d.ts +6 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/index.js +3 -0
- package/dist/components/molecules/navigation/menu-dock/menu-dock.js +1 -1
- package/dist/components/organisms/chat-log/chat-log.d.ts +30 -0
- package/dist/components/organisms/chat-log/chat-log.d.ts.map +1 -0
- package/dist/components/organisms/chat-log/chat-log.js +21 -0
- package/dist/components/organisms/chat-log/index.d.ts +3 -0
- package/dist/components/organisms/chat-log/index.d.ts.map +1 -0
- package/dist/components/organisms/chat-log/index.js +1 -0
- package/dist/components/organisms/document-editor/document-editor.d.ts.map +1 -1
- package/dist/components/organisms/document-editor/document-editor.js +2 -2
- package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.d.ts.map +1 -1
- package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.js +1 -1
- package/dist/components/organisms/form-layout/form-layout.d.ts.map +1 -1
- package/dist/components/organisms/form-layout/form-layout.js +3 -1
- package/dist/components/organisms/genealogy-canvas/genealogy-canvas.d.ts +0 -5
- package/dist/components/organisms/genealogy-canvas/genealogy-canvas.d.ts.map +1 -1
- package/dist/components/organisms/genealogy-canvas/genealogy-canvas.js +50 -55
- package/dist/components/organisms/index.d.ts +2 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/organisms/index.js +1 -0
- package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
- package/dist/components/organisms/prompt-input/index.d.ts +1 -1
- package/dist/components/organisms/prompt-input/index.d.ts.map +1 -1
- package/dist/components/organisms/prompt-input/index.js +1 -1
- package/dist/components/organisms/prompt-input/prompt-input.d.ts +22 -7
- package/dist/components/organisms/prompt-input/prompt-input.d.ts.map +1 -1
- package/dist/components/organisms/prompt-input/prompt-input.js +26 -17
- package/dist/index.js +501 -501
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +43 -0
- package/package.json +18 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatMessage Component - Flowtomic UI
|
|
3
|
+
*
|
|
4
|
+
* Componente genérico de mensagem de chat com suporte a markdown,
|
|
5
|
+
* tipos de mensagem customizáveis, badges e context menu
|
|
6
|
+
*/
|
|
7
|
+
import type { HTMLAttributes } from "react";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
export interface ChatMessageData {
|
|
10
|
+
id: string | number;
|
|
11
|
+
content: string;
|
|
12
|
+
sender: string;
|
|
13
|
+
timestamp: Date | string;
|
|
14
|
+
messageType?: string;
|
|
15
|
+
isSummary?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ChatMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
message: ChatMessageData;
|
|
19
|
+
onEdit?: (id: string | number) => void;
|
|
20
|
+
onDelete?: (id: string | number) => void;
|
|
21
|
+
onViewContext?: (id: string | number) => void;
|
|
22
|
+
renderMarkdown?: boolean;
|
|
23
|
+
messageTypeConfig?: Record<string, {
|
|
24
|
+
label: string;
|
|
25
|
+
badgeClassName?: string;
|
|
26
|
+
containerClassName?: string;
|
|
27
|
+
senderClassName?: string;
|
|
28
|
+
}>;
|
|
29
|
+
senderConfig?: Record<string, {
|
|
30
|
+
containerClassName?: string;
|
|
31
|
+
senderClassName?: string;
|
|
32
|
+
isSystem?: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
formatTimestamp?: (timestamp: Date | string) => string;
|
|
35
|
+
showActions?: boolean;
|
|
36
|
+
showTimestamp?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const ChatMessage: React.ForwardRefExoticComponent<ChatMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
//# sourceMappingURL=chat-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/data-display/chat-message/chat-message.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CACxB,MAAM,EACN;QACE,KAAK,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CACF,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CACnB,MAAM,EACN;QACE,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CACF,CAAC;IACF,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,KAAK,MAAM,CAAC;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA0CD,eAAO,MAAM,WAAW,yFAgKvB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ChatMessage Component - Flowtomic UI
|
|
4
|
+
*
|
|
5
|
+
* Componente genérico de mensagem de chat com suporte a markdown,
|
|
6
|
+
* tipos de mensagem customizáveis, badges e context menu
|
|
7
|
+
*/
|
|
8
|
+
import { Edit, Eye, MoreVertical, Trash2 } from "lucide-react";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import ReactMarkdown from "react-markdown";
|
|
11
|
+
import { cn } from "@/lib/utils";
|
|
12
|
+
import { Badge, Button } from "../../../atoms";
|
|
13
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, } from "../../../atoms/actions/context-menu";
|
|
14
|
+
const defaultMessageTypeConfig = {
|
|
15
|
+
STORY: {
|
|
16
|
+
label: "STORY",
|
|
17
|
+
badgeClassName: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",
|
|
18
|
+
containerClassName: "bg-blue-100 dark:bg-blue-900/30 border-blue-500",
|
|
19
|
+
senderClassName: "text-blue-700 dark:text-blue-300",
|
|
20
|
+
},
|
|
21
|
+
ACTION: {
|
|
22
|
+
label: "ACTION",
|
|
23
|
+
badgeClassName: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",
|
|
24
|
+
containerClassName: "bg-yellow-50 dark:bg-yellow-900/20 border-yellow-500",
|
|
25
|
+
senderClassName: "text-yellow-700 dark:text-yellow-400",
|
|
26
|
+
},
|
|
27
|
+
SAY: {
|
|
28
|
+
label: "SAY",
|
|
29
|
+
badgeClassName: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",
|
|
30
|
+
containerClassName: "bg-emerald-50 dark:bg-emerald-900/20 border-emerald-500",
|
|
31
|
+
senderClassName: "text-emerald-700 dark:text-emerald-400",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
const defaultSenderConfig = {
|
|
35
|
+
Sistema: {
|
|
36
|
+
containerClassName: "text-center text-gray-500 dark:text-gray-400 text-sm italic",
|
|
37
|
+
isSystem: true,
|
|
38
|
+
},
|
|
39
|
+
Mestre: {
|
|
40
|
+
containerClassName: "bg-blue-100 dark:bg-blue-900/30 border-l-4 border-blue-500 p-4 rounded-r",
|
|
41
|
+
senderClassName: "text-blue-700 dark:text-blue-300 text-sm font-medium",
|
|
42
|
+
},
|
|
43
|
+
Narrador: {
|
|
44
|
+
containerClassName: "bg-blue-100 dark:bg-blue-900/30 border-l-4 border-blue-500 p-4 rounded-r",
|
|
45
|
+
senderClassName: "text-blue-700 dark:text-blue-300 text-sm font-medium",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const defaultFormatTimestamp = (timestamp) => {
|
|
49
|
+
return new Date(timestamp).toLocaleString();
|
|
50
|
+
};
|
|
51
|
+
export const ChatMessage = React.forwardRef(({ message, onEdit, onDelete, onViewContext, renderMarkdown = true, messageTypeConfig = defaultMessageTypeConfig, senderConfig = defaultSenderConfig, formatTimestamp = defaultFormatTimestamp, showActions = true, showTimestamp = true, className, ...props }, ref) => {
|
|
52
|
+
const typeConfig = message.messageType ? messageTypeConfig[message.messageType] : undefined;
|
|
53
|
+
const senderCfg = senderConfig[message.sender] || {
|
|
54
|
+
containerClassName: "bg-gray-100 dark:bg-gray-800/50 border-l-4 border-yellow-500 p-4 rounded-r",
|
|
55
|
+
senderClassName: "text-yellow-600 dark:text-yellow-400",
|
|
56
|
+
};
|
|
57
|
+
const isSystem = senderCfg.isSystem || message.sender === "Sistema";
|
|
58
|
+
const hasActions = showActions && (onEdit || onDelete || onViewContext);
|
|
59
|
+
const renderTypeBadge = () => {
|
|
60
|
+
if (!message.messageType || !typeConfig)
|
|
61
|
+
return null;
|
|
62
|
+
return (_jsx(Badge, { className: cn("text-[10px] font-medium ml-2", typeConfig.badgeClassName), children: typeConfig.label }));
|
|
63
|
+
};
|
|
64
|
+
const renderContent = () => {
|
|
65
|
+
if (renderMarkdown) {
|
|
66
|
+
return (_jsx(ReactMarkdown, { components: {
|
|
67
|
+
strong: ({ ...props }) => (_jsx("strong", { className: cn("font-bold", typeConfig?.senderClassName || senderCfg.senderClassName), ...props })),
|
|
68
|
+
em: ({ ...props }) => _jsx("em", { className: "italic", ...props }),
|
|
69
|
+
p: ({ ...props }) => _jsx("span", { ...props }),
|
|
70
|
+
}, children: message.content }));
|
|
71
|
+
}
|
|
72
|
+
return _jsx("span", { children: message.content });
|
|
73
|
+
};
|
|
74
|
+
// System message (centered, italic)
|
|
75
|
+
if (isSystem) {
|
|
76
|
+
return (_jsxs("div", { ref: ref, id: `message-${message.id}`, className: cn(message.isSummary
|
|
77
|
+
? "bg-purple-50 dark:bg-purple-900/20 border-l-4 border-purple-500"
|
|
78
|
+
: "", senderCfg.containerClassName, className), ...props, children: [renderContent(), showTimestamp && (_jsx("div", { className: "mt-1 text-[10px]", children: formatTimestamp(message.timestamp) }))] }));
|
|
79
|
+
}
|
|
80
|
+
// Regular message with actions
|
|
81
|
+
return (_jsxs("div", { ref: ref, id: `message-${message.id}`, className: cn(message.isSummary
|
|
82
|
+
? "bg-purple-50 dark:bg-purple-900/20 border-l-4 border-purple-500"
|
|
83
|
+
: "", typeConfig?.containerClassName || senderCfg.containerClassName, className), ...props, children: [_jsxs("div", { className: "flex items-center justify-between mb-1", children: [_jsxs("div", { className: cn("text-sm font-medium flex items-center gap-2", typeConfig?.senderClassName || senderCfg.senderClassName), children: [_jsx("span", { children: message.sender }), renderTypeBadge()] }), hasActions && (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", className: "p-1 hover:bg-gray-200 dark:hover:bg-gray-700/50 rounded transition-colors", title: "Op\u00E7\u00F5es da mensagem", children: _jsx(MoreVertical, { className: "w-3 h-4" }) }) }), _jsxs(ContextMenuContent, { children: [onEdit && (_jsxs(ContextMenuItem, { onClick: () => onEdit(message.id), children: [_jsx(Edit, { className: "w-4 h-4 mr-2" }), "Editar"] })), onViewContext && (_jsxs(ContextMenuItem, { onClick: () => onViewContext(message.id), children: [_jsx(Eye, { className: "w-4 h-4 mr-2" }), "Ver Contexto"] })), onDelete && (_jsxs(ContextMenuItem, { onClick: () => onDelete(message.id), className: "text-red-400 focus:text-red-400", children: [_jsx(Trash2, { className: "w-4 h-4 mr-2" }), "Excluir"] }))] })] }))] }), _jsx("div", { className: "text-gray-900 dark:text-gray-200", children: renderContent() }), showTimestamp && (_jsx("div", { className: "mt-1 text-[10px] text-gray-500 dark:text-gray-400", children: formatTimestamp(message.timestamp) }))] }));
|
|
84
|
+
});
|
|
85
|
+
ChatMessage.displayName = "ChatMessage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/data-display/chat-message/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatMessage } from "./chat-message";
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Componente de mensagem com branches e attachments
|
|
5
5
|
*/
|
|
6
6
|
import type { FileUIPart, UIMessage } from "ai";
|
|
7
|
+
import hardenReactMarkdown from "harden-react-markdown";
|
|
7
8
|
import type { ComponentProps, HTMLAttributes } from "react";
|
|
8
9
|
import * as React from "react";
|
|
9
|
-
import {
|
|
10
|
-
import { Button } from "
|
|
10
|
+
import { type Options } from "react-markdown";
|
|
11
|
+
import { Button } from "@/components/atoms";
|
|
12
|
+
import "katex/dist/katex.min.css";
|
|
11
13
|
export type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
12
14
|
from: UIMessage["role"];
|
|
13
15
|
};
|
|
@@ -40,13 +42,27 @@ export declare const MessageBranchSelector: React.ForwardRefExoticComponent<HTML
|
|
|
40
42
|
from: UIMessage["role"];
|
|
41
43
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
42
44
|
export type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
43
|
-
export declare const MessageBranchPrevious: React.ForwardRefExoticComponent<Omit<import("
|
|
45
|
+
export declare const MessageBranchPrevious: React.ForwardRefExoticComponent<Omit<import("@/components/atoms").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
44
46
|
export type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
45
|
-
export declare const MessageBranchNext: React.ForwardRefExoticComponent<Omit<import("
|
|
47
|
+
export declare const MessageBranchNext: React.ForwardRefExoticComponent<Omit<import("@/components/atoms").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
46
48
|
export type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
47
49
|
export declare const MessageBranchPage: React.ForwardRefExoticComponent<MessageBranchPageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
48
|
-
export type MessageResponseProps =
|
|
49
|
-
|
|
50
|
+
export type MessageResponseProps = HTMLAttributes<HTMLDivElement> & {
|
|
51
|
+
options?: Options;
|
|
52
|
+
children: Options["children"];
|
|
53
|
+
allowedImagePrefixes?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["allowedImagePrefixes"];
|
|
54
|
+
allowedLinkPrefixes?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["allowedLinkPrefixes"];
|
|
55
|
+
defaultOrigin?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["defaultOrigin"];
|
|
56
|
+
parseIncompleteMarkdown?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare const MessageResponse: React.NamedExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
59
|
+
options?: Options;
|
|
60
|
+
children: Options["children"];
|
|
61
|
+
allowedImagePrefixes?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["allowedImagePrefixes"];
|
|
62
|
+
allowedLinkPrefixes?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["allowedLinkPrefixes"];
|
|
63
|
+
defaultOrigin?: ComponentProps<ReturnType<typeof hardenReactMarkdown>>["defaultOrigin"];
|
|
64
|
+
parseIncompleteMarkdown?: boolean;
|
|
65
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
50
66
|
export type MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
51
67
|
data: FileUIPart;
|
|
52
68
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/data-display/message/message.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/data-display/message/message.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import hardenReactMarkdown from "harden-react-markdown";
|
|
2
3
|
import { ChevronLeftIcon, ChevronRightIcon, PaperclipIcon, XIcon } from "lucide-react";
|
|
3
4
|
import * as React from "react";
|
|
4
|
-
import { createContext, memo, useContext, useEffect, useState } from "react";
|
|
5
|
-
import
|
|
5
|
+
import { createContext, isValidElement, memo, useContext, useEffect, useState } from "react";
|
|
6
|
+
import ReactMarkdown from "react-markdown";
|
|
7
|
+
import rehypeKatex from "rehype-katex";
|
|
8
|
+
import remarkGfm from "remark-gfm";
|
|
9
|
+
import remarkMath from "remark-math";
|
|
10
|
+
import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/atoms";
|
|
11
|
+
import { CodeBlock, CodeBlockCopyButton } from "@/components/atoms/code/code-block";
|
|
12
|
+
import { ButtonGroup, ButtonGroupText } from "@/components/molecules/forms/button-group";
|
|
6
13
|
import { cn } from "@/lib/utils";
|
|
7
|
-
import
|
|
8
|
-
import { ButtonGroup, ButtonGroupText } from "../../forms/button-group";
|
|
14
|
+
import "katex/dist/katex.min.css";
|
|
9
15
|
export const Message = React.forwardRef(({ className, from, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("group flex w-full max-w-[80%] gap-2", from === "user" ? "is-user ml-auto justify-end" : "is-assistant", className), ...props })));
|
|
10
16
|
Message.displayName = "Message";
|
|
11
17
|
export const MessageContent = React.forwardRef(({ children, className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", className), ...props, children: children })));
|
|
@@ -90,12 +96,190 @@ export const MessageBranchPage = React.forwardRef(({ className, ...props }, ref)
|
|
|
90
96
|
return (_jsxs(ButtonGroupText, { ref: ref, className: cn("border-none bg-transparent text-muted-foreground shadow-none", className), ...props, children: [currentBranch + 1, " of ", totalBranches] }));
|
|
91
97
|
});
|
|
92
98
|
MessageBranchPage.displayName = "MessageBranchPage";
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Parses markdown text and removes incomplete tokens to prevent partial rendering
|
|
101
|
+
* of links, images, bold, and italic formatting during streaming.
|
|
102
|
+
*/
|
|
103
|
+
function parseIncompleteMarkdown(text) {
|
|
104
|
+
if (!text || typeof text !== "string") {
|
|
105
|
+
return text;
|
|
106
|
+
}
|
|
107
|
+
let result = text;
|
|
108
|
+
// Handle incomplete links and images
|
|
109
|
+
// Pattern: [...] or ![...] where the closing ] is missing
|
|
110
|
+
const linkImagePattern = /(!?\[)([^\]]*?)$/;
|
|
111
|
+
const linkMatch = result.match(linkImagePattern);
|
|
112
|
+
if (linkMatch) {
|
|
113
|
+
// If we have an unterminated [ or ![, remove it and everything after
|
|
114
|
+
const startIndex = result.lastIndexOf(linkMatch[1]);
|
|
115
|
+
result = result.substring(0, startIndex);
|
|
116
|
+
}
|
|
117
|
+
// Handle incomplete bold formatting (**)
|
|
118
|
+
const boldPattern = /(\*\*)([^*]*?)$/;
|
|
119
|
+
const boldMatch = result.match(boldPattern);
|
|
120
|
+
if (boldMatch) {
|
|
121
|
+
// Count the number of ** in the entire string
|
|
122
|
+
const asteriskPairs = (result.match(/\*\*/g) || []).length;
|
|
123
|
+
// If odd number of **, we have an incomplete bold - complete it
|
|
124
|
+
if (asteriskPairs % 2 === 1) {
|
|
125
|
+
result = `${result}**`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Handle incomplete italic formatting (__)
|
|
129
|
+
const italicPattern = /(__)([^_]*?)$/;
|
|
130
|
+
const italicMatch = result.match(italicPattern);
|
|
131
|
+
if (italicMatch) {
|
|
132
|
+
// Count the number of __ in the entire string
|
|
133
|
+
const underscorePairs = (result.match(/__/g) || []).length;
|
|
134
|
+
// If odd number of __, we have an incomplete italic - complete it
|
|
135
|
+
if (underscorePairs % 2 === 1) {
|
|
136
|
+
result = `${result}__`;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Handle incomplete single asterisk italic (*)
|
|
140
|
+
const singleAsteriskPattern = /(\*)([^*]*?)$/;
|
|
141
|
+
const singleAsteriskMatch = result.match(singleAsteriskPattern);
|
|
142
|
+
if (singleAsteriskMatch) {
|
|
143
|
+
// Count single asterisks that aren't part of **
|
|
144
|
+
const singleAsterisks = result.split("").reduce((acc, char, index) => {
|
|
145
|
+
if (char === "*") {
|
|
146
|
+
// Check if it's part of a ** pair
|
|
147
|
+
const prevChar = result[index - 1];
|
|
148
|
+
const nextChar = result[index + 1];
|
|
149
|
+
if (prevChar !== "*" && nextChar !== "*") {
|
|
150
|
+
return acc + 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return acc;
|
|
154
|
+
}, 0);
|
|
155
|
+
// If odd number of single *, we have an incomplete italic - complete it
|
|
156
|
+
if (singleAsterisks % 2 === 1) {
|
|
157
|
+
result = `${result}*`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Handle incomplete single underscore italic (_)
|
|
161
|
+
const singleUnderscorePattern = /(_)([^_]*?)$/;
|
|
162
|
+
const singleUnderscoreMatch = result.match(singleUnderscorePattern);
|
|
163
|
+
if (singleUnderscoreMatch) {
|
|
164
|
+
// Count single underscores that aren't part of __
|
|
165
|
+
const singleUnderscores = result.split("").reduce((acc, char, index) => {
|
|
166
|
+
if (char === "_") {
|
|
167
|
+
// Check if it's part of a __ pair
|
|
168
|
+
const prevChar = result[index - 1];
|
|
169
|
+
const nextChar = result[index + 1];
|
|
170
|
+
if (prevChar !== "_" && nextChar !== "_") {
|
|
171
|
+
return acc + 1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return acc;
|
|
175
|
+
}, 0);
|
|
176
|
+
// If odd number of single _, we have an incomplete italic - complete it
|
|
177
|
+
if (singleUnderscores % 2 === 1) {
|
|
178
|
+
result = `${result}_`;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Handle incomplete inline code blocks (`) - but avoid code blocks (```)
|
|
182
|
+
const inlineCodePattern = /(`)([^`]*?)$/;
|
|
183
|
+
const inlineCodeMatch = result.match(inlineCodePattern);
|
|
184
|
+
if (inlineCodeMatch) {
|
|
185
|
+
// Check if we're dealing with a code block (triple backticks)
|
|
186
|
+
const _hasCodeBlockStart = result.includes("```");
|
|
187
|
+
const codeBlockPattern = /```[\s\S]*?```/g;
|
|
188
|
+
const _completeCodeBlocks = (result.match(codeBlockPattern) || []).length;
|
|
189
|
+
const allTripleBackticks = (result.match(/```/g) || []).length;
|
|
190
|
+
// If we have an odd number of ``` sequences, we're inside an incomplete code block
|
|
191
|
+
// In this case, don't complete inline code
|
|
192
|
+
const insideIncompleteCodeBlock = allTripleBackticks % 2 === 1;
|
|
193
|
+
if (!insideIncompleteCodeBlock) {
|
|
194
|
+
// Count the number of single backticks that are NOT part of triple backticks
|
|
195
|
+
let singleBacktickCount = 0;
|
|
196
|
+
for (let i = 0; i < result.length; i++) {
|
|
197
|
+
if (result[i] === "`") {
|
|
198
|
+
// Check if this backtick is part of a triple backtick sequence
|
|
199
|
+
const isTripleStart = result.substring(i, i + 3) === "```";
|
|
200
|
+
const isTripleMiddle = i > 0 && result.substring(i - 1, i + 2) === "```";
|
|
201
|
+
const isTripleEnd = i > 1 && result.substring(i - 2, i + 1) === "```";
|
|
202
|
+
if (!(isTripleStart || isTripleMiddle || isTripleEnd)) {
|
|
203
|
+
singleBacktickCount++;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// If odd number of single backticks, we have an incomplete inline code - complete it
|
|
208
|
+
if (singleBacktickCount % 2 === 1) {
|
|
209
|
+
result = `${result}\``;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Handle incomplete strikethrough formatting (~~)
|
|
214
|
+
const strikethroughPattern = /(~~)([^~]*?)$/;
|
|
215
|
+
const strikethroughMatch = result.match(strikethroughPattern);
|
|
216
|
+
if (strikethroughMatch) {
|
|
217
|
+
// Count the number of ~~ in the entire string
|
|
218
|
+
const tildePairs = (result.match(/~~/g) || []).length;
|
|
219
|
+
// If odd number of ~~, we have an incomplete strikethrough - complete it
|
|
220
|
+
if (tildePairs % 2 === 1) {
|
|
221
|
+
result = `${result}~~`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
// Create a hardened version of ReactMarkdown
|
|
227
|
+
const HardenedMarkdown = hardenReactMarkdown(ReactMarkdown);
|
|
228
|
+
const components = {
|
|
229
|
+
ol: ({ node, children, className, ...props }) => (_jsx("ol", { className: cn("ml-4 list-outside list-decimal", className), ...props, children: children })),
|
|
230
|
+
li: ({ node, children, className, ...props }) => (_jsx("li", { className: cn("py-1", className), ...props, children: children })),
|
|
231
|
+
ul: ({ node, children, className, ...props }) => (_jsx("ul", { className: cn("ml-4 list-outside list-disc", className), ...props, children: children })),
|
|
232
|
+
hr: ({ node, className, ...props }) => (_jsx("hr", { className: cn("my-6 border-border", className), ...props })),
|
|
233
|
+
strong: ({ node, children, className, ...props }) => (_jsx("span", { className: cn("font-semibold", className), ...props, children: children })),
|
|
234
|
+
a: ({ node, children, className, ...props }) => (_jsx("a", { className: cn("font-medium text-primary underline", className), rel: "noreferrer", target: "_blank", ...props, children: children })),
|
|
235
|
+
h1: ({ node, children, className, ...props }) => (_jsx("h1", { className: cn("mt-6 mb-2 font-semibold text-3xl", className), ...props, children: children })),
|
|
236
|
+
h2: ({ node, children, className, ...props }) => (_jsx("h2", { className: cn("mt-6 mb-2 font-semibold text-2xl", className), ...props, children: children })),
|
|
237
|
+
h3: ({ node, children, className, ...props }) => (_jsx("h3", { className: cn("mt-6 mb-2 font-semibold text-xl", className), ...props, children: children })),
|
|
238
|
+
h4: ({ node, children, className, ...props }) => (_jsx("h4", { className: cn("mt-6 mb-2 font-semibold text-lg", className), ...props, children: children })),
|
|
239
|
+
h5: ({ node, children, className, ...props }) => (_jsx("h5", { className: cn("mt-6 mb-2 font-semibold text-base", className), ...props, children: children })),
|
|
240
|
+
h6: ({ node, children, className, ...props }) => (_jsx("h6", { className: cn("mt-6 mb-2 font-semibold text-sm", className), ...props, children: children })),
|
|
241
|
+
table: ({ node, children, className, ...props }) => (_jsx("div", { className: "my-4 overflow-x-auto", children: _jsx("table", { className: cn("w-full border-collapse border border-border", className), ...props, children: children }) })),
|
|
242
|
+
thead: ({ node, children, className, ...props }) => (_jsx("thead", { className: cn("bg-muted/50", className), ...props, children: children })),
|
|
243
|
+
tbody: ({ node, children, className, ...props }) => (_jsx("tbody", { className: cn("divide-y divide-border", className), ...props, children: children })),
|
|
244
|
+
tr: ({ node, children, className, ...props }) => (_jsx("tr", { className: cn("border-border border-b", className), ...props, children: children })),
|
|
245
|
+
th: ({ node, children, className, ...props }) => (_jsx("th", { className: cn("px-4 py-2 text-left font-semibold text-sm", className), ...props, children: children })),
|
|
246
|
+
td: ({ node, children, className, ...props }) => (_jsx("td", { className: cn("px-4 py-2 text-sm", className), ...props, children: children })),
|
|
247
|
+
blockquote: ({ node, children, className, ...props }) => (_jsx("blockquote", { className: cn("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic", className), ...props, children: children })),
|
|
248
|
+
code: ({ node, className, ...props }) => {
|
|
249
|
+
const inline = node?.position?.start.line === node?.position?.end.line;
|
|
250
|
+
if (!inline) {
|
|
251
|
+
return _jsx("code", { className: className, ...props });
|
|
252
|
+
}
|
|
253
|
+
return (_jsx("code", { className: cn("rounded bg-muted px-1.5 py-0.5 font-mono text-sm", className), ...props }));
|
|
254
|
+
},
|
|
255
|
+
pre: ({ node, className, children }) => {
|
|
256
|
+
let language = "javascript";
|
|
257
|
+
if (typeof node?.properties?.className === "string") {
|
|
258
|
+
const lang = node.properties.className.replace("language-", "");
|
|
259
|
+
// Validate that it's a valid BundledLanguage, fallback to javascript
|
|
260
|
+
language = lang || "javascript";
|
|
261
|
+
}
|
|
262
|
+
// Extract code content from children safely
|
|
263
|
+
let code = "";
|
|
264
|
+
if (isValidElement(children) &&
|
|
265
|
+
children.props &&
|
|
266
|
+
typeof children.props.children === "string") {
|
|
267
|
+
code = children.props.children;
|
|
268
|
+
}
|
|
269
|
+
else if (typeof children === "string") {
|
|
270
|
+
code = children;
|
|
271
|
+
}
|
|
272
|
+
return (_jsx(CodeBlock, { className: cn("my-4 h-auto", className), code: code, language: language, children: _jsx(CodeBlockCopyButton, { onCopy: () => console.log("Copied code to clipboard"), onError: () => console.error("Failed to copy code to clipboard") }) }));
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
const MessageResponseComponent = React.forwardRef(({ className, options, children, allowedImagePrefixes, allowedLinkPrefixes, defaultOrigin, parseIncompleteMarkdown: shouldParseIncompleteMarkdown = true, ...props }, ref) => {
|
|
276
|
+
// Parse the children to remove incomplete markdown tokens if enabled
|
|
277
|
+
const parsedChildren = typeof children === "string" && shouldParseIncompleteMarkdown
|
|
278
|
+
? parseIncompleteMarkdown(children)
|
|
279
|
+
: children;
|
|
280
|
+
return (_jsx("div", { ref: ref, className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), ...props, children: _jsx(HardenedMarkdown, { allowedImagePrefixes: allowedImagePrefixes ?? ["*"], allowedLinkPrefixes: allowedLinkPrefixes ?? ["*"], components: components, defaultOrigin: defaultOrigin, rehypePlugins: [rehypeKatex], remarkPlugins: [remarkGfm, remarkMath], ...options, children: parsedChildren }) }));
|
|
96
281
|
});
|
|
97
282
|
MessageResponseComponent.displayName = "MessageResponse";
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
283
|
export const MessageResponse = memo(MessageResponseComponent, (prevProps, nextProps) => prevProps.children === nextProps.children);
|
|
100
284
|
export const MessageAttachment = React.forwardRef(({ data, className, onRemove, ...props }, ref) => {
|
|
101
285
|
const filename = data.filename || "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable-widget.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/draggable-widget/draggable-widget.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE;QACZ,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"draggable-widget.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/draggable-widget/draggable-widget.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE;QACZ,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,4DA0I3B,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { useDraggable } from "@dnd-kit/core";
|
|
|
9
9
|
import { CSS } from "@dnd-kit/utilities";
|
|
10
10
|
import { GripVertical, Settings2, X } from "lucide-react";
|
|
11
11
|
import { memo } from "react";
|
|
12
|
-
import { WidgetResizeHandle } from "@/components/atoms/widget-resize-handle";
|
|
12
|
+
import { WidgetResizeHandle } from "@/components/atoms/layout/widget-resize-handle";
|
|
13
13
|
import { cn } from "@/lib/utils";
|
|
14
14
|
/**
|
|
15
15
|
* Componente de widget arrastável
|
|
@@ -39,6 +39,10 @@ export const DraggableWidget = memo(({ widgetId, widgetType, children, isEditMod
|
|
|
39
39
|
e.stopPropagation();
|
|
40
40
|
onConfigure?.(widgetId);
|
|
41
41
|
};
|
|
42
|
-
return (_jsxs("div", { ref: setNodeRef, style: style, className: cn("relative group", isDragging && "opacity-50 z-50", isEditMode && "ring-2 ring-primary/20", className), children: [_jsx("div", { className: cn("h-full w-full bg-card rounded-lg border border-border shadow-sm overflow-hidden", isEditMode && "hover:shadow-md transition-shadow"), children: children }), isEditMode && (_jsxs(_Fragment, { children: [_jsx("
|
|
42
|
+
return (_jsxs("div", { ref: setNodeRef, style: style, className: cn("relative group", isDragging && "opacity-50 z-50", isEditMode && "ring-2 ring-primary/20", className), children: [_jsx("div", { className: cn("h-full w-full bg-card rounded-lg border border-border shadow-sm overflow-hidden", isEditMode && "hover:shadow-md transition-shadow"), children: children }), isEditMode && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", ...attributes, ...listeners, className: cn("absolute top-2 left-2 p-1.5 rounded-md", "bg-background/80 backdrop-blur-sm border border-border", "cursor-grab active:cursor-grabbing", "opacity-0 group-hover:opacity-100 transition-opacity", "hover:bg-background"), tabIndex: 0, "aria-label": "Arrastar widget", onKeyDown: (e) => {
|
|
43
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
}
|
|
46
|
+
}, children: _jsx(GripVertical, { className: "w-4 h-4 text-muted-foreground" }) }), _jsxs("div", { className: "absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: [onConfigure && (_jsx("button", { type: "button", onClick: handleConfigure, className: cn("p-1.5 rounded-md", "bg-background/80 backdrop-blur-sm border border-border", "hover:bg-background text-muted-foreground hover:text-foreground", "transition-colors"), "aria-label": "Configurar widget", children: _jsx(Settings2, { className: "w-4 h-4" }) })), onRemove && (_jsx("button", { type: "button", onClick: handleRemove, className: cn("p-1.5 rounded-md", "bg-background/80 backdrop-blur-sm border border-border", "hover:bg-destructive hover:text-destructive-foreground", "text-muted-foreground transition-colors"), "aria-label": "Remover widget", children: _jsx(X, { className: "w-4 h-4" }) }))] }), onResize && (_jsx(WidgetResizeHandle, { widgetId: widgetId, currentWidth: currentWidth, currentHeight: currentHeight, onResize: onResize, cellSize: cellSize, gap: gap }))] }))] }));
|
|
43
47
|
});
|
|
44
48
|
DraggableWidget.displayName = "DraggableWidget";
|
package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditChatMessageModal Component - Flowtomic UI
|
|
3
|
+
*
|
|
4
|
+
* Modal genérico para editar mensagens de chat com validação
|
|
5
|
+
* de alterações não salvas e exibição de metadados
|
|
6
|
+
*/
|
|
7
|
+
import type * as React from "react";
|
|
8
|
+
import type { ChatMessageData } from "../../data-display/chat-message";
|
|
9
|
+
export interface EditChatMessageModalProps {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
message: ChatMessageData | null;
|
|
13
|
+
onSave: (id: string | number, content: string) => Promise<void> | void;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
formatTimestamp?: (timestamp: Date | string) => string;
|
|
16
|
+
getMessageTypeBadgeClassName?: (messageType?: string) => string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const EditChatMessageModal: React.FC<EditChatMessageModalProps>;
|
|
20
|
+
//# sourceMappingURL=edit-chat-message-modal.d.ts.map
|
package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-chat-message-modal.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAYpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,KAAK,MAAM,CAAC;IACvD,4BAA4B,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA4HpE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* EditChatMessageModal Component - Flowtomic UI
|
|
4
|
+
*
|
|
5
|
+
* Modal genérico para editar mensagens de chat com validação
|
|
6
|
+
* de alterações não salvas e exibição de metadados
|
|
7
|
+
*/
|
|
8
|
+
import { Edit, Save } from "lucide-react";
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { cn } from "@/lib/utils";
|
|
11
|
+
import { Badge, Button, Dialog, DialogContent, DialogHeader, DialogTitle, Textarea, } from "../../../atoms";
|
|
12
|
+
const defaultFormatTimestamp = (timestamp) => {
|
|
13
|
+
return new Date(timestamp).toLocaleString();
|
|
14
|
+
};
|
|
15
|
+
const defaultGetMessageTypeBadgeClassName = (messageType) => {
|
|
16
|
+
switch (messageType) {
|
|
17
|
+
case "SAY":
|
|
18
|
+
return "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300";
|
|
19
|
+
case "ACTION":
|
|
20
|
+
return "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300";
|
|
21
|
+
case "STORY":
|
|
22
|
+
return "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300";
|
|
23
|
+
default:
|
|
24
|
+
return "bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const EditChatMessageModal = ({ isOpen, onClose, message, onSave, isLoading = false, formatTimestamp = defaultFormatTimestamp, getMessageTypeBadgeClassName = defaultGetMessageTypeBadgeClassName, className, }) => {
|
|
28
|
+
const [editedContent, setEditedContent] = useState("");
|
|
29
|
+
const [hasChanges, setHasChanges] = useState(false);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (message) {
|
|
32
|
+
setEditedContent(message.content);
|
|
33
|
+
setHasChanges(false);
|
|
34
|
+
}
|
|
35
|
+
}, [message]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (message) {
|
|
38
|
+
setHasChanges(editedContent !== message.content);
|
|
39
|
+
}
|
|
40
|
+
}, [editedContent, message]);
|
|
41
|
+
const handleSave = async () => {
|
|
42
|
+
if (!message || !hasChanges || isLoading)
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
await onSave(message.id, editedContent);
|
|
46
|
+
onClose();
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error("Error saving message:", error);
|
|
50
|
+
// Error handling should be done by the parent component
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const handleClose = () => {
|
|
54
|
+
if (hasChanges) {
|
|
55
|
+
const confirmClose = window.confirm("Você tem alterações não salvas. Deseja realmente fechar?");
|
|
56
|
+
if (!confirmClose)
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
onClose();
|
|
60
|
+
};
|
|
61
|
+
if (!message)
|
|
62
|
+
return null;
|
|
63
|
+
return (_jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: _jsxs(DialogContent, { className: cn("max-w-2xl max-h-[80vh] overflow-hidden", className), children: [_jsx(DialogHeader, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Edit, { className: "w-5 h-5 text-blue-600 dark:text-blue-400" }), _jsx(DialogTitle, { className: "text-lg", children: "Editar Mensagem" })] }) }), _jsxs("div", { className: "space-y-4", children: [_jsx("div", { className: "bg-gray-50 dark:bg-gray-800/50 rounded-lg p-3 border", children: _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [_jsx("span", { className: "font-medium text-gray-900 dark:text-gray-100", children: message.sender }), message.messageType && (_jsx(Badge, { className: getMessageTypeBadgeClassName(message.messageType), children: message.messageType })), _jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400 ml-auto", children: formatTimestamp(message.timestamp) })] }) }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "message-content", className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: "Conte\u00FAdo da Mensagem" }), _jsx(Textarea, { id: "message-content", value: editedContent, onChange: (e) => setEditedContent(e.target.value), className: "min-h-[200px] resize-none", placeholder: "Digite o conte\u00FAdo da mensagem...", disabled: isLoading }), _jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400", children: [_jsxs("span", { children: [editedContent.length, " caracteres"] }), hasChanges && (_jsx("div", { className: "flex items-center gap-1 text-amber-600 dark:text-amber-400", children: _jsx("span", { children: "\u26A0\uFE0F Altera\u00E7\u00F5es n\u00E3o salvas" }) }))] })] }), _jsxs("div", { className: "flex items-center justify-end gap-2 pt-4 border-t", children: [_jsx(Button, { variant: "outline", onClick: handleClose, disabled: isLoading, children: "Cancelar" }), _jsxs(Button, { onClick: handleSave, disabled: !hasChanges || isLoading || !editedContent.trim(), className: "flex items-center gap-2", children: [isLoading ? (_jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-white" })) : (_jsx(Save, { className: "w-4 h-4" })), "Salvar Altera\u00E7\u00F5es"] })] })] })] }) }));
|
|
64
|
+
};
|
|
65
|
+
EditChatMessageModal.displayName = "EditChatMessageModal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/feedback/edit-chat-message-modal/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditChatMessageModal } from "./edit-chat-message-modal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-section.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"autocomplete-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-section.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,mBAAmB,iGAkBxB,CAAC;AAIF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -7,7 +7,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { cn } from "@/lib/utils";
|
|
9
9
|
const AutocompleteSection = React.forwardRef(({ className, title, children, ...props }, ref) => {
|
|
10
|
-
return (
|
|
10
|
+
return (
|
|
11
|
+
// biome-ignore lint/a11y/useSemanticElements: Agrupamento em menu de autocomplete
|
|
12
|
+
_jsxs("div", { ref: ref, ...props, className: cn("space-y-1", className), role: "group", "aria-label": title, children: [title && (_jsx("div", { className: "px-2 py-1.5 text-xs font-semibold text-muted-foreground", children: title })), _jsx("ul", { className: "space-y-0.5", children: children })] }));
|
|
11
13
|
});
|
|
12
14
|
AutocompleteSection.displayName = "AutocompleteSection";
|
|
13
15
|
export { AutocompleteSection };
|