@clubmed/usg-chat-ui 1.2.6 → 1.3.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/README.md +36 -0
- package/assets/style.css +1 -1
- package/chunks/react.esm.js +2012 -1997
- package/chunks/react.esm.js.map +1 -1
- package/chunks/vi.2VT5v0um.js +1 -0
- package/config/chatLabels.d.ts +43 -0
- package/config/chatLabels.js +2 -0
- package/config/chatLabels.js.map +1 -0
- package/contexts/ChatLabelsContext.d.ts +13 -0
- package/contexts/ChatLabelsContext.js +24 -0
- package/contexts/ChatLabelsContext.js.map +1 -0
- package/contexts/ChatLabelsContext.test.d.ts +1 -0
- package/contexts/ChatLabelsContext.test.js +23 -0
- package/contexts/ChatLabelsContext.test.js.map +1 -0
- package/molecules/AiElements/Branch.js +45 -44
- package/molecules/AiElements/Branch.js.map +1 -1
- package/molecules/AiElements/PromptInput.js +60 -58
- package/molecules/AiElements/PromptInput.js.map +1 -1
- package/molecules/RichText/useCollaboration.test.js +1 -1
- package/organisms/canvas/CanvasLayout.d.ts +2 -1
- package/organisms/canvas/CanvasLayout.js +1249 -1248
- package/organisms/canvas/CanvasLayout.js.map +1 -1
- package/organisms/chat/Chat.d.ts +7 -1
- package/organisms/chat/Chat.js +67 -67
- package/organisms/chat/Chat.js.map +1 -1
- package/organisms/chat/ChatHeader.d.ts +4 -4
- package/organisms/chat/ChatHeader.js +41 -39
- package/organisms/chat/ChatHeader.js.map +1 -1
- package/organisms/chat/ChatHeader.test.d.ts +1 -0
- package/organisms/chat/ChatHeader.test.js +18 -0
- package/organisms/chat/ChatHeader.test.js.map +1 -0
- package/organisms/chat/ChatMessageList.d.ts +1 -2
- package/organisms/chat/ChatMessageList.js +73 -58
- package/organisms/chat/ChatMessageList.js.map +1 -1
- package/organisms/chat/ChatMessageList.test.d.ts +1 -0
- package/organisms/chat/ChatMessageList.test.js +67 -0
- package/organisms/chat/ChatMessageList.test.js.map +1 -0
- package/organisms/chat/ChatSettingsButton.d.ts +2 -0
- package/organisms/chat/ChatSettingsButton.js +24 -0
- package/organisms/chat/ChatSettingsButton.js.map +1 -0
- package/organisms/chat/ChatSettingsButton.test.d.ts +1 -0
- package/organisms/chat/ChatSettingsButton.test.js +16 -0
- package/organisms/chat/ChatSettingsButton.test.js.map +1 -0
- package/organisms/chat/ConversationSidebar.js +44 -43
- package/organisms/chat/ConversationSidebar.js.map +1 -1
- package/organisms/chat/MessageActions.js +104 -103
- package/organisms/chat/MessageActions.js.map +1 -1
- package/organisms/chat/MessageRenderers.js +1 -1
- package/organisms/chat/SidebarToggleButton.js +9 -7
- package/organisms/chat/SidebarToggleButton.js.map +1 -1
- package/organisms/chat/hooks/useChat.d.ts +1 -1
- package/organisms/chat/hooks/useChat.js +83 -83
- package/organisms/chat/hooks/useChat.js.map +1 -1
- package/package.json +1 -1
- package/utils/interpolate.d.ts +5 -0
- package/utils/interpolate.js +13 -0
- package/utils/interpolate.js.map +1 -0
- package/utils/interpolate.test.d.ts +1 -0
- package/utils/interpolate.test.js +21 -0
- package/utils/interpolate.test.js.map +1 -0
package/chunks/vi.2VT5v0um.js
CHANGED
|
@@ -10565,6 +10565,7 @@ function Tt(e) {
|
|
|
10565
10565
|
export {
|
|
10566
10566
|
Dp as a,
|
|
10567
10567
|
Fp as b,
|
|
10568
|
+
jp as c,
|
|
10568
10569
|
iy as d,
|
|
10569
10570
|
Ag as g,
|
|
10570
10571
|
cy as i,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ChatLabelsConfig {
|
|
2
|
+
/** Example: "Bonjour {{firstName}} 👋" */
|
|
3
|
+
greetingTemplate: string;
|
|
4
|
+
/** Example: "Bienvenue dans votre assistant de product management" */
|
|
5
|
+
emptyStateTitle: string;
|
|
6
|
+
/** Example: "Décrivez votre besoin et commençons !" */
|
|
7
|
+
emptyStateDescription: string;
|
|
8
|
+
/** Example: "Réflexion en cours..." */
|
|
9
|
+
assistantThinkingIndicator: string;
|
|
10
|
+
/** Example: "Paramètres" */
|
|
11
|
+
chatSettingsButtonAriaLabel: string;
|
|
12
|
+
/** Example: "Ouvrir l'historique" */
|
|
13
|
+
sidebarOpenHistoryAriaLabel: string;
|
|
14
|
+
/** Example: "Rafraîchir" */
|
|
15
|
+
conversationRefreshAriaLabel: string;
|
|
16
|
+
/** Example: "Fermer l'historique" */
|
|
17
|
+
conversationCloseHistoryAriaLabel: string;
|
|
18
|
+
/** Example: "Copier le message" */
|
|
19
|
+
messageCopyAriaLabel: string;
|
|
20
|
+
/** Example: "Régénérer la réponse" */
|
|
21
|
+
messageRegenerateAriaLabel: string;
|
|
22
|
+
/** Example: "Ouvrir Canva" */
|
|
23
|
+
messageOpenCanvasAriaLabel: string;
|
|
24
|
+
/** Example: "Réponse utile" */
|
|
25
|
+
messageThumbsUpAriaLabel: string;
|
|
26
|
+
/** Example: "Réponse non utile" */
|
|
27
|
+
messageThumbsDownAriaLabel: string;
|
|
28
|
+
/** Example: "Fermer" */
|
|
29
|
+
messageCloseFeedbackAriaLabel: string;
|
|
30
|
+
/** Example: "Réduire le canvas" */
|
|
31
|
+
canvasReduceAriaLabel: string;
|
|
32
|
+
/** Example: "Agrandir le canvas" */
|
|
33
|
+
canvasExpandAriaLabel: string;
|
|
34
|
+
/** Example: "Fermer le canvas" */
|
|
35
|
+
canvasCloseAriaLabel: string;
|
|
36
|
+
/** Example: "Previous branch" */
|
|
37
|
+
branchPreviousAriaLabel: string;
|
|
38
|
+
/** Example: "Next branch" */
|
|
39
|
+
branchNextAriaLabel: string;
|
|
40
|
+
/** Example: "Submit" */
|
|
41
|
+
promptSubmitAriaLabel: string;
|
|
42
|
+
}
|
|
43
|
+
export type ChatLabelOverrides = Partial<ChatLabelsConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatLabels.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ChatLabelOverrides } from '../config/chatLabels';
|
|
3
|
+
type InterpolateValues = Record<string, string | number | null | undefined>;
|
|
4
|
+
export interface ChatLabelsApi {
|
|
5
|
+
get: (key: string, fallback?: string) => string;
|
|
6
|
+
p: (key: string, fallback?: string, values?: InterpolateValues) => string | undefined;
|
|
7
|
+
}
|
|
8
|
+
interface ChatLabelsProviderProps {
|
|
9
|
+
labels?: ChatLabelOverrides;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatLabelsProvider({ labels, children }: PropsWithChildren<ChatLabelsProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useChatLabels(): ChatLabelsApi;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as d, useContext as p, useMemo as u } from "react";
|
|
4
|
+
import { interpolate as C } from "../utils/interpolate.js";
|
|
5
|
+
const i = d(null);
|
|
6
|
+
function L({ labels: t, children: c }) {
|
|
7
|
+
const r = u(() => t || {}, [t]), a = u(() => ({ get: (o, e) => (r[o] ?? e ?? "").toString(), p: (o, e, n) => {
|
|
8
|
+
const s = r[o] ?? e;
|
|
9
|
+
if (!(!s && !e))
|
|
10
|
+
return C(s ?? e ?? "", n);
|
|
11
|
+
} }), [r]);
|
|
12
|
+
return /* @__PURE__ */ m(i.Provider, { value: a, children: c });
|
|
13
|
+
}
|
|
14
|
+
function g() {
|
|
15
|
+
const t = p(i);
|
|
16
|
+
if (!t)
|
|
17
|
+
throw new Error("useChatLabels must be used within a ChatLabelsProvider");
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
L as ChatLabelsProvider,
|
|
22
|
+
g as useChatLabels
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=ChatLabelsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatLabelsContext.js","sources":["../../lib/contexts/ChatLabelsContext.tsx"],"sourcesContent":["\"use client\";\n\nimport {createContext, useContext, useMemo, type PropsWithChildren} from \"react\";\nimport {type ChatLabelOverrides, type ChatLabelsConfig} from \"../config/chatLabels\";\nimport {interpolate} from \"../utils/interpolate\";\n\ntype InterpolateValues = Record<string, string | number | null | undefined>;\n\nexport interface ChatLabelsApi {\n get: (key: string, fallback?: string) => string;\n p: (key: string, fallback?: string, values?: InterpolateValues) => string | undefined;\n}\n\nconst ChatLabelsContext = createContext<ChatLabelsApi | null>(null);\n\ninterface ChatLabelsProviderProps {\n labels?: ChatLabelOverrides;\n}\n\nexport function ChatLabelsProvider({labels, children}: PropsWithChildren<ChatLabelsProviderProps>) {\n const merged = useMemo(() => labels || {}, [labels]);\n\n const value = useMemo<ChatLabelsApi>(() => {\n const get = (key: string, fallback?: string) => {\n const resolved = merged[key as keyof ChatLabelsConfig];\n return (resolved ?? fallback ?? \"\").toString();\n };\n\n const p = (key: string, fallback?: string, values?: InterpolateValues) => {\n const template = merged[key as keyof ChatLabelsConfig] ?? fallback;\n if (!template && !fallback) {\n return undefined;\n }\n return interpolate(template ?? fallback ?? \"\", values);\n };\n\n return {get, p};\n }, [merged]);\n\n return <ChatLabelsContext.Provider value={value}>{children}</ChatLabelsContext.Provider>;\n}\n\nexport function useChatLabels(): ChatLabelsApi {\n const context = useContext(ChatLabelsContext);\n\n if (!context) {\n throw new Error(\"useChatLabels must be used within a ChatLabelsProvider\");\n }\n\n return context;\n}\n"],"names":["ChatLabelsContext","createContext","ChatLabelsProvider","labels","children","merged","useMemo","value","key","fallback","values","template","interpolate","jsx","useChatLabels","context","useContext"],"mappings":";;;;AAaA,MAAMA,IAAoBC,EAAoC,IAAI;AAM3D,SAASC,EAAmB,EAAC,QAAAC,GAAQ,UAAAC,KAAuD;AACjG,QAAMC,IAASC,EAAQ,MAAMH,KAAU,CAAA,GAAI,CAACA,CAAM,CAAC,GAE7CI,IAAQD,EAAuB,OAc5B,EAAC,KAbI,CAACE,GAAaC,OACPJ,EAAOG,CAA6B,KACjCC,KAAY,IAAI,SAAA,GAWzB,GARH,CAACD,GAAaC,GAAmBC,MAA+B;AACxE,UAAMC,IAAWN,EAAOG,CAA6B,KAAKC;AAC1D,QAAI,GAACE,KAAY,CAACF;AAGlB,aAAOG,EAAYD,KAAYF,KAAY,IAAIC,CAAM;AAAA,EACvD,EAEa,IACZ,CAACL,CAAM,CAAC;AAEX,SAAO,gBAAAQ,EAACb,EAAkB,UAAlB,EAA2B,OAAAO,GAAe,UAAAH,EAAA,CAAS;AAC7D;AAEO,SAASU,IAA+B;AAC7C,QAAMC,IAAUC,EAAWhB,CAAiB;AAE5C,MAAI,CAACe;AACH,UAAM,IAAI,MAAM,wDAAwD;AAG1E,SAAOA;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { r as o } from "../chunks/react.esm.js";
|
|
3
|
+
import { useChatLabels as s, ChatLabelsProvider as l } from "./ChatLabelsContext.js";
|
|
4
|
+
import { d as n, i as a, g as e } from "../chunks/vi.2VT5v0um.js";
|
|
5
|
+
const u = (r) => (
|
|
6
|
+
// eslint-disable-next-line react/display-name
|
|
7
|
+
({ children: t }) => /* @__PURE__ */ i(l, { labels: r, children: t })
|
|
8
|
+
);
|
|
9
|
+
n("ChatLabelsContext", () => {
|
|
10
|
+
a("throws when hook is used outside provider", () => {
|
|
11
|
+
e(() => o(() => s())).toThrowError(
|
|
12
|
+
"useChatLabels must be used within a ChatLabelsProvider"
|
|
13
|
+
);
|
|
14
|
+
}), a("returns merged defaults and overrides through get()", () => {
|
|
15
|
+
const r = { emptyStateTitle: "Custom title" }, { result: t } = o(() => s(), {
|
|
16
|
+
wrapper: u(r)
|
|
17
|
+
});
|
|
18
|
+
e(t.current.get("emptyStateTitle")).toBe("Custom title"), e(t.current.get("assistantThinkingIndicator")).toBe(
|
|
19
|
+
""
|
|
20
|
+
), e(t.current.get("nonexistent", "Fallback label")).toBe("Fallback label");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=ChatLabelsContext.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatLabelsContext.test.js","sources":["../../lib/contexts/ChatLabelsContext.test.tsx"],"sourcesContent":["import {renderHook} from \"@testing-library/react\";\nimport {describe, expect, it} from \"vitest\";\nimport type {ReactNode} from \"react\";\nimport {ChatLabelsProvider, useChatLabels} from \"./ChatLabelsContext\";\nimport {type ChatLabelOverrides} from \"../config/chatLabels\";\n\nconst withLabels =\n (labels?: ChatLabelOverrides) =>\n // eslint-disable-next-line react/display-name\n ({children}: {children: ReactNode}) => {\n return <ChatLabelsProvider labels={labels}>{children}</ChatLabelsProvider>;\n };\n\ndescribe(\"ChatLabelsContext\", () => {\n it(\"throws when hook is used outside provider\", () => {\n expect(() => renderHook(() => useChatLabels())).toThrowError(\n \"useChatLabels must be used within a ChatLabelsProvider\"\n );\n });\n\n it(\"returns merged defaults and overrides through get()\", () => {\n const overrides: ChatLabelOverrides = {emptyStateTitle: \"Custom title\"};\n const {result} = renderHook(() => useChatLabels(), {\n wrapper: withLabels(overrides),\n });\n\n expect(result.current.get(\"emptyStateTitle\")).toBe(\"Custom title\");\n expect(result.current.get(\"assistantThinkingIndicator\")).toBe(\n \"\"\n );\n expect(result.current.get(\"nonexistent\", \"Fallback label\")).toBe(\"Fallback label\");\n });\n});\n"],"names":["withLabels","labels","children","jsx","ChatLabelsProvider","describe","it","expect","renderHook","useChatLabels","overrides","result"],"mappings":";;;;AAMA,MAAMA,IACJ,CAACC;AAAA;AAAA,EAEC,CAAC,EAAC,UAAAC,EAAA,MACO,gBAAAC,EAACC,GAAA,EAAmB,QAAAH,GAAiB,UAAAC,EAAA,CAAS;AAAA;AAG3DG,EAAS,qBAAqB,MAAM;AAClC,EAAAC,EAAG,6CAA6C,MAAM;AACpDC,IAAAA,EAAO,MAAMC,EAAW,MAAMC,EAAA,CAAe,CAAC,EAAE;AAAA,MAC9C;AAAA,IAAA;AAAA,EAEJ,CAAC,GAEDH,EAAG,uDAAuD,MAAM;AAC9D,UAAMI,IAAgC,EAAC,iBAAiB,eAAA,GAClD,EAAC,QAAAC,EAAA,IAAUH,EAAW,MAAMC,KAAiB;AAAA,MACjD,SAAST,EAAWU,CAAS;AAAA,IAAA,CAC9B;AAEDH,IAAAA,EAAOI,EAAO,QAAQ,IAAI,iBAAiB,CAAC,EAAE,KAAK,cAAc,GACjEJ,EAAOI,EAAO,QAAQ,IAAI,4BAA4B,CAAC,EAAE;AAAA,MACvD;AAAA,IAAA,GAEFJ,EAAOI,EAAO,QAAQ,IAAI,eAAe,gBAAgB,CAAC,EAAE,KAAK,gBAAgB;AAAA,EACnF,CAAC;AACH,CAAC;"}
|
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Button as
|
|
2
|
+
import { jsx as c, jsxs as B } from "react/jsx-runtime";
|
|
3
|
+
import { Button as f } from "../Buttons/Button.js";
|
|
4
4
|
import { cn as l } from "../../utils/cn.js";
|
|
5
|
-
import { createContext as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { createContext as N, useState as m, useEffect as y, useContext as k } from "react";
|
|
6
|
+
import { useChatLabels as b } from "../../contexts/ChatLabelsContext.js";
|
|
7
|
+
import { c as w } from "../../chunks/createLucideIcon.js";
|
|
8
|
+
import { C } from "../../chunks/chevron-right.js";
|
|
8
9
|
/**
|
|
9
10
|
* @license lucide-react v0.545.0 - ISC
|
|
10
11
|
*
|
|
11
12
|
* This source code is licensed under the ISC license.
|
|
12
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
14
|
*/
|
|
14
|
-
const
|
|
15
|
-
const e =
|
|
15
|
+
const L = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], P = w("chevron-left", L), g = N(null), u = () => {
|
|
16
|
+
const e = k(g);
|
|
16
17
|
if (!e)
|
|
17
18
|
throw new Error("Branch components must be used within Branch");
|
|
18
19
|
return e;
|
|
19
|
-
},
|
|
20
|
+
}, I = ({
|
|
20
21
|
defaultBranch: e = 0,
|
|
21
22
|
onBranchChange: t,
|
|
22
23
|
className: o,
|
|
23
24
|
...n
|
|
24
25
|
}) => {
|
|
25
|
-
const [r, a] =
|
|
26
|
+
const [r, a] = m(e), [s, h] = m([]), d = (i) => {
|
|
26
27
|
a(i), t == null || t(i);
|
|
27
28
|
}, p = () => {
|
|
28
|
-
const i = r > 0 ? r - 1 :
|
|
29
|
-
|
|
29
|
+
const i = r > 0 ? r - 1 : s.length - 1;
|
|
30
|
+
d(i);
|
|
30
31
|
}, v = () => {
|
|
31
|
-
const i = r <
|
|
32
|
-
|
|
32
|
+
const i = r < s.length - 1 ? r + 1 : 0;
|
|
33
|
+
d(i);
|
|
33
34
|
}, x = {
|
|
34
35
|
currentBranch: r,
|
|
35
|
-
totalBranches:
|
|
36
|
+
totalBranches: s.length,
|
|
36
37
|
goToPrevious: p,
|
|
37
38
|
goToNext: v,
|
|
38
|
-
branches:
|
|
39
|
-
setBranches:
|
|
39
|
+
branches: s,
|
|
40
|
+
setBranches: h
|
|
40
41
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ c(g.Provider, { value: x, children: /* @__PURE__ */ c(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
45
|
className: l("grid w-full gap-2 [&>div]:pb-0", o),
|
|
45
46
|
...n
|
|
46
47
|
}
|
|
47
48
|
) });
|
|
48
|
-
},
|
|
49
|
+
}, M = ({ children: e, ...t }) => {
|
|
49
50
|
const { currentBranch: o, setBranches: n, branches: r } = u(), a = Array.isArray(e) ? e : [e];
|
|
50
51
|
return y(() => {
|
|
51
52
|
r.length !== a.length && n(a);
|
|
52
|
-
}, [a, r, n]), a.map((
|
|
53
|
+
}, [a, r, n]), a.map((s, h) => /* @__PURE__ */ c(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
56
|
className: l(
|
|
56
57
|
"grid gap-2 overflow-hidden [&>div]:pb-0",
|
|
57
|
-
|
|
58
|
+
h === o ? "block" : "hidden"
|
|
58
59
|
),
|
|
59
60
|
...t,
|
|
60
|
-
children:
|
|
61
|
+
children: s
|
|
61
62
|
},
|
|
62
|
-
|
|
63
|
+
s.key
|
|
63
64
|
));
|
|
64
|
-
},
|
|
65
|
+
}, R = ({
|
|
65
66
|
className: e,
|
|
66
67
|
from: t,
|
|
67
68
|
...o
|
|
68
69
|
}) => {
|
|
69
70
|
const { totalBranches: n } = u();
|
|
70
|
-
return n <= 1 ? null : /* @__PURE__ */
|
|
71
|
+
return n <= 1 ? null : /* @__PURE__ */ c(
|
|
71
72
|
"div",
|
|
72
73
|
{
|
|
73
74
|
className: l(
|
|
@@ -78,16 +79,16 @@ const z = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], C = k("chevron-lef
|
|
|
78
79
|
...o
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
|
-
},
|
|
82
|
+
}, V = ({
|
|
82
83
|
className: e,
|
|
83
84
|
children: t,
|
|
84
85
|
...o
|
|
85
86
|
}) => {
|
|
86
|
-
const { goToPrevious: n, totalBranches: r } = u();
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
87
|
+
const { goToPrevious: n, totalBranches: r } = u(), { get: a } = b(), s = a("branchPreviousAriaLabel", "Previous branch");
|
|
88
|
+
return /* @__PURE__ */ c(
|
|
89
|
+
f,
|
|
89
90
|
{
|
|
90
|
-
"aria-label":
|
|
91
|
+
"aria-label": s,
|
|
91
92
|
className: l(
|
|
92
93
|
"size-7 shrink-0 rounded-full text-muted-foreground transition-colors",
|
|
93
94
|
"hover:bg-accent hover:text-foreground",
|
|
@@ -100,19 +101,19 @@ const z = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], C = k("chevron-lef
|
|
|
100
101
|
type: "button",
|
|
101
102
|
variant: "ghost",
|
|
102
103
|
...o,
|
|
103
|
-
children: t ?? /* @__PURE__ */
|
|
104
|
+
children: t ?? /* @__PURE__ */ c(P, { size: 14 })
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
|
-
},
|
|
107
|
+
}, q = ({
|
|
107
108
|
className: e,
|
|
108
109
|
children: t,
|
|
109
110
|
...o
|
|
110
111
|
}) => {
|
|
111
|
-
const { goToNext: n, totalBranches: r } = u();
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
112
|
+
const { goToNext: n, totalBranches: r } = u(), { get: a } = b(), s = a("branchNextAriaLabel", "Next branch");
|
|
113
|
+
return /* @__PURE__ */ c(
|
|
114
|
+
f,
|
|
114
115
|
{
|
|
115
|
-
"aria-label":
|
|
116
|
+
"aria-label": s,
|
|
116
117
|
className: l(
|
|
117
118
|
"size-7 shrink-0 rounded-full text-muted-foreground transition-colors",
|
|
118
119
|
"hover:bg-accent hover:text-foreground",
|
|
@@ -125,12 +126,12 @@ const z = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], C = k("chevron-lef
|
|
|
125
126
|
type: "button",
|
|
126
127
|
variant: "ghost",
|
|
127
128
|
...o,
|
|
128
|
-
children: t ?? /* @__PURE__ */
|
|
129
|
+
children: t ?? /* @__PURE__ */ c(C, { size: 14 })
|
|
129
130
|
}
|
|
130
131
|
);
|
|
131
|
-
},
|
|
132
|
+
}, D = ({ className: e, ...t }) => {
|
|
132
133
|
const { currentBranch: o, totalBranches: n } = u();
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ B(
|
|
134
135
|
"span",
|
|
135
136
|
{
|
|
136
137
|
className: l(
|
|
@@ -147,11 +148,11 @@ const z = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], C = k("chevron-lef
|
|
|
147
148
|
);
|
|
148
149
|
};
|
|
149
150
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
I as Branch,
|
|
152
|
+
M as BranchMessages,
|
|
153
|
+
q as BranchNext,
|
|
154
|
+
D as BranchPage,
|
|
155
|
+
V as BranchPrevious,
|
|
156
|
+
R as BranchSelector
|
|
156
157
|
};
|
|
157
158
|
//# sourceMappingURL=Branch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Branch.js","sources":["../../../../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-left.js","../../../lib/molecules/AiElements/Branch.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.545.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m15 18-6-6 6-6\", key: \"1wnfg3\" }]];\nconst ChevronLeft = createLucideIcon(\"chevron-left\", __iconNode);\n\nexport { __iconNode, ChevronLeft as default };\n//# sourceMappingURL=chevron-left.js.map\n","\"use client\";\n\nimport { Button } from \"@clubmed/usg-chat-ui/molecules/Buttons/Button\";\nimport { cn } from \"@clubmed/usg-chat-ui/utils/cn\";\nimport type { UIMessage } from \"ai\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes, ReactElement } from \"react\";\nimport { createContext, useContext, useEffect, useState } from \"react\";\n\ntype BranchContextType = {\n currentBranch: number;\n totalBranches: number;\n goToPrevious: () => void;\n goToNext: () => void;\n branches: ReactElement[];\n setBranches: (branches: ReactElement[]) => void;\n};\n\nconst BranchContext = createContext<BranchContextType | null>(null);\n\nconst useBranch = () => {\n const context = useContext(BranchContext);\n\n if (!context) {\n throw new Error(\"Branch components must be used within Branch\");\n }\n\n return context;\n};\n\nexport type BranchProps = HTMLAttributes<HTMLDivElement> & {\n defaultBranch?: number;\n onBranchChange?: (branchIndex: number) => void;\n};\n\nexport const Branch = ({\n defaultBranch = 0,\n onBranchChange,\n className,\n ...props\n}: BranchProps) => {\n const [currentBranch, setCurrentBranch] = useState(defaultBranch);\n const [branches, setBranches] = useState<ReactElement[]>([]);\n\n const handleBranchChange = (newBranch: number) => {\n setCurrentBranch(newBranch);\n onBranchChange?.(newBranch);\n };\n\n const goToPrevious = () => {\n const newBranch =\n currentBranch > 0 ? currentBranch - 1 : branches.length - 1;\n handleBranchChange(newBranch);\n };\n\n const goToNext = () => {\n const newBranch =\n currentBranch < branches.length - 1 ? currentBranch + 1 : 0;\n handleBranchChange(newBranch);\n };\n\n const contextValue: BranchContextType = {\n currentBranch,\n totalBranches: branches.length,\n goToPrevious,\n goToNext,\n branches,\n setBranches,\n };\n\n return (\n <BranchContext.Provider value={contextValue}>\n <div\n className={cn(\"grid w-full gap-2 [&>div]:pb-0\", className)}\n {...props}\n />\n </BranchContext.Provider>\n );\n};\n\nexport type BranchMessagesProps = HTMLAttributes<HTMLDivElement>;\n\nexport const BranchMessages = ({ children, ...props }: BranchMessagesProps) => {\n const { currentBranch, setBranches, branches } = useBranch();\n const childrenArray = Array.isArray(children) ? children : [children];\n\n // Use useEffect to update branches when they change\n useEffect(() => {\n if (branches.length !== childrenArray.length) {\n setBranches(childrenArray);\n }\n }, [childrenArray, branches, setBranches]);\n\n return childrenArray.map((branch, index) => (\n <div\n className={cn(\n \"grid gap-2 overflow-hidden [&>div]:pb-0\",\n index === currentBranch ? \"block\" : \"hidden\"\n )}\n key={branch.key}\n {...props}\n >\n {branch}\n </div>\n ));\n};\n\nexport type BranchSelectorProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage[\"role\"];\n};\n\nexport const BranchSelector = ({\n className,\n from,\n ...props\n}: BranchSelectorProps) => {\n const { totalBranches } = useBranch();\n\n // Don't render if there's only one branch\n if (totalBranches <= 1) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center gap-2 self-end px-10\",\n from === \"assistant\" ? \"justify-start\" : \"justify-end\",\n className\n )}\n {...props}\n />\n );\n};\n\nexport type BranchPreviousProps = ComponentProps<typeof Button>;\n\nexport const BranchPrevious = ({\n className,\n children,\n ...props\n}: BranchPreviousProps) => {\n const { goToPrevious, totalBranches } = useBranch();\n\n return (\n <Button\n aria-label=\"Previous branch\"\n className={cn(\n \"size-7 shrink-0 rounded-full text-muted-foreground transition-colors\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={totalBranches <= 1}\n onClick={goToPrevious}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronLeftIcon size={14} />}\n </Button>\n );\n};\n\nexport type BranchNextProps = ComponentProps<typeof Button>;\n\nexport const BranchNext = ({\n className,\n children,\n ...props\n}: BranchNextProps) => {\n const { goToNext, totalBranches } = useBranch();\n\n return (\n <Button\n aria-label=\"Next branch\"\n className={cn(\n \"size-7 shrink-0 rounded-full text-muted-foreground transition-colors\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={totalBranches <= 1}\n onClick={goToNext}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronRightIcon size={14} />}\n </Button>\n );\n};\n\nexport type BranchPageProps = HTMLAttributes<HTMLSpanElement>;\n\nexport const BranchPage = ({ className, ...props }: BranchPageProps) => {\n const { currentBranch, totalBranches } = useBranch();\n\n return (\n <span\n className={cn(\n \"font-medium text-muted-foreground text-xs tabular-nums\",\n className\n )}\n {...props}\n >\n {currentBranch + 1} of {totalBranches}\n </span>\n );\n};\n"],"names":["__iconNode","ChevronLeft","createLucideIcon","BranchContext","createContext","useBranch","context","useContext","Branch","defaultBranch","onBranchChange","className","props","currentBranch","setCurrentBranch","useState","branches","setBranches","handleBranchChange","newBranch","goToPrevious","goToNext","contextValue","jsx","cn","BranchMessages","children","childrenArray","useEffect","branch","index","BranchSelector","from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A,QACAb;AAAA,MAAA;AAAA,MAEF,UAAUsB,KAAiB;AAAA,MAC3B,SAASb;AAAA,MACT,MAAK;AAAA,MACL,MAAK;AAAA,MACL,SAAQ;AAAA,MACP,GAAGR;AAAA,MAEH,UAAAc,KAAY,gBAAAH,EAACa,GAAA,EAAgB,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG9C,GAIaC,IAAa,CAAC;AAAA,EACzB,WAAA1B;AAAA,EACA,UAAAe;AAAA,EACA,GAAGd;AACL,MAAuB;AACrB,QAAM,EAAE,UAAAS,GAAU,eAAAY,EAAA,IAAkB5B,EAAA;AAEpC,SACE,gBAAAkB;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,cAAW;AAAA,MACX,WAAWX;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAb;AAAA,MAAA;AAAA,MAEF,UAAUsB,KAAiB;AAAA,MAC3B,SAASZ;AAAA,MACT,MAAK;AAAA,MACL,MAAK;AAAA,MACL,SAAQ;AAAA,MACP,GAAGT;AAAA,MAEH,UAAAc,KAAY,gBAAAH,EAACe,GAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG/C,GAIaC,IAAa,CAAC,EAAE,WAAA5B,GAAW,GAAGC,QAA6B;AACtE,QAAM,EAAE,eAAAC,GAAe,eAAAoB,EAAA,IAAkB5B,EAAA;AAEzC,SACE,gBAAAmC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWhB;AAAA,QACT;AAAA,QACAb;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAC,IAAgB;AAAA,QAAE;AAAA,QAAKoB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9B;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"Branch.js","sources":["../../../../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-left.js","../../../lib/molecules/AiElements/Branch.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.545.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m15 18-6-6 6-6\", key: \"1wnfg3\" }]];\nconst ChevronLeft = createLucideIcon(\"chevron-left\", __iconNode);\n\nexport { __iconNode, ChevronLeft as default };\n//# sourceMappingURL=chevron-left.js.map\n","\"use client\";\n\nimport {Button} from \"@clubmed/usg-chat-ui/molecules/Buttons/Button\";\nimport {cn} from \"@clubmed/usg-chat-ui/utils/cn\";\nimport type {UIMessage} from \"ai\";\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\nimport type {ComponentProps, HTMLAttributes, ReactElement} from \"react\";\nimport {createContext, useContext, useEffect, useState} from \"react\";\nimport {useChatLabels} from \"../../contexts/ChatLabelsContext\";\n\ntype BranchContextType = {\n currentBranch: number;\n totalBranches: number;\n goToPrevious: () => void;\n goToNext: () => void;\n branches: ReactElement[];\n setBranches: (branches: ReactElement[]) => void;\n};\n\nconst BranchContext = createContext<BranchContextType | null>(null);\n\nconst useBranch = () => {\n const context = useContext(BranchContext);\n\n if (!context) {\n throw new Error(\"Branch components must be used within Branch\");\n }\n\n return context;\n};\n\nexport type BranchProps = HTMLAttributes<HTMLDivElement> & {\n defaultBranch?: number;\n onBranchChange?: (branchIndex: number) => void;\n};\n\nexport const Branch = ({\n defaultBranch = 0,\n onBranchChange,\n className,\n ...props\n}: BranchProps) => {\n const [currentBranch, setCurrentBranch] = useState(defaultBranch);\n const [branches, setBranches] = useState<ReactElement[]>([]);\n\n const handleBranchChange = (newBranch: number) => {\n setCurrentBranch(newBranch);\n onBranchChange?.(newBranch);\n };\n\n const goToPrevious = () => {\n const newBranch =\n currentBranch > 0 ? currentBranch - 1 : branches.length - 1;\n handleBranchChange(newBranch);\n };\n\n const goToNext = () => {\n const newBranch =\n currentBranch < branches.length - 1 ? currentBranch + 1 : 0;\n handleBranchChange(newBranch);\n };\n\n const contextValue: BranchContextType = {\n currentBranch,\n totalBranches: branches.length,\n goToPrevious,\n goToNext,\n branches,\n setBranches,\n };\n\n return (\n <BranchContext.Provider value={contextValue}>\n <div\n className={cn(\"grid w-full gap-2 [&>div]:pb-0\", className)}\n {...props}\n />\n </BranchContext.Provider>\n );\n};\n\nexport type BranchMessagesProps = HTMLAttributes<HTMLDivElement>;\n\nexport const BranchMessages = ({ children, ...props }: BranchMessagesProps) => {\n const { currentBranch, setBranches, branches } = useBranch();\n const childrenArray = Array.isArray(children) ? children : [children];\n\n // Use useEffect to update branches when they change\n useEffect(() => {\n if (branches.length !== childrenArray.length) {\n setBranches(childrenArray);\n }\n }, [childrenArray, branches, setBranches]);\n\n return childrenArray.map((branch, index) => (\n <div\n className={cn(\n \"grid gap-2 overflow-hidden [&>div]:pb-0\",\n index === currentBranch ? \"block\" : \"hidden\"\n )}\n key={branch.key}\n {...props}\n >\n {branch}\n </div>\n ));\n};\n\nexport type BranchSelectorProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage[\"role\"];\n};\n\nexport const BranchSelector = ({\n className,\n from,\n ...props\n}: BranchSelectorProps) => {\n const { totalBranches } = useBranch();\n\n // Don't render if there's only one branch\n if (totalBranches <= 1) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center gap-2 self-end px-10\",\n from === \"assistant\" ? \"justify-start\" : \"justify-end\",\n className\n )}\n {...props}\n />\n );\n};\n\nexport type BranchPreviousProps = ComponentProps<typeof Button>;\n\nexport const BranchPrevious = ({\n className,\n children,\n ...props\n}: BranchPreviousProps) => {\n const {goToPrevious, totalBranches} = useBranch();\n const {get} = useChatLabels();\n const ariaLabel = get(\"branchPreviousAriaLabel\", \"Previous branch\");\n\n return (\n <Button\n aria-label={ariaLabel}\n className={cn(\n \"size-7 shrink-0 rounded-full text-muted-foreground transition-colors\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={totalBranches <= 1}\n onClick={goToPrevious}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronLeftIcon size={14} />}\n </Button>\n );\n};\n\nexport type BranchNextProps = ComponentProps<typeof Button>;\n\nexport const BranchNext = ({\n className,\n children,\n ...props\n}: BranchNextProps) => {\n const {goToNext, totalBranches} = useBranch();\n const {get} = useChatLabels();\n const ariaLabel = get(\"branchNextAriaLabel\", \"Next branch\");\n\n return (\n <Button\n aria-label={ariaLabel}\n className={cn(\n \"size-7 shrink-0 rounded-full text-muted-foreground transition-colors\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={totalBranches <= 1}\n onClick={goToNext}\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronRightIcon size={14} />}\n </Button>\n );\n};\n\nexport type BranchPageProps = HTMLAttributes<HTMLSpanElement>;\n\nexport const BranchPage = ({ className, ...props }: BranchPageProps) => {\n const { currentBranch, totalBranches } = useBranch();\n\n return (\n <span\n className={cn(\n \"font-medium text-muted-foreground text-xs tabular-nums\",\n className\n )}\n {...props}\n >\n {currentBranch + 1} of {totalBranches}\n </span>\n );\n};\n"],"names":["__iconNode","ChevronLeft","createLucideIcon","BranchContext","createContext","useBranch","context","useContext","Branch","defaultBranch","onBranchChange","className","props","currentBranch","setCurrentBranch","useState","branches","setBranches","handleBranchChange","newBranch","goToPrevious","goToNext","contextValue","jsx","cn","BranchMessages","children","childrenArray","useEffect","branch","index","BranchSelector","from","totalBranches","BranchPrevious","get","useChatLabels","ariaLabel","Button","ChevronLeftIcon","BranchNext","ChevronRightIcon","BranchPage","jsxs"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE,CAA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AA,MACP,GAAGR;AAAA,MAEH,UAAAc,KAAY,gBAAAH,EAACgB,GAAA,EAAgB,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG9C,GAIaC,IAAa,CAAC;AAAA,EACzB,WAAA7B;AAAA,EACA,UAAAe;AAAA,EACA,GAAGd;AACL,MAAuB;AACrB,QAAM,EAAC,UAAAS,GAAU,eAAAY,EAAA,IAAiB5B,EAAA,GAC5B,EAAC,KAAA8B,EAAA,IAAOC,EAAA,GACRC,IAAYF,EAAI,uBAAuB,aAAa;AAE1D,SACE,gBAAAZ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,cAAYD;AAAA,MACZ,WAAWb;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAb;AAAA,MAAA;AAAA,MAEF,UAAUsB,KAAiB;AAAA,MAC3B,SAASZ;AAAA,MACT,MAAK;AAAA,MACL,MAAK;AAAA,MACL,SAAQ;AAAA,MACP,GAAGT;AAAA,MAEH,UAAAc,KAAY,gBAAAH,EAACkB,GAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG/C,GAIaC,IAAa,CAAC,EAAE,WAAA/B,GAAW,GAAGC,QAA6B;AACtE,QAAM,EAAE,eAAAC,GAAe,eAAAoB,EAAA,IAAkB5B,EAAA;AAEzC,SACE,gBAAAsC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWnB;AAAA,QACT;AAAA,QACAb;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAC,IAAgB;AAAA,QAAE;AAAA,QAAKoB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9B;","x_google_ignoreList":[0]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { InputGroup as p, InputGroupTextarea as l, InputGroupAddon as f, InputGroupButton as d } from "../Forms/InputGroups/InputGroup.js";
|
|
4
4
|
import { cn as c } from "../../utils/cn.js";
|
|
5
|
-
import { useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { useState as b } from "react";
|
|
6
|
+
import { useChatLabels as g } from "../../contexts/ChatLabelsContext.js";
|
|
7
|
+
import { S as h } from "../../chunks/send.js";
|
|
8
|
+
import { L as I } from "../../chunks/loader-circle.js";
|
|
9
|
+
import { c as S } from "../../chunks/createLucideIcon.js";
|
|
9
10
|
import { X as N } from "../../chunks/x.js";
|
|
10
11
|
/**
|
|
11
12
|
* @license lucide-react v0.545.0 - ISC
|
|
@@ -13,94 +14,95 @@ import { X as N } from "../../chunks/x.js";
|
|
|
13
14
|
* This source code is licensed under the ISC license.
|
|
14
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const y = [
|
|
17
18
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
|
|
18
|
-
],
|
|
19
|
-
className:
|
|
20
|
-
children:
|
|
19
|
+
], x = S("square", y), q = ({
|
|
20
|
+
className: o,
|
|
21
|
+
children: r,
|
|
21
22
|
onSubmit: i,
|
|
22
|
-
...
|
|
23
|
+
...a
|
|
23
24
|
}) => {
|
|
24
|
-
const m = (
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
i({ text:
|
|
25
|
+
const m = (s) => {
|
|
26
|
+
s.preventDefault();
|
|
27
|
+
const t = new FormData(s.currentTarget).get("message") || "";
|
|
28
|
+
i({ text: t }, s);
|
|
28
29
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ e(
|
|
30
31
|
"form",
|
|
31
32
|
{
|
|
32
|
-
className: c("w-full",
|
|
33
|
+
className: c("w-full", o),
|
|
33
34
|
onSubmit: m,
|
|
34
|
-
...
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
...a,
|
|
36
|
+
children: /* @__PURE__ */ e(p, { children: r })
|
|
36
37
|
}
|
|
37
38
|
);
|
|
38
|
-
},
|
|
39
|
-
className:
|
|
40
|
-
...
|
|
41
|
-
}) => /* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
placeholder:
|
|
39
|
+
}, E = ({
|
|
40
|
+
className: o,
|
|
41
|
+
...r
|
|
42
|
+
}) => /* @__PURE__ */ e("div", { className: c("contents", o), ...r }), j = ({
|
|
43
|
+
className: o,
|
|
44
|
+
placeholder: r = "What would you like to know?",
|
|
44
45
|
onKeyDown: i,
|
|
45
|
-
...
|
|
46
|
+
...a
|
|
46
47
|
}) => {
|
|
47
|
-
const [m,
|
|
48
|
+
const [m, s] = b(!1), n = (t) => {
|
|
48
49
|
var u;
|
|
49
50
|
if (i) {
|
|
50
|
-
i(
|
|
51
|
+
i(t);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
t.key === "Enter" && !t.shiftKey && !m && !t.nativeEvent.isComposing && (t.preventDefault(), (u = t.currentTarget.form) == null || u.requestSubmit());
|
|
54
55
|
};
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ e(
|
|
56
57
|
l,
|
|
57
58
|
{
|
|
58
|
-
className: c("field-sizing-content max-h-48 min-h-16",
|
|
59
|
+
className: c("field-sizing-content max-h-48 min-h-16", o),
|
|
59
60
|
name: "message",
|
|
60
|
-
onCompositionEnd: () =>
|
|
61
|
-
onCompositionStart: () =>
|
|
62
|
-
onKeyDown:
|
|
63
|
-
placeholder:
|
|
64
|
-
...
|
|
61
|
+
onCompositionEnd: () => s(!1),
|
|
62
|
+
onCompositionStart: () => s(!0),
|
|
63
|
+
onKeyDown: n,
|
|
64
|
+
placeholder: r,
|
|
65
|
+
...a
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
|
-
},
|
|
68
|
-
className:
|
|
69
|
-
...
|
|
70
|
-
}) => /* @__PURE__ */
|
|
68
|
+
}, A = ({
|
|
69
|
+
className: o,
|
|
70
|
+
...r
|
|
71
|
+
}) => /* @__PURE__ */ e(
|
|
71
72
|
f,
|
|
72
73
|
{
|
|
73
74
|
align: "block-end",
|
|
74
|
-
className: c("justify-between gap-1",
|
|
75
|
-
...
|
|
75
|
+
className: c("justify-between gap-1", o),
|
|
76
|
+
...r
|
|
76
77
|
}
|
|
77
|
-
),
|
|
78
|
-
className:
|
|
79
|
-
variant:
|
|
78
|
+
), B = ({
|
|
79
|
+
className: o,
|
|
80
|
+
variant: r = "default",
|
|
80
81
|
size: i = "icon-sm",
|
|
81
|
-
status:
|
|
82
|
+
status: a,
|
|
82
83
|
children: m,
|
|
83
|
-
...
|
|
84
|
+
...s
|
|
84
85
|
}) => {
|
|
85
|
-
let
|
|
86
|
-
|
|
86
|
+
let n = /* @__PURE__ */ e(h, { className: "size-4" });
|
|
87
|
+
const { get: t } = g(), u = t("promptSubmitAriaLabel", "Submit");
|
|
88
|
+
return a === "submitted" ? n = /* @__PURE__ */ e(I, { className: "size-4 animate-spin" }) : a === "streaming" ? n = /* @__PURE__ */ e(x, { className: "size-4" }) : a === "error" && (n = /* @__PURE__ */ e(N, { className: "size-4" })), /* @__PURE__ */ e(
|
|
87
89
|
d,
|
|
88
90
|
{
|
|
89
|
-
"aria-label":
|
|
90
|
-
className: c(
|
|
91
|
+
"aria-label": u,
|
|
92
|
+
className: c(o),
|
|
91
93
|
size: i,
|
|
92
94
|
type: "submit",
|
|
93
|
-
variant:
|
|
94
|
-
...
|
|
95
|
-
children: m ??
|
|
95
|
+
variant: r,
|
|
96
|
+
...s,
|
|
97
|
+
children: m ?? n
|
|
96
98
|
}
|
|
97
99
|
);
|
|
98
100
|
};
|
|
99
101
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
q as PromptInput,
|
|
103
|
+
E as PromptInputBody,
|
|
104
|
+
A as PromptInputFooter,
|
|
105
|
+
B as PromptInputSubmit,
|
|
106
|
+
j as PromptInputTextarea
|
|
105
107
|
};
|
|
106
108
|
//# sourceMappingURL=PromptInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptInput.js","sources":["../../../../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/square.js","../../../lib/molecules/AiElements/PromptInput.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.545.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }]\n];\nconst Square = createLucideIcon(\"square\", __iconNode);\n\nexport { __iconNode, Square as default };\n//# sourceMappingURL=square.js.map\n","\"use client\";\n\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupTextarea,\n} from \"@clubmed/usg-chat-ui/molecules/Forms/InputGroups/InputGroup\";\nimport { cn } from \"@clubmed/usg-chat-ui/utils/cn\";\nimport type { ChatStatus } from \"ai\";\nimport { Loader2Icon, SendIcon, SquareIcon, XIcon } from \"lucide-react\";\nimport type {\n ComponentProps,\n FormEvent,\n HTMLAttributes,\n KeyboardEventHandler,\n} from \"react\";\nimport { useState } from \"react\";\n\nexport type PromptInputMessage = {\n text?: string;\n};\n\nexport type PromptInputProps = Omit<\n HTMLAttributes<HTMLFormElement>,\n \"onSubmit\"\n> & {\n onSubmit: (\n message: PromptInputMessage,\n event: FormEvent<HTMLFormElement>\n ) => void | Promise<void>;\n};\n\nexport const PromptInput = ({\n className,\n children,\n onSubmit,\n ...props\n}: PromptInputProps) => {\n const handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const formData = new FormData(event.currentTarget);\n const text = (formData.get(\"message\") as string) || \"\";\n onSubmit({ text }, event);\n };\n\n return (\n <form\n className={cn(\"w-full\", className)}\n onSubmit={handleSubmit}\n {...props}\n >\n <InputGroup>{children}</InputGroup>\n </form>\n );\n};\n\nexport type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputBody = ({\n className,\n ...props\n}: PromptInputBodyProps) => (\n <div className={cn(\"contents\", className)} {...props} />\n);\n\nexport type PromptInputTextareaProps = ComponentProps<\n typeof InputGroupTextarea\n>;\n\nexport const PromptInputTextarea = ({\n className,\n placeholder = \"What would you like to know?\",\n onKeyDown,\n ...props\n}: PromptInputTextareaProps) => {\n const [isComposing, setIsComposing] = useState(false);\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (event) => {\n if (onKeyDown) {\n onKeyDown(event);\n return;\n }\n\n if (\n event.key === \"Enter\" &&\n !event.shiftKey &&\n !isComposing &&\n !event.nativeEvent.isComposing\n ) {\n event.preventDefault();\n event.currentTarget.form?.requestSubmit();\n }\n };\n\n return (\n <InputGroupTextarea\n className={cn(\"field-sizing-content max-h-48 min-h-16\", className)}\n name=\"message\"\n onCompositionEnd={() => setIsComposing(false)}\n onCompositionStart={() => setIsComposing(true)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n {...props}\n />\n );\n};\n\nexport type PromptInputFooterProps = ComponentProps<typeof InputGroupAddon>;\n\nexport const PromptInputFooter = ({\n className,\n ...props\n}: PromptInputFooterProps) => (\n <InputGroupAddon\n align=\"block-end\"\n className={cn(\"justify-between gap-1\", className)}\n {...props}\n />\n);\n\nexport type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {\n status?: ChatStatus;\n};\n\nexport const PromptInputSubmit = ({\n className,\n variant = \"default\",\n size = \"icon-sm\",\n status,\n children,\n ...props\n}: PromptInputSubmitProps) => {\n let Icon = <SendIcon className=\"size-4\" />;\n\n if (status === \"submitted\") {\n Icon = <Loader2Icon className=\"size-4 animate-spin\" />;\n } else if (status === \"streaming\") {\n Icon = <SquareIcon className=\"size-4\" />;\n } else if (status === \"error\") {\n Icon = <XIcon className=\"size-4\" />;\n }\n\n return (\n <InputGroupButton\n aria-label
|
|
1
|
+
{"version":3,"file":"PromptInput.js","sources":["../../../../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/square.js","../../../lib/molecules/AiElements/PromptInput.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.545.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }]\n];\nconst Square = createLucideIcon(\"square\", __iconNode);\n\nexport { __iconNode, Square as default };\n//# sourceMappingURL=square.js.map\n","\"use client\";\n\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupTextarea,\n} from \"@clubmed/usg-chat-ui/molecules/Forms/InputGroups/InputGroup\";\nimport { cn } from \"@clubmed/usg-chat-ui/utils/cn\";\nimport type { ChatStatus } from \"ai\";\nimport { Loader2Icon, SendIcon, SquareIcon, XIcon } from \"lucide-react\";\nimport type {\n ComponentProps,\n FormEvent,\n HTMLAttributes,\n KeyboardEventHandler,\n} from \"react\";\nimport { useState } from \"react\";\nimport {useChatLabels} from \"../../contexts/ChatLabelsContext\";\n\nexport type PromptInputMessage = {\n text?: string;\n};\n\nexport type PromptInputProps = Omit<\n HTMLAttributes<HTMLFormElement>,\n \"onSubmit\"\n> & {\n onSubmit: (\n message: PromptInputMessage,\n event: FormEvent<HTMLFormElement>\n ) => void | Promise<void>;\n};\n\nexport const PromptInput = ({\n className,\n children,\n onSubmit,\n ...props\n}: PromptInputProps) => {\n const handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const formData = new FormData(event.currentTarget);\n const text = (formData.get(\"message\") as string) || \"\";\n onSubmit({ text }, event);\n };\n\n return (\n <form\n className={cn(\"w-full\", className)}\n onSubmit={handleSubmit}\n {...props}\n >\n <InputGroup>{children}</InputGroup>\n </form>\n );\n};\n\nexport type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputBody = ({\n className,\n ...props\n}: PromptInputBodyProps) => (\n <div className={cn(\"contents\", className)} {...props} />\n);\n\nexport type PromptInputTextareaProps = ComponentProps<\n typeof InputGroupTextarea\n>;\n\nexport const PromptInputTextarea = ({\n className,\n placeholder = \"What would you like to know?\",\n onKeyDown,\n ...props\n}: PromptInputTextareaProps) => {\n const [isComposing, setIsComposing] = useState(false);\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (event) => {\n if (onKeyDown) {\n onKeyDown(event);\n return;\n }\n\n if (\n event.key === \"Enter\" &&\n !event.shiftKey &&\n !isComposing &&\n !event.nativeEvent.isComposing\n ) {\n event.preventDefault();\n event.currentTarget.form?.requestSubmit();\n }\n };\n\n return (\n <InputGroupTextarea\n className={cn(\"field-sizing-content max-h-48 min-h-16\", className)}\n name=\"message\"\n onCompositionEnd={() => setIsComposing(false)}\n onCompositionStart={() => setIsComposing(true)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n {...props}\n />\n );\n};\n\nexport type PromptInputFooterProps = ComponentProps<typeof InputGroupAddon>;\n\nexport const PromptInputFooter = ({\n className,\n ...props\n}: PromptInputFooterProps) => (\n <InputGroupAddon\n align=\"block-end\"\n className={cn(\"justify-between gap-1\", className)}\n {...props}\n />\n);\n\nexport type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {\n status?: ChatStatus;\n};\n\nexport const PromptInputSubmit = ({\n className,\n variant = \"default\",\n size = \"icon-sm\",\n status,\n children,\n ...props\n}: PromptInputSubmitProps) => {\n let Icon = <SendIcon className=\"size-4\" />;\n const {get} = useChatLabels();\n const ariaLabel = get(\"promptSubmitAriaLabel\", \"Submit\");\n\n if (status === \"submitted\") {\n Icon = <Loader2Icon className=\"size-4 animate-spin\" />;\n } else if (status === \"streaming\") {\n Icon = <SquareIcon className=\"size-4\" />;\n } else if (status === \"error\") {\n Icon = <XIcon className=\"size-4\" />;\n }\n\n return (\n <InputGroupButton\n aria-label={ariaLabel}\n className={cn(className)}\n size={size}\n type=\"submit\"\n variant={variant}\n {...props}\n >\n {children ?? Icon}\n </InputGroupButton>\n );\n};\n"],"names":["__iconNode","Square","createLucideIcon","PromptInput","className","children","onSubmit","props","handleSubmit","event","text","jsx","cn","InputGroup","PromptInputBody","PromptInputTextarea","placeholder","onKeyDown","isComposing","setIsComposing","useState","handleKeyDown","_a","InputGroupTextarea","PromptInputFooter","InputGroupAddon","PromptInputSubmit","variant","size","status","Icon","SendIcon","get","useChatLabels","ariaLabel","Loader2Icon","SquareIcon","XIcon","InputGroupButton"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,KAAK,SAAQ,CAAE;AAChF,GACMC,IAASC,EAAiB,UAAUF,CAAU,GCsBvCG,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAwB;AACtB,QAAMC,IAAe,CAACC,MAAsC;AAC1D,IAAAA,EAAM,eAAA;AAEN,UAAMC,IADW,IAAI,SAASD,EAAM,aAAa,EAC1B,IAAI,SAAS,KAAgB;AACpD,IAAAH,EAAS,EAAE,MAAAI,EAAA,GAAQD,CAAK;AAAA,EAC1B;AAEA,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAG,UAAUR,CAAS;AAAA,MACjC,UAAUI;AAAA,MACT,GAAGD;AAAA,MAEJ,UAAA,gBAAAI,EAACE,KAAY,UAAAR,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAG5B,GAIaS,IAAkB,CAAC;AAAA,EAC9B,WAAAV;AAAA,EACA,GAAGG;AACL,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IAAYF,EAAI,yBAAyB,QAAQ;AAEvD,SAAIH,MAAW,cACbC,IAAO,gBAAAnB,EAACwB,GAAA,EAAY,WAAU,sBAAA,CAAsB,IAC3CN,MAAW,cACpBC,IAAO,gBAAAnB,EAACyB,GAAA,EAAW,WAAU,SAAA,CAAS,IAC7BP,MAAW,YACpBC,IAAO,gBAAAnB,EAAC0B,GAAA,EAAM,WAAU,SAAA,CAAS,IAIjC,gBAAA1B;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,cAAYJ;AAAA,MACZ,WAAWtB,EAAGR,CAAS;AAAA,MACvB,MAAAwB;AAAA,MACA,MAAK;AAAA,MACL,SAAAD;AAAA,MACC,GAAGpB;AAAA,MAEH,UAAAF,KAAYyB;AAAA,IAAA;AAAA,EAAA;AAGnB;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as s } from "../../chunks/react.esm.js";
|
|
2
|
-
import {
|
|
2
|
+
import { u as d, D as b, c as v, _ as u } from "../../chunks/useCollaboration.js";
|
|
3
3
|
import { useChatConfig as p } from "../../contexts/ChatContext.js";
|
|
4
4
|
import { v as r, d as h, b as f, a as C, i, g as t } from "../../chunks/vi.2VT5v0um.js";
|
|
5
5
|
r.mock("@clubmed/usg-chat-ui/contexts/ChatContext", () => ({
|