Skip to content

Commit f742cf2

Browse files
authored
Merge pull request #5 from amisamyra99/website/docs-intershop
update ui style with custom css
2 parents ac54978 + 49d33aa commit f742cf2

File tree

9 files changed

+160
-158
lines changed

9 files changed

+160
-158
lines changed

chatbot.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
import Chatbot from "https://cdn.jsdelivr.net/gh/intershop/ai-flowise-chat-embed@website/docs-intershop/dist/web.js"
2-
//import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
1+
//import Chatbot from 'https://cdn.jsdelivr.net/gh/intershop/ai-flowise-chat-embed@website/docs-intershop/dist/web.js';
2+
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
33
const welcome = {
44
en: "Hi! Need help with Intershop documentation? I'm the AI assistant specializing in the latest versions of ICM, IOM, CEC, IAC, SMC, and OMA. Feel free to ask me your questions.",
55
fr: "Bonjour ! Besoin d'aide avec la documentation Intershop ? Je suis l'assistant IA spécialisé dans les dernières versions d'ICM, IOM, CEC, IAC, SMC et OMA. N'hésitez pas à me poser vos questions.",
6-
de: "Hallo! Brauchen Sie Hilfe mit der Intershop-Dokumentation? Ich bin der KI-Assistent, der auf die neuesten Versionen von ICM, IOM, CEC, IAC, SMC und OMA spezialisiert ist. Stellen Sie mir gerne Ihre Fragen."
6+
de: 'Hallo! Brauchen Sie Hilfe mit der Intershop-Dokumentation? Ich bin der KI-Assistent, der auf die neuesten Versionen von ICM, IOM, CEC, IAC, SMC und OMA spezialisiert ist. Stellen Sie mir gerne Ihre Fragen.',
77
};
8-
var welcomeMessage=welcome.en;
8+
var welcomeMessage = welcome.en;
99
Chatbot.init({
10-
chatflowid: "8fba968e-f8ed-4401-8a9f-57eaa5f45535",
11-
apiHost: "https://ish-flowise-app.azurewebsites.net",
10+
chatflowid: '8fba968e-f8ed-4401-8a9f-57eaa5f45535',
11+
apiHost: 'https://ish-flowise-app.azurewebsites.net',
1212
chatflowConfig: {
1313
vars: {
1414
currentUrl: window.location.href,
1515
lang: (() => {
16-
17-
1816
function getLangFromUrl(url) {
19-
const validLangCodes = ["en", "de", "fr"];
17+
const validLangCodes = ['en', 'de', 'fr'];
2018
const match = url.match(/\/([a-z]{2})(\/|$)/); // Slightly simplified regex
2119

2220
return match ? (validLangCodes.includes(match[1]) ? match[1] : null) : null;
2321
}
2422
const url = window.location.href;
25-
var extracted_lang=getLangFromUrl(url)|| "de";
26-
console.log(extracted_lang)
23+
var extracted_lang = getLangFromUrl(url) || 'de';
24+
console.log(extracted_lang);
2725
welcomeMessage = welcome[extracted_lang] || welcome.en; // Default to English if the language key is missing.
28-
2926
})(),
3027
service: (() => {
3128
// Access the current URL from the vars
@@ -37,16 +34,16 @@ Chatbot.init({
3734
const regex = /(?:docs\.intershop\.com|file:\/\/\/D:\/documentation-online-help-(icm|iap|iom)\/src)/;
3835
const regex2 = /(?:docs\.intershop\.com|file:\/\/\/D:\/(documentation-online-help-icm|documentation-online-help-iap)\/src)\/(\w+)/;
3936
const match = url.match(regex);
40-
console.log(match)
37+
console.log(match);
4138
// Return the matched group if found; otherwise, default to 'icm'
4239
return match ? match[1] : 'icm';
4340
}
4441

4542
const url = window.location.href;
4643
// Execute the function to extract the service
4744
return getServiceFromUrl('https://docs.intershop.com/icm/latest/olh/icm/de/');
48-
})()
49-
}
45+
})(),
46+
},
5047
},
5148
observersConfig: {},
5249
theme: {
@@ -68,12 +65,11 @@ Chatbot.init({
6865
chatWindow: {
6966
showTitle: true,
7067
showAgentMessages: true,
71-
title: 'Intershop Documentation Chatbot',
68+
title: 'Intershop Documentation Copilot',
7269
//titleAvatarSrc: " https://amisamyra99.github.io/chatbot-flowise-js-hosting/images/bot24.png",
7370

7471
welcomeMessage: welcomeMessage,
75-
76-
72+
7773
errorMessage: 'It seems that we are encountering a problem.',
7874
backgroundColor: '#ffffff',
7975
//set a pixel value
@@ -108,23 +104,26 @@ Chatbot.init({
108104
feedback: {
109105
color: '#303235',
110106
backgroundColor: '#008e87',
107+
buttonColor: '#008e87'
108+
111109
},
112110
footer: {
113111
textColor: '#303235',
114112
text: 'Powered by',
115-
company: 'Intershop Gmbh',
113+
company: 'Intershop',
116114
companyLink: 'https://docs.intershop.com/index.php',
117115
},
118116
},
119117
disclaimer: {
120118
title: 'Disclaimer',
121-
message: 'By using this chatbot, you agree to the <a target="_blank" style="color: #008e87;" href="https://www.intershop.com/en/privacy-policy" >Terms & Condition</a>',
119+
message:
120+
'By using this chatbot, you agree to the <a target="_blank" style="color: #008e87;" href="https://www.intershop.com/en/privacy-policy" >Terms & Condition</a>',
122121
textColor: 'black',
123122
buttonColor: '#008e87',
124123
buttonText: 'Start Chatting',
125124
buttonTextColor: 'white',
126125
blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
127126
backgroundColor: 'white',
128-
}
129-
}
130-
});
127+
},
128+
},
129+
});

dist/features/bubble/components/Bubble.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/features/popup/components/DisclaimerPopup.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 123 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -10,136 +10,137 @@
1010
<body>
1111
<!-- <flowise-fullchatbot style="font-family: 'Open Sans', sans-serif !important;"></flowise-fullchatbot> -->
1212
<script type="module">
13-
import Chatbot from "https://cdn.jsdelivr.net/gh/intershop/ai-flowise-chat-embed@website/docs-intershop/dist/web.js"
14-
//import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
15-
const welcome = {
16-
en: "Hi! Need help with Intershop documentation? I'm the AI assistant specializing in the latest versions of ICM, IOM, CEC, IAC, SMC, and OMA. Feel free to ask me your questions.",
17-
fr: "Bonjour ! Besoin d'aide avec la documentation Intershop ? Je suis l'assistant IA spécialisé dans les dernières versions d'ICM, IOM, CEC, IAC, SMC et OMA. N'hésitez pas à me poser vos questions.",
18-
de: "Hallo! Brauchen Sie Hilfe mit der Intershop-Dokumentation? Ich bin der KI-Assistent, der auf die neuesten Versionen von ICM, IOM, CEC, IAC, SMC und OMA spezialisiert ist. Stellen Sie mir gerne Ihre Fragen."
19-
};
20-
var welcomeMessage=welcome.en;
21-
Chatbot.init({
22-
chatflowid: "8fba968e-f8ed-4401-8a9f-57eaa5f45535",
23-
apiHost: "https://ish-flowise-app.azurewebsites.net",
24-
chatflowConfig: {
25-
vars: {
26-
currentUrl: window.location.href,
27-
lang: (() => {
13+
//import Chatbot from 'https://cdn.jsdelivr.net/gh/intershop/ai-flowise-chat-embed@website/docs-intershop/dist/web.js';
14+
//import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
15+
import chatWindow from 'http://localhost:5678/web.js'
16+
const welcome = {
17+
en: "Hi! Need help with Intershop documentation? I'm the AI assistant specializing in the latest versions of ICM, IOM, CEC, IAC, SMC, and OMA. Feel free to ask me your questions.",
18+
fr: "Bonjour ! Besoin d'aide avec la documentation Intershop ? Je suis l'assistant IA spécialisé dans les dernières versions d'ICM, IOM, CEC, IAC, SMC et OMA. N'hésitez pas à me poser vos questions.",
19+
de: 'Hallo! Brauchen Sie Hilfe mit der Intershop-Dokumentation? Ich bin der AI-Assistent, der auf die neuesten Versionen von ICM, IOM, CEC, IAC, SMC und OMA spezialisiert ist. Stellen Sie mir gerne Ihre Fragen.',
20+
};
21+
var welcomeMessage = welcome.en;
2822

23+
Chatbot.init({
24+
chatflowid: '8fba968e-f8ed-4401-8a9f-57eaa5f45535',
25+
apiHost: 'https://ish-flowise-app.azurewebsites.net',
26+
chatflowConfig: {
27+
vars: {
28+
currentUrl: window.location.href,
29+
lang: (() => {
30+
function getLangFromUrl(url) {
31+
const validLangCodes = ['en', 'de', 'fr'];
32+
const match = url.match(/\/([a-z]{2})(\/|$)/); // Slightly simplified regex
2933

30-
function getLangFromUrl(url) {
31-
const validLangCodes = ["en", "de", "fr"];
32-
const match = url.match(/\/([a-z]{2})(\/|$)/); // Slightly simplified regex
34+
return match ? (validLangCodes.includes(match[1]) ? match[1] : null) : null;
35+
}
36+
const url = window.location.href;
37+
var extracted_lang = getLangFromUrl(url) || 'en';
38+
console.log(extracted_lang);
39+
welcomeMessage = welcome[extracted_lang] || welcome.en; // Default to English if the language key is missing.
40+
})(),
41+
service: (() => {
42+
// Access the current URL from the vars
43+
// const currentUrl = 'https://docs.intershop.com/iap/olh/cec/en/';
44+
45+
// Function to extract the service identifier
46+
function getServiceFromUrl(url) {
47+
// Match the pattern after the domain or path
48+
const regex = /(?:docs\.intershop\.com|file:\/\/\/D:\/documentation-online-help-(icm|iap|iom)\/src)/;
49+
const regex2 = /(?:docs\.intershop\.com|file:\/\/\/D:\/(documentation-online-help-icm|documentation-online-help-iap)\/src)\/(\w+)/;
50+
const match = url.match(regex);
51+
console.log(match);
52+
// Return the matched group if found; otherwise, default to 'icm'
53+
return match ? match[1] : 'icm';
54+
}
3355

34-
return match ? (validLangCodes.includes(match[1]) ? match[1] : null) : null;
35-
}
36-
const url = window.location.href;
37-
var extracted_lang=getLangFromUrl(url)|| "de";
38-
console.log(extracted_lang)
39-
welcomeMessage = welcome[extracted_lang] || welcome.en; // Default to English if the language key is missing.
56+
const url = window.location.href;
57+
// Execute the function to extract the service
58+
return getServiceFromUrl('https://docs.intershop.com/icm/latest/olh/icm/de/');
59+
})(),
60+
},
61+
},
62+
observersConfig: {},
63+
theme: {
64+
button: {
65+
backgroundColor: '#008e87',
66+
right: 20,
67+
bottom: 20,
68+
size: 48, // small | medium | large | number
69+
dragAndDrop: true,
70+
iconColor: 'white',
71+
autoWindowOpen: {
72+
autoOpen: true, //parameter to control automatic window opening
73+
openDelay: 2, // Optional parameter for delay time in seconds
74+
autoOpenOnMobile: false, //parameter to control automatic window opening in mobile
75+
},
76+
},
4077

41-
})(),
42-
service: (() => {
43-
// Access the current URL from the vars
44-
// const currentUrl = 'https://docs.intershop.com/iap/olh/cec/en/';
78+
customCSS: ``,
79+
chatWindow: {
80+
showTitle: true,
81+
showAgentMessages: true,
82+
title: 'Intershop Documentation Copilot',
83+
//titleAvatarSrc: " https://amisamyra99.github.io/chatbot-flowise-js-hosting/images/bot24.png",
4584

46-
// Function to extract the service identifier
47-
function getServiceFromUrl(url) {
48-
// Match the pattern after the domain or path
49-
const regex = /(?:docs\.intershop\.com|file:\/\/\/D:\/documentation-online-help-(icm|iap|iom)\/src)/;
50-
const regex2 = /(?:docs\.intershop\.com|file:\/\/\/D:\/(documentation-online-help-icm|documentation-online-help-iap)\/src)\/(\w+)/;
51-
const match = url.match(regex);
52-
console.log(match)
53-
// Return the matched group if found; otherwise, default to 'icm'
54-
return match ? match[1] : 'icm';
55-
}
85+
welcomeMessage: welcomeMessage,
5686

57-
const url = window.location.href;
58-
// Execute the function to extract the service
59-
return getServiceFromUrl('https://docs.intershop.com/icm/latest/olh/icm/de/');
60-
})()
61-
}
87+
errorMessage: 'It seems that we are encountering a problem.',
88+
backgroundColor: '#ffffff',
89+
//set a pixel value
90+
//height: 1000,
91+
//width: 600,
92+
fontSize: 16,
93+
clearChatOnReload: false,
94+
sourceDocsTitle: 'Sources:',
95+
botMessage: {
96+
backgroundColor: '#f7f8ff',
97+
textColor: '#303235',
98+
// showAvatar: true,
99+
//avatarSrc: 'https://amisamyra99.github.io/chatbot-flowise-js-hosting/images/bot24.png',
62100
},
63-
observersConfig: {},
64-
theme: {
65-
button: {
66-
backgroundColor: '#008e87',
67-
right: 20,
68-
bottom: 20,
69-
size: 48, // small | medium | large | number
70-
dragAndDrop: true,
71-
iconColor: 'white',
72-
autoWindowOpen: {
73-
autoOpen: true, //parameter to control automatic window opening
74-
openDelay: 2, // Optional parameter for delay time in seconds
75-
autoOpenOnMobile: false, //parameter to control automatic window opening in mobile
76-
},
77-
},
78-
79-
customCSS: ``,
80-
chatWindow: {
81-
showTitle: true,
82-
showAgentMessages: true,
83-
title: 'Intershop Documentation Chatbot',
84-
//titleAvatarSrc: " https://amisamyra99.github.io/chatbot-flowise-js-hosting/images/bot24.png",
101+
userMessage: {
102+
backgroundColor: '#008e87',
103+
textColor: '#ffffff',
104+
//showAvatar: true,
105+
//avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
106+
},
107+
textInput: {
108+
placeholder: 'Type your question',
109+
backgroundColor: '#ffffff',
110+
textColor: '#303235',
111+
sendButtonColor: '#008e87',
112+
maxChars: 50,
113+
maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
114+
autoFocus: true,
115+
sendMessageSound: false,
116+
receiveMessageSound: false,
117+
},
118+
feedback: {
119+
color: '#303235',
120+
backgroundColor: '#ffffff',
121+
buttonColor: '#ffffff'
85122

86-
welcomeMessage: welcomeMessage,
87-
88-
89-
errorMessage: 'It seems that we are encountering a problem.',
90-
backgroundColor: '#ffffff',
91-
//set a pixel value
92-
height: 700,
93-
width: 600,
94-
fontSize: 16,
95-
clearChatOnReload: false,
96-
sourceDocsTitle: 'Sources:',
97-
botMessage: {
98-
backgroundColor: '#f7f8ff',
99-
textColor: '#303235',
100-
// showAvatar: true,
101-
//avatarSrc: 'https://amisamyra99.github.io/chatbot-flowise-js-hosting/images/bot24.png',
102-
},
103-
userMessage: {
104-
backgroundColor: '#008e87',
105-
textColor: '#ffffff',
106-
//showAvatar: true,
107-
//avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
108-
},
109-
textInput: {
110-
placeholder: 'Type your question',
111-
backgroundColor: '#ffffff',
112-
textColor: '#303235',
113-
sendButtonColor: '#008e87',
114-
maxChars: 50,
115-
maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
116-
autoFocus: true,
117-
sendMessageSound: false,
118-
receiveMessageSound: false,
119-
},
120-
feedback: {
121-
color: '#303235',
122-
backgroundColor: '#008e87',
123-
},
124-
footer: {
125-
textColor: '#303235',
126-
text: 'Powered by',
127-
company: 'Intershop Gmbh',
128-
companyLink: 'https://docs.intershop.com/index.php',
129-
},
130-
},
131-
disclaimer: {
132-
title: 'Disclaimer',
133-
message: 'By using this chatbot, you agree to the <a target="_blank" style="color: #008e87;" href="https://www.intershop.com/en/privacy-policy" >Terms & Condition</a>',
134-
textColor: 'black',
135-
buttonColor: '#008e87',
136-
buttonText: 'Start Chatting',
137-
buttonTextColor: 'white',
138-
blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
139-
backgroundColor: 'white',
140-
}
141-
}
142-
});
123+
},
124+
footer: {
125+
textColor: '#303235',
126+
text: 'Powered by',
127+
company: 'Intershop',
128+
companyLink: 'https://docs.intershop.com/index.php',
129+
},
130+
},
131+
disclaimer: {
132+
title: 'Disclaimer',
133+
message:
134+
'By using this chatbot, you agree to the <a target="_blank" style="color: #008e87;" href="https://www.intershop.com/en/privacy-policy" >Terms & Condition</a>',
135+
textColor: 'black',
136+
buttonColor: '#008e87',
137+
buttonText: 'Start Chatting',
138+
buttonTextColor: 'white',
139+
blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
140+
backgroundColor: 'white',
141+
},
142+
},
143+
});
143144

144145
</script>
145146
</body>

dist/web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)