@elia-assistant/chatui 1.0.11 → 1.0.12
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 +1 -1
- package/dist/chat-store.js +10 -0
- package/dist/chatui.css +1 -1
- package/dist/chatui.iife.css +1 -1
- package/dist/chatui.iife.js +9 -9
- package/dist/chunks/{i18n-B0xhVAye.js → i18n-CGlsSoQa.js} +3 -3
- package/dist/chunks/i18n-CgST8dWz.js +2 -0
- package/dist/chunks/settingsStore-Bqlj_GzJ.js +134 -0
- package/dist/chunks/{translation-CsXAAc6O.js → translation-BHOB8oBB.js} +8 -2
- package/dist/chunks/{translation-D0S7F5mA.js → translation-KDPjplc7.js} +8 -2
- package/dist/components/InputArea.d.ts +2 -1
- package/dist/hooks/useChat.d.ts +2 -1
- package/dist/hooks/useCta.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +414 -198
- package/dist/lib/n8nClient.d.ts +2 -2
- package/dist/store/chatStore.d.ts +5 -0
- package/dist/store.js +1 -1
- package/dist/types/index.d.ts +10 -16
- package/package.json +1 -1
- package/dist/chunks/i18n-23dPrR-0.js +0 -2
- package/dist/chunks/settingsStore-CpRkCJCy.js +0 -254
|
@@ -1274,8 +1274,8 @@ var oe = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
1274
1274
|
}
|
|
1275
1275
|
};
|
|
1276
1276
|
}, $ = /* @__PURE__ */ Object.assign({
|
|
1277
|
-
"./locales/en/translation.json": () => import("./translation-
|
|
1278
|
-
"./locales/sk/translation.json": () => import("./translation-
|
|
1277
|
+
"./locales/en/translation.json": () => import("./translation-BHOB8oBB.js"),
|
|
1278
|
+
"./locales/sk/translation.json": () => import("./translation-KDPjplc7.js")
|
|
1279
1279
|
}), me = Array.from(new Set(Object.keys($).map((e) => e.split("/")[2]).filter((e) => !!e)));
|
|
1280
1280
|
function he() {
|
|
1281
1281
|
try {
|
|
@@ -1301,4 +1301,4 @@ var ge = J;
|
|
|
1301
1301
|
//#endregion
|
|
1302
1302
|
export { k as a, Y as i, fe as n, ue as r, ge as t };
|
|
1303
1303
|
|
|
1304
|
-
//# sourceMappingURL=i18n-
|
|
1304
|
+
//# sourceMappingURL=i18n-CGlsSoQa.js.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { n as e, t } from "./middleware-DgE1WAsA.js";
|
|
2
|
+
//#region src/themes.ts
|
|
3
|
+
var n = [
|
|
4
|
+
{
|
|
5
|
+
id: "midnight",
|
|
6
|
+
label: "Midnight",
|
|
7
|
+
baseColor: "#0f1117",
|
|
8
|
+
accentColor: "#6366f1"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "ivory",
|
|
12
|
+
label: "Ivory",
|
|
13
|
+
baseColor: "#ffffff",
|
|
14
|
+
accentColor: "#4338ca"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "sunrise",
|
|
18
|
+
label: "Sunrise",
|
|
19
|
+
baseColor: "#ffffff",
|
|
20
|
+
accentColor: "#f97316"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "cosmos",
|
|
24
|
+
label: "Cosmos",
|
|
25
|
+
baseColor: "#0d0a1a",
|
|
26
|
+
accentColor: "#a855f7"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "forest",
|
|
30
|
+
label: "Forest",
|
|
31
|
+
baseColor: "#0a1410",
|
|
32
|
+
accentColor: "#22c55e"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "ocean",
|
|
36
|
+
label: "Ocean",
|
|
37
|
+
baseColor: "#060f1a",
|
|
38
|
+
accentColor: "#06b6d4"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "cherry",
|
|
42
|
+
label: "Cherry",
|
|
43
|
+
baseColor: "#ffffff",
|
|
44
|
+
accentColor: "#ef4444"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "navy",
|
|
48
|
+
label: "Navy",
|
|
49
|
+
baseColor: "#080f1e",
|
|
50
|
+
accentColor: "#3b82f6"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "lavender",
|
|
54
|
+
label: "Lavender",
|
|
55
|
+
baseColor: "#faf5ff",
|
|
56
|
+
accentColor: "#8b5cf6"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "amber",
|
|
60
|
+
label: "Amber",
|
|
61
|
+
baseColor: "#0f0a00",
|
|
62
|
+
accentColor: "#f59e0b"
|
|
63
|
+
}
|
|
64
|
+
], r = "midnight";
|
|
65
|
+
function i(e) {
|
|
66
|
+
return n.find((t) => t.id === e) ?? n[0];
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/store/settingsStore.ts
|
|
70
|
+
var a = {
|
|
71
|
+
webhookUrl: "",
|
|
72
|
+
chatInputKey: "chatInput",
|
|
73
|
+
chatSessionKey: "sessionId",
|
|
74
|
+
mode: "fullscreen",
|
|
75
|
+
showSidebar: !1,
|
|
76
|
+
showWelcomeScreen: !0,
|
|
77
|
+
streaming: !1,
|
|
78
|
+
botName: "Assistant",
|
|
79
|
+
showCta: !0,
|
|
80
|
+
ctaText: "Hi! How can I help you today?",
|
|
81
|
+
ctaDelay: 5e3,
|
|
82
|
+
ctaSound: !0,
|
|
83
|
+
hideSettings: !0,
|
|
84
|
+
poweredByLabel: "ELIA AI Assistant",
|
|
85
|
+
poweredByUrl: "https://www.elia-asistent.com",
|
|
86
|
+
poweredByHide: !1,
|
|
87
|
+
fullscreenSheet: !1,
|
|
88
|
+
fullscreenSheetHeight: "75vh",
|
|
89
|
+
i18n: {
|
|
90
|
+
en: {
|
|
91
|
+
initialMessages: [],
|
|
92
|
+
ctaText: "Hi! How can I help you today?"
|
|
93
|
+
},
|
|
94
|
+
sk: {
|
|
95
|
+
initialMessages: [],
|
|
96
|
+
ctaText: "Dobrý deň! Ako vám môžem pomôcť?"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, o = e()(t((e) => ({
|
|
100
|
+
config: a,
|
|
101
|
+
activeTheme: r,
|
|
102
|
+
language: "en",
|
|
103
|
+
setConfig(t) {
|
|
104
|
+
e((e) => ({ config: {
|
|
105
|
+
...e.config,
|
|
106
|
+
...t
|
|
107
|
+
} }));
|
|
108
|
+
},
|
|
109
|
+
setTheme(t) {
|
|
110
|
+
e({ activeTheme: t });
|
|
111
|
+
},
|
|
112
|
+
setLanguage(t) {
|
|
113
|
+
e({ language: t }), import("./i18n-CgST8dWz.js").then((e) => {
|
|
114
|
+
e.default.changeLanguage(t);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}), {
|
|
118
|
+
name: "chatui-settings",
|
|
119
|
+
merge: (e, t) => {
|
|
120
|
+
let n = e;
|
|
121
|
+
return {
|
|
122
|
+
...t,
|
|
123
|
+
...n,
|
|
124
|
+
config: {
|
|
125
|
+
...t.config,
|
|
126
|
+
...n.config ?? {}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
//#endregion
|
|
132
|
+
export { i as n, n as r, o as t };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=settingsStore-Bqlj_GzJ.js.map
|
|
@@ -72,7 +72,13 @@ var e = {
|
|
|
72
72
|
poweredByUrl: "\"Powered by\" link URL",
|
|
73
73
|
poweredByHide: "Hide \"Powered by\" footer",
|
|
74
74
|
save: "Save",
|
|
75
|
-
cancel: "Cancel"
|
|
75
|
+
cancel: "Cancel",
|
|
76
|
+
theme: "Theme",
|
|
77
|
+
exportConfig: "Export config",
|
|
78
|
+
exportHint: "Paste this into your host app's bootstrap file (e.g. <code>src/main.tsx</code>) before the first React render. See <code>example.html</code> for the full integration guide.",
|
|
79
|
+
back: "Back",
|
|
80
|
+
copyToClipboard: "Copy to clipboard",
|
|
81
|
+
copied: "Copied"
|
|
76
82
|
}, c = {
|
|
77
83
|
errors: e,
|
|
78
84
|
welcome: t,
|
|
@@ -86,4 +92,4 @@ var e = {
|
|
|
86
92
|
//#endregion
|
|
87
93
|
export { c as default, e as errors, a as footer, r as header, n as input, s as settings, i as sidebar, o as tabs, t as welcome };
|
|
88
94
|
|
|
89
|
-
//# sourceMappingURL=translation-
|
|
95
|
+
//# sourceMappingURL=translation-BHOB8oBB.js.map
|
|
@@ -72,7 +72,13 @@ var e = {
|
|
|
72
72
|
poweredByUrl: "URL odkazu \"Poháňa\"",
|
|
73
73
|
poweredByHide: "Skryť pätičku \"Poháňa\"",
|
|
74
74
|
save: "Uložiť",
|
|
75
|
-
cancel: "Zrušiť"
|
|
75
|
+
cancel: "Zrušiť",
|
|
76
|
+
theme: "Téma",
|
|
77
|
+
exportConfig: "Exportovať konfiguráciu",
|
|
78
|
+
exportHint: "Vložte toto do bootstrap súboru vašej hostiteľskej aplikácie (napr. <code>src/main.tsx</code>) pred prvým renderom Reactu. Pozrite <code>example.html</code> pre kompletný návod na integráciu.",
|
|
79
|
+
back: "Späť",
|
|
80
|
+
copyToClipboard: "Kopírovať do schránky",
|
|
81
|
+
copied: "Skopírované"
|
|
76
82
|
}, c = {
|
|
77
83
|
errors: e,
|
|
78
84
|
welcome: t,
|
|
@@ -86,4 +92,4 @@ var e = {
|
|
|
86
92
|
//#endregion
|
|
87
93
|
export { c as default, e as errors, a as footer, r as header, n as input, s as settings, i as sidebar, o as tabs, t as welcome };
|
|
88
94
|
|
|
89
|
-
//# sourceMappingURL=translation-
|
|
95
|
+
//# sourceMappingURL=translation-KDPjplc7.js.map
|
package/dist/hooks/useChat.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Attachment } from '../types/index.ts';
|
|
1
2
|
export declare function useChat(): {
|
|
2
|
-
send: (text: string) => Promise<void>;
|
|
3
|
+
send: (text: string, attachments?: Attachment[]) => Promise<void>;
|
|
3
4
|
retry: (messageId: string) => Promise<void>;
|
|
4
5
|
isStreaming: boolean;
|
|
5
6
|
};
|
package/dist/hooks/useCta.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChatConfig } from '../types/index.ts';
|
|
2
|
-
export declare function useCta(config: ChatConfig, language: string,
|
|
2
|
+
export declare function useCta(config: ChatConfig, language: string, enabled: boolean): {
|
|
3
3
|
showCta: boolean;
|
|
4
4
|
ctaText: string;
|
|
5
5
|
dismiss: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { App } from './App.tsx';
|
|
2
2
|
export { createChat } from './createChat.ts';
|
|
3
3
|
export type { CreateChatOptions, ChatInstance } from './createChat.ts';
|
|
4
|
-
export type { ChatConfig, LangOverride, Message, Session, ThemeDef,
|
|
4
|
+
export type { ChatConfig, LangOverride, Message, Session, ThemeDef, NotificationItem, NotificationTag, NotificationTagVariant, FaqItem, } from './types/index.ts';
|