Skip to content

Commit 1108a71

Browse files
authored
VF Chatbot : Updated code for standalone chatbot and modal chatbot
1 parent 4a894b2 commit 1108a71

15 files changed

+490
-559
lines changed

craco.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
webpack: {
5+
configure: (webpackConfig) => {
6+
const oneOfRule = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf));
7+
if (oneOfRule) {
8+
oneOfRule.oneOf.forEach(rule => {
9+
if (
10+
rule.loader &&
11+
rule.loader.includes("babel-loader") &&
12+
rule.exclude
13+
) {
14+
const originalExclude = rule.exclude;
15+
rule.exclude = (input) => {
16+
if (
17+
typeof input === "string" &&
18+
input.replace(/\\/g, "/").includes("node_modules/@visual-framework/vf-chatbot")
19+
) {
20+
return false;
21+
}
22+
if (typeof originalExclude === "function") {
23+
return originalExclude(input);
24+
}
25+
if (Array.isArray(originalExclude)) {
26+
return originalExclude.some(ex => input.includes(ex));
27+
}
28+
return false;
29+
};
30+
31+
// Add this: force automatic runtime for our package
32+
if (!rule.options) rule.options = {};
33+
if (!rule.options.overrides) rule.options.overrides = [];
34+
rule.options.overrides.push({
35+
test: /@visual-framework[\\\/]vf-chatbot/,
36+
presets: [
37+
[
38+
"@babel/preset-react",
39+
{ runtime: "automatic" }
40+
]
41+
]
42+
});
43+
}
44+
});
45+
}
46+
return webpackConfig;
47+
}
48+
}
49+
};

package.json

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "/vf-react/",
66
"dependencies": {
7+
"@craco/craco": "^7.1.0",
78
"@testing-library/jest-dom": "^5.17.0",
89
"@testing-library/react": "^13.4.0",
910
"@testing-library/user-event": "^13.5.0",
@@ -15,13 +16,17 @@
1516
"@visual-framework/vf-box": "^2.4.0",
1617
"@visual-framework/vf-button": "3.0.2",
1718
"@visual-framework/vf-card": "2.7.2",
18-
"@visual-framework/vf-chatbot-action-prompt": "^1.0.0-beta.1",
19-
"@visual-framework/vf-chatbot-feedback": "^1.0.0-beta.1",
20-
"@visual-framework/vf-chatbot-prompt": "^1.0.0-beta.1",
21-
"@visual-framework/vf-chatbot-selector": "^1.0.0-beta.1",
22-
"@visual-framework/vf-chatbot-sources": "^1.0.0-beta.1",
23-
"@visual-framework/vf-chatbot-standalone": "^1.0.0-beta.1",
24-
"@visual-framework/vf-chatbot-welcome": "^1.0.0-beta.1",
19+
"@visual-framework/vf-chatbot": "latest",
20+
"@visual-framework/vf-chatbot-action-prompt": "latest",
21+
"@visual-framework/vf-chatbot-dialog": "latest",
22+
"@visual-framework/vf-chatbot-fab": "latest",
23+
"@visual-framework/vf-chatbot-feedback": "latest",
24+
"@visual-framework/vf-chatbot-modal": "latest",
25+
"@visual-framework/vf-chatbot-prompt": "latest",
26+
"@visual-framework/vf-chatbot-selector": "latest",
27+
"@visual-framework/vf-chatbot-sources": "latest",
28+
"@visual-framework/vf-chatbot-standalone": "latest",
29+
"@visual-framework/vf-chatbot-welcome": "latest",
2530
"@visual-framework/vf-content": "1.6.16",
2631
"@visual-framework/vf-core": "2.2.47",
2732
"@visual-framework/vf-extensions-react": "^0.0.8",
@@ -50,10 +55,10 @@
5055
"web-vitals": "^2.1.4"
5156
},
5257
"scripts": {
53-
"start": "react-scripts start",
54-
"build": "react-scripts build",
55-
"test": "react-scripts test",
56-
"eject": "react-scripts eject"
58+
"start": "craco start",
59+
"build": "craco build",
60+
"test": "craco test",
61+
"eject": "craco eject"
5762
},
5863
"browserslist": {
5964
"production": [
@@ -66,5 +71,9 @@
6671
"last 1 firefox version",
6772
"last 1 safari version"
6873
]
74+
},
75+
"devDependencies": {
76+
"@babel/plugin-syntax-jsx": "^7.27.1",
77+
"@babel/preset-react": "^7.27.1"
6978
}
7079
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"predefinedQA": {
3+
"What is Metabolights?": {
4+
"answer": "<div>MetaboLights is an open access repository for metabolomics studies, including raw experimental data and associated metadata.</div>\n<div>To know more:</div>\n<ol>\n <li class='vf-list__item'>\n <a href='#'>Methods and resources for omics studies</a>: A curated collection of EMBL-EBI on-demand training.\n </li>\n <li class='vf-list__item'>\n <a href='#'>MetaboLights</a>: Quick tour.\n </li>\n <li class='vf-list__item'>\n <a href='#'>Chemical biology</a>: A curated set of EMBL-EBI online courses.\n </li>\n</ol>"
5+
},
6+
"Learn how to apply bioinformatics tools in your academic work": {
7+
"answer": "Our Tools and Services portal provides access to commonly used resources in genomics, proteomics, and more. We also offer tutorials and use cases to guide integration into your academic projects."
8+
},
9+
"Start a guided learning path in bioinformatics": {
10+
"answer": "Great! You can begin with our structured courses and learning paths designed for beginners at the EMBL-EBI Training Portal. Perfect for students and early-stage researchers.",
11+
"sources": [
12+
{
13+
"domain": "ebi.ac.uk",
14+
"title": "EMBL-EBI Training",
15+
"url": "https://www.ebi.ac.uk/training/",
16+
"description": "Delivering world-class training in data-driven life sciences."
17+
}
18+
]
19+
},
20+
"Find resources and tools for structural biology analysis": {
21+
"answer": "Discover tools for structural biology, including protein modeling, domain analysis, and sequence alignment. Visit our Tools & Services portal to access popular resources.",
22+
"sources": [
23+
{
24+
"domain": "github.com",
25+
"title": "Structural Biology",
26+
"url": "https://github.com/pengzhangzhi/Awesome-Computational-Structural-Biology?utm_source=chatgpt.com",
27+
"description": "Awesome Computational Structural Biology (GitHub) – curated list of tools, tutorials, and courses"
28+
},
29+
{
30+
"domain": "hwi.buffalo.edu",
31+
"title": "Structural Biology Resource Page",
32+
"url": "https://hwi.buffalo.edu/structural-biology-resources/?utm_source=chatgpt.com",
33+
"description": "Structural Biology Resource Page – links to cryo-EM, crystallography, and X-ray data collection info from Hauptman-Woodward Institute"
34+
},
35+
{
36+
"domain": "www.creative-biostructure.com",
37+
"title": "Structural Biology Tools",
38+
"url": "https://www.creative-biostructure.com/structural-biology-tools.htm?srsltid=AfmBOooqvJ0ksY6p6Pryq1diKVWPxNK0t68zKnuyMuTB0_k1IABozOXO&utm_source=chatgpt.com",
39+
"description": "Creative Biostructure – lists structural resources and software across core techniques like crystallography and cryo-EM"
40+
}
41+
]
42+
},
43+
"How can I submit genomic data to EMBL-EBI?": {
44+
"answer": "To submit genomic data, visit the EMBL-EBI submission portal, where you’ll find step-by-step guides and tools for submitting sequencing data, assemblies, annotations, and more.",
45+
"sources": [
46+
{
47+
"domain": "ebi.ac.uk",
48+
"title": "EMBL's European Bioinformatics Institute",
49+
"url": "https://www.ebi.ac.uk/",
50+
"description": "Run BLAST searches against comprehensive sequence databases at EMBL-EBI."
51+
},
52+
{
53+
"domain": "ena-docs.readthedocs.io",
54+
"title": "ENA Documentation",
55+
"url": "https://ena-docs.readthedocs.io/en/latest/",
56+
"description": "ENA Documentation"
57+
}
58+
]
59+
},
60+
"Access documentation and developer tools": {
61+
"answer": "Explore the databse, where you can find model predictions, usage documentation, API access, and links to related publications. Developers can also access integration guides through the EMBL-EBI API Hub.",
62+
"sources": [
63+
{
64+
"domain": "ebi.ac.uk",
65+
"title": "EMBL-EBI APIs and Tools",
66+
"url": "https://www.ebi.ac.uk/services",
67+
"description": "Browse services by domain (genomics, proteomics, etc.) and access APIs."
68+
},
69+
{
70+
"domain": "ebi.ac.uk",
71+
"title": "EMBL-EBI API Documentation",
72+
"url": "https://www.ebi.ac.uk/about/api",
73+
"description": "RESTful APIs for tools like BLAST, InterProScan, Clustal Omega, etc."
74+
}
75+
]
76+
},
77+
"Discover upcoming bioinformatics workshops for beginners": {
78+
"answer": "Start your learning journey with our Training Events Calendar, featuring upcoming live webinars, virtual workshops, and in-person courses. Many sessions are designed for beginners and cover topics like genomics, data standards, and tool usage."
79+
}
80+
},
81+
"fallbackResponses": [
82+
{
83+
"answer": "I'm sorry, I'm having trouble connecting to my knowledge base right now. Could you try again in a moment?",
84+
"prompts": [
85+
{
86+
"action_text": "Contact support team",
87+
"action_url": "tel:+44 1223 494 444"
88+
},
89+
{
90+
"action_text": "Submit a support request",
91+
"action_url": "https://www.ebi.ac.uk/about/contact/support/"
92+
}
93+
]
94+
}
95+
]
96+
}

0 commit comments

Comments
 (0)