@fast-simon/shopify-hydrogen 1.0.3 → 1.0.5

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.
Files changed (138) hide show
  1. package/README.md +186 -179
  2. package/dist/esnext/@types/Tab.d.ts +9 -9
  3. package/dist/esnext/@types/Tab.js +5 -5
  4. package/dist/esnext/@types/appServerProps.d.ts +12 -12
  5. package/dist/esnext/@types/appServerProps.js +1 -1
  6. package/dist/esnext/@types/articles.d.ts +12 -12
  7. package/dist/esnext/@types/articles.js +1 -1
  8. package/dist/esnext/@types/categories.d.ts +10 -10
  9. package/dist/esnext/@types/categories.js +1 -1
  10. package/dist/esnext/@types/currency.d.ts +1 -1
  11. package/dist/esnext/@types/currency.js +1 -1
  12. package/dist/esnext/@types/device.d.ts +1 -1
  13. package/dist/esnext/@types/device.js +1 -1
  14. package/dist/esnext/@types/editor.d.ts +416 -416
  15. package/dist/esnext/@types/editor.js +6 -6
  16. package/dist/esnext/@types/facets.d.ts +37 -37
  17. package/dist/esnext/@types/facets.js +16 -16
  18. package/dist/esnext/@types/ispOptions.d.ts +6 -6
  19. package/dist/esnext/@types/ispOptions.js +1 -1
  20. package/dist/esnext/@types/narrow.d.ts +7 -7
  21. package/dist/esnext/@types/narrow.js +1 -1
  22. package/dist/esnext/@types/product.d.ts +134 -134
  23. package/dist/esnext/@types/product.js +7 -7
  24. package/dist/esnext/@types/promoTile.d.ts +11 -11
  25. package/dist/esnext/@types/promoTile.js +1 -1
  26. package/dist/esnext/@types/results.d.ts +38 -36
  27. package/dist/esnext/@types/results.js +1 -1
  28. package/dist/esnext/@types/routing.d.ts +11 -11
  29. package/dist/esnext/@types/routing.js +1 -1
  30. package/dist/esnext/@types/siteSetup.d.ts +52 -52
  31. package/dist/esnext/@types/siteSetup.js +1 -1
  32. package/dist/esnext/@types/siteStatus.d.ts +5 -5
  33. package/dist/esnext/@types/siteStatus.js +1 -1
  34. package/dist/esnext/@types/sortBy.d.ts +12 -12
  35. package/dist/esnext/@types/sortBy.js +1 -1
  36. package/dist/esnext/@types/translations.d.ts +12 -12
  37. package/dist/esnext/@types/translations.js +6 -6
  38. package/dist/esnext/components/FastSimonApp.server.d.ts +9 -9
  39. package/dist/esnext/components/FastSimonApp.server.js +45 -45
  40. package/dist/esnext/components/FastSimonProvider.server.d.ts +10 -10
  41. package/dist/esnext/components/FastSimonProvider.server.js +9 -9
  42. package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.d.ts +8 -8
  43. package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.js +5 -5
  44. package/dist/esnext/components/Filters/FacetOption.client.d.ts +9 -9
  45. package/dist/esnext/components/Filters/FacetOption.client.js +39 -39
  46. package/dist/esnext/components/Filters/Filters.server.d.ts +12 -12
  47. package/dist/esnext/components/Filters/Filters.server.js +11 -11
  48. package/dist/esnext/components/Filters/FiltersList.server.d.ts +8 -8
  49. package/dist/esnext/components/Filters/FiltersList.server.js +11 -11
  50. package/dist/esnext/components/Filters/FiltersSkeleton.d.ts +3 -3
  51. package/dist/esnext/components/Filters/FiltersSkeleton.js +32 -32
  52. package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.d.ts +6 -6
  53. package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.js +20 -20
  54. package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.d.ts +8 -8
  55. package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.js +11 -11
  56. package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.d.ts +8 -8
  57. package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.js +51 -51
  58. package/dist/esnext/components/PageTitle/PageTitle.server.d.ts +7 -7
  59. package/dist/esnext/components/PageTitle/PageTitle.server.js +4 -4
  60. package/dist/esnext/components/Pagination/Pagination.client.d.ts +9 -9
  61. package/dist/esnext/components/Pagination/Pagination.client.js +43 -43
  62. package/dist/esnext/components/Pagination/utils.d.ts +1 -1
  63. package/dist/esnext/components/Pagination/utils.js +4 -4
  64. package/dist/esnext/components/ProductCard/ProductCard.d.ts +10 -10
  65. package/dist/esnext/components/ProductCard/ProductCard.js +31 -31
  66. package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.d.ts +10 -10
  67. package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.js +23 -23
  68. package/dist/esnext/components/ProductCard/components/Compare/Compare.d.ts +6 -6
  69. package/dist/esnext/components/ProductCard/components/Compare/Compare.js +6 -6
  70. package/dist/esnext/components/ProductCard/components/Info/ProductInfo.d.ts +9 -9
  71. package/dist/esnext/components/ProductCard/components/Info/ProductInfo.js +11 -11
  72. package/dist/esnext/components/ProductCard/components/Price/Price.d.ts +7 -7
  73. package/dist/esnext/components/ProductCard/components/Price/Price.js +6 -6
  74. package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.d.ts +8 -8
  75. package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.js +7 -7
  76. package/dist/esnext/components/ProductCard/components/Title/Title.d.ts +7 -7
  77. package/dist/esnext/components/ProductCard/components/Title/Title.js +4 -4
  78. package/dist/esnext/components/ProductGrid/ProductGrid.server.d.ts +10 -10
  79. package/dist/esnext/components/ProductGrid/ProductGrid.server.js +10 -10
  80. package/dist/esnext/components/ProductGrid/stylesUtil.d.ts +138 -138
  81. package/dist/esnext/components/ProductGrid/stylesUtil.js +122 -122
  82. package/dist/esnext/components/ResultsSummary/ResultsSummary.server.d.ts +7 -7
  83. package/dist/esnext/components/ResultsSummary/ResultsSummary.server.js +8 -8
  84. package/dist/esnext/components/SortBy/SortBy.client.d.ts +10 -10
  85. package/dist/esnext/components/SortBy/SortBy.client.js +8 -8
  86. package/dist/esnext/components/SortBy/components/DesktopSortBy.client.d.ts +8 -8
  87. package/dist/esnext/components/SortBy/components/DesktopSortBy.client.js +30 -30
  88. package/dist/esnext/components/SortBy/utils.d.ts +8 -8
  89. package/dist/esnext/components/SortBy/utils.js +28 -28
  90. package/dist/esnext/components/index.d.ts +2 -2
  91. package/dist/esnext/components/index.js +2 -2
  92. package/dist/esnext/context/setRoutingContext.d.ts +2 -2
  93. package/dist/esnext/context/setRoutingContext.js +14 -14
  94. package/dist/esnext/context/setSiteContext.d.ts +6 -6
  95. package/dist/esnext/context/setSiteContext.js +18 -18
  96. package/dist/esnext/hooks/ResizeDetect.client.d.ts +2 -2
  97. package/dist/esnext/hooks/ResizeDetect.client.js +6 -6
  98. package/dist/esnext/hooks/useClickOutside.d.ts +1 -1
  99. package/dist/esnext/hooks/useClickOutside.js +12 -12
  100. package/dist/esnext/hooks/useScreenSize.d.ts +1 -1
  101. package/dist/esnext/hooks/useScreenSize.js +19 -19
  102. package/dist/esnext/icons/DownArrowIcon.d.ts +9 -9
  103. package/dist/esnext/icons/DownArrowIcon.js +5 -5
  104. package/dist/esnext/icons/LeftArrowIcon.d.ts +8 -8
  105. package/dist/esnext/icons/LeftArrowIcon.js +5 -5
  106. package/dist/esnext/icons/RejectIcon.d.ts +8 -8
  107. package/dist/esnext/icons/RejectIcon.js +5 -5
  108. package/dist/esnext/icons/RightArrowIcon.d.ts +8 -8
  109. package/dist/esnext/icons/RightArrowIcon.js +5 -5
  110. package/dist/esnext/icons/Spinner.d.ts +11 -11
  111. package/dist/esnext/icons/Spinner.js +6 -6
  112. package/dist/esnext/index.d.ts +1 -1
  113. package/dist/esnext/index.js +1 -1
  114. package/dist/esnext/services/categories_navigation.d.ts +48 -48
  115. package/dist/esnext/services/categories_navigation.js +51 -51
  116. package/dist/esnext/services/search.d.ts +47 -47
  117. package/dist/esnext/services/search.js +51 -51
  118. package/dist/esnext/services/site_setup.d.ts +7 -7
  119. package/dist/esnext/services/site_setup.js +69 -69
  120. package/dist/esnext/utils/DynamicStyle.d.ts +7 -7
  121. package/dist/esnext/utils/DynamicStyle.js +5 -5
  122. package/dist/esnext/utils/defaults.d.ts +8 -8
  123. package/dist/esnext/utils/defaults.js +9 -9
  124. package/dist/esnext/utils/getDynamicStylesVar.d.ts +1 -1
  125. package/dist/esnext/utils/getDynamicStylesVar.js +5 -5
  126. package/dist/esnext/utils/getRoutingState.d.ts +9 -9
  127. package/dist/esnext/utils/getRoutingState.js +13 -13
  128. package/dist/esnext/utils/makeServingRequests.d.ts +6 -6
  129. package/dist/esnext/utils/makeServingRequests.js +32 -32
  130. package/dist/node/plugin/extendOptimizeDeps.d.ts +2 -2
  131. package/dist/node/plugin/extendOptimizeDeps.js +14 -14
  132. package/dist/node/plugin/index.d.ts +3 -3
  133. package/dist/node/plugin/index.js +13 -13
  134. package/dist/node/plugin/injectCSS.d.ts +2 -2
  135. package/dist/node/plugin/injectCSS.js +25 -25
  136. package/dist/node/plugin/suppressWarnings.d.ts +2 -2
  137. package/dist/node/plugin/suppressWarnings.js +21 -21
  138. package/package.json +33 -34
package/README.md CHANGED
@@ -1,180 +1,187 @@
1
- # Fast Simon & Shopify Integration
2
- Build Search and Discovery experience with Fast Simon, a Shopify Plus Certified Partner
3
-
4
- [Getting started guide]('https://instantsearchplus.zendesk.com/hc/en-us/categories/360000839131-Getting-Started-with-Fast-Simon')
5
-
6
-
7
- # Hydrogen App
8
- Hydrogen is a React framework and SDK that you can use to build fast and dynamic Shopify custom storefronts.
9
-
10
- [Getting started guide]('https://shopify.dev/custom-storefronts/hydrogen')
11
-
12
- # Fast Simon For Shopify Hydrogen
13
- React NPM package to support Fast Simon Search and Discovery tools in Shopify Hydrogen Projects.
14
-
15
- # What is Fast Simon for Shopify Hydrogen?
16
- Fast Simon Shopify Hydrogen is a React library to be used in Shopify Hydrogen apps.
17
-
18
- By installing this library on your Hydrogen-based React Shopify storefront, you will be able to render Fast Simon Search and Discovery tools in your app.
19
-
20
- # Installation Guide
21
- This document will guide you to:
22
- * Configure your Shopify store ready for Fast Simon Shopify Hydrogen.
23
- * Install and use Fast Simon Shopify Hydrogen components in your Shopify Hydrogen app.
24
-
25
- ### Requirements
26
- * Shopify store
27
- * Hydrogen app
28
- * Fast Simon app installed on your Shopify store
29
- * Shopify custom app with Storefront access token
30
-
31
- ### Configure Hydrogen app config
32
- Update hydrogen.config.js with your shop's domain and Storefront API token.
33
-
34
- ### Expose Shopify Metafields
35
- Fast Simon Search and Discovery uses Metafields in order to customize the UI based on Fast Simon No-code editor configuration.
36
- Metafields need to be exposed so that they can be retrieved by your Hydrogen app.
37
-
38
- Unfortunately, Shopify does not have a way of exposing Shop Metafields via their admin UI.
39
-
40
- We strongly recommend to contact Fast Simon Support, we will expose the relevant Metafields for you.
41
-
42
- # How to Use Fast Simon In Your Hydrogen App
43
- #### Installation
44
-
45
- 1. In your Hydrogen app directory, run
46
- ```shell
47
- npm install @fast-simon/shopify-hydrogen
48
- ```
49
- 2. Create ```fastsimon.config.json``` file in your root directory and fill it with your Fast Simon UUID & store id:
50
- ```json
51
- {
52
- "UUID": "",
53
- "storeID": 0
54
- }
55
- ```
56
- 3. Open ```vite.config.ts``` and import the Fast Simon plugin:
57
- ```typescript
58
- import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
59
- ```
60
-
61
- 4. Add ```fastSimon()```to the list of plugins:
62
- ```typescript
63
- /// <reference types="vitest" />
64
- import {defineConfig} from 'vite';
65
- import hydrogen from '@shopify/hydrogen/plugin';
66
- import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
67
-
68
- export default defineConfig({
69
- plugins: [hydrogen(), fastSimonPlugin()],
70
- resolve: {
71
- alias: [{find: /^~\/(.*)/, replacement: '/src/$1'}],
72
- },
73
- optimizeDeps: {
74
- include: ['@headlessui/react', 'clsx', 'react-use', 'typographic-base'],
75
- },
76
- test: {
77
- globals: true,
78
- testTimeout: 10000,
79
- hookTimeout: 10000,
80
- },
81
- server: {
82
- port: 5000
83
- },
84
- });
85
- ```
86
-
87
- 5. Open App.server.tsx and import ```FastSimonProviderServer```:
88
- ```typescript
89
- import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
90
- ```
91
-
92
- 6. Include the ```FastSimonProviderServer```, passing through the request object, UUID and store id from your ```fastsimon.config.json file```:
93
- ```jsx
94
- function App({request}) {
95
- const pathname = new URL(request.normalizedUrl).pathname;
96
- const localeMatch = /^\/([a-z]{2})(\/|$)/i.exec(pathname);
97
- const countryCode = localeMatch ? localeMatch[1] : undefined;
98
- const isHome = pathname === `/${countryCode ? countryCode + '/' : ''}`;
99
-
100
- return (
101
- <Suspense fallback={<HeaderFallback isHome={isHome} />}>
102
- <ShopifyProvider countryCode={countryCode}>
103
- <FastSimonProviderServer storeID={fastConfig.storeID} uuid={fastConfig.UUID} request={request}>
104
- <CartProvider countryCode={countryCode}>
105
- <Suspense>
106
- <DefaultSeo />
107
- </Suspense>
108
- <Router>
109
- <FileRoutes
110
- basePath={countryCode ? `/${countryCode}/` : undefined}
111
- />
112
- <Route path="*" page={<NotFound />} />
113
- </Router>
114
- </CartProvider>
115
- <PerformanceMetrics />
116
- {import.meta.env.DEV && <PerformanceMetricsDebug />}
117
- <ShopifyAnalytics />
118
- </FastSimonProviderServer>
119
- </ShopifyProvider>
120
- </Suspense>
121
- );
122
- }
123
-
124
- ```
125
- You can also provide your UUID and storeID directly instead of creating the ```fastsimon.config.json```
126
-
127
- ### Usage
128
- ##### Collections:
129
- 1. Open ```src/routes/collections/[handle].server.jsx``` and import ```FastSimonAppServer```:
130
- ```typescript
131
- import {FastSimonAppServer} from "@fast-simon/shopify-hydrogen";
132
- ```
133
- 2. To the collection handler function, add ```fastSimonProps``` parameter:
134
- ```jsx
135
- export default function Collection({params, fastSimonProps}) {...}
136
- ```
137
-
138
- 3. Replace the Shopify Grid component by ```FastSimonAppServer```, pass ```collectionID``` and ```fastSimonProps``` as shown below.
139
- ```jsx
140
- <Layout>
141
- <Suspense>
142
- <Seo type="collection" data={collection} />
143
- </Suspense>
144
- <PageHeader heading={collection.title}>
145
- {collection?.description && (
146
- <div className="flex items-baseline justify-between w-full">
147
- <div>
148
- <Text format width="narrow" as="p" className="inline-block">
149
- {collection.description}
150
- </Text>
151
- </div>
152
- </div>
153
- )}
154
- </PageHeader>
155
- <Section>
156
- <FastSimonAppServer collectionID={collection.id} fastSimonProps={fastSimonProps}/>
157
- </Section>
158
- </Layout>
159
- ```
160
-
161
- ##### Search Page:
162
- 1. Open ```src/routes/search.server.jsx``` and import ```FastSimonAppServer```:
163
- ```typescript
164
- import {FastSimonAppServer} from "@fast-simon/shopify-hydrogen";
165
- ```
166
- 2. To the search handler function, add ```fastSimonProps``` parameter:
167
- ```jsx
168
- export default function Search({pageBy = PAGINATION_SIZE, params, fastSimonProps}) {...}
169
- ```
170
-
171
- 3. Replace the Shopify Grid component by ```FastSimonAppServer```, pass ```query``` and ```fastSimonProps``` as shown below.
172
- ```jsx
173
- return (
174
- <SearchPage searchTerm={decodeURI(searchTerm)}>
175
- <Section>
176
- <FastSimonAppServer query={decodeURI(searchTerm)} fastSimonProps={fastSimonProps}/>
177
- </Section>
178
- </SearchPage>
179
- );
1
+ # Fast Simon & Shopify Integration
2
+ Build Search and Discovery experience with Fast Simon, a Shopify Plus Certified Partner
3
+
4
+ [Getting started guide]('https://instantsearchplus.zendesk.com/hc/en-us/categories/360000839131-Getting-Started-with-Fast-Simon')
5
+
6
+
7
+ # Hydrogen App
8
+ Hydrogen is a React framework and SDK that you can use to build fast and dynamic Shopify custom storefronts.
9
+
10
+ [Getting started guide]('https://shopify.dev/custom-storefronts/hydrogen')
11
+
12
+ # Fast Simon For Shopify Hydrogen
13
+ React NPM package to support Fast Simon Search and Discovery tools in Shopify Hydrogen Projects.
14
+
15
+ # What is Fast Simon for Shopify Hydrogen?
16
+ Fast Simon Shopify Hydrogen is a React library to be used in Shopify Hydrogen apps.
17
+
18
+ By installing this library on your Hydrogen-based React Shopify storefront, you will be able to render Fast Simon Search and Discovery tools in your app.
19
+
20
+ # Installation Guide
21
+ This document will guide you to:
22
+ * Configure your Shopify store ready for Fast Simon Shopify Hydrogen.
23
+ * Install and use Fast Simon Shopify Hydrogen components in your Shopify Hydrogen app.
24
+
25
+ ### Prerequisites
26
+ Before installation, authenticate with Fast Simon private NPM packages:
27
+
28
+ ```bash
29
+ npm config set "//registry.npmjs.org/:_authToken" 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
30
+ ```
31
+
32
+ ### Requirements
33
+ * Shopify store
34
+ * Hydrogen app
35
+ * Fast Simon app installed on your Shopify store
36
+ * Shopify custom app with Storefront access token
37
+
38
+ ### Configure Hydrogen app config
39
+ Update hydrogen.config.js with your shop's domain and Storefront API token.
40
+
41
+ ### Expose Shopify Metafields
42
+ Fast Simon Search and Discovery uses Metafields in order to customize the UI based on Fast Simon No-code editor configuration.
43
+ Metafields need to be exposed so that they can be retrieved by your Hydrogen app.
44
+
45
+ Unfortunately, Shopify does not have a way of exposing Shop Metafields via their admin UI.
46
+
47
+ We strongly recommend to contact Fast Simon Support, we will expose the relevant Metafields for you.
48
+
49
+ # How to Use Fast Simon In Your Hydrogen App
50
+ #### Installation
51
+
52
+ 1. In your Hydrogen app directory, run
53
+ ```shell
54
+ npm install @fast-simon/shopify-hydrogen
55
+ ```
56
+ 2. Create ```fastsimon.config.json``` file in your root directory and fill it with your Fast Simon UUID & store id:
57
+ ```json
58
+ {
59
+ "UUID": "",
60
+ "storeID": 0
61
+ }
62
+ ```
63
+ 3. Open ```vite.config.ts``` and import the Fast Simon plugin:
64
+ ```typescript
65
+ import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
66
+ ```
67
+
68
+ 4. Add ```fastSimon()```to the list of plugins:
69
+ ```typescript
70
+ /// <reference types="vitest" />
71
+ import {defineConfig} from 'vite';
72
+ import hydrogen from '@shopify/hydrogen/plugin';
73
+ import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
74
+
75
+ export default defineConfig({
76
+ plugins: [hydrogen(), fastSimonPlugin()],
77
+ resolve: {
78
+ alias: [{find: /^~\/(.*)/, replacement: '/src/$1'}],
79
+ },
80
+ optimizeDeps: {
81
+ include: ['@headlessui/react', 'clsx', 'react-use', 'typographic-base'],
82
+ },
83
+ test: {
84
+ globals: true,
85
+ testTimeout: 10000,
86
+ hookTimeout: 10000,
87
+ },
88
+ server: {
89
+ port: 5000
90
+ },
91
+ });
92
+ ```
93
+
94
+ 5. Open App.server.tsx and import ```FastSimonProviderServer```:
95
+ ```typescript
96
+ import fastSimonPlugin from "@fast-simon/shopify-hydrogen/plugin";
97
+ ```
98
+
99
+ 6. Include the ```FastSimonProviderServer```, passing through the request object, UUID and store id from your ```fastsimon.config.json file```:
100
+ ```jsx
101
+ function App({request}) {
102
+ const pathname = new URL(request.normalizedUrl).pathname;
103
+ const localeMatch = /^\/([a-z]{2})(\/|$)/i.exec(pathname);
104
+ const countryCode = localeMatch ? localeMatch[1] : undefined;
105
+ const isHome = pathname === `/${countryCode ? countryCode + '/' : ''}`;
106
+
107
+ return (
108
+ <Suspense fallback={<HeaderFallback isHome={isHome} />}>
109
+ <ShopifyProvider countryCode={countryCode}>
110
+ <FastSimonProviderServer storeID={fastConfig.storeID} uuid={fastConfig.UUID} request={request}>
111
+ <CartProvider countryCode={countryCode}>
112
+ <Suspense>
113
+ <DefaultSeo />
114
+ </Suspense>
115
+ <Router>
116
+ <FileRoutes
117
+ basePath={countryCode ? `/${countryCode}/` : undefined}
118
+ />
119
+ <Route path="*" page={<NotFound />} />
120
+ </Router>
121
+ </CartProvider>
122
+ <PerformanceMetrics />
123
+ {import.meta.env.DEV && <PerformanceMetricsDebug />}
124
+ <ShopifyAnalytics />
125
+ </FastSimonProviderServer>
126
+ </ShopifyProvider>
127
+ </Suspense>
128
+ );
129
+ }
130
+
131
+ ```
132
+ You can also provide your UUID and storeID directly instead of creating the ```fastsimon.config.json```
133
+
134
+ ### Usage
135
+ ##### Collections:
136
+ 1. Open ```src/routes/collections/[handle].server.jsx``` and import ```FastSimonAppServer```:
137
+ ```typescript
138
+ import {FastSimonAppServer} from "@fast-simon/shopify-hydrogen";
139
+ ```
140
+ 2. To the collection handler function, add ```fastSimonProps``` parameter:
141
+ ```jsx
142
+ export default function Collection({params, fastSimonProps}) {...}
143
+ ```
144
+
145
+ 3. Replace the Shopify Grid component by ```FastSimonAppServer```, pass ```collectionID``` and ```fastSimonProps``` as shown below.
146
+ ```jsx
147
+ <Layout>
148
+ <Suspense>
149
+ <Seo type="collection" data={collection} />
150
+ </Suspense>
151
+ <PageHeader heading={collection.title}>
152
+ {collection?.description && (
153
+ <div className="flex items-baseline justify-between w-full">
154
+ <div>
155
+ <Text format width="narrow" as="p" className="inline-block">
156
+ {collection.description}
157
+ </Text>
158
+ </div>
159
+ </div>
160
+ )}
161
+ </PageHeader>
162
+ <Section>
163
+ <FastSimonAppServer collectionID={collection.id} fastSimonProps={fastSimonProps}/>
164
+ </Section>
165
+ </Layout>
166
+ ```
167
+
168
+ ##### Search Page:
169
+ 1. Open ```src/routes/search.server.jsx``` and import ```FastSimonAppServer```:
170
+ ```typescript
171
+ import {FastSimonAppServer} from "@fast-simon/shopify-hydrogen";
172
+ ```
173
+ 2. To the search handler function, add ```fastSimonProps``` parameter:
174
+ ```jsx
175
+ export default function Search({pageBy = PAGINATION_SIZE, params, fastSimonProps}) {...}
176
+ ```
177
+
178
+ 3. Replace the Shopify Grid component by ```FastSimonAppServer```, pass ```query``` and ```fastSimonProps``` as shown below.
179
+ ```jsx
180
+ return (
181
+ <SearchPage searchTerm={decodeURI(searchTerm)}>
182
+ <Section>
183
+ <FastSimonAppServer query={decodeURI(searchTerm)} fastSimonProps={fastSimonProps}/>
184
+ </Section>
185
+ </SearchPage>
186
+ );
180
187
  ```
@@ -1,9 +1,9 @@
1
- export declare enum TabType {
2
- Products = 0,
3
- Articles = 1
4
- }
5
- export interface Tab {
6
- label: string;
7
- value: TabType;
8
- totalResults: number;
9
- }
1
+ export declare enum TabType {
2
+ Products = 0,
3
+ Articles = 1
4
+ }
5
+ export interface Tab {
6
+ label: string;
7
+ value: TabType;
8
+ totalResults: number;
9
+ }
@@ -1,5 +1,5 @@
1
- export var TabType;
2
- (function (TabType) {
3
- TabType[TabType["Products"] = 0] = "Products";
4
- TabType[TabType["Articles"] = 1] = "Articles";
5
- })(TabType || (TabType = {}));
1
+ export var TabType;
2
+ (function (TabType) {
3
+ TabType[TabType["Products"] = 0] = "Products";
4
+ TabType[TabType["Articles"] = 1] = "Articles";
5
+ })(TabType || (TabType = {}));
@@ -1,12 +1,12 @@
1
- import type { SortBy } from "./sortBy";
2
- import type { Narrow } from "./narrow";
3
- export interface AppServerProps {
4
- page?: number;
5
- sortBy?: SortBy;
6
- narrow?: Narrow;
7
- searchWithinSearch?: string;
8
- query?: string;
9
- collectionID?: string;
10
- narrowString?: string;
11
- deviceMode?: string;
12
- }
1
+ import type { SortBy } from "./sortBy";
2
+ import type { Narrow } from "./narrow";
3
+ export interface AppServerProps {
4
+ page?: number;
5
+ sortBy?: SortBy;
6
+ narrow?: Narrow;
7
+ searchWithinSearch?: string;
8
+ query?: string;
9
+ collectionID?: string;
10
+ narrowString?: string;
11
+ deviceMode?: string;
12
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,12 +1,12 @@
1
- export declare type ArticleServerItem = [ArticleTitle, ArticleURL, ArticleDescription, null, ArticleImage];
2
- declare type ArticleTitle = string;
3
- declare type ArticleURL = string;
4
- declare type ArticleDescription = string | null;
5
- declare type ArticleImage = string | null;
6
- export interface Article {
7
- title: string;
8
- url: string;
9
- description: string;
10
- image: string;
11
- }
12
- export {};
1
+ export declare type ArticleServerItem = [ArticleTitle, ArticleURL, ArticleDescription, null, ArticleImage];
2
+ declare type ArticleTitle = string;
3
+ declare type ArticleURL = string;
4
+ declare type ArticleDescription = string | null;
5
+ declare type ArticleImage = string | null;
6
+ export interface Article {
7
+ title: string;
8
+ url: string;
9
+ description: string;
10
+ image: string;
11
+ }
12
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,10 +1,10 @@
1
- export declare type AncestorCategory = [string, string, string];
2
- export interface Category {
3
- d: string;
4
- id: string;
5
- l: string;
6
- p_id: string;
7
- t: string;
8
- u: string;
9
- parent_name?: string;
10
- }
1
+ export declare type AncestorCategory = [string, string, string];
2
+ export interface Category {
3
+ d: string;
4
+ id: string;
5
+ l: string;
6
+ p_id: string;
7
+ t: string;
8
+ u: string;
9
+ parent_name?: string;
10
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export declare type Currency = string | 'USD' | 'CRC' | 'AUD' | 'AZN' | 'NZD' | 'CAD' | 'VES' | 'SGD' | 'COP' | 'GBP' | 'BRL' | 'ILS' | 'AED' | 'JMD' | 'MYR' | 'THB' | 'DKK' | 'EGP' | 'NOK' | 'SEK' | 'HKD' | 'ZAR' | 'CHF' | 'HRK' | 'INR' | 'UAH' | 'RUB' | 'BYR' | 'IRR' | 'MXN' | 'TWD' | 'TRY' | 'TRL' | 'TL' | 'PLN' | 'HUF' | 'BGN' | 'EUR' | 'NGN' | 'RON' | 'VND' | 'BDT' | 'XOF' | 'JPY' | 'CNY' | 'KRW' | 'ARS';
1
+ export declare type Currency = string | 'USD' | 'CRC' | 'AUD' | 'AZN' | 'NZD' | 'CAD' | 'VES' | 'SGD' | 'COP' | 'GBP' | 'BRL' | 'ILS' | 'AED' | 'JMD' | 'MYR' | 'THB' | 'DKK' | 'EGP' | 'NOK' | 'SEK' | 'HKD' | 'ZAR' | 'CHF' | 'HRK' | 'INR' | 'UAH' | 'RUB' | 'BYR' | 'IRR' | 'MXN' | 'TWD' | 'TRY' | 'TRL' | 'TL' | 'PLN' | 'HUF' | 'BGN' | 'EUR' | 'NGN' | 'RON' | 'VND' | 'BDT' | 'XOF' | 'JPY' | 'CNY' | 'KRW' | 'ARS';
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export declare type Device = 'mobile' | 'desktop' | 'tablet';
1
+ export declare type Device = 'mobile' | 'desktop' | 'tablet';
@@ -1 +1 @@
1
- export {};
1
+ export {};