@clubmed/usg-chat-ui 1.2.7 → 1.4.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.
Files changed (63) hide show
  1. package/README.md +36 -0
  2. package/assets/style.css +1 -1
  3. package/chunks/react.esm.js +2012 -1997
  4. package/chunks/react.esm.js.map +1 -1
  5. package/chunks/vi.2VT5v0um.js +1 -0
  6. package/config/chatLabels.d.ts +83 -0
  7. package/config/chatLabels.js +2 -0
  8. package/config/chatLabels.js.map +1 -0
  9. package/contexts/ChatLabelsContext.d.ts +13 -0
  10. package/contexts/ChatLabelsContext.js +24 -0
  11. package/contexts/ChatLabelsContext.js.map +1 -0
  12. package/contexts/ChatLabelsContext.test.d.ts +1 -0
  13. package/contexts/ChatLabelsContext.test.js +23 -0
  14. package/contexts/ChatLabelsContext.test.js.map +1 -0
  15. package/molecules/AiElements/Branch.js +45 -44
  16. package/molecules/AiElements/Branch.js.map +1 -1
  17. package/molecules/AiElements/PromptInput.js +60 -58
  18. package/molecules/AiElements/PromptInput.js.map +1 -1
  19. package/molecules/RichText/useCollaboration.test.js +1 -1
  20. package/organisms/canvas/CanvasLayout.d.ts +2 -1
  21. package/organisms/canvas/CanvasLayout.js +1249 -1248
  22. package/organisms/canvas/CanvasLayout.js.map +1 -1
  23. package/organisms/chat/Chat.d.ts +7 -1
  24. package/organisms/chat/Chat.js +70 -69
  25. package/organisms/chat/Chat.js.map +1 -1
  26. package/organisms/chat/ChatHeader.d.ts +4 -5
  27. package/organisms/chat/ChatHeader.js +36 -39
  28. package/organisms/chat/ChatHeader.js.map +1 -1
  29. package/organisms/chat/ChatHeader.test.d.ts +1 -0
  30. package/organisms/chat/ChatHeader.test.js +18 -0
  31. package/organisms/chat/ChatHeader.test.js.map +1 -0
  32. package/organisms/chat/ChatMessageList.d.ts +1 -2
  33. package/organisms/chat/ChatMessageList.js +73 -58
  34. package/organisms/chat/ChatMessageList.js.map +1 -1
  35. package/organisms/chat/ChatMessageList.test.d.ts +1 -0
  36. package/organisms/chat/ChatMessageList.test.js +67 -0
  37. package/organisms/chat/ChatMessageList.test.js.map +1 -0
  38. package/organisms/chat/ChatSettingsButton.d.ts +2 -0
  39. package/organisms/chat/ChatSettingsButton.js +25 -0
  40. package/organisms/chat/ChatSettingsButton.js.map +1 -0
  41. package/organisms/chat/ChatSettingsButton.test.d.ts +1 -0
  42. package/organisms/chat/ChatSettingsButton.test.js +16 -0
  43. package/organisms/chat/ChatSettingsButton.test.js.map +1 -0
  44. package/organisms/chat/ConversationSidebar.js +45 -44
  45. package/organisms/chat/ConversationSidebar.js.map +1 -1
  46. package/organisms/chat/MessageActions.js +163 -138
  47. package/organisms/chat/MessageActions.js.map +1 -1
  48. package/organisms/chat/MessageRenderers.js +1 -1
  49. package/organisms/chat/PromptComposer.js +19 -14
  50. package/organisms/chat/PromptComposer.js.map +1 -1
  51. package/organisms/chat/SidebarToggleButton.d.ts +2 -1
  52. package/organisms/chat/SidebarToggleButton.js +15 -12
  53. package/organisms/chat/SidebarToggleButton.js.map +1 -1
  54. package/organisms/chat/hooks/useChat.d.ts +1 -1
  55. package/organisms/chat/hooks/useChat.js +83 -83
  56. package/organisms/chat/hooks/useChat.js.map +1 -1
  57. package/package.json +1 -1
  58. package/utils/interpolate.d.ts +5 -0
  59. package/utils/interpolate.js +13 -0
  60. package/utils/interpolate.js.map +1 -0
  61. package/utils/interpolate.test.d.ts +1 -0
  62. package/utils/interpolate.test.js +21 -0
  63. package/utils/interpolate.test.js.map +1 -0
@@ -1,6 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ChatHeaderProps } from './ChatHeader';
3
+ import { ChatLabelOverrides } from '../../config/chatLabels';
2
4
  export interface ChatProps {
5
+ title?: string;
3
6
  className?: string;
4
7
  headerActions?: ReactNode;
8
+ variant?: ChatHeaderProps["variant"];
9
+ labels?: ChatLabelOverrides;
5
10
  }
6
- export declare function Chat({ headerActions, className, }: ChatProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Chat({ title, headerActions, variant, className, labels, }: ChatProps): import("react/jsx-runtime").JSX.Element;
12
+ export default Chat;
@@ -1,63 +1,64 @@
1
1
  "use client";
2
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
3
3
  import { cn as d } from "../../utils/cn.js";
4
- import { ChatHeader as L } from "./ChatHeader.js";
5
- import { SidebarToggleButton as R } from "./SidebarToggleButton.js";
6
- import { ConversationSidebar as M } from "./ConversationSidebar.js";
4
+ import { ChatHeader as k } from "./ChatHeader.js";
5
+ import { SidebarToggleButton as z } from "./SidebarToggleButton.js";
6
+ import { ConversationSidebar as I } from "./ConversationSidebar.js";
7
7
  import { ChatMessageList as T } from "./ChatMessageList.js";
8
8
  import { PromptComposer as j } from "./PromptComposer.js";
9
- import { CanvasLayout as F } from "../canvas/CanvasLayout.js";
10
- import { StoryCanvas as I } from "../canvas/StoryCanvas.js";
11
- import { ApiDocsCanvas as k } from "../canvas/ApiDocsCanvas.js";
12
- import { ReleaseNoteCanvas as z } from "../canvas/ReleaseNoteCanvas.js";
9
+ import { CanvasLayout as A } from "../canvas/CanvasLayout.js";
10
+ import { StoryCanvas as F } from "../canvas/StoryCanvas.js";
11
+ import { ApiDocsCanvas as B } from "../canvas/ApiDocsCanvas.js";
12
+ import { ReleaseNoteCanvas as P } from "../canvas/ReleaseNoteCanvas.js";
13
13
  import { SettingsModal as W } from "../settings/SettingsModal.js";
14
14
  import { useChat as _ } from "./hooks/useChat.js";
15
- function V({
16
- headerActions: h,
17
- className: f
15
+ import { ChatSettingsButton as p } from "./ChatSettingsButton.js";
16
+ import { ChatLabelsProvider as $ } from "../../contexts/ChatLabelsContext.js";
17
+ function te({
18
+ title: h = "ClubMed USG AI Assistant",
19
+ headerActions: u,
20
+ variant: o = "full",
21
+ className: f,
22
+ labels: g
18
23
  }) {
19
24
  const {
20
- chatMessages: t,
21
- settingsOpen: g,
22
- setSettingsOpen: a,
23
- sidebarOpen: i,
24
- setSidebarOpen: r,
25
- sidebarRefreshTrigger: u,
26
- currentConversationId: v,
27
- loadConversation: C,
28
- handleNewConversation: x,
29
- isLoadingMessage: s,
25
+ chatMessages: C,
26
+ settingsOpen: x,
27
+ setSettingsOpen: s,
28
+ sidebarOpen: b,
29
+ setSidebarOpen: l,
30
+ sidebarRefreshTrigger: v,
31
+ currentConversationId: S,
32
+ loadConversation: w,
33
+ handleNewConversation: N,
34
+ isLoadingMessage: r,
30
35
  canvasType: n,
31
- isFullscreen: l,
32
- canvasWidth: m,
33
- isResizing: c,
34
- resizeWidth: p,
35
- handleFollowupClick: S,
36
- handleSubmit: w,
37
- handleRegenerate: y,
38
- localInput: b,
39
- setLocalInput: N,
40
- emptyStateGreeting: O
36
+ isFullscreen: i,
37
+ canvasWidth: a,
38
+ isResizing: m,
39
+ resizeWidth: c,
40
+ handleFollowupClick: y,
41
+ handleSubmit: L,
42
+ handleRegenerate: O,
43
+ localInput: M,
44
+ setLocalInput: R
41
45
  } = _();
42
- return /* @__PURE__ */ o("div", { className: d("usg-chat-ui", f), "data-testid": "chat", children: [
43
- /* @__PURE__ */ e(
44
- L,
45
- {
46
- conversationCount: t.length,
47
- onOpenSettings: () => a(!0),
48
- actions: h
49
- }
50
- ),
51
- /* @__PURE__ */ o("div", { className: "flex-1 flex overflow-hidden relative", children: [
52
- !i && /* @__PURE__ */ e(R, { onOpen: () => r(!0) }),
53
- i && /* @__PURE__ */ e(
54
- M,
46
+ return /* @__PURE__ */ e($, { labels: g, children: /* @__PURE__ */ t("div", { className: d("usg-chat-ui", f), "data-testid": "chat", children: [
47
+ !(o != null && o.includes("no-header")) && /* @__PURE__ */ t(k, { title: h, variant: o, children: [
48
+ u,
49
+ /* @__PURE__ */ e(p, { onClick: () => s(!0) })
50
+ ] }),
51
+ /* @__PURE__ */ t("div", { className: "flex-1 flex overflow-hidden relative", children: [
52
+ /* @__PURE__ */ e(z, { className: "absolute left-4 z-10 top-4", onOpen: () => l(!0) }),
53
+ (o == null ? void 0 : o.includes("no-header")) && /* @__PURE__ */ e(p, { className: "absolute right-4 z-10 top-4", onClick: () => s(!0) }),
54
+ b && /* @__PURE__ */ e(
55
+ I,
55
56
  {
56
- currentConversationId: v,
57
- onSelectConversation: C,
58
- onNewConversation: x,
59
- refreshTrigger: u,
60
- onClose: () => r(!1)
57
+ currentConversationId: S,
58
+ onSelectConversation: w,
59
+ onNewConversation: N,
60
+ refreshTrigger: v,
61
+ onClose: () => l(!1)
61
62
  }
62
63
  ),
63
64
  /* @__PURE__ */ e(
@@ -65,45 +66,45 @@ function V({
65
66
  {
66
67
  className: d(
67
68
  "flex-1 flex items-stretch justify-center overflow-hidden min-h-0",
68
- l && "lg:w-0 lg:opacity-0 lg:pointer-events-none",
69
- !c && "transition-all duration-300"
69
+ i && "lg:w-0 lg:opacity-0 lg:pointer-events-none",
70
+ !m && "transition-all duration-300"
70
71
  ),
71
72
  style: {
72
- width: l ? "0" : c && p !== null ? `calc(100% - ${p}px)` : m !== null ? `calc(100% - ${m}px)` : "50%"
73
+ width: i ? "0" : m && c !== null ? `calc(100% - ${c}px)` : a !== null ? `calc(100% - ${a}px)` : "50%"
73
74
  },
74
- children: /* @__PURE__ */ o("div", { className: "w-full max-w-3xl flex flex-col h-full", children: [
75
+ children: /* @__PURE__ */ t("div", { className: "w-full max-w-3xl flex flex-col h-full", children: [
75
76
  /* @__PURE__ */ e(
76
77
  T,
77
78
  {
78
- chatMessages: t,
79
- isLoadingMessage: s,
80
- onFollowupClick: S,
81
- onRegenerate: y,
82
- emptyStateGreeting: O
79
+ chatMessages: C,
80
+ isLoadingMessage: r,
81
+ onFollowupClick: y,
82
+ onRegenerate: O
83
83
  }
84
84
  ),
85
85
  /* @__PURE__ */ e(
86
86
  j,
87
87
  {
88
- value: b,
89
- isLoading: s,
90
- onChange: N,
91
- onSubmit: w
88
+ value: M,
89
+ isLoading: r,
90
+ onChange: R,
91
+ onSubmit: L
92
92
  }
93
93
  )
94
94
  ] })
95
95
  }
96
96
  ),
97
- /* @__PURE__ */ o(F, { children: [
98
- n === "story" && /* @__PURE__ */ e(I, {}),
99
- n === "api_docs" && /* @__PURE__ */ e(k, {}),
100
- n === "release_note" && /* @__PURE__ */ e(z, {})
97
+ /* @__PURE__ */ t(A, { children: [
98
+ n === "story" && /* @__PURE__ */ e(F, {}),
99
+ n === "api_docs" && /* @__PURE__ */ e(B, {}),
100
+ n === "release_note" && /* @__PURE__ */ e(P, {})
101
101
  ] })
102
102
  ] }),
103
- /* @__PURE__ */ e(W, { open: g, onOpenChange: a })
104
- ] });
103
+ /* @__PURE__ */ e(W, { open: x, onOpenChange: s })
104
+ ] }) });
105
105
  }
106
106
  export {
107
- V as Chat
107
+ te as Chat,
108
+ te as default
108
109
  };
109
110
  //# sourceMappingURL=Chat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.js","sources":["../../../lib/organisms/chat/Chat.tsx"],"sourcesContent":["\"use client\";\n\nimport type {ReactNode} from \"react\";\n\nimport {cn} from \"../../utils/cn\";\nimport {ChatHeader} from \"./ChatHeader\";\nimport {SidebarToggleButton} from \"./SidebarToggleButton\";\nimport {ConversationSidebar} from \"./ConversationSidebar\";\nimport {ChatMessageList} from \"./ChatMessageList\";\nimport {PromptComposer} from \"./PromptComposer\";\nimport {CanvasLayout} from \"../canvas/CanvasLayout\";\nimport {StoryCanvas} from \"../canvas/StoryCanvas\";\nimport {ApiDocsCanvas} from \"../canvas/ApiDocsCanvas\";\nimport {ReleaseNoteCanvas} from \"../canvas/ReleaseNoteCanvas\";\nimport {SettingsModal} from \"../settings/SettingsModal\";\nimport {useChat} from \"./hooks/useChat\";\n\nexport interface ChatProps {\n className?: string;\n headerActions?: ReactNode;\n}\n\nexport function Chat({\n headerActions,\n className,\n }: ChatProps) {\n const {\n chatMessages,\n settingsOpen,\n setSettingsOpen,\n sidebarOpen,\n setSidebarOpen,\n sidebarRefreshTrigger,\n currentConversationId,\n loadConversation,\n handleNewConversation,\n isLoadingMessage,\n canvasType,\n isFullscreen,\n canvasWidth,\n isResizing,\n resizeWidth,\n handleFollowupClick,\n handleSubmit,\n handleRegenerate,\n localInput,\n setLocalInput,\n emptyStateGreeting\n } = useChat();\n\n return (\n <div className={cn(\"usg-chat-ui\", className)} data-testid=\"chat\">\n <ChatHeader\n conversationCount={chatMessages.length}\n onOpenSettings={() => setSettingsOpen(true)}\n actions={headerActions}\n />\n\n <div className=\"flex-1 flex overflow-hidden relative\">\n {!sidebarOpen && <SidebarToggleButton onOpen={() => setSidebarOpen(true)}/>}\n\n {sidebarOpen && (\n <ConversationSidebar\n currentConversationId={currentConversationId}\n onSelectConversation={loadConversation}\n onNewConversation={handleNewConversation}\n refreshTrigger={sidebarRefreshTrigger}\n onClose={() => setSidebarOpen(false)}\n />\n )}\n\n <main\n className={cn(\n \"flex-1 flex items-stretch justify-center overflow-hidden min-h-0\",\n isFullscreen && \"lg:w-0 lg:opacity-0 lg:pointer-events-none\",\n !isResizing && \"transition-all duration-300\"\n )}\n style={{\n width: isFullscreen\n ? \"0\"\n : isResizing && resizeWidth !== null\n ? `calc(100% - ${resizeWidth}px)`\n : canvasWidth !== null\n ? `calc(100% - ${canvasWidth}px)`\n : \"50%\",\n }}\n >\n <div className=\"w-full max-w-3xl flex flex-col h-full\">\n <ChatMessageList\n chatMessages={chatMessages}\n isLoadingMessage={isLoadingMessage}\n onFollowupClick={handleFollowupClick}\n onRegenerate={handleRegenerate}\n emptyStateGreeting={emptyStateGreeting}\n />\n\n <PromptComposer\n value={localInput}\n isLoading={isLoadingMessage}\n onChange={setLocalInput}\n onSubmit={handleSubmit}\n />\n </div>\n </main>\n\n <CanvasLayout>\n {canvasType === \"story\" && <StoryCanvas/>}\n {canvasType === \"api_docs\" && <ApiDocsCanvas/>}\n {canvasType === \"release_note\" && <ReleaseNoteCanvas/>}\n </CanvasLayout>\n </div>\n\n <SettingsModal open={settingsOpen} onOpenChange={setSettingsOpen}/>\n </div>\n );\n}\n"],"names":["Chat","headerActions","className","chatMessages","settingsOpen","setSettingsOpen","sidebarOpen","setSidebarOpen","sidebarRefreshTrigger","currentConversationId","loadConversation","handleNewConversation","isLoadingMessage","canvasType","isFullscreen","canvasWidth","isResizing","resizeWidth","handleFollowupClick","handleSubmit","handleRegenerate","localInput","setLocalInput","emptyStateGreeting","useChat","jsxs","cn","jsx","ChatHeader","SidebarToggleButton","ConversationSidebar","ChatMessageList","PromptComposer","CanvasLayout","StoryCanvas","ApiDocsCanvas","ReleaseNoteCanvas","SettingsModal"],"mappings":";;;;;;;;;;;;;;AAsBO,SAASA,EAAK;AAAA,EACE,eAAAC;AAAA,EACA,WAAAC;AACF,GAAc;AACjC,QAAM;AAAA,IACJ,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAA;AAEJ,SACE,gBAAAC,EAAC,SAAI,WAAWC,EAAG,eAAexB,CAAS,GAAG,eAAY,QACxD,UAAA;AAAA,IAAA,gBAAAyB;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,mBAAmBzB,EAAa;AAAA,QAChC,gBAAgB,MAAME,EAAgB,EAAI;AAAA,QAC1C,SAASJ;AAAA,MAAA;AAAA,IAAA;AAAA,IAGX,gBAAAwB,EAAC,OAAA,EAAI,WAAU,wCACZ,UAAA;AAAA,MAAA,CAACnB,KAAe,gBAAAqB,EAACE,GAAA,EAAoB,QAAQ,MAAMtB,EAAe,EAAI,GAAE;AA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
1
+ {"version":3,"file":"Chat.js","sources":["../../../lib/organisms/chat/Chat.tsx"],"sourcesContent":["\"use client\";\n\nimport type {ReactNode} from \"react\";\n\nimport {cn} from \"../../utils/cn\";\nimport {ChatHeader, type ChatHeaderProps} from \"./ChatHeader\";\nimport {SidebarToggleButton} from \"./SidebarToggleButton\";\nimport {ConversationSidebar} from \"./ConversationSidebar\";\nimport {ChatMessageList} from \"./ChatMessageList\";\nimport {PromptComposer} from \"./PromptComposer\";\nimport {CanvasLayout} from \"../canvas/CanvasLayout\";\nimport {StoryCanvas} from \"../canvas/StoryCanvas\";\nimport {ApiDocsCanvas} from \"../canvas/ApiDocsCanvas\";\nimport {ReleaseNoteCanvas} from \"../canvas/ReleaseNoteCanvas\";\nimport {SettingsModal} from \"../settings/SettingsModal\";\nimport {useChat} from \"./hooks/useChat\";\nimport type {ChatLabelOverrides} from \"../../config/chatLabels\";\nimport {ChatSettingsButton} from \"@clubmed/usg-chat-ui/organisms/chat/ChatSettingsButton\";\nimport {ChatLabelsProvider} from \"../../contexts/ChatLabelsContext\";\n\nexport interface ChatProps {\n title?: string;\n className?: string;\n headerActions?: ReactNode;\n variant?: ChatHeaderProps[\"variant\"];\n labels?: ChatLabelOverrides;\n}\n\nexport function Chat({\n title = \"ClubMed USG AI Assistant\",\n headerActions,\n variant = \"full\",\n className,\n labels,\n }: ChatProps) {\n const {\n chatMessages,\n settingsOpen,\n setSettingsOpen,\n sidebarOpen,\n setSidebarOpen,\n sidebarRefreshTrigger,\n currentConversationId,\n loadConversation,\n handleNewConversation,\n isLoadingMessage,\n canvasType,\n isFullscreen,\n canvasWidth,\n isResizing,\n resizeWidth,\n handleFollowupClick,\n handleSubmit,\n handleRegenerate,\n localInput,\n setLocalInput,\n } = useChat();\n\n return (\n <ChatLabelsProvider labels={labels}>\n <div className={cn(\"usg-chat-ui\", className)} data-testid=\"chat\">\n {\n !variant?.includes(\"no-header\") && <ChatHeader title={title} variant={variant}>\n {headerActions}\n <ChatSettingsButton onClick={() => setSettingsOpen(true)}/>\n </ChatHeader>\n }\n\n <div className=\"flex-1 flex overflow-hidden relative\">\n <SidebarToggleButton className=\"absolute left-4 z-10 top-4\" onOpen={() => setSidebarOpen(true)}/>\n\n {variant?.includes(\"no-header\") && <ChatSettingsButton className=\"absolute right-4 z-10 top-4\" onClick={() => setSettingsOpen(true)}/>}\n\n {sidebarOpen && (\n <ConversationSidebar\n currentConversationId={currentConversationId}\n onSelectConversation={loadConversation}\n onNewConversation={handleNewConversation}\n refreshTrigger={sidebarRefreshTrigger}\n onClose={() => setSidebarOpen(false)}\n />\n )}\n\n <main\n className={cn(\n \"flex-1 flex items-stretch justify-center overflow-hidden min-h-0\",\n isFullscreen && \"lg:w-0 lg:opacity-0 lg:pointer-events-none\",\n !isResizing && \"transition-all duration-300\"\n )}\n style={{\n width: isFullscreen\n ? \"0\"\n : isResizing && resizeWidth !== null\n ? `calc(100% - ${resizeWidth}px)`\n : canvasWidth !== null\n ? `calc(100% - ${canvasWidth}px)`\n : \"50%\",\n }}\n >\n <div className=\"w-full max-w-3xl flex flex-col h-full\">\n <ChatMessageList\n chatMessages={chatMessages}\n isLoadingMessage={isLoadingMessage}\n onFollowupClick={handleFollowupClick}\n onRegenerate={handleRegenerate}\n />\n\n <PromptComposer\n value={localInput}\n isLoading={isLoadingMessage}\n onChange={setLocalInput}\n onSubmit={handleSubmit}\n />\n </div>\n </main>\n\n <CanvasLayout>\n {canvasType === \"story\" && <StoryCanvas/>}\n {canvasType === \"api_docs\" && <ApiDocsCanvas/>}\n {canvasType === \"release_note\" && <ReleaseNoteCanvas/>}\n </CanvasLayout>\n </div>\n\n <SettingsModal open={settingsOpen} onOpenChange={setSettingsOpen}/>\n </div>\n </ChatLabelsProvider>\n );\n}\n\nexport default Chat;\n"],"names":["Chat","title","headerActions","variant","className","labels","chatMessages","settingsOpen","setSettingsOpen","sidebarOpen","setSidebarOpen","sidebarRefreshTrigger","currentConversationId","loadConversation","handleNewConversation","isLoadingMessage","canvasType","isFullscreen","canvasWidth","isResizing","resizeWidth","handleFollowupClick","handleSubmit","handleRegenerate","localInput","setLocalInput","useChat","jsx","ChatLabelsProvider","jsxs","cn","ChatHeader","ChatSettingsButton","SidebarToggleButton","ConversationSidebar","ChatMessageList","PromptComposer","CanvasLayout","StoryCanvas","ApiDocsCanvas","ReleaseNoteCanvas","SettingsModal"],"mappings":";;;;;;;;;;;;;;;;AA4BO,SAASA,GAAK;AAAA,EACE,OAAAC,IAAQ;AAAA,EACR,eAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,QAAAC;AACF,GAAc;AACjC,QAAM;AAAA,IACJ,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,IACEC,EAAA;AAEJ,SACE,gBAAAC,EAACC,GAAA,EAAmB,QAAAvB,GAClB,UAAA,gBAAAwB,EAAC,OAAA,EAAI,WAAWC,EAAG,eAAe1B,CAAS,GAAG,eAAY,QAEtD,UAAA;AAAA,IAAA,EAACD,KAAA,QAAAA,EAAS,SAAS,iBAAgB,gBAAA0B,EAACE,GAAA,EAAW,OAAA9B,GAAc,SAAAE,GAC1D,UAAA;AAAA,MAAAD;AAAA,wBACA8B,GAAA,EAAmB,SAAS,MAAMxB,EAAgB,EAAI,EAAA,CAAE;AAAA,IAAA,GAC3D;AAAA,IAGF,gBAAAqB,EAAC,OAAA,EAAI,WAAU,wCACb,UAAA;AAAA,MAAA,gBAAAF,EA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B,gBAAAW,EAACa,GAAA,CAAA,CAAiB;AAAA,MAAA,EAAA,CACtD;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAb,EAACc,GAAA,EAAc,MAAMlC,GAAc,cAAcC,EAAA,CAAgB;AAAA,EAAA,EAAA,CACnE,EAAA,CACF;AAEJ;"}
@@ -1,7 +1,6 @@
1
- import { ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  export interface ChatHeaderProps {
3
- conversationCount: number;
4
- onOpenSettings: () => void;
5
- actions?: ReactNode;
3
+ title: string;
4
+ variant?: string;
6
5
  }
7
- export declare function ChatHeader({ conversationCount, onOpenSettings, actions }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ChatHeader({ title, variant, children }: PropsWithChildren<ChatHeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,43 +1,40 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { W as o } from "../../chunks/wand-sparkles.js";
4
- import { S as i } from "../../chunks/settings.js";
5
- function m({ conversationCount: t, onOpenSettings: s, actions: a }) {
6
- return /* @__PURE__ */ r("div", { className: "h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors shadow-sm", children: [
7
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3 sm:gap-4", children: [
8
- /* @__PURE__ */ r("div", { className: "relative group", children: [
9
- /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500" }),
10
- /* @__PURE__ */ r(
11
- "div",
12
- {
13
- className: "relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden",
14
- style: {
15
- background: "linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)",
16
- boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)"
17
- },
18
- children: [
19
- /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
20
- /* @__PURE__ */ e(o, { className: "h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10", strokeWidth: 2 })
21
- ]
22
- }
23
- )
24
- ] }),
25
- /* @__PURE__ */ e("div", { className: "flex flex-col", children: /* @__PURE__ */ e("h1", { className: "text-sm sm:text-base font-semibold text-foreground tracking-tight", children: "ClubMed USG AI Assistant" }) }),
26
- t > 0 && /* @__PURE__ */ e("div", { className: "sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground", children: t })
27
- ] }),
28
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3", children: [
29
- a,
30
- /* @__PURE__ */ e(
31
- "button",
32
- {
33
- onClick: s,
34
- className: "group relative flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-lg border border-border bg-card hover:bg-muted transition-all duration-200 hover:scale-105 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",
35
- "aria-label": "Paramètres",
36
- children: /* @__PURE__ */ e(i, { className: "h-4 w-4 sm:h-5 sm:w-5 text-muted-foreground group-hover:rotate-90 transition-transform duration-500" })
37
- }
38
- )
39
- ] })
40
- ] });
2
+ import { jsxs as r, jsx as s, Fragment as l } from "react/jsx-runtime";
3
+ import { cn as d } from "../../utils/cn.js";
4
+ import { W as i } from "../../chunks/wand-sparkles.js";
5
+ function m({ title: o, variant: e = "", children: t }) {
6
+ return /* @__PURE__ */ r(
7
+ "div",
8
+ {
9
+ className: d("h-16 flex items-center justify-between px-4 sm:px-6 transition-colors", {
10
+ "shadow-sm": !(e != null && e.includes("no-shadow")),
11
+ "bg-card/95 border-b border-border backdrop-blur-xl": !(e != null && e.includes("no-border"))
12
+ }),
13
+ children: [
14
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-3 sm:gap-4", children: [
15
+ /* @__PURE__ */ s("div", { className: "relative group", children: !(e != null && e.includes("no-logo")) && /* @__PURE__ */ r(l, { children: [
16
+ /* @__PURE__ */ s("div", { className: "absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500" }),
17
+ /* @__PURE__ */ r(
18
+ "div",
19
+ {
20
+ className: "relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden",
21
+ style: {
22
+ background: "linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)",
23
+ boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)"
24
+ },
25
+ children: [
26
+ /* @__PURE__ */ s("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
27
+ /* @__PURE__ */ s(i, { className: "h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10", strokeWidth: 2 })
28
+ ]
29
+ }
30
+ )
31
+ ] }) }),
32
+ /* @__PURE__ */ s("div", { className: "flex flex-col", children: /* @__PURE__ */ s("h1", { className: "text-sm sm:text-base font-semibold text-foreground tracking-tight", children: o }) })
33
+ ] }),
34
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2 sm:gap-3", children: t })
35
+ ]
36
+ }
37
+ );
41
38
  }
42
39
  export {
43
40
  m as ChatHeader
@@ -1 +1 @@
1
- {"version":3,"file":"ChatHeader.js","sources":["../../../lib/organisms/chat/ChatHeader.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Settings as SettingsIcon, Wand2 } from \"lucide-react\";\n\nexport interface ChatHeaderProps {\n conversationCount: number;\n onOpenSettings: () => void;\n actions?: ReactNode;\n}\n\nexport function ChatHeader({ conversationCount, onOpenSettings, actions }: ChatHeaderProps) {\n return (\n <div className=\"h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors shadow-sm\">\n <div className=\"flex items-center gap-3 sm:gap-4\">\n <div className=\"relative group\">\n <div className=\"absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500\" />\n <div\n className=\"relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden\"\n style={{\n background: \"linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)\",\n boxShadow: \"inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)\",\n }}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none\" />\n <Wand2 className=\"h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10\" strokeWidth={2} />\n </div>\n </div>\n\n <div className=\"flex flex-col\">\n <h1 className=\"text-sm sm:text-base font-semibold text-foreground tracking-tight\">\n ClubMed USG AI Assistant\n </h1>\n </div>\n\n {conversationCount > 0 && (\n <div className=\"sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground\">\n {conversationCount}\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-2 sm:gap-3\">\n {actions}\n <button\n onClick={onOpenSettings}\n className=\"group relative flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-lg border border-border bg-card hover:bg-muted transition-all duration-200 hover:scale-105 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n aria-label=\"Paramètres\"\n >\n <SettingsIcon className=\"h-4 w-4 sm:h-5 sm:w-5 text-muted-foreground group-hover:rotate-90 transition-transform duration-500\" />\n </button>\n </div>\n </div>\n );\n}\n"],"names":["ChatHeader","conversationCount","onOpenSettings","actions","jsxs","jsx","Wand2","SettingsIcon"],"mappings":";;;;AAWO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WithChildren} from \"react\";\nimport {Wand2} from \"lucide-react\";\nimport {cn} from \"@clubmed/usg-chat-ui/utils/cn\";\n\nexport interface ChatHeaderProps {\n title: string;\n variant?: string;\n}\n\nexport function ChatHeader({title, variant = \"\", children}: PropsWithChildren<ChatHeaderProps>) {\n return (\n <div\n className={cn(\"h-16 flex items-center justify-between px-4 sm:px-6 transition-colors\", {\n \"shadow-sm\": !variant?.includes(\"no-shadow\"),\n \"bg-card/95 border-b border-border backdrop-blur-xl\": !variant?.includes(\"no-border\"),\n })}>\n <div className=\"flex items-center gap-3 sm:gap-4\">\n <div className=\"relative group\">\n {!variant?.includes(\"no-logo\") && (\n <>\n <div className=\"absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500\"/>\n <div\n className=\"relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden\"\n style={{\n background: \"linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)\",\n boxShadow: \"inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)\",\n }}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none\"/>\n <Wand2 className=\"h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10\" strokeWidth={2}/>\n </div>\n </>\n )}\n </div>\n\n <div className=\"flex flex-col\">\n <h1 className=\"text-sm sm:text-base font-semibold text-foreground tracking-tight\">\n {title}\n </h1>\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 sm:gap-3\">\n {children}\n </div>\n </div>\n );\n}\n"],"names":["ChatHeader","title","variant","children","jsxs","cn","jsx","Fragment","Wand2"],"mappings":";;;;AAWO,SAASA,EAAW,EAAC,OAAAC,GAAO,SAAAC,IAAU,IAAI,UAAAC,KAA+C;AAC9F,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAG,yEAAyE;AAAA,QACrF,aAAa,EAACH,KAAA,QAAAA,EAAS,SAAS;AAAA,QAChC,sDAAsD,EAACA,KAAA,QAAAA,EAAS,SAAS;AAAA,MAAW,CACrF;AAAA,MACD,UAAA;AAAA,QAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,oCACb,UAAA;AAAA,UAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,kBACZ,UAAA,EAACJ,KAAA,QAAAA,EAAS,SAAS,eAClB,gBAAAE,EAAAG,GAAA,EACE,UAAA;AAAA,YAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,8GAAA,CAA6G;AAAA,YAC5H,gBAAAF;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,OAAO;AAAA,kBACL,YAAY;AAAA,kBACZ,WAAW;AAAA,gBAAA;AAAA,gBAGb,UAAA;AAAA,kBAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,sFAAA,CAAqF;AAAA,kBACpG,gBAAAA,EAACE,GAAA,EAAM,WAAU,kDAAiD,aAAa,EAAA,CAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACnF,EAAA,CACF,EAAA,CAEJ;AAAA,UAEA,gBAAAF,EAAC,SAAI,WAAU,iBACb,4BAAC,MAAA,EAAG,WAAU,qEACX,UAAAL,EAAA,CACH,EAAA,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,oCACZ,UAAAH,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { a as o, s as a } from "../../chunks/react.esm.js";
3
+ import { ChatHeader as s } from "./ChatHeader.js";
4
+ import { ChatLabelsProvider as r } from "../../contexts/ChatLabelsContext.js";
5
+ import { d as h, i, g as t } from "../../chunks/vi.2VT5v0um.js";
6
+ h("<ChatHeader />", () => {
7
+ i("renders title, actions", () => {
8
+ o(
9
+ /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(s, { title: "Assistant", children: /* @__PURE__ */ e("span", { children: "Action" }) }) })
10
+ ), t(a.getByText("Assistant")).toBeInTheDocument(), t(a.getByText("Action")).toBeInTheDocument();
11
+ }), i("toggles shadow based on variant and hides badge", () => {
12
+ const { container: n, queryByText: d } = o(
13
+ /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(s, { title: "No Shadow", variant: "no-shadow" }) })
14
+ );
15
+ t(n.firstChild).not.toHaveClass("shadow-sm"), t(d("0")).toBeNull();
16
+ });
17
+ });
18
+ //# sourceMappingURL=ChatHeader.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatHeader.test.js","sources":["../../../lib/organisms/chat/ChatHeader.test.tsx"],"sourcesContent":["import {render, screen} from \"@testing-library/react\";\nimport {describe, expect, it} from \"vitest\";\nimport {ChatHeader} from \"./ChatHeader\";\nimport {ChatLabelsProvider} from \"../../contexts/ChatLabelsContext\";\n\ndescribe(\"<ChatHeader />\", () => {\n it(\"renders title, actions\", () => {\n render(\n <ChatLabelsProvider>\n <ChatHeader title=\"Assistant\">\n <span>Action</span>\n </ChatHeader>\n </ChatLabelsProvider>\n );\n\n expect(screen.getByText(\"Assistant\")).toBeInTheDocument();\n expect(screen.getByText(\"Action\")).toBeInTheDocument();\n });\n\n it(\"toggles shadow based on variant and hides badge\", () => {\n const {container, queryByText} = render(\n <ChatLabelsProvider>\n <ChatHeader title=\"No Shadow\" variant=\"no-shadow\" />\n </ChatLabelsProvider>\n );\n\n expect(container.firstChild).not.toHaveClass(\"shadow-sm\");\n expect(queryByText(\"0\")).toBeNull();\n });\n});\n"],"names":["describe","it","render","jsx","ChatLabelsProvider","ChatHeader","expect","screen","container","queryByText"],"mappings":";;;;;AAKAA,EAAS,kBAAkB,MAAM;AAC/B,EAAAC,EAAG,0BAA0B,MAAM;AACjC,IAAAC;AAAA,MACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACE,GAAA,EAAW,OAAM,aAChB,UAAA,gBAAAF,EAAC,QAAA,EAAK,UAAA,SAAA,CAAM,EAAA,CACd,EAAA,CACF;AAAA,IAAA,GAGFG,EAAOC,EAAO,UAAU,WAAW,CAAC,EAAE,kBAAA,GACtCD,EAAOC,EAAO,UAAU,QAAQ,CAAC,EAAE,kBAAA;AAAA,EACrC,CAAC,GAEDN,EAAG,mDAAmD,MAAM;AAC1D,UAAM,EAAC,WAAAO,GAAW,aAAAC,EAAA,IAAeP;AAAA,MAC/B,gBAAAC,EAACC,KACC,UAAA,gBAAAD,EAACE,GAAA,EAAW,OAAM,aAAY,SAAQ,aAAY,EAAA,CACpD;AAAA,IAAA;AAGFC,IAAAA,EAAOE,EAAU,UAAU,EAAE,IAAI,YAAY,WAAW,GACxDF,EAAOG,EAAY,GAAG,CAAC,EAAE,SAAA;AAAA,EAC3B,CAAC;AACH,CAAC;"}
@@ -4,7 +4,6 @@ interface ChatMessageListProps {
4
4
  isLoadingMessage: boolean;
5
5
  onFollowupClick: (question: string) => void;
6
6
  onRegenerate: (messageKey: string) => void;
7
- emptyStateGreeting?: string;
8
7
  }
9
- export declare function ChatMessageList({ chatMessages, isLoadingMessage, onFollowupClick, onRegenerate, emptyStateGreeting, }: ChatMessageListProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ChatMessageList({ chatMessages, isLoadingMessage, onFollowupClick, onRegenerate, }: ChatMessageListProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,73 +1,85 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as e, Fragment as i } from "react/jsx-runtime";
3
- import { Branch as g, BranchMessages as x, BranchSelector as v, BranchPrevious as b, BranchPage as w, BranchNext as C } from "../../molecules/AiElements/Branch.js";
4
- import { Conversation as y, ConversationContent as B, ConversationEmptyState as S, ConversationScrollButton as N } from "../../molecules/AiElements/Conversation.js";
5
- import { Message as c, MessageContent as l } from "../../molecules/AiElements/Message.js";
6
- import { Reasoning as k, ReasoningTrigger as R, ReasoningContent as M } from "../../molecules/AiElements/Reasoning.js";
7
- import { Response as T } from "../../molecules/AiElements/Response.js";
8
- import { Sources as D, SourcesTrigger as j, SourcesContent as P, Source as Q } from "../../molecules/AiElements/Sources.js";
9
- import { MessageRenderer as W } from "./MessageRenderers.js";
10
- import { MessageActions as q } from "./MessageActions.js";
11
- import { W as z } from "../../chunks/wand-sparkles.js";
12
- function O({
2
+ import { jsxs as r, jsx as e, Fragment as d } from "react/jsx-runtime";
3
+ import { Branch as v, BranchMessages as C, BranchSelector as w, BranchPrevious as y, BranchPage as B, BranchNext as N } from "../../molecules/AiElements/Branch.js";
4
+ import { Conversation as S, ConversationContent as T, ConversationEmptyState as k, ConversationScrollButton as R } from "../../molecules/AiElements/Conversation.js";
5
+ import { Message as m, MessageContent as h } from "../../molecules/AiElements/Message.js";
6
+ import { Reasoning as D, ReasoningTrigger as M, ReasoningContent as j } from "../../molecules/AiElements/Reasoning.js";
7
+ import { Response as I } from "../../molecules/AiElements/Response.js";
8
+ import { Sources as P, SourcesTrigger as Q, SourcesContent as W, Source as q } from "../../molecules/AiElements/Sources.js";
9
+ import { MessageRenderer as z } from "./MessageRenderers.js";
10
+ import { MessageActions as A } from "./MessageActions.js";
11
+ import { useChatConfig as J } from "../../contexts/ChatContext.js";
12
+ import { useChatLabels as L } from "../../contexts/ChatLabelsContext.js";
13
+ import { W as $ } from "../../chunks/wand-sparkles.js";
14
+ function ee({
13
15
  chatMessages: a,
14
- isLoadingMessage: d,
15
- onFollowupClick: h,
16
- onRegenerate: m,
17
- emptyStateGreeting: u
16
+ isLoadingMessage: u,
17
+ onFollowupClick: f,
18
+ onRegenerate: p
18
19
  }) {
19
- const f = () => a.map(({ versions: s, ...n }, p) => /* @__PURE__ */ t(g, { defaultBranch: s.length - 1, children: [
20
- /* @__PURE__ */ e(x, { children: s.map((r) => /* @__PURE__ */ e(c, { from: n.from, children: /* @__PURE__ */ t(l, { children: [
21
- n.sources && n.sources.length > 0 && /* @__PURE__ */ t(D, { children: [
22
- /* @__PURE__ */ e(j, { count: n.sources.length }),
23
- /* @__PURE__ */ e(P, { children: n.sources.map((o) => /* @__PURE__ */ e(Q, { href: o.href, title: o.title }, o.href)) })
20
+ var l;
21
+ const { get: i, p: g } = L(), { user: s } = J(), x = () => a.map(({ versions: c, ...t }, b) => /* @__PURE__ */ r(v, { defaultBranch: c.length - 1, children: [
22
+ /* @__PURE__ */ e(C, { children: c.map((n) => /* @__PURE__ */ e(m, { from: t.from, children: /* @__PURE__ */ r(h, { children: [
23
+ t.sources && t.sources.length > 0 && /* @__PURE__ */ r(P, { children: [
24
+ /* @__PURE__ */ e(Q, { count: t.sources.length }),
25
+ /* @__PURE__ */ e(W, { children: t.sources.map((o) => /* @__PURE__ */ e(q, { href: o.href, title: o.title }, o.href)) })
24
26
  ] }),
25
- n.reasoning && /* @__PURE__ */ t(k, { duration: n.reasoning.duration, children: [
26
- /* @__PURE__ */ e(R, {}),
27
- /* @__PURE__ */ e(M, { children: n.reasoning.content })
27
+ t.reasoning && /* @__PURE__ */ r(D, { duration: t.reasoning.duration, children: [
28
+ /* @__PURE__ */ e(M, {}),
29
+ /* @__PURE__ */ e(j, { children: t.reasoning.content })
28
30
  ] }),
29
- n.from === "assistant" ? /* @__PURE__ */ t(i, { children: [
31
+ t.from === "assistant" ? /* @__PURE__ */ r(d, { children: [
30
32
  /* @__PURE__ */ e(
31
- W,
33
+ z,
32
34
  {
33
- responseType: r.responseType || "message",
34
- content: r.content,
35
- canvasData: r.canvasData,
36
- followupQuestions: r.followupQuestions,
37
- onQuestionClick: h
35
+ responseType: n.responseType || "message",
36
+ content: n.content,
37
+ canvasData: n.canvasData,
38
+ followupQuestions: n.followupQuestions,
39
+ onQuestionClick: f
38
40
  }
39
41
  ),
40
42
  /* @__PURE__ */ e(
41
- q,
43
+ A,
42
44
  {
43
- content: r.content,
44
- messageId: r.id,
45
- responseType: r.responseType,
46
- canvasData: r.canvasData,
45
+ content: n.content,
46
+ messageId: n.id,
47
+ responseType: n.responseType,
48
+ canvasData: n.canvasData,
47
49
  onRegenerate: () => {
48
- const o = a[p - 1];
49
- (o == null ? void 0 : o.from) === "user" && m(n.key);
50
+ const o = a[b - 1];
51
+ (o == null ? void 0 : o.from) === "user" && p(t.key);
50
52
  }
51
53
  }
52
54
  )
53
- ] }) : /* @__PURE__ */ e(T, { children: r.content })
54
- ] }) }, `${n.key}-${r.id}`)) }),
55
- s.length > 1 && /* @__PURE__ */ t(v, { from: n.from, children: [
56
- /* @__PURE__ */ e(b, {}),
57
- /* @__PURE__ */ e(w, {}),
58
- /* @__PURE__ */ e(C, {})
55
+ ] }) : /* @__PURE__ */ e(I, { children: n.content })
56
+ ] }) }, `${t.key}-${n.id}`)) }),
57
+ c.length > 1 && /* @__PURE__ */ r(w, { from: t.from, children: [
58
+ /* @__PURE__ */ e(y, {}),
59
+ /* @__PURE__ */ e(B, {}),
60
+ /* @__PURE__ */ e(N, {})
59
61
  ] })
60
- ] }, n.key));
61
- return /* @__PURE__ */ t(y, { className: "flex-1", children: [
62
- /* @__PURE__ */ e(B, { children: a.length === 0 ? /* @__PURE__ */ e(
63
- S,
62
+ ] }, t.key));
63
+ return /* @__PURE__ */ r(S, { className: "flex-1", children: [
64
+ /* @__PURE__ */ e(T, { children: a.length === 0 ? /* @__PURE__ */ e(
65
+ k,
64
66
  {
65
- greeting: u,
66
- title: "Bienvenue dans votre assistant de product management",
67
- description: "Je vous aide à créer des user stories Jira de qualité, générer des release notes, répondre à vos questions sur l'API ClubMed, structurer vos besoins fonctionnels. Décrivez votre besoin et commençons !",
68
- icon: /* @__PURE__ */ t("div", { className: "relative mx-auto w-fit", children: [
67
+ greeting: g(
68
+ "greetingTemplate",
69
+ "Bonjour {{firstName}} 👋",
70
+ { firstName: (l = s == null ? void 0 : s.userName) == null ? void 0 : l.split(" ")[0] }
71
+ ),
72
+ title: i(
73
+ "emptyStateTitle",
74
+ "Bienvenue dans votre assistant de product management"
75
+ ),
76
+ description: i(
77
+ "emptyStateDescription",
78
+ "Je vous aide à créer des user stories Jira de qualité, générer des release notes, répondre à vos questions sur l'API ClubMed, structurer vos besoins fonctionnels. Décrivez votre besoin et commençons !"
79
+ ),
80
+ icon: /* @__PURE__ */ r("div", { className: "relative mx-auto w-fit", children: [
69
81
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-foreground/10 blur-3xl" }),
70
- /* @__PURE__ */ t(
82
+ /* @__PURE__ */ r(
71
83
  "div",
72
84
  {
73
85
  className: "relative flex h-16 w-16 sm:h-20 sm:w-20 items-center justify-center rounded-2xl shadow-2xl ring-1 ring-border/40 transition-transform hover:scale-110 duration-500 overflow-hidden",
@@ -77,20 +89,23 @@ function O({
77
89
  },
78
90
  children: [
79
91
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
80
- /* @__PURE__ */ e(z, { className: "h-8 w-8 sm:h-10 sm:w-10 text-white relative z-10", strokeWidth: 1.5 })
92
+ /* @__PURE__ */ e($, { className: "h-8 w-8 sm:h-10 sm:w-10 text-white relative z-10", strokeWidth: 1.5 })
81
93
  ]
82
94
  }
83
95
  )
84
96
  ] })
85
97
  }
86
- ) : /* @__PURE__ */ t(i, { children: [
87
- f(),
88
- d && /* @__PURE__ */ e(c, { from: "assistant", children: /* @__PURE__ */ e(l, { variant: "flat", children: /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground animate-pulse", children: "Réflexion en cours..." }) }) })
98
+ ) : /* @__PURE__ */ r(d, { children: [
99
+ x(),
100
+ u && /* @__PURE__ */ e(m, { from: "assistant", children: /* @__PURE__ */ e(h, { variant: "flat", children: /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground animate-pulse", children: i(
101
+ "assistantThinkingIndicator",
102
+ "Réflexion en cours..."
103
+ ) }) }) })
89
104
  ] }) }),
90
- /* @__PURE__ */ e(N, {})
105
+ /* @__PURE__ */ e(R, {})
91
106
  ] });
92
107
  }
93
108
  export {
94
- O as ChatMessageList
109
+ ee as ChatMessageList
95
110
  };
96
111
  //# sourceMappingURL=ChatMessageList.js.map