@graphcommerce/magento-search 9.1.0-canary.34 → 9.1.0-canary.35

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.1.0-canary.35
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4b02607`](https://github.com/graphcommerce-org/graphcommerce/commit/4b02607b26dd45e33bba3fb73d36052757dc2dec) - Solve issue where seaches containing a `/` would not consider everything after the `/` as part of the search. ([@paales](https://github.com/paales))
8
+
9
+ - [`ec5b915`](https://github.com/graphcommerce-org/graphcommerce/commit/ec5b91559fb8e702ae3043c38a73c62c7724aefa) - Solve issue where the cursor would jump after the first result of the search page came in. ([@paales](https://github.com/paales))
10
+
3
11
  ## 9.1.0-canary.34
4
12
 
5
13
  ## 9.1.0-canary.33
@@ -26,9 +26,9 @@ export function useProductFiltersProSearchInput<
26
26
  const initial = useRef(true)
27
27
 
28
28
  useEffect(() => {
29
+ initial.current = false
29
30
  // When page initially loads, fill in the search field with the search param.
30
31
  if (internalRef.current && initial.current && searchParam) {
31
- initial.current = false
32
32
  internalRef.current.selectionStart = searchParam.length
33
33
  internalRef.current.selectionEnd = searchParam.length
34
34
  return
@@ -50,7 +50,7 @@ export function useProductFiltersProSearchInput<
50
50
  if (e.key === 'Enter') {
51
51
  const context = globalFormContextRef.current
52
52
  if (!context || !searchPage) {
53
- return router.push(`/search/${e.currentTarget.value}`)
53
+ return router.push(`/search/${encodeURIComponent(e.currentTarget.value)}`)
54
54
  }
55
55
  context.form.setValue('currentPage', 1)
56
56
  context.form.setValue('search', e.currentTarget.value)
@@ -64,7 +64,7 @@ export function useProductFiltersProSearchInput<
64
64
  // When we're not on the search page, we want to navigate as soon as possible.
65
65
  // TODO: We only want to navigate once, and let the rest be handled by the search page.
66
66
  if (!context || !searchPage) {
67
- return router.push(`/search/${e.target.value}`)
67
+ return router.push(`/search/${encodeURIComponent(e.target.value)}`)
68
68
  }
69
69
 
70
70
  context.form.setValue('currentPage', 1)
@@ -6,7 +6,7 @@ export function useSearchPageAndParam() {
6
6
 
7
7
  const path = router.asPath.startsWith('/c/') ? router.asPath.slice(3) : router.asPath.slice(1)
8
8
  const [url] = extractUrlQuery({ url: path.split('#')[0].split('/') })
9
- const searchParam = url?.startsWith('search') ? decodeURI(url.split('/')[1] ?? '') : null
9
+ const searchParam = url?.startsWith('search') ? decodeURIComponent(url.split('/')[1] ?? '') : null
10
10
  const searchPage = router.asPath.startsWith('/search')
11
11
  return [searchPage, searchParam] as const
12
12
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-search",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.34",
5
+ "version": "9.1.0-canary.35",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,17 +12,17 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.34",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.34",
17
- "@graphcommerce/framer-utils": "^9.1.0-canary.34",
18
- "@graphcommerce/graphql": "^9.1.0-canary.34",
19
- "@graphcommerce/image": "^9.1.0-canary.34",
20
- "@graphcommerce/magento-product": "^9.1.0-canary.34",
21
- "@graphcommerce/magento-store": "^9.1.0-canary.34",
22
- "@graphcommerce/next-ui": "^9.1.0-canary.34",
23
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.34",
24
- "@graphcommerce/react-hook-form": "^9.1.0-canary.34",
25
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.34",
15
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.35",
16
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.35",
17
+ "@graphcommerce/framer-utils": "^9.1.0-canary.35",
18
+ "@graphcommerce/graphql": "^9.1.0-canary.35",
19
+ "@graphcommerce/image": "^9.1.0-canary.35",
20
+ "@graphcommerce/magento-product": "^9.1.0-canary.35",
21
+ "@graphcommerce/magento-store": "^9.1.0-canary.35",
22
+ "@graphcommerce/next-ui": "^9.1.0-canary.35",
23
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.35",
24
+ "@graphcommerce/react-hook-form": "^9.1.0-canary.35",
25
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.35",
26
26
  "@lingui/core": "^4.2.1",
27
27
  "@lingui/macro": "^4.2.1",
28
28
  "@lingui/react": "^4.2.1",