@graphcommerce/algolia-search 6.2.0-canary.67 → 6.2.0-canary.69
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
|
# @graphcommerce/algolia-search
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.69
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.68
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- [#1990](https://github.com/graphcommerce-org/graphcommerce/pull/1990) [`0729105cd`](https://github.com/graphcommerce-org/graphcommerce/commit/0729105cdb84b9f73d1fda7dac7daf867f4e0b9b) - Add CategorySearchResults component that can be injected with a plugin instead of SearchForm, fix various styling issues with search ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.67
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.66
|
|
@@ -8,7 +8,7 @@ import { useHits, useSearchBox, UseSearchBoxProps } from 'react-instantsearch-ho
|
|
|
8
8
|
type SearchBoxProps = UseSearchBoxProps & SearchFormProps
|
|
9
9
|
|
|
10
10
|
export function SearchBox(props: SearchBoxProps) {
|
|
11
|
-
const { search, textFieldProps } = props
|
|
11
|
+
const { search, textFieldProps, sx = [] } = props
|
|
12
12
|
const searchInputElement = useRef<HTMLInputElement>(null)
|
|
13
13
|
|
|
14
14
|
const { refine } = useSearchBox()
|
|
@@ -52,7 +52,7 @@ export function SearchBox(props: SearchBoxProps) {
|
|
|
52
52
|
inputRef={searchInputElement}
|
|
53
53
|
onChange={debounceSearch}
|
|
54
54
|
fullWidth
|
|
55
|
-
sx={{ mt: 1, mb: 1 }}
|
|
55
|
+
sx={[{ mt: 1, mb: 1 }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
56
56
|
{...textFieldProps}
|
|
57
57
|
/>
|
|
58
58
|
)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/algolia-search",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.69",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,20 +12,20 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
16
|
-
"@graphcommerce/next-config": "^6.2.0-canary.
|
|
17
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
18
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.69",
|
|
16
|
+
"@graphcommerce/next-config": "^6.2.0-canary.69",
|
|
17
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.69",
|
|
18
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.69"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/graphql": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/ecommerce-ui": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/magento-search": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/next-config": "^6.2.0-canary.
|
|
25
|
-
"@graphcommerce/next-ui": "6.2.0-canary.
|
|
26
|
-
"@graphcommerce/magento-product": "6.2.0-canary.
|
|
27
|
-
"@graphcommerce/graphql-mesh": "6.2.0-canary.
|
|
28
|
-
"@graphcommerce/magento-store": "6.2.0-canary.
|
|
21
|
+
"@graphcommerce/graphql": "6.2.0-canary.69",
|
|
22
|
+
"@graphcommerce/ecommerce-ui": "6.2.0-canary.69",
|
|
23
|
+
"@graphcommerce/magento-search": "6.2.0-canary.69",
|
|
24
|
+
"@graphcommerce/next-config": "^6.2.0-canary.69",
|
|
25
|
+
"@graphcommerce/next-ui": "6.2.0-canary.69",
|
|
26
|
+
"@graphcommerce/magento-product": "6.2.0-canary.69",
|
|
27
|
+
"@graphcommerce/graphql-mesh": "6.2.0-canary.69",
|
|
28
|
+
"@graphcommerce/magento-store": "6.2.0-canary.69",
|
|
29
29
|
"algoliasearch": "^4.15.0",
|
|
30
30
|
"react-instantsearch-hooks-web": "^6.41.0"
|
|
31
31
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CategorySearchResult,
|
|
1
|
+
import { CategorySearchResult, CategorySearchResultsProps } from '@graphcommerce/magento-search'
|
|
2
2
|
import { IfConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { Index } from 'react-instantsearch-hooks-web'
|
|
4
4
|
import { useAlgoliaCategoryResults } from '../hooks/useAlgoliaCategoryResults'
|
|
5
5
|
import { useAlgoliaSearchIndexConfig } from '../hooks/useAlgoliaSearchIndexConfig'
|
|
6
6
|
|
|
7
|
-
export const component = '
|
|
7
|
+
export const component = 'CategorySearchResults'
|
|
8
8
|
export const exported = '@graphcommerce/magento-search'
|
|
9
9
|
export const ifConfig: IfConfig = 'algoliaApplicationId'
|
|
10
10
|
|
|
@@ -17,6 +17,7 @@ function CategoryHits() {
|
|
|
17
17
|
<>
|
|
18
18
|
{categories.map((category) => (
|
|
19
19
|
<CategorySearchResult
|
|
20
|
+
key={category.category_uid}
|
|
20
21
|
breadcrumbs={[category]}
|
|
21
22
|
search={search}
|
|
22
23
|
url_path={category.category_url_path}
|
|
@@ -26,19 +27,19 @@ function CategoryHits() {
|
|
|
26
27
|
)
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
function AlgoliaCategorySearchPlugin(props: PluginProps<
|
|
30
|
-
const { Prev, ...rest } = props
|
|
30
|
+
function AlgoliaCategorySearchPlugin(props: PluginProps<CategorySearchResultsProps>) {
|
|
31
|
+
const { Prev, children, ...rest } = props
|
|
31
32
|
const searchIndex = useAlgoliaSearchIndexConfig('_categories')?.searchIndex
|
|
32
33
|
|
|
33
|
-
if (!searchIndex) return <Prev {...rest}
|
|
34
|
+
if (!searchIndex) return <Prev {...rest}>{children}</Prev>
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
<Prev {...rest}>
|
|
38
|
+
{children}
|
|
38
39
|
<Index indexName={searchIndex}>
|
|
39
40
|
<CategoryHits />
|
|
40
41
|
</Index>
|
|
41
|
-
|
|
42
|
+
</Prev>
|
|
42
43
|
)
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CategorySearchResult,
|
|
1
|
+
import { CategorySearchResult, CategorySearchResultsProps } from '@graphcommerce/magento-search'
|
|
2
2
|
import { IfConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { Index } from 'react-instantsearch-hooks-web'
|
|
4
4
|
import { useAlgoliaPageResults } from '../hooks/useAlgoliaPageResults'
|
|
5
5
|
import { useAlgoliaSearchIndexConfig } from '../hooks/useAlgoliaSearchIndexConfig'
|
|
6
6
|
|
|
7
|
-
export const component = '
|
|
7
|
+
export const component = 'CategorySearchResults'
|
|
8
8
|
export const exported = '@graphcommerce/magento-search'
|
|
9
9
|
export const ifConfig: IfConfig = 'algoliaApplicationId'
|
|
10
10
|
|
|
@@ -34,19 +34,19 @@ function PageHits() {
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function AlgoliaPageSearchPlugin(props: PluginProps<
|
|
37
|
+
function AlgoliaPageSearchPlugin(props: PluginProps<CategorySearchResultsProps>) {
|
|
38
38
|
const { Prev, ...rest } = props
|
|
39
39
|
const searchIndex = useAlgoliaSearchIndexConfig('_pages')?.searchIndex
|
|
40
40
|
|
|
41
41
|
if (!searchIndex) return <Prev {...rest} />
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
<Prev {...rest}>
|
|
45
|
+
{rest.children}
|
|
46
46
|
<Index indexName={searchIndex}>
|
|
47
47
|
<PageHits />
|
|
48
48
|
</Index>
|
|
49
|
-
|
|
49
|
+
</Prev>
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -5,7 +5,7 @@ import { Index } from 'react-instantsearch-hooks-web'
|
|
|
5
5
|
import { useAlgoliaProductResults } from '../hooks/useAlgoliaProductResults'
|
|
6
6
|
import { useAlgoliaSearchIndexConfig } from '../hooks/useAlgoliaSearchIndexConfig'
|
|
7
7
|
|
|
8
|
-
export const component = '
|
|
8
|
+
export const component = 'ProductListItemsBase'
|
|
9
9
|
export const exported = '@graphcommerce/magento-search'
|
|
10
10
|
export const ifConfig: IfConfig = 'algoliaApplicationId'
|
|
11
11
|
|