@netlify/spark-ui 1.12.0-alpha.0 → 1.12.0-alpha.1
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/dist/assets/AskNetlify.css +1 -1
- package/dist/assets/SearchLink.css +1 -1
- package/dist/assets/SearchModal.css +1 -1
- package/dist/chunks/{ChatInterface.EQAPs01R.js → AskNetlify.lrswYyKn.js} +119 -110
- package/dist/components/preact/AskNetlify/AskNetlify.d.ts +3 -3
- package/dist/components/preact/AskNetlify/AskNetlify.js +8 -34
- package/dist/components/preact/AskNetlify/components/ChatMessages.d.ts +2 -1
- package/dist/components/preact/AskNetlify/components/ChatMessages.js +25 -21
- package/dist/components/preact/AskNetlify/components/SourcesList.js +17 -13
- package/dist/components/preact/AskNetlify/hooks/useAskAnalytics.d.ts +23 -0
- package/dist/components/preact/AskNetlify/hooks/useAskAnalytics.js +22 -0
- package/dist/components/preact/Icon/index.js +6 -6
- package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.d.ts +1 -1
- package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.js +23 -22
- package/dist/components/preact/SearchModal/components/SearchLinkThemeToggle.d.ts +1 -0
- package/dist/components/preact/SearchModal/components/SearchLinkThemeToggle.js +26 -0
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +89 -84
- package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -1
- package/dist/components/preact/SearchModal/components/SearchWindow.js +55 -48
- package/dist/components/preact/SearchModal/hooks/index.d.ts +1 -1
- package/dist/components/preact/SearchModal/hooks/index.js +8 -8
- package/dist/components/preact/SearchModal/hooks/useKeyboardNav.d.ts +1 -1
- package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +11 -12
- package/dist/components/preact/SearchModal/hooks/useSearch.js +19 -19
- package/dist/components/preact/SearchModal/hooks/{useSearchLogger.d.ts → useSearchAnalytics.d.ts} +2 -2
- package/dist/components/preact/SearchModal/hooks/{useSearchLogger.js → useSearchAnalytics.js} +5 -5
- package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.d.ts +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.js +8 -9
- package/dist/components/preact/SearchModal/hooks/useSearchParams.d.ts +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchParams.js +14 -7
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.d.ts +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +7 -8
- package/dist/components/preact/SearchModal/types/search.types.d.ts +11 -4
- package/dist/components/preact/index.js +3 -3
- package/package.json +1 -1
- package/packages/components/preact/AskNetlify/AskNetlify.css +41 -1
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +98 -34
- package/packages/components/preact/AskNetlify/components/ChatMessages.tsx +9 -7
- package/packages/components/preact/AskNetlify/components/SourcesList.tsx +24 -16
- package/packages/components/preact/AskNetlify/hooks/useAskAnalytics.tsx +50 -0
- package/packages/components/preact/Icon/index.tsx +2 -2
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +5 -0
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.tsx +6 -4
- package/packages/components/preact/SearchModal/components/SearchLinkThemeToggle.tsx +19 -0
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +22 -3
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +73 -89
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +64 -46
- package/packages/components/preact/SearchModal/hooks/index.ts +1 -1
- package/packages/components/preact/SearchModal/hooks/useKeyboardNav.ts +1 -3
- package/packages/components/preact/SearchModal/hooks/useSearch.ts +20 -16
- package/packages/components/preact/SearchModal/hooks/{useSearchLogger.ts → useSearchAnalytics.ts} +9 -10
- package/packages/components/preact/SearchModal/hooks/useSearchHotkeys.ts +2 -4
- package/packages/components/preact/SearchModal/hooks/useSearchParams.ts +24 -2
- package/packages/components/preact/SearchModal/hooks/useSearchToggles.ts +1 -3
- package/packages/components/preact/SearchModal/types/search.types.tsx +7 -4
- package/packages/styles/loaders.css +18 -0
- package/packages/styles/tokens.css +4 -0
- package/dist/components/preact/AskNetlify/components/ChatInterface.d.ts +0 -7
- package/dist/components/preact/AskNetlify/components/ChatInterface.js +0 -10
- package/packages/components/preact/AskNetlify/components/ChatInterface.tsx +0 -94
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface
|
|
2
|
-
kapaIntegrationId?: string;
|
|
1
|
+
interface Props {
|
|
3
2
|
setModalState?: (e: {
|
|
4
3
|
current: string;
|
|
5
4
|
}) => void;
|
|
5
|
+
initialQuery?: string;
|
|
6
6
|
}
|
|
7
|
-
export default function AskNetlify(
|
|
7
|
+
export default function AskNetlify({ setModalState, initialQuery }: Props): import("preact").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
9
|
-
a,
|
|
10
|
-
{
|
|
11
|
-
integrationId: n.kapaIntegrationId,
|
|
12
|
-
callbacks: {
|
|
13
|
-
askAI: {
|
|
14
|
-
onQuerySubmit: (e) => {
|
|
15
|
-
var t;
|
|
16
|
-
!e.question || !e.threadId || (t = r == null ? void 0 : r.current) == null || t.track("ask:new_query", {
|
|
17
|
-
question: e.question,
|
|
18
|
-
thread_id: e.threadId
|
|
19
|
-
});
|
|
20
|
-
},
|
|
21
|
-
onAnswerGenerationCompleted: (e) => {
|
|
22
|
-
var t;
|
|
23
|
-
!e.questionAnswerId || !e.answer || (t = r == null ? void 0 : r.current) == null || t.track("ask:answer_generated", {
|
|
24
|
-
question_id: e.questionAnswerId,
|
|
25
|
-
answer_length: e.answer.length
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
children: /* @__PURE__ */ o(s, { setModalState: n.setModalState })
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
1
|
+
import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import "../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
+
import { A as f } from "../../../chunks/AskNetlify.lrswYyKn.js";
|
|
4
|
+
import "./components/QuestionList/questions.js";
|
|
5
|
+
import "./components/QuestionList/QuestionList.js";
|
|
6
|
+
import "./components/BackButton.js";
|
|
7
|
+
import "./components/ChatMessages.js";
|
|
34
8
|
export {
|
|
35
|
-
|
|
9
|
+
f as default
|
|
36
10
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'preact';
|
|
2
|
-
export declare function ChatMessages({ conversation, lastMessageRef, }: {
|
|
2
|
+
export declare function ChatMessages({ conversation, lastMessageRef, isPreparingAnswer, }: {
|
|
3
3
|
conversation: any[];
|
|
4
4
|
lastMessageRef: Ref<HTMLDivElement>;
|
|
5
|
+
isPreparingAnswer: boolean;
|
|
5
6
|
}): import("preact").JSX.Element;
|
|
@@ -1567,31 +1567,35 @@ $.parse;
|
|
|
1567
1567
|
S.lex;
|
|
1568
1568
|
function ut({
|
|
1569
1569
|
conversation: n,
|
|
1570
|
-
lastMessageRef: e
|
|
1570
|
+
lastMessageRef: e,
|
|
1571
|
+
isPreparingAnswer: t
|
|
1571
1572
|
}) {
|
|
1572
|
-
return /* @__PURE__ */ w(Re, { children:
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
/* @__PURE__ */ w("div", { class: "n-ask-message
|
|
1576
|
-
"div",
|
|
1577
|
-
{
|
|
1578
|
-
ref: s ? e : null,
|
|
1579
|
-
class: "n-ask-message-bubble n-ask-user-message",
|
|
1580
|
-
children: /* @__PURE__ */ w("p", { children: t.question })
|
|
1581
|
-
}
|
|
1582
|
-
) }),
|
|
1583
|
-
/* @__PURE__ */ w("div", { class: "n-ask-message-left", children: t.answer ? /* @__PURE__ */ w("div", { class: "n-ask-message-bubble n-ask-bot-message", children: [
|
|
1584
|
-
/* @__PURE__ */ w(
|
|
1573
|
+
return /* @__PURE__ */ w(Re, { children: [
|
|
1574
|
+
n.map((r, s) => {
|
|
1575
|
+
const i = s === n.length - 1;
|
|
1576
|
+
return /* @__PURE__ */ w("div", { class: "n-ask-message", children: [
|
|
1577
|
+
/* @__PURE__ */ w("div", { class: "n-ask-message-right", children: /* @__PURE__ */ w(
|
|
1585
1578
|
"div",
|
|
1586
1579
|
{
|
|
1587
|
-
|
|
1588
|
-
|
|
1580
|
+
ref: i ? e : null,
|
|
1581
|
+
class: "n-ask-message-bubble n-ask-user-message",
|
|
1582
|
+
children: /* @__PURE__ */ w("p", { children: r.question })
|
|
1589
1583
|
}
|
|
1590
|
-
),
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1584
|
+
) }),
|
|
1585
|
+
/* @__PURE__ */ w("div", { class: "n-ask-message-left", children: r.answer && /* @__PURE__ */ w("div", { class: "n-ask-message-bubble n-ask-bot-message", children: [
|
|
1586
|
+
/* @__PURE__ */ w(
|
|
1587
|
+
"div",
|
|
1588
|
+
{
|
|
1589
|
+
class: "n-ask-message-answer n-ask-prose prose flow",
|
|
1590
|
+
dangerouslySetInnerHTML: { __html: f.parse(r.answer) }
|
|
1591
|
+
}
|
|
1592
|
+
),
|
|
1593
|
+
r.id && /* @__PURE__ */ w($e, { sources: r.sources })
|
|
1594
|
+
] }) })
|
|
1595
|
+
] }, r.id || `qa-${s}`);
|
|
1596
|
+
}),
|
|
1597
|
+
t && /* @__PURE__ */ w("div", { class: "n-ask-message-loader", children: /* @__PURE__ */ w(Se, { name: "askNetlify" }) })
|
|
1598
|
+
] });
|
|
1595
1599
|
}
|
|
1596
1600
|
export {
|
|
1597
1601
|
ut as ChatMessages
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { u as t } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import i from "../../Icon/index.js";
|
|
3
|
+
function h({ sources: l }) {
|
|
4
|
+
return l != null && l.length ? /* @__PURE__ */ t("div", { className: "n-ask-sources", children: /* @__PURE__ */ t("details", { children: [
|
|
5
|
+
/* @__PURE__ */ t("summary", { children: [
|
|
6
|
+
/* @__PURE__ */ t("h4", { class: "n-ask-sources-title", children: "Sources:" }),
|
|
7
|
+
/* @__PURE__ */ t(i, { name: "caretRight" })
|
|
8
|
+
] }),
|
|
9
|
+
/* @__PURE__ */ t("ul", { children: l.map((e, r) => {
|
|
10
|
+
if (e.title)
|
|
11
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t("a", { href: e.source_url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
12
|
+
e.title,
|
|
13
|
+
e.subtitle && e.subtitle !== e.title && /* @__PURE__ */ t("span", { children: [
|
|
10
14
|
" - ",
|
|
11
|
-
|
|
15
|
+
e.subtitle
|
|
12
16
|
] })
|
|
13
|
-
] }) },
|
|
17
|
+
] }) }, r);
|
|
14
18
|
}) })
|
|
15
|
-
] }) : null;
|
|
19
|
+
] }) }) : null;
|
|
16
20
|
}
|
|
17
21
|
export {
|
|
18
|
-
|
|
22
|
+
h as SourcesList
|
|
19
23
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { QuerySubmitPayload, AnswerGenerationCompletedPayload } from '@kapaai/react-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that tracks analytics events related to Ask Netlify and pushes them to the Google Analytics 4 (GA4) data layer.
|
|
4
|
+
*
|
|
5
|
+
* This hook captures two key interaction events and pushes their payloads to the `dataLayer`, enabling tracking in GA4:
|
|
6
|
+
* - `ask:new_query`: Triggered when a user submits a new question. The payload includes the question text and a thread ID.
|
|
7
|
+
* - `ask:answer_generated`: Triggered when a generated answer is completed. The payload includes the question ID and the length of the answer.
|
|
8
|
+
*
|
|
9
|
+
* Internally, the hook uses an instance of the `Analytics` class to structure and dispatch events. All event payloads are pushed to `window.dataLayer` to be consumed by Google Tag Manager and GA4.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Object} - An object with the following functions:
|
|
12
|
+
* - `handleNewQuery`: Callback to be invoked when a user submits a new question. Sends a `ask:new_query` event with:
|
|
13
|
+
* - `question` (string): The user-submitted question.
|
|
14
|
+
* - `thread_id` (string): A unique identifier for the conversation thread.
|
|
15
|
+
* - `handleAnswer`: Callback to be invoked when a answer is returned. Sends a `ask:answer_generated` event with:
|
|
16
|
+
* - `question_id` (string): The ID linking the question to its answer.
|
|
17
|
+
* - `answer_length` (number): The character length of the generated answer.
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
export declare function useAskAnalytics(): {
|
|
21
|
+
handleNewQuery: (data: QuerySubmitPayload) => void;
|
|
22
|
+
handleAnswer: (data: AnswerGenerationCompletedPayload) => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A as o, q as n } from "../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
2
|
+
import { A as u } from "../../../../chunks/analytics.Ch1vuuOl.js";
|
|
3
|
+
function A() {
|
|
4
|
+
const r = o(new u()).current, s = n((e) => {
|
|
5
|
+
!e.question || !e.threadId || r == null || r.track("ask:new_query", {
|
|
6
|
+
question: e.question,
|
|
7
|
+
thread_id: e.threadId
|
|
8
|
+
});
|
|
9
|
+
}, []), t = n((e) => {
|
|
10
|
+
!e.questionAnswerId || !e.answer || r == null || r.track("ask:answer_generated", {
|
|
11
|
+
question_id: e.questionAnswerId,
|
|
12
|
+
answer_length: e.answer.length
|
|
13
|
+
});
|
|
14
|
+
}, []);
|
|
15
|
+
return {
|
|
16
|
+
handleNewQuery: s,
|
|
17
|
+
handleAnswer: t
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
A as useAskAnalytics
|
|
22
|
+
};
|
|
@@ -84,7 +84,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
84
84
|
y: "7.3",
|
|
85
85
|
width: "3",
|
|
86
86
|
height: "2",
|
|
87
|
-
fill: "var(--
|
|
87
|
+
fill: "var(--n-ask-netlify-eyelid-color, currentColor)"
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
/* @__PURE__ */ C(
|
|
@@ -95,7 +95,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
95
95
|
y: "7.3",
|
|
96
96
|
width: "3",
|
|
97
97
|
height: "2",
|
|
98
|
-
fill: "var(--
|
|
98
|
+
fill: "var(--n-ask-netlify-eyelid-color, currentColor)"
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
] }), n = () => /* @__PURE__ */ C(
|
|
@@ -157,7 +157,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
157
157
|
d: "M49.8875 0.137732C48.3 -0.349768 46.625 0.525232 46.1375 2.11273L28.1375 60.1127C27.65 61.7002 28.525 63.3752 30.1125 63.8627C31.7 64.3502 33.375 63.4752 33.8625 61.8877L51.8625 3.88773C52.35 2.30023 51.475 0.625232 49.8875 0.137732ZM58.8125 14.9502C57.675 16.1627 57.7375 18.0627 58.95 19.1877L72.6125 32.0002L58.95 44.8127C57.7375 45.9502 57.675 47.8502 58.8125 49.0502C59.95 50.2502 61.85 50.3252 63.05 49.1877L79.05 34.1877C79.65 33.6252 80 32.8252 80 32.0002C80 31.1752 79.6625 30.3752 79.05 29.8127L63.05 14.8127C61.8375 13.6752 59.9375 13.7377 58.8125 14.9502ZM21.1875 14.9502C20.05 13.7377 18.15 13.6752 16.95 14.8127L0.95 29.8127C0.3375 30.3752 0 31.1752 0 32.0002C0 32.8252 0.3375 33.6252 0.95 34.1877L16.95 49.1877C18.1625 50.3252 20.0625 50.2627 21.1875 49.0502C22.3125 47.8377 22.2625 45.9377 21.05 44.8127L7.3875 32.0002L21.05 19.1877C22.2625 18.0502 22.325 16.1502 21.1875 14.9502Z",
|
|
158
158
|
fill: "currentColor"
|
|
159
159
|
}
|
|
160
|
-
),
|
|
160
|
+
), f = () => /* @__PURE__ */ C(
|
|
161
161
|
"path",
|
|
162
162
|
{
|
|
163
163
|
d: "M4.83333 1C3.82214 1 3 1.78477 3 2.75V13.25C3 14.2152 3.82214 15 4.83333 15H12.1667C13.1779 15 14 14.2152 14 13.25V5.375H10.3333C9.8263 5.375 9.41667 4.98398 9.41667 4.5V1H4.83333ZM10.3333 1V4.5H14L10.3333 1ZM6.20833 8H10.7917C11.0438 8 11.25 8.19687 11.25 8.4375C11.25 8.67813 11.0438 8.875 10.7917 8.875H6.20833C5.95625 8.875 5.75 8.67813 5.75 8.4375C5.75 8.19687 5.95625 8 6.20833 8ZM6.20833 9.75H10.7917C11.0438 9.75 11.25 9.94687 11.25 10.1875C11.25 10.4281 11.0438 10.625 10.7917 10.625H6.20833C5.95625 10.625 5.75 10.4281 5.75 10.1875C5.75 9.94687 5.95625 9.75 6.20833 9.75ZM6.20833 11.5H10.7917C11.0438 11.5 11.25 11.6969 11.25 11.9375C11.25 12.1781 11.0438 12.375 10.7917 12.375H6.20833C5.95625 12.375 5.75 12.1781 5.75 11.9375C5.75 11.6969 5.95625 11.5 6.20833 11.5Z",
|
|
@@ -177,7 +177,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
177
177
|
d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.48998 7.58293C7.24532 7.9418 7.1073 8.36489 7.09243 8.80158L7.09232 9.00062C7.09232 9.21263 7.17498 9.41595 7.32211 9.56587C7.46924 9.71578 7.6688 9.8 7.87688 9.8C8.08495 9.8 8.28451 9.71578 8.43164 9.56587C8.57878 9.41595 8.66143 9.21263 8.66143 9.00062V8.8172C8.67459 8.68789 8.72283 8.56481 8.80083 8.46179C8.82284 8.43271 8.87624 8.39281 8.96482 8.34893C9.04677 8.30834 9.13665 8.27475 9.21483 8.24583L9.2194 8.24414L9.22961 8.24053L9.23662 8.2376C9.7635 8.01739 10.1981 7.61624 10.4651 7.10372C10.7321 6.5912 10.8149 5.99957 10.6987 5.43153L10.6962 5.42197C10.5641 4.91215 10.2876 4.45323 9.90133 4.10235C9.51593 3.7523 9.03819 3.52522 8.52737 3.44924C8.1077 3.37054 7.67619 3.38633 7.26312 3.49553C6.849 3.605 6.46349 3.80568 6.13376 4.08342C5.58181 4.54443 5.25866 5.23048 5.25 5.95706V5.95934C5.25 6.17135 5.33266 6.37468 5.47979 6.52459C5.62692 6.6745 5.82648 6.75872 6.03456 6.75872C6.24264 6.75872 6.44219 6.6745 6.58933 6.52459C6.73595 6.37519 6.81855 6.17275 6.81911 5.96153C6.82486 5.70702 6.94287 5.46722 7.13988 5.30865C7.29566 5.18188 7.47721 5.09021 7.67067 5.04112C7.86413 4.99203 8.06566 4.98632 8.26159 5.02383L8.2716 5.02518C8.47683 5.05273 8.67003 5.13962 8.82831 5.27556C8.98372 5.40903 9.09909 5.5843 9.16133 5.78128C9.23237 6.20988 8.99652 6.63061 8.59639 6.78484L8.59136 6.78696C8.22065 6.94277 7.74615 7.20718 7.48998 7.58293ZM7.87406 12.6C8.42636 12.6 8.8741 12.1523 8.8741 11.6C8.8741 11.0477 8.42636 10.6 7.87406 10.6C7.32175 10.6 6.87402 11.0477 6.87402 11.6C6.87402 12.1523 7.32175 12.6 7.87406 12.6Z",
|
|
178
178
|
fill: "currentColor"
|
|
179
179
|
}
|
|
180
|
-
),
|
|
180
|
+
), h = () => /* @__PURE__ */ C(
|
|
181
181
|
"path",
|
|
182
182
|
{
|
|
183
183
|
d: "M59.4286 0H4.55714C2.04286 0 0 2.07143 0 4.61429V59.3857C0 61.9286 2.04286 64 4.55714 64H59.4286C61.9429 64 64 61.9286 64 59.3857V4.61429C64 2.07143 61.9429 0 59.4286 0ZM19.3429 54.8571H9.85714V24.3143H19.3571V54.8571H19.3429ZM14.6 20.1429C11.5571 20.1429 9.1 17.6714 9.1 14.6429C9.1 11.6143 11.5571 9.14286 14.6 9.14286C17.6286 9.14286 20.1 11.6143 20.1 14.6429C20.1 17.6857 17.6429 20.1429 14.6 20.1429ZM54.9 54.8571H45.4143V40C45.4143 36.4571 45.3429 31.9 40.4857 31.9C35.5429 31.9 34.7857 35.7571 34.7857 39.7429V54.8571H25.3V24.3143H34.4V28.4857H34.5286C35.8 26.0857 38.9 23.5571 43.5143 23.5571C53.1143 23.5571 54.9 29.8857 54.9 38.1143V54.8571Z",
|
|
@@ -209,13 +209,13 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
209
209
|
comment: c,
|
|
210
210
|
link: d,
|
|
211
211
|
lightbulb: u,
|
|
212
|
-
pageWithLines:
|
|
212
|
+
pageWithLines: f,
|
|
213
213
|
rss: i,
|
|
214
214
|
search: n,
|
|
215
215
|
terminal: M,
|
|
216
216
|
question: Z,
|
|
217
217
|
bluesky: s,
|
|
218
|
-
linkedin:
|
|
218
|
+
linkedin: h,
|
|
219
219
|
twitter: H,
|
|
220
220
|
youtube: p
|
|
221
221
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SearchLinkProps } from '../../types/search.types';
|
|
2
|
-
declare const SearchLink: ({ as: Component, icon, label, url, excerpt, resource, onClick, }: SearchLinkProps) => import("preact").JSX.Element;
|
|
2
|
+
declare const SearchLink: ({ as: Component, icon, label, url, excerpt, resource, onClick, children, }: SearchLinkProps) => import("preact").JSX.Element;
|
|
3
3
|
export default SearchLink;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { u as a } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import "../../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import '../../../../../assets/SearchLink.css';const
|
|
6
|
-
as:
|
|
7
|
-
icon:
|
|
8
|
-
label:
|
|
9
|
-
url:
|
|
10
|
-
excerpt:
|
|
11
|
-
resource:
|
|
12
|
-
onClick:
|
|
3
|
+
import { useSearchAnalytics as k } from "../../hooks/useSearchAnalytics.js";
|
|
4
|
+
import i from "../../../Icon/index.js";
|
|
5
|
+
import '../../../../../assets/SearchLink.css';const u = ({
|
|
6
|
+
as: h = "a",
|
|
7
|
+
icon: e,
|
|
8
|
+
label: s,
|
|
9
|
+
url: m,
|
|
10
|
+
excerpt: c,
|
|
11
|
+
resource: n,
|
|
12
|
+
onClick: l,
|
|
13
|
+
children: r
|
|
13
14
|
}) => {
|
|
14
|
-
const { handleClick:
|
|
15
|
+
const { handleClick: t } = k();
|
|
15
16
|
return /* @__PURE__ */ a(
|
|
16
|
-
|
|
17
|
+
h,
|
|
17
18
|
{
|
|
18
19
|
className: "n-search-link",
|
|
19
|
-
href:
|
|
20
|
-
onClick: (
|
|
21
|
-
|
|
20
|
+
href: m,
|
|
21
|
+
onClick: (d) => {
|
|
22
|
+
l && l(), t(d);
|
|
22
23
|
},
|
|
23
24
|
children: [
|
|
24
|
-
|
|
25
|
+
e && /* @__PURE__ */ a("span", { className: "n-search-link-icon", children: /* @__PURE__ */ a(i, { name: e }) }),
|
|
25
26
|
/* @__PURE__ */ a("div", { className: "n-search-link-body", children: [
|
|
26
27
|
/* @__PURE__ */ a("p", { className: "n-search-link-title", children: [
|
|
27
|
-
/* @__PURE__ */ a("span", { className: "n-search-link-label", children:
|
|
28
|
-
" ",
|
|
29
|
-
|
|
28
|
+
s && /* @__PURE__ */ a("span", { className: "n-search-link-label", children: s }),
|
|
29
|
+
r && /* @__PURE__ */ a("span", { className: "n-search-link-label", children: r }),
|
|
30
|
+
n && /* @__PURE__ */ a("span", { className: "n-search-link-badge", "data-resource": n, children: n })
|
|
30
31
|
] }),
|
|
31
|
-
|
|
32
|
+
c && /* @__PURE__ */ a("p", { className: "n-search-link-excerpt", dangerouslySetInnerHTML: { __html: c } })
|
|
32
33
|
] }),
|
|
33
|
-
/* @__PURE__ */ a("div", { className: "n-search-link-icon", children: /* @__PURE__ */ a(
|
|
34
|
+
/* @__PURE__ */ a("div", { className: "n-search-link-icon", children: /* @__PURE__ */ a(i, { name: "caretRight" }) })
|
|
34
35
|
]
|
|
35
36
|
}
|
|
36
37
|
);
|
|
37
38
|
};
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
u as default
|
|
40
41
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SearchLinkThemeToggle(): import("preact").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { u as n } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import o from "./SearchLink/SearchLink.js";
|
|
3
|
+
const c = {
|
|
4
|
+
light: "dark",
|
|
5
|
+
dark: "light"
|
|
6
|
+
}, h = (e) => {
|
|
7
|
+
const t = document.getElementById("site-theme-select");
|
|
8
|
+
t && (t.value = e), document.documentElement.setAttribute("data-theme", e), localStorage.setItem("theme", e);
|
|
9
|
+
};
|
|
10
|
+
function l() {
|
|
11
|
+
return /* @__PURE__ */ n(
|
|
12
|
+
o,
|
|
13
|
+
{
|
|
14
|
+
as: "button",
|
|
15
|
+
icon: "lightbulb",
|
|
16
|
+
label: "Toggle theme",
|
|
17
|
+
onClick: () => {
|
|
18
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)").matches, t = document.documentElement.getAttribute("data-theme"), m = e ? "dark" : t || "light";
|
|
19
|
+
m && h(c[m]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
l as default
|
|
26
|
+
};
|
|
@@ -1,99 +1,104 @@
|
|
|
1
1
|
import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import b from "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { A as g, y as h, d as y } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
+
import { A as b, K as w } from "../../../../../chunks/AskNetlify.lrswYyKn.js";
|
|
4
|
+
import K from "../../../Modal/Modal.js";
|
|
5
|
+
import d from "../../../KeyboardKey/KeyboardKey.js";
|
|
6
|
+
import L from "../SearchWindow.js";
|
|
7
|
+
import C from "../SearchInput.js";
|
|
7
8
|
import M from "../SearchLink/SearchLink.js";
|
|
8
9
|
import { useSearch as O } from "../../hooks/useSearch.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useKeyboardNav as
|
|
11
|
-
import { useSearchHotkeys as
|
|
12
|
-
import { useSearchParams as
|
|
13
|
-
import { useSearchToggles as
|
|
14
|
-
import R from "../../../AskNetlify/
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import '../../../../../assets/SearchModal.css';function q(
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
function
|
|
20
|
-
|
|
10
|
+
import { useSearchAnalytics as E } from "../../hooks/useSearchAnalytics.js";
|
|
11
|
+
import { useKeyboardNav as Q } from "../../hooks/useKeyboardNav.js";
|
|
12
|
+
import { useSearchHotkeys as x } from "../../hooks/useSearchHotkeys.js";
|
|
13
|
+
import { useSearchParams as G } from "../../hooks/useSearchParams.js";
|
|
14
|
+
import { useSearchToggles as P } from "../../hooks/useSearchToggles.js";
|
|
15
|
+
import { useAskAnalytics as R } from "../../../AskNetlify/hooks/useAskAnalytics.js";
|
|
16
|
+
import { Fragment as N } from "preact";
|
|
17
|
+
import '../../../../../assets/SearchModal.css';function q(r) {
|
|
18
|
+
const n = g(null);
|
|
19
|
+
return h(() => {
|
|
20
|
+
function o(m) {
|
|
21
|
+
n.current && !n.current.contains(m.target) && r();
|
|
21
22
|
}
|
|
22
|
-
return document.addEventListener("mousedown",
|
|
23
|
-
document.removeEventListener("mousedown",
|
|
23
|
+
return document.addEventListener("mousedown", o), () => {
|
|
24
|
+
document.removeEventListener("mousedown", o);
|
|
24
25
|
};
|
|
25
|
-
}, [
|
|
26
|
+
}, [r]), n;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, [l]), m(() => {
|
|
40
|
-
var c;
|
|
41
|
-
const n = (c = a.current) == null ? void 0 : c.querySelector("input");
|
|
42
|
-
n && n.focus(), t.current === "ask" ? setTimeout(() => {
|
|
43
|
-
a.current.classList.add("n-search-modal-ask");
|
|
44
|
-
}, 150) : t.current === "search" && setTimeout(() => {
|
|
45
|
-
a.current.classList.remove("n-search-modal-ask");
|
|
46
|
-
}, 150);
|
|
47
|
-
}, [t.current]), /* @__PURE__ */ e(
|
|
48
|
-
b,
|
|
28
|
+
function re(r = { className: "", children: void 0, debug: !1, kapaIntegrationId: void 0 }) {
|
|
29
|
+
const { children: n, className: o, debug: m, ...A } = r, [s, c] = y({ current: "search" }), [i, f] = y(!1), l = () => f(!0), u = () => f(!1), t = g(null), v = q(u), { state: a, actions: p } = O();
|
|
30
|
+
P(l, c), G(p.setSearchTerm, l), x(i, l, u), Q(t, i, u), E(a, m);
|
|
31
|
+
const { handleNewQuery: I, handleAnswer: T } = R();
|
|
32
|
+
return h(() => {
|
|
33
|
+
t.current && (i ? t.current.showModal() : t.current.close());
|
|
34
|
+
}, [i]), h(() => {
|
|
35
|
+
var k;
|
|
36
|
+
const S = (k = t.current) == null ? void 0 : k.querySelector("input");
|
|
37
|
+
S && S.focus();
|
|
38
|
+
}, [s.current]), /* @__PURE__ */ e(
|
|
39
|
+
w,
|
|
49
40
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
integrationId: r.kapaIntegrationId || "",
|
|
42
|
+
callbacks: {
|
|
43
|
+
askAI: {
|
|
44
|
+
onQuerySubmit: I,
|
|
45
|
+
onAnswerGenerationCompleted: T
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
children: /* @__PURE__ */ e(
|
|
49
|
+
K,
|
|
50
|
+
{
|
|
51
|
+
ref: t,
|
|
52
|
+
className: `n-search-modal ${o || ""}`,
|
|
53
|
+
"data-state": s.current,
|
|
54
|
+
...A,
|
|
55
|
+
children: /* @__PURE__ */ e("div", { ref: v, className: "n-search-container", children: [
|
|
56
|
+
s.current === "ask" && /* @__PURE__ */ e(b, { setModalState: c, initialQuery: a.searchTerm }),
|
|
57
|
+
s.current === "search" && /* @__PURE__ */ e(N, { children: [
|
|
58
|
+
/* @__PURE__ */ e(C, { setSearchTerm: p.setSearchTerm, initialValue: a.searchTerm }),
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
L,
|
|
61
|
+
{
|
|
62
|
+
setModalState: c,
|
|
63
|
+
searchLoading: a.isLoading,
|
|
64
|
+
searchTerm: a.searchTerm,
|
|
65
|
+
results: a.results,
|
|
66
|
+
children: /* @__PURE__ */ e(N, { children: [
|
|
67
|
+
r.kapaIntegrationId && /* @__PURE__ */ e(
|
|
68
|
+
M,
|
|
69
|
+
{
|
|
70
|
+
as: "button",
|
|
71
|
+
icon: "askNetlify",
|
|
72
|
+
label: "Ask Netlify",
|
|
73
|
+
excerpt: "Get an instant AI-generated answer",
|
|
74
|
+
onClick: () => {
|
|
75
|
+
c({ current: "ask" });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
n
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ e("div", { className: "n-search-footer", children: [
|
|
84
|
+
/* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
|
|
85
|
+
/* @__PURE__ */ e(d, { keyNames: ["Esc"] }),
|
|
86
|
+
"to close"
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
|
|
89
|
+
/* @__PURE__ */ e(d, { keyNames: ["Tab"] }),
|
|
90
|
+
/* @__PURE__ */ e("span", { children: "or" }),
|
|
91
|
+
/* @__PURE__ */ e(d, { keyNames: ["↑", "↓"] }),
|
|
92
|
+
"to navigate"
|
|
93
|
+
] })
|
|
77
94
|
] })
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ e("div", { className: "n-search-footer", children: [
|
|
81
|
-
/* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
|
|
82
|
-
/* @__PURE__ */ e(p, { keyNames: ["Esc"] }),
|
|
83
|
-
"to close"
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
|
|
86
|
-
/* @__PURE__ */ e(p, { keyNames: ["Tab"] }),
|
|
87
|
-
/* @__PURE__ */ e("span", { children: "or" }),
|
|
88
|
-
/* @__PURE__ */ e(p, { keyNames: ["↑", "↓"] }),
|
|
89
|
-
"to navigate"
|
|
90
95
|
] })
|
|
91
96
|
] })
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
}
|
|
98
|
+
)
|
|
94
99
|
}
|
|
95
100
|
);
|
|
96
101
|
}
|
|
97
102
|
export {
|
|
98
|
-
|
|
103
|
+
re as default
|
|
99
104
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SearchWindowProps } from '../types/search.types';
|
|
2
|
-
export default function SearchWindow({ searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps): import("preact").JSX.Element;
|
|
2
|
+
export default function SearchWindow({ setModalState, searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps): import("preact").JSX.Element;
|