@netlify/spark-ui 1.5.0-alpha.8 → 1.5.0-alpha.9
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.
|
@@ -5689,17 +5689,13 @@ function Sl(e) {
|
|
|
5689
5689
|
function fl({ setModalState: e }) {
|
|
5690
5690
|
const [t, a] = ct(""), { conversation: i, submitQuery: n, isGeneratingAnswer: r, isPreparingAnswer: l, stopGeneration: o } = gl(), u = Se(null), s = {
|
|
5691
5691
|
"e477f4dd-7159-4c31-8a18-4dfc7e84d927": "How does Netlify simplify my CI/CD pipeline?",
|
|
5692
|
+
"39229ddb-9000-4e83-bbf8-54f1c1e55ed4": "How can I use Netlify to improve my site’s Core Web Vitals?",
|
|
5692
5693
|
"5c41b3c2-4c90-4cf7-9f24-f0d0b8f0f759": "What are the benefits of using Netlify with a headless CMS?",
|
|
5693
|
-
"0270de6c-387e-401f-b24c-6ae1166db477": "What are the performance benefits of hosting on Netlify’s edge network?"
|
|
5694
|
-
"39229ddb-9000-4e83-bbf8-54f1c1e55ed4": "How can I use Netlify to improve my site’s Core Web Vitals?"
|
|
5694
|
+
"0270de6c-387e-401f-b24c-6ae1166db477": "What are the performance benefits of hosting on Netlify’s edge network?"
|
|
5695
5695
|
}, c = (h) => {
|
|
5696
5696
|
h.preventDefault();
|
|
5697
5697
|
const d = h.target.getAttribute("data-id");
|
|
5698
|
-
|
|
5699
|
-
const f = s[d];
|
|
5700
|
-
f.trim() && n(f.trim()), a("");
|
|
5701
|
-
}
|
|
5702
|
-
t.trim() && (n(t.trim()), a(""));
|
|
5698
|
+
(d ? s[d] : t).trim() && (n(t.trim()), a(""));
|
|
5703
5699
|
};
|
|
5704
5700
|
return Oe(() => {
|
|
5705
5701
|
const h = u.current;
|
|
@@ -5725,7 +5721,7 @@ function fl({ setModalState: e }) {
|
|
|
5725
5721
|
}
|
|
5726
5722
|
),
|
|
5727
5723
|
/* @__PURE__ */ E("div", { ref: u, className: "conversation n-search-window", children: [
|
|
5728
|
-
!i.length && /* @__PURE__ */ E("ul", { class: "question-list", role: "list", children: Object.entries(
|
|
5724
|
+
!i.length && /* @__PURE__ */ E("ul", { class: "question-list", role: "list", children: Object.entries(QandAMap).map(([h, d]) => /* @__PURE__ */ E("li", { children: /* @__PURE__ */ E("button", { class: "question", onClick: c, "data-id": h, children: d }) })) }),
|
|
5729
5725
|
i.map((h, d) => /* @__PURE__ */ E("div", { className: "message", children: [
|
|
5730
5726
|
/* @__PURE__ */ E("div", { className: "message-right", children: /* @__PURE__ */ E("div", { className: "message-bubble user-message", children: /* @__PURE__ */ E("p", { children: h.question }) }) }),
|
|
5731
5727
|
/* @__PURE__ */ E("div", { className: "message-left", children: h.answer ? /* @__PURE__ */ E("div", { className: "message-bubble bot-message", children: /* @__PURE__ */ E(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/spark-ui",
|
|
3
3
|
"description": "Assets, design tokens, components, and utilities",
|
|
4
|
-
"version": "1.5.0-alpha.
|
|
4
|
+
"version": "1.5.0-alpha.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/preact/index.js",
|
|
7
7
|
"types": "dist/components/preact/index.d.ts",
|
|
@@ -31,30 +31,23 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
31
31
|
|
|
32
32
|
const chatRef = useRef(null);
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const questions = {
|
|
35
35
|
'e477f4dd-7159-4c31-8a18-4dfc7e84d927': 'How does Netlify simplify my CI/CD pipeline?',
|
|
36
|
+
'39229ddb-9000-4e83-bbf8-54f1c1e55ed4':
|
|
37
|
+
'How can I use Netlify to improve my site’s Core Web Vitals?',
|
|
36
38
|
'5c41b3c2-4c90-4cf7-9f24-f0d0b8f0f759':
|
|
37
39
|
'What are the benefits of using Netlify with a headless CMS?',
|
|
38
40
|
'0270de6c-387e-401f-b24c-6ae1166db477':
|
|
39
41
|
'What are the performance benefits of hosting on Netlify’s edge network?',
|
|
40
|
-
'39229ddb-9000-4e83-bbf8-54f1c1e55ed4':
|
|
41
|
-
'How can I use Netlify to improve my site’s Core Web Vitals?',
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const handleSubmit = e => {
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
if (id) {
|
|
50
|
-
const question = QandAMap[id];
|
|
51
|
-
if (question.trim()) {
|
|
52
|
-
submitQuery(question.trim());
|
|
53
|
-
}
|
|
54
|
-
setMessage('');
|
|
55
|
-
}
|
|
47
|
+
const questionId = e.target.getAttribute('data-id');
|
|
48
|
+
const question = questionId ? questions[questionId] : message;
|
|
56
49
|
|
|
57
|
-
if (
|
|
50
|
+
if (question.trim()) {
|
|
58
51
|
submitQuery(message.trim());
|
|
59
52
|
setMessage('');
|
|
60
53
|
}
|