@netlify/spark-ui 1.14.4 → 1.14.6
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/chunks/{AskNetlify.34ZT77N0.js → AskNetlify.xyk4QsqP.js} +222 -230
- package/dist/components/preact/AskNetlify/AskNetlify.js +1 -1
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchParams.js +18 -18
- package/dist/components/preact/index.js +1 -1
- package/package.json +1 -1
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +8 -24
- package/packages/components/preact/SearchModal/hooks/useSearchParams.ts +9 -6
- package/packages/styles/layout.css +10 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import "../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
-
import { A as d } from "../../../chunks/AskNetlify.
|
|
3
|
+
import { A as d } from "../../../chunks/AskNetlify.xyk4QsqP.js";
|
|
4
4
|
import "./components/QuestionList/questions.js";
|
|
5
5
|
import "./components/QuestionList/QuestionList.js";
|
|
6
6
|
import "./components/BackButton.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import { A as g, y as f, d } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
-
import { A as K, K as L } from "../../../../../chunks/AskNetlify.
|
|
3
|
+
import { A as K, K as L } from "../../../../../chunks/AskNetlify.xyk4QsqP.js";
|
|
4
4
|
import P from "../../../Modal/Modal.js";
|
|
5
5
|
import h from "../../../KeyboardKey/KeyboardKey.js";
|
|
6
6
|
import M from "../SearchWindow.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
const
|
|
7
|
-
window.pagefind && (
|
|
1
|
+
import { d as u, y as g } from "../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
2
|
+
function m(a, c, i, r) {
|
|
3
|
+
const [o, h] = u(!1);
|
|
4
|
+
g(() => {
|
|
5
|
+
let e;
|
|
6
|
+
const s = () => {
|
|
7
|
+
window.pagefind && (h(!0), e && clearInterval(e));
|
|
8
8
|
};
|
|
9
|
-
return
|
|
10
|
-
}, []),
|
|
11
|
-
if (typeof location > "u" ||
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
return s(), e = setInterval(s, 100), () => clearInterval(e);
|
|
10
|
+
}, []), g(() => {
|
|
11
|
+
if (typeof location > "u" || o) return;
|
|
12
|
+
const e = new URLSearchParams(location.search), s = e.has("ask"), n = e.get("msg") || e.get("message"), f = e.get("search"), t = new URL(location.href);
|
|
13
|
+
if (["ask", "msg", "message", "search"].forEach((d) => {
|
|
14
|
+
t.searchParams.delete(d);
|
|
15
|
+
}), window.history.replaceState({}, "", t), s || n) {
|
|
16
|
+
n && i(n), r == null || r({ current: "ask" }), a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
}, [
|
|
19
|
+
f && (c(f), a());
|
|
20
|
+
}, [o, a, r, c, i]);
|
|
21
21
|
}
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
m as useSearchParams
|
|
24
24
|
};
|
|
@@ -4,7 +4,7 @@ import { default as m } from "./Icon/index.js";
|
|
|
4
4
|
import { default as s } from "./SearchModal/components/SearchLink/SearchLink.js";
|
|
5
5
|
import { default as u } from "./SearchModal/components/SearchHeading/SearchHeading.js";
|
|
6
6
|
import { default as i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
|
|
7
|
-
import { A as S } from "../../chunks/AskNetlify.
|
|
7
|
+
import { A as S } from "../../chunks/AskNetlify.xyk4QsqP.js";
|
|
8
8
|
import "preact";
|
|
9
9
|
import "../../chunks/hooks.module.DGkdD5n9.js";
|
|
10
10
|
import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
|
package/package.json
CHANGED
|
@@ -51,35 +51,19 @@ export default function AskNetlify({ setModalState, searchQuery, urlParamQuery }
|
|
|
51
51
|
}
|
|
52
52
|
}, [newMessageReady]);
|
|
53
53
|
|
|
54
|
-
const [urlParamHandled, setUrlParamHandled] = useState(false);
|
|
55
|
-
|
|
56
54
|
useEffect(() => {
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (searchQuery) {
|
|
56
|
+
setMessage('');
|
|
57
|
+
submitQuery(searchQuery.trim());
|
|
58
|
+
setNewMessageReady(true);
|
|
61
59
|
}
|
|
62
|
-
}, [
|
|
60
|
+
}, [searchQuery, setMessage, setNewMessageReady]);
|
|
63
61
|
|
|
64
|
-
/**
|
|
65
|
-
* Populates and handles the input when a query is present.
|
|
66
|
-
*
|
|
67
|
-
* - If `urlParamQuery` exists, pre-fills the input and waits for user action.
|
|
68
|
-
* - If `searchQuery` exists, auto-submits the query.
|
|
69
|
-
*
|
|
70
|
-
* Focuses the input and marks the message as ready in both cases.
|
|
71
|
-
*/
|
|
72
62
|
useEffect(() => {
|
|
73
|
-
if (!searchQuery)
|
|
74
|
-
|
|
75
|
-
const trimmedQuery = searchQuery.trim();
|
|
76
|
-
|
|
77
|
-
if (searchQuery) {
|
|
78
|
-
submitQuery(trimmedQuery);
|
|
79
|
-
inputRef?.current?.focus();
|
|
80
|
-
setNewMessageReady(true);
|
|
63
|
+
if (!searchQuery && urlParamQuery) {
|
|
64
|
+
setMessage(urlParamQuery);
|
|
81
65
|
}
|
|
82
|
-
}, [
|
|
66
|
+
}, [urlParamQuery, searchQuery, setMessage]);
|
|
83
67
|
|
|
84
68
|
return (
|
|
85
69
|
<div className="n-ask-chat-container">
|
|
@@ -54,14 +54,17 @@ export function useSearchParams(
|
|
|
54
54
|
const msg = params.get('msg') || params.get('message');
|
|
55
55
|
const search = params.get('search');
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
57
|
+
// Remove params from window URL
|
|
58
|
+
const url = new URL(location.href);
|
|
59
|
+
['ask', 'msg', 'message', 'search'].forEach(param => {
|
|
60
|
+
url.searchParams.delete(param);
|
|
61
|
+
});
|
|
62
|
+
window.history.replaceState({}, '', url);
|
|
62
63
|
|
|
63
64
|
if (hasAsk || msg) {
|
|
64
|
-
|
|
65
|
+
msg && setUrlParamTerm(msg);
|
|
66
|
+
setModalState?.({ current: 'ask' });
|
|
67
|
+
onOpen();
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
67
70
|
|
|
@@ -29,6 +29,16 @@
|
|
|
29
29
|
grid-auto-rows: var(--n-grid-auto-rows, auto);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.n-flex-grid {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: var(--n-grid-gap, var(--space-m));
|
|
36
|
+
|
|
37
|
+
> * {
|
|
38
|
+
flex: 1 1 var(--n-grid-column-min-size);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
.n-stack {
|
|
33
43
|
display: grid;
|
|
34
44
|
grid-template-areas: 'stack';
|