@usereactify/search 5.59.0 → 5.59.1-beta.0

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 (286) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/package.json +7 -5
  3. package/dist/src/components/ClearAll/ClearAll.d.ts +1 -1
  4. package/dist/src/components/ClearAll/ClearAll.js +4 -9
  5. package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
  6. package/dist/src/components/CustomComponent/CustomComponent.d.ts +1 -1
  7. package/dist/src/components/CustomComponent/CustomComponent.js +2 -2
  8. package/dist/src/components/CustomComponent/CustomComponent.js.map +1 -1
  9. package/dist/src/components/Example/ExampleClearAll.d.ts +2 -2
  10. package/dist/src/components/Example/ExampleClearAll.js +2 -5
  11. package/dist/src/components/Example/ExampleClearAll.js.map +1 -1
  12. package/dist/src/components/Example/ExampleCustomComponent.d.ts +1 -1
  13. package/dist/src/components/Example/ExampleCustomComponent.js +3 -7
  14. package/dist/src/components/Example/ExampleCustomComponent.js.map +1 -1
  15. package/dist/src/components/Example/ExampleFilterList.d.ts +2 -2
  16. package/dist/src/components/Example/ExampleFilterList.js +31 -66
  17. package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
  18. package/dist/src/components/Example/ExampleFilterRange.d.ts +2 -2
  19. package/dist/src/components/Example/ExampleFilterRange.js +2 -12
  20. package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
  21. package/dist/src/components/Example/ExampleFilterSlider.d.ts +2 -2
  22. package/dist/src/components/Example/ExampleFilterSlider.js +11 -18
  23. package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
  24. package/dist/src/components/Example/ExampleFilters.d.ts +1 -1
  25. package/dist/src/components/Example/ExampleFilters.js +3 -8
  26. package/dist/src/components/Example/ExampleFilters.js.map +1 -1
  27. package/dist/src/components/Example/ExampleFiltersSelected.d.ts +2 -2
  28. package/dist/src/components/Example/ExampleFiltersSelected.js +3 -24
  29. package/dist/src/components/Example/ExampleFiltersSelected.js.map +1 -1
  30. package/dist/src/components/Example/ExampleHookUseFilters.d.ts +1 -1
  31. package/dist/src/components/Example/ExampleHookUseFilters.js +3 -10
  32. package/dist/src/components/Example/ExampleHookUseFilters.js.map +1 -1
  33. package/dist/src/components/Example/ExampleHookUseResults.d.ts +1 -1
  34. package/dist/src/components/Example/ExampleHookUseResults.js +3 -8
  35. package/dist/src/components/Example/ExampleHookUseResults.js.map +1 -1
  36. package/dist/src/components/Example/ExampleHookUseSearch.js +2 -2
  37. package/dist/src/components/Example/ExampleHookUseSearch.js.map +1 -1
  38. package/dist/src/components/Example/ExampleHookUseSortBy.js +2 -1
  39. package/dist/src/components/Example/ExampleHookUseSortBy.js.map +1 -1
  40. package/dist/src/components/Example/ExampleProductCardWeight.d.ts +1 -1
  41. package/dist/src/components/Example/ExampleProductCardWeight.js +14 -47
  42. package/dist/src/components/Example/ExampleProductCardWeight.js.map +1 -1
  43. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.d.ts +1 -1
  44. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +2 -6
  45. package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -1
  46. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.d.ts +1 -1
  47. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +2 -6
  48. package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -1
  49. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.d.ts +1 -1
  50. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +2 -6
  51. package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -1
  52. package/dist/src/components/Example/ExampleResultCardCallout.d.ts +1 -1
  53. package/dist/src/components/Example/ExampleResultCardCallout.js +2 -4
  54. package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -1
  55. package/dist/src/components/Example/ExampleResultCardProduct.d.ts +2 -2
  56. package/dist/src/components/Example/ExampleResultCardProduct.js +2 -12
  57. package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -1
  58. package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.d.ts +2 -2
  59. package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.js +2 -5
  60. package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.js.map +1 -1
  61. package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +2 -2
  62. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js +2 -5
  63. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -1
  64. package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +2 -2
  65. package/dist/src/components/Example/ExampleResultPaginationNextPrev.js +2 -7
  66. package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -1
  67. package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +2 -2
  68. package/dist/src/components/Example/ExampleResultPaginationNumbered.js +6 -20
  69. package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -1
  70. package/dist/src/components/Example/ExampleResults.d.ts +1 -1
  71. package/dist/src/components/Example/ExampleResults.js +7 -10
  72. package/dist/src/components/Example/ExampleResults.js.map +1 -1
  73. package/dist/src/components/Example/ExampleSearch.d.ts +1 -1
  74. package/dist/src/components/Example/ExampleSearch.js +2 -2
  75. package/dist/src/components/Example/ExampleSearch.js.map +1 -1
  76. package/dist/src/components/Example/ExampleSortBy.d.ts +2 -2
  77. package/dist/src/components/Example/ExampleSortBy.js +2 -5
  78. package/dist/src/components/Example/ExampleSortBy.js.map +1 -1
  79. package/dist/src/components/Example/ExampleStats.d.ts +2 -2
  80. package/dist/src/components/Example/ExampleStats.js +2 -8
  81. package/dist/src/components/Example/ExampleStats.js.map +1 -1
  82. package/dist/src/components/Example/ExampleSuggestions.d.ts +2 -2
  83. package/dist/src/components/Example/ExampleSuggestions.js +2 -7
  84. package/dist/src/components/Example/ExampleSuggestions.js.map +1 -1
  85. package/dist/src/components/Example/index.d.ts +6 -6
  86. package/dist/src/components/Example/index.js +6 -6
  87. package/dist/src/components/Example/index.js.map +1 -1
  88. package/dist/src/components/Filter/Filter.d.ts +1 -1
  89. package/dist/src/components/Filter/Filter.js +30 -35
  90. package/dist/src/components/Filter/Filter.js.map +1 -1
  91. package/dist/src/components/Filter/Filters.d.ts +4 -4
  92. package/dist/src/components/Filter/Filters.js +3 -6
  93. package/dist/src/components/Filter/Filters.js.map +1 -1
  94. package/dist/src/components/Filter/FiltersSelected.d.ts +1 -1
  95. package/dist/src/components/Filter/FiltersSelected.js +4 -9
  96. package/dist/src/components/Filter/FiltersSelected.js.map +1 -1
  97. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +2 -2
  98. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +20 -8
  99. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
  100. package/dist/src/components/Result/ResultCardCallout.d.ts +2 -2
  101. package/dist/src/components/Result/ResultCardCallout.js +3 -2
  102. package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
  103. package/dist/src/components/Result/ResultCardProduct.d.ts +1 -1
  104. package/dist/src/components/Result/ResultCardProduct.js +4 -3
  105. package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
  106. package/dist/src/components/Result/ResultPaginationInfiniteScroll.d.ts +3 -3
  107. package/dist/src/components/Result/ResultPaginationInfiniteScroll.js +3 -6
  108. package/dist/src/components/Result/ResultPaginationInfiniteScroll.js.map +1 -1
  109. package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +3 -3
  110. package/dist/src/components/Result/ResultPaginationLoadMore.js +3 -6
  111. package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -1
  112. package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +3 -3
  113. package/dist/src/components/Result/ResultPaginationNextPrev.js +3 -6
  114. package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -1
  115. package/dist/src/components/Result/ResultPaginationNumbered.d.ts +3 -3
  116. package/dist/src/components/Result/ResultPaginationNumbered.js +3 -6
  117. package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
  118. package/dist/src/components/Result/ResultStateProvider.d.ts +2 -2
  119. package/dist/src/components/Result/ResultStateProvider.js +3 -3
  120. package/dist/src/components/Result/ResultStateProvider.js.map +1 -1
  121. package/dist/src/components/Result/Results.d.ts +2 -2
  122. package/dist/src/components/Result/Results.js +50 -52
  123. package/dist/src/components/Result/Results.js.map +1 -1
  124. package/dist/src/components/Result/index.d.ts +4 -4
  125. package/dist/src/components/Result/index.js +4 -4
  126. package/dist/src/components/Result/index.js.map +1 -1
  127. package/dist/src/components/Search/Search.d.ts +1 -1
  128. package/dist/src/components/Search/Search.js +3 -6
  129. package/dist/src/components/Search/Search.js.map +1 -1
  130. package/dist/src/components/Sensor/SensorCollection.d.ts +1 -1
  131. package/dist/src/components/Sensor/SensorCollection.js +2 -2
  132. package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
  133. package/dist/src/components/Sensor/SensorCustom.d.ts +1 -2
  134. package/dist/src/components/Sensor/SensorCustom.js +5 -6
  135. package/dist/src/components/Sensor/SensorCustom.js.map +1 -1
  136. package/dist/src/components/Sensor/SensorExplain.js +2 -2
  137. package/dist/src/components/Sensor/SensorExplain.js.map +1 -1
  138. package/dist/src/components/Sensor/SensorInventoryAvailable.d.ts +1 -1
  139. package/dist/src/components/Sensor/SensorInventoryAvailable.js +2 -2
  140. package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
  141. package/dist/src/components/Sensor/SensorPublished.d.ts +1 -1
  142. package/dist/src/components/Sensor/SensorPublished.js +2 -2
  143. package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
  144. package/dist/src/components/Sensor/SensorSearchTerm.d.ts +1 -2
  145. package/dist/src/components/Sensor/SensorSearchTerm.js +19 -124
  146. package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
  147. package/dist/src/components/Sensor/SensorSort.d.ts +1 -1
  148. package/dist/src/components/Sensor/SensorSort.js +2 -2
  149. package/dist/src/components/Sensor/SensorSort.js.map +1 -1
  150. package/dist/src/components/Sensor/Sensors.d.ts +1 -3
  151. package/dist/src/components/Sensor/Sensors.js +13 -46
  152. package/dist/src/components/Sensor/Sensors.js.map +1 -1
  153. package/dist/src/components/Sensor/index.d.ts +7 -9
  154. package/dist/src/components/Sensor/index.js +6 -10
  155. package/dist/src/components/Sensor/index.js.map +1 -1
  156. package/dist/src/components/SortBy/SortBy.d.ts +1 -1
  157. package/dist/src/components/SortBy/SortBy.js +3 -6
  158. package/dist/src/components/SortBy/SortBy.js.map +1 -1
  159. package/dist/src/components/Stats/Stats.d.ts +2 -2
  160. package/dist/src/components/Stats/Stats.js +2 -5
  161. package/dist/src/components/Stats/Stats.js.map +1 -1
  162. package/dist/src/components/Suggestions/Suggestions.d.ts +1 -1
  163. package/dist/src/components/Suggestions/Suggestions.js +7 -8
  164. package/dist/src/components/Suggestions/Suggestions.js.map +1 -1
  165. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.d.ts +1 -1
  166. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js +3 -3
  167. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -1
  168. package/dist/src/components/Utility/index.js.map +1 -1
  169. package/dist/src/components/index.d.ts +2 -2
  170. package/dist/src/components/index.js +2 -2
  171. package/dist/src/components/index.js.map +1 -1
  172. package/dist/src/hooks/index.d.ts +11 -11
  173. package/dist/src/hooks/index.js +11 -11
  174. package/dist/src/hooks/index.js.map +1 -1
  175. package/dist/src/hooks/react-slider/useReactSliderProps.d.ts +2 -2
  176. package/dist/src/hooks/react-slider/useReactSliderProps.js +6 -6
  177. package/dist/src/hooks/react-slider/useReactSliderProps.js.map +1 -1
  178. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +1 -1
  179. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +2 -2
  180. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
  181. package/dist/src/hooks/useAnalytics.js.map +1 -1
  182. package/dist/src/hooks/useConfig.d.ts +1 -1
  183. package/dist/src/hooks/useConfig.js +1 -1
  184. package/dist/src/hooks/useConfig.js.map +1 -1
  185. package/dist/src/hooks/useCuration.d.ts +1 -1
  186. package/dist/src/hooks/useCuration.js +9 -25
  187. package/dist/src/hooks/useCuration.js.map +1 -1
  188. package/dist/src/hooks/useDebugger.js +3 -3
  189. package/dist/src/hooks/useDebugger.js.map +1 -1
  190. package/dist/src/hooks/useFilterCollapsedState.d.ts +1 -1
  191. package/dist/src/hooks/useFilterCollapsedState.js.map +1 -1
  192. package/dist/src/hooks/useFilterListProps.d.ts +2 -2
  193. package/dist/src/hooks/useFilterListProps.js +7 -11
  194. package/dist/src/hooks/useFilterListProps.js.map +1 -1
  195. package/dist/src/hooks/useFilterRangeProps.d.ts +1 -1
  196. package/dist/src/hooks/useFilterRangeProps.js +11 -14
  197. package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
  198. package/dist/src/hooks/useFilterSliderProps.d.ts +1 -1
  199. package/dist/src/hooks/useFilterSliderProps.js +10 -9
  200. package/dist/src/hooks/useFilterSliderProps.js.map +1 -1
  201. package/dist/src/hooks/useFilters.d.ts +1 -1
  202. package/dist/src/hooks/useFilters.js +4 -7
  203. package/dist/src/hooks/useFilters.js.map +1 -1
  204. package/dist/src/hooks/useIndices.js +2 -2
  205. package/dist/src/hooks/useIndices.js.map +1 -1
  206. package/dist/src/hooks/usePagination.d.ts +1 -1
  207. package/dist/src/hooks/usePagination.js +6 -14
  208. package/dist/src/hooks/usePagination.js.map +1 -1
  209. package/dist/src/hooks/usePaginationLoadable.d.ts +1 -1
  210. package/dist/src/hooks/usePaginationLoadable.js +3 -5
  211. package/dist/src/hooks/usePaginationLoadable.js.map +1 -1
  212. package/dist/src/hooks/useProductPrice.d.ts +1 -1
  213. package/dist/src/hooks/useProductPrice.js +3 -1
  214. package/dist/src/hooks/useProductPrice.js.map +1 -1
  215. package/dist/src/hooks/useReactifySearchContext.d.ts +1 -1
  216. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  217. package/dist/src/hooks/useResults.d.ts +1 -1
  218. package/dist/src/hooks/useResults.js +4 -4
  219. package/dist/src/hooks/useResults.js.map +1 -1
  220. package/dist/src/hooks/useSearch.d.ts +1 -1
  221. package/dist/src/hooks/useSearch.js +8 -9
  222. package/dist/src/hooks/useSearch.js.map +1 -1
  223. package/dist/src/hooks/useSortBy.d.ts +1 -1
  224. package/dist/src/hooks/useSortBy.js +1 -1
  225. package/dist/src/hooks/useSortBy.js.map +1 -1
  226. package/dist/src/index.js.map +1 -1
  227. package/dist/src/search-request-builder/base-builders.d.ts +18 -0
  228. package/dist/src/search-request-builder/base-builders.js +184 -0
  229. package/dist/src/search-request-builder/base-builders.js.map +1 -0
  230. package/dist/src/search-request-builder/curation-builders.d.ts +2 -0
  231. package/dist/src/search-request-builder/curation-builders.js +44 -0
  232. package/dist/src/search-request-builder/curation-builders.js.map +1 -0
  233. package/dist/src/search-request-builder/index.d.ts +3 -0
  234. package/dist/src/search-request-builder/index.js +12 -0
  235. package/dist/src/search-request-builder/index.js.map +1 -0
  236. package/dist/src/search-request-builder/search-request-builder.d.ts +3 -0
  237. package/dist/src/search-request-builder/search-request-builder.js +54 -0
  238. package/dist/src/search-request-builder/search-request-builder.js.map +1 -0
  239. package/dist/src/search-request-builder/types.d.ts +105 -0
  240. package/dist/src/search-request-builder/types.js +30 -0
  241. package/dist/src/search-request-builder/types.js.map +1 -0
  242. package/dist/src/search-request-builder/utils.d.ts +27 -0
  243. package/dist/src/search-request-builder/utils.js +144 -0
  244. package/dist/src/search-request-builder/utils.js.map +1 -0
  245. package/dist/src/types/config.d.ts +1 -1
  246. package/dist/src/types/config.js.map +1 -1
  247. package/dist/src/types/elastic.d.ts +8 -11
  248. package/dist/src/types/elastic.js.map +1 -1
  249. package/dist/src/types/firestore.d.ts +5 -5
  250. package/dist/src/types/firestore.js.map +1 -1
  251. package/dist/src/types/index.js.map +1 -1
  252. package/dist/src/types/reactivesearch.d.ts +1 -1
  253. package/dist/src/types/reactivesearch.js.map +1 -1
  254. package/dist/src/types/shopify.d.ts +1 -1
  255. package/dist/src/types/shopify.js.map +1 -1
  256. package/dist/src/utility/config.d.ts +1 -1
  257. package/dist/src/utility/config.js +1 -1
  258. package/dist/src/utility/config.js.map +1 -1
  259. package/dist/src/utility/curation.d.ts +2 -2
  260. package/dist/src/utility/curation.js +1 -1
  261. package/dist/src/utility/curation.js.map +1 -1
  262. package/dist/src/utility/debug.js +1 -1
  263. package/dist/src/utility/debug.js.map +1 -1
  264. package/dist/src/utility/filters.d.ts +2 -2
  265. package/dist/src/utility/filters.js.map +1 -1
  266. package/dist/src/utility/liquid.d.ts +2 -2
  267. package/dist/src/utility/liquid.js +2 -5
  268. package/dist/src/utility/liquid.js.map +1 -1
  269. package/dist/src/utility/props.d.ts +7 -226
  270. package/dist/src/utility/props.js +61 -108
  271. package/dist/src/utility/props.js.map +1 -1
  272. package/dist/src/utility/server.d.ts +1 -1
  273. package/dist/src/utility/server.js +3 -3
  274. package/dist/src/utility/server.js.map +1 -1
  275. package/dist/src/utility/sortOption.d.ts +2 -2
  276. package/dist/src/utility/sortOption.js.map +1 -1
  277. package/package.json +7 -5
  278. package/dist/src/components/Sensor/SensorCollectionWeighted.d.ts +0 -1
  279. package/dist/src/components/Sensor/SensorCollectionWeighted.js +0 -21
  280. package/dist/src/components/Sensor/SensorCollectionWeighted.js.map +0 -1
  281. package/dist/src/components/Sensor/SensorSearchWeighted.d.ts +0 -1
  282. package/dist/src/components/Sensor/SensorSearchWeighted.js +0 -22
  283. package/dist/src/components/Sensor/SensorSearchWeighted.js.map +0 -1
  284. package/dist/src/utility/queries.d.ts +0 -393
  285. package/dist/src/utility/queries.js +0 -197
  286. package/dist/src/utility/queries.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../../src/types/elastic.ts"],"names":[],"mappings":";;;AAOA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;AACrB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAqPD,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B","sourcesContent":["import { Callout } from \"./firestore\";\nimport {\n Maybe,\n ProductVariantInventoryPolicy,\n MetafieldValueType,\n} from \"./graphql\";\n\nexport enum ElasticDocumentType {\n Callout = \"callout\",\n Product = \"product\",\n}\n\nexport interface ElasticDocumentBase {\n /** Elasticsearch score when explain is enabled */\n _score?: number;\n /** Elasticsearch explanation when explain is enabled */\n _explanation?: {\n value: number;\n description: string;\n details?: Array<{\n value: number;\n description: string;\n details?: any[];\n }>;\n };\n}\n\nexport type ElasticDocument = ElasticCallout | ElasticProduct;\n\nexport interface ElasticCallout extends ElasticDocumentBase {\n type: ElasticDocumentType.Callout;\n key: string;\n callout: Omit<Callout, \"keywords\">;\n /** elastic callouts are always published */\n published: true;\n /** elastic callouts are always attached to one curation */\n curations: [ElasticCuration] | [];\n}\n\nexport interface ElasticProduct extends ElasticDocumentBase {\n type: ElasticDocumentType.Product;\n /** the log id from which this product was last uploaded */\n lastLogId: string;\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n description: string;\n vendor: string;\n product_type: string;\n handle: string;\n url: string;\n tags: Array<string>;\n collection_titles: Array<string>;\n /** tag prefixes defined in tagKeys are split to their own attributes */\n [key: `tags_${string}`]: Array<string> | undefined;\n /** decimal number e.g. 99.95 */\n price_min: number;\n /** decimal number e.g. 99.95 */\n price_max: number;\n /** market specific price min, decimal number e.g. 99.95 */\n [key: `price_min_market_${number}`]: number;\n /** market specific price max, decimal number e.g. 99.95 */\n [key: `price_max_market_${number}`]: number;\n /** array of option names e.g. [\"Colour\", \"Size\"] */\n options: Array<string>;\n /** @todo it would be better to use ProductStatus directly, which has uppercase */\n status: \"active\" | \"archived\" | \"draft\";\n published: boolean;\n /** ISO 8601 datetime */\n published_at: Maybe<string>;\n /** ISO 8601 datetime */\n updated_at: string;\n /** ISO 8601 datetime */\n created_at: string;\n tracks_inventory: boolean;\n /** originalSrc URL for featured image */\n image: Maybe<string>;\n /** array of images (undefined if images are disabled in sync settings) */\n images?: Array<ElasticImage>;\n /** array of variants attached to product (undefined if variants are disabled in sync settings) */\n variants?: Array<ElasticVariant>;\n /** price ranges from presentment prices (undefined if presentment prices or variants are disabled in sync settings) */\n presentment_price_ranges?: {\n min_variant_price: Array<ElasticPresentmentPrice>;\n max_variant_price: Array<ElasticPresentmentPrice>;\n };\n /** array of variant skus (undefined if variants are disabled in sync settings) */\n variant_skus?: Array<string>;\n /** combined array of option values from all option types (undefined if variants are disabled in sync settings) */\n variant_options?: Array<string>;\n /** array of collections which this product belongs to (undefined if collections are disabled in sync settings) */\n collections?: Array<ElasticCollection>;\n /** array of whitelisted metafields (undefined if metafields are disabled in sync settings) */\n metafields?: Array<ElasticMetafield>;\n /** decimal number e.g. 99.95 (undefined if variants are disabled in sync settings) */\n discount_amount?: number;\n /** combined inventory for all variants (undefined if variants are disabled in sync settings) */\n inventory_total?: number;\n /** number of days since published, null if unpublished */\n published_days: Maybe<number>;\n /** collection of curations that this product is attached to */\n curations?: Array<ElasticCuration>;\n /** related products **/\n related?: Array<ElasticProductRelated>;\n}\n\nexport interface ElasticProductRelated {\n createdAt: string;\n description: string;\n featuredImage: {\n originalSrc: \"https://cdn.shopify.com/s/files/1/0614/3977/0777/p…71d6-e7fd-4f5f-aa99-c722e2832d01.jpg?v=1660776345\";\n };\n handle: string;\n id: string;\n images: Array<ElasticImage>;\n legacyResourceId: string;\n metafields?: Array<ElasticMetafield>;\n options: Array<{\n name: string;\n }>;\n priceRangeV2: {\n maxVariantPrice: {\n amount: string;\n };\n minVariantPrice: {\n amount: string;\n };\n };\n productType: string;\n publishedAt: string;\n status: \"ACTIVE\" | \"ARCHIVED\" | \"DRAFT\";\n storefrontId: string;\n tags: Array<string>;\n title: string;\n tracksInventory: boolean;\n updatedAt: string;\n variants: Array<ElasticVariant>;\n vendor: string;\n __typename: \"Product\";\n}\n\nexport interface ElasticVariant {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n sku: Maybe<string>;\n barcode: Maybe<string>;\n /** array of presentment prices (undefined if presentment prices are disabled in sync settings) */\n presentment_prices?: Array<{\n price: ElasticPresentmentPrice;\n compare_at_price: Maybe<ElasticPresentmentPrice>;\n }>;\n /** decimal number e.g. 99.95 */\n price: number;\n /** decimal number e.g. 99.95 */\n compare_at_price: Maybe<number>;\n /** value string for option 1 e.g. Blue */\n option1: Maybe<string>;\n /** value string for option 2 e.g. Medium */\n option2: Maybe<string>;\n /** value string for option 3 */\n option3: Maybe<string>;\n /** sort position within the product */\n position: number;\n inventory_policy: ProductVariantInventoryPolicy;\n inventory_quantity: number;\n available: boolean;\n /** array of images (only available if this variant has been merged from another product and if images are enabled in sync settings) */\n images?: Array<ElasticImage>;\n}\n\nexport interface ElasticCollection {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n handle: string;\n title: string;\n position: number;\n}\n\nexport interface ElasticMetafield {\n key: string;\n type: string;\n value: string;\n namespace: string;\n /**\n * Legacy valueType attribute which is no longer provided by Shopify. We still\n * populate this field to prevent any frontends breaking which rely on it.\n *\n * @see https://shopify.dev/apps/metafields/definitions/types\n */\n value_type: MetafieldValueType;\n}\n\nexport interface ElasticPresentmentPrice {\n /** decimal number e.g. 99.95 */\n amount: number;\n currency_code: string;\n}\n\nexport interface ElasticImage {\n /** originalSrc URL */\n src: string;\n /** alt text */\n alt: Maybe<string>;\n}\n\nexport interface ElasticCuration {\n id: string;\n hidden: boolean;\n position?: number;\n searchTerm?: string;\n collectionHandle?: string;\n}\n\n// non-exhaustive type for bulk request\n// https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html\nexport type ElasticBulkOperationUpdate = [\n { update: { _index: string; _id: string } },\n {\n script?: {\n lang: \"painless\";\n source: string;\n params?: Record<string, any>;\n };\n upsert?: Partial<ElasticProduct>;\n scripted_upsert?: true;\n doc?: Partial<ElasticProduct>;\n doc_as_upsert?: true;\n }\n];\n\nexport type ElasticBulkOperationIndex = [\n { index: { _index: string; _id: string } },\n ElasticDocument\n];\n\nexport type ElasticBulkOperation =\n | ElasticBulkOperationUpdate\n | ElasticBulkOperationIndex;\n\nexport type ElasticSearchResult<T = ElasticDocument> = {\n hits: {\n hits: Array<ElasticHit<T>>;\n };\n};\n\nexport type ElasticHit<T = ElasticDocument> = {\n _id: string;\n _source: T;\n _score: number | null;\n};\n\nexport enum ElasticDataType {\n Text = \"text\",\n Long = \"long\",\n Date = \"date\",\n Float = \"float\",\n Nested = \"nested\",\n Keyword = \"keyword\",\n Boolean = \"boolean\",\n}\n\nexport interface ElasticProperty {\n analyzer?: string;\n type: ElasticDataType;\n ignore_above?: number;\n fields?: { [key: string]: ElasticField };\n properties?: { [key: string]: ElasticProperty };\n}\n\nexport interface ElasticField {\n type: ElasticDataType;\n ignore_above?: number;\n}\n"]}
1
+ {"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../../src/types/elastic.ts"],"names":[],"mappings":";;;AAGA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;AACrB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAgPD,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B","sourcesContent":["import type { Callout } from \"./firestore\";\nimport type { Maybe, MetafieldValueType, ProductVariantInventoryPolicy } from \"./graphql\";\n\nexport enum ElasticDocumentType {\n Callout = \"callout\",\n Product = \"product\",\n}\n\nexport interface ElasticDocumentBase {\n /** Elasticsearch score when explain is enabled */\n _score?: number;\n /** Elasticsearch explanation when explain is enabled */\n _explanation?: {\n value: number;\n description: string;\n details?: Array<{\n value: number;\n description: string;\n details?: any[];\n }>;\n };\n}\n\nexport type ElasticDocument = ElasticCallout | ElasticProduct;\n\nexport interface ElasticCallout extends ElasticDocumentBase {\n type: ElasticDocumentType.Callout;\n key: string;\n callout: Omit<Callout, \"keywords\">;\n /** elastic callouts are always published */\n published: true;\n /** elastic callouts are always attached to one curation */\n curations: [ElasticCuration] | [];\n}\n\nexport interface ElasticProduct extends ElasticDocumentBase {\n type: ElasticDocumentType.Product;\n /** the log id from which this product was last uploaded */\n lastLogId: string;\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n description: string;\n vendor: string;\n product_type: string;\n handle: string;\n url: string;\n tags: Array<string>;\n collection_titles: Array<string>;\n /** tag prefixes defined in tagKeys are split to their own attributes */\n [key: `tags_${string}`]: Array<string> | undefined;\n /** decimal number e.g. 99.95 */\n price_min: number;\n /** decimal number e.g. 99.95 */\n price_max: number;\n /** market specific price min, decimal number e.g. 99.95 */\n [key: `price_min_market_${number}`]: number;\n /** market specific price max, decimal number e.g. 99.95 */\n [key: `price_max_market_${number}`]: number;\n /** array of option names e.g. [\"Colour\", \"Size\"] */\n options: Array<string>;\n /** @todo it would be better to use ProductStatus directly, which has uppercase */\n status: \"active\" | \"archived\" | \"draft\";\n published: boolean;\n /** ISO 8601 datetime */\n published_at: Maybe<string>;\n /** ISO 8601 datetime */\n updated_at: string;\n /** ISO 8601 datetime */\n created_at: string;\n tracks_inventory: boolean;\n /** originalSrc URL for featured image */\n image: Maybe<string>;\n /** array of images (undefined if images are disabled in sync settings) */\n images?: Array<ElasticImage>;\n /** array of variants attached to product (undefined if variants are disabled in sync settings) */\n variants?: Array<ElasticVariant>;\n /** price ranges from presentment prices (undefined if presentment prices or variants are disabled in sync settings) */\n presentment_price_ranges?: {\n min_variant_price: Array<ElasticPresentmentPrice>;\n max_variant_price: Array<ElasticPresentmentPrice>;\n };\n /** array of variant skus (undefined if variants are disabled in sync settings) */\n variant_skus?: Array<string>;\n /** combined array of option values from all option types (undefined if variants are disabled in sync settings) */\n variant_options?: Array<string>;\n /** array of collections which this product belongs to (undefined if collections are disabled in sync settings) */\n collections?: Array<ElasticCollection>;\n /** array of whitelisted metafields (undefined if metafields are disabled in sync settings) */\n metafields?: Array<ElasticMetafield>;\n /** decimal number e.g. 99.95 (undefined if variants are disabled in sync settings) */\n discount_amount?: number;\n /** combined inventory for all variants (undefined if variants are disabled in sync settings) */\n inventory_total?: number;\n /** number of days since published, null if unpublished */\n published_days: Maybe<number>;\n /** collection of curations that this product is attached to */\n curations?: Array<ElasticCuration>;\n /** related products **/\n related?: Array<ElasticProductRelated>;\n}\n\nexport interface ElasticProductRelated {\n createdAt: string;\n description: string;\n featuredImage: {\n originalSrc: \"https://cdn.shopify.com/s/files/1/0614/3977/0777/p…71d6-e7fd-4f5f-aa99-c722e2832d01.jpg?v=1660776345\";\n };\n handle: string;\n id: string;\n images: Array<ElasticImage>;\n legacyResourceId: string;\n metafields?: Array<ElasticMetafield>;\n options: Array<{\n name: string;\n }>;\n priceRangeV2: {\n maxVariantPrice: {\n amount: string;\n };\n minVariantPrice: {\n amount: string;\n };\n };\n productType: string;\n publishedAt: string;\n status: \"ACTIVE\" | \"ARCHIVED\" | \"DRAFT\";\n storefrontId: string;\n tags: Array<string>;\n title: string;\n tracksInventory: boolean;\n updatedAt: string;\n variants: Array<ElasticVariant>;\n vendor: string;\n __typename: \"Product\";\n}\n\nexport interface ElasticVariant {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n title: string;\n sku: Maybe<string>;\n barcode: Maybe<string>;\n /** array of presentment prices (undefined if presentment prices are disabled in sync settings) */\n presentment_prices?: Array<{\n price: ElasticPresentmentPrice;\n compare_at_price: Maybe<ElasticPresentmentPrice>;\n }>;\n /** decimal number e.g. 99.95 */\n price: number;\n /** decimal number e.g. 99.95 */\n compare_at_price: Maybe<number>;\n /** value string for option 1 e.g. Blue */\n option1: Maybe<string>;\n /** value string for option 2 e.g. Medium */\n option2: Maybe<string>;\n /** value string for option 3 */\n option3: Maybe<string>;\n /** sort position within the product */\n position: number;\n inventory_policy: ProductVariantInventoryPolicy;\n inventory_quantity: number;\n available: boolean;\n /** array of images (only available if this variant has been merged from another product and if images are enabled in sync settings) */\n images?: Array<ElasticImage>;\n}\n\nexport interface ElasticCollection {\n /** legacy resource id */\n id: number;\n storefrontId: string;\n handle: string;\n title: string;\n position: number;\n}\n\nexport interface ElasticMetafield {\n key: string;\n type: string;\n value: string;\n namespace: string;\n /**\n * Legacy valueType attribute which is no longer provided by Shopify. We still\n * populate this field to prevent any frontends breaking which rely on it.\n *\n * @see https://shopify.dev/apps/metafields/definitions/types\n */\n value_type: MetafieldValueType;\n}\n\nexport interface ElasticPresentmentPrice {\n /** decimal number e.g. 99.95 */\n amount: number;\n currency_code: string;\n}\n\nexport interface ElasticImage {\n /** originalSrc URL */\n src: string;\n /** alt text */\n alt: Maybe<string>;\n}\n\nexport interface ElasticCuration {\n id: string;\n hidden: boolean;\n position?: number;\n searchTerm?: string;\n collectionHandle?: string;\n}\n\n// non-exhaustive type for bulk request\n// https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html\nexport type ElasticBulkOperationUpdate = [\n { update: { _index: string; _id: string } },\n {\n script?: {\n lang: \"painless\";\n source: string;\n params?: Record<string, any>;\n };\n upsert?: Partial<ElasticProduct>;\n scripted_upsert?: true;\n doc?: Partial<ElasticProduct>;\n doc_as_upsert?: true;\n },\n];\n\nexport type ElasticBulkOperationIndex = [{ index: { _index: string; _id: string } }, ElasticDocument];\n\nexport type ElasticBulkOperation = ElasticBulkOperationUpdate | ElasticBulkOperationIndex;\n\nexport type ElasticSearchResult<T = ElasticDocument> = {\n hits: {\n hits: Array<ElasticHit<T>>;\n };\n};\n\nexport type ElasticHit<T = ElasticDocument> = {\n _id: string;\n _source: T;\n _score: number | null;\n};\n\nexport enum ElasticDataType {\n Text = \"text\",\n Long = \"long\",\n Date = \"date\",\n Float = \"float\",\n Nested = \"nested\",\n Keyword = \"keyword\",\n Boolean = \"boolean\",\n}\n\nexport interface ElasticProperty {\n analyzer?: string;\n type: ElasticDataType;\n ignore_above?: number;\n fields?: { [key: string]: ElasticField };\n properties?: { [key: string]: ElasticProperty };\n}\n\nexport interface ElasticField {\n type: ElasticDataType;\n ignore_above?: number;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ShopifyProduct, ShopifyProductImage } from "./shopify";
1
+ import type { ShopifyProduct, ShopifyProductImage } from "./shopify";
2
2
  export interface ResourceDocument {
3
3
  id: string;
4
4
  keywords: Array<string>;
@@ -62,7 +62,7 @@ export declare const DefinedFieldType: {
62
62
  readonly Long: "long";
63
63
  readonly Boolean: "boolean";
64
64
  };
65
- export type DefinedFieldType = typeof DefinedFieldType[keyof typeof DefinedFieldType] | (string & {});
65
+ export type DefinedFieldType = (typeof DefinedFieldType)[keyof typeof DefinedFieldType] | (string & {});
66
66
  export interface DefinedField {
67
67
  label: string;
68
68
  name: string;
@@ -296,9 +296,9 @@ export interface SearchableField extends ResourceDocument {
296
296
  enabled: boolean;
297
297
  hidden?: boolean;
298
298
  points: number;
299
- allowedMistakes: number;
299
+ maxEdits: number;
300
300
  mistakePenaltyPercent: number;
301
- synyonymEnabled: boolean;
301
+ synonymEnabled: boolean;
302
302
  synonymPenaltyPercent: number;
303
303
  }
304
304
  export interface Boosting {
@@ -321,4 +321,4 @@ export declare const Operation: {
321
321
  readonly LessThan: "less than";
322
322
  readonly GreaterThan: "greater than";
323
323
  };
324
- export type Operation = typeof Operation[keyof typeof Operation];
324
+ export type Operation = (typeof Operation)[keyof typeof Operation];
@@ -1 +1 @@
1
- {"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;AAUA,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,4CAA4B,CAAA;IAC5B,kDAAkC,CAAA;IAClC,mCAAmB,CAAA;IACnB,oDAAoC,CAAA;IACpC,0DAA0C,CAAA;IAC1C,oDAAoC,CAAA;IACpC,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,oDAAoC,CAAA;AACtC,CAAC,EArBW,YAAY,4BAAZ,YAAY,QAqBvB;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAC/C,0DAAiB,CAAA;IACjB,qEAA4B,CAAA;AAC9B,CAAC,EAHW,qCAAqC,qDAArC,qCAAqC,QAGhD;AAEY,QAAA,0CAA0C,GAGnD;IACF,CAAC,qCAAqC,CAAC,MAAM,CAAC,EAAE,iBAAiB;IACjE,CAAC,qCAAqC,CAAC,WAAW,CAAC,EAAE,sCAAsC;CAC5F,CAAC;AAEF,IAAY,mBAaX;AAbD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,4CAAqB,CAAA;IACrB,8CAAuB,CAAA;IACvB,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,2DAAoC,CAAA;IACpC,iEAA0C,CAAA;IAC1C,2DAAoC,CAAA;AACtC,CAAC,EAbW,mBAAmB,mCAAnB,mBAAmB,QAa9B;AAEY,QAAA,yBAA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AAqB,CAAA;AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAsGY,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;CACnB,CAAC","sourcesContent":["import { ShopifyProduct, ShopifyProductImage } from \"./shopify\";\n\nexport interface ResourceDocument {\n id: string;\n keywords: Array<string>;\n version?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport enum ResourceType {\n ActivityLog = \"activity_log\",\n Product = \"product\",\n Collection = \"collection\",\n Curation = \"curation\",\n CurationPin = \"curation_pin\",\n CurationHiding = \"curation_hiding\",\n Callout = \"callout\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Antonym = \"antonym\",\n Synonym = \"synonym\",\n Task = \"task\",\n SearchableField = \"searchable_field\",\n}\n\nexport enum MerchandisingCalloutAutofillBehaviour {\n Always = \"always\",\n MoreResults = \"more_results\",\n}\n\nexport const MerchandisingCalloutAutofillBehaviourLabel: Record<\n MerchandisingCalloutAutofillBehaviour,\n string\n> = {\n [MerchandisingCalloutAutofillBehaviour.Always]: \"Autofill always\",\n [MerchandisingCalloutAutofillBehaviour.MoreResults]: \"Autofill when there are more results\",\n};\n\nexport enum SharedStoreResource {\n Curation = \"curation\",\n Callout = \"callout\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Synonym = \"synonym\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n}\n\nexport const SharedStoreResourceLabels: Record<SharedStoreResource, string> = {\n [SharedStoreResource.Curation]: \"Curation\",\n [SharedStoreResource.Callout]: \"Callout\",\n [SharedStoreResource.FilterGroup]: \"Filter group\",\n [SharedStoreResource.FilterFacet]: \"Filter facet\",\n [SharedStoreResource.MergedValue]: \"Merged value\",\n [SharedStoreResource.Redirect]: \"Redirect\",\n [SharedStoreResource.Relevancy]: \"Relevancy\",\n [SharedStoreResource.Sort]: \"Sort\",\n [SharedStoreResource.Synonym]: \"Synonym\",\n [SharedStoreResource.SettingsAccount]: \"Settings account\",\n [SharedStoreResource.SettingsAutomation]: \"Settings automation\",\n [SharedStoreResource.SettingsProduct]: \"Settings product\",\n};\n\nexport interface Relevance extends ResourceDocument {\n field: string;\n enabled: boolean;\n importance: number;\n searchType: \"always_search\" | \"search_page\" | \"instant_search\";\n hidden?: boolean;\n}\n\nexport const DefinedFieldType = {\n Array: \"array\",\n Text: \"text\",\n Float: \"float\",\n Long: \"long\",\n Boolean: \"boolean\",\n} as const;\nexport type DefinedFieldType =\n | typeof DefinedFieldType[keyof typeof DefinedFieldType]\n | (string & {});\n\nexport interface DefinedField {\n label: string;\n name: string;\n type: DefinedFieldType;\n}\n\nexport interface Sort extends ResourceDocument {\n name: string;\n handle: string;\n field: string;\n position: number;\n enabled: boolean;\n direction: \"desc\" | \"asc\";\n visibility: \"all\" | \"search\" | \"collection\";\n hidden?: boolean;\n}\n\nexport interface FilterGroup extends ResourceDocument {\n name: string;\n handle: string;\n enabled: boolean;\n pageSize: number;\n collections: Array<string>;\n type: \"search\" | \"collection\";\n paginationType: \"pagination\" | \"load_more\" | \"next_prev\" | \"infinite_scroll\";\n inventoryVisibility: \"show_all\" | \"hide_products\" | \"hide_variants\" | \"hide_all\";\n}\n\nexport interface FilterFacet extends ResourceDocument {\n name: string;\n field: string;\n handle: string;\n position: number;\n enabled: boolean;\n keywords: Array<string>;\n customSortOrder?: string;\n displayType: \"multi\" | \"single\" | \"slider\";\n displayView: \"list\" | \"check\" | \"swatch\" | \"range\" | \"box\";\n displaySize: string;\n displaySliderStep: string;\n displaySliderPrefix: string;\n displaySliderSuffix: string;\n displayRangeOptions: Array<string>;\n settingsShowMore: boolean;\n settingsUppercase: boolean;\n settingsShowSearch: boolean;\n settingsShowFilter: boolean;\n settingsShowEmptyValues: boolean;\n settingsHideUnavailable: boolean;\n settingsCollapsedMobile: boolean;\n settingsCollapsedDesktop: boolean;\n settingsFilterLogic: \"and\" | \"or\";\n valuesShow: \"all\" | \"manual\";\n valuesManual: Array<string>;\n valuesExclude: Array<string>;\n}\n\nexport interface Redirect extends ResourceDocument {\n url: string;\n query: string;\n enabled: boolean;\n hidden?: boolean;\n}\n\nexport interface Curation extends ResourceDocument {\n title: string;\n status: CurationStatus;\n published: boolean;\n searchTerm?: string;\n longRunningTask?: boolean;\n collectionHandle?: string;\n collectionId?: string;\n type: CurationType;\n /** @deprecated */\n boosting?: {\n groupings?: BoostGrouping[];\n sortings?: BoostSorting[];\n };\n sort?: CurationSort;\n schedule?: CurationSchedule;\n scheduleEnabled?: boolean;\n scheduleTimezone?: string;\n hidden?: boolean;\n\n markets: Array<string>;\n\n boostings?: Boosting[];\n sortings?: Sorting[];\n}\n\nexport enum CurationType {\n Search = \"search\",\n Collection = \"collection\",\n}\n\nexport interface CurationSort {\n sortTag?: string;\n sortOption: string;\n sortDirection: \"asc\" | \"desc\";\n sortVariantOption?: \"option1\" | \"option2\" | \"option3\";\n}\n\nexport interface CurationSchedule {\n schedulePublish: string;\n schedulePublishEnabled: boolean;\n scheduleUnpublish: string;\n scheduleUnpublishEnabled: boolean;\n}\n\nexport enum CurationStatus {\n Draft = \"draft\",\n Publishing = \"publishing\",\n Published = \"published\",\n Error = \"error\",\n Unpublishing = \"unpublishing\",\n Resetting = \"resetting\",\n Pinning = \"pinning\",\n Sorting = \"sorting\",\n}\n\nexport interface CurationHiding {\n productId: number;\n}\n\nexport interface Market {\n id: string;\n label: string;\n enabled: boolean;\n publicationId: string;\n locationId: string;\n currencyCode?: string;\n countryCode?: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostGrouping {\n key: string;\n value: string;\n field: string;\n position: number;\n operation: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostSorting {\n key: string;\n field: string;\n query?: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport interface Link {\n content: string;\n url: string;\n key: string;\n}\n\nexport interface Callout extends ResourceDocument {\n type: CalloutType;\n link: string;\n links: Array<Link>;\n // name: string;\n title: string;\n content: string;\n enabled: boolean;\n textColor: string;\n mobileImage: string;\n mobileVideo: string;\n desktopVideo: string;\n desktopImage: string;\n backgroundColor: string;\n visibility: \"desktop\" | \"mobile\" | \"all\";\n displayColumns: string; // @todo this should be a number\n displayRows: string; // @todo this should be a number\n selectedDates?: {\n end: number;\n start: number;\n };\n hidden?: boolean;\n}\n\nexport enum CalloutType {\n Standard = \"standard\",\n Autofill = \"autofill\",\n}\n\nexport enum SynonymType {\n Group = \"group\",\n Oneway = \"oneway\",\n}\nexport interface Synonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n synonyms: Array<string>;\n type: SynonymType;\n hidden?: boolean;\n}\nexport interface Antonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n antonyms: Array<string>;\n hidden?: boolean;\n}\n\nexport interface MergedValue extends ResourceDocument {\n name: string;\n field: string;\n enabled: boolean;\n values: Array<string>;\n hidden?: boolean;\n}\n\nexport interface Collection extends ResourceDocument {\n title: string;\n handle: string;\n shopifyId: string;\n productIds: Array<string>;\n storefrontId: string;\n legacyResourceId: number;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n}\n\n// product is the shopify product with edges and nodes normalised\nexport type Product = ResourceDocument &\n Omit<\n ShopifyProduct,\n \"variants\" | \"images\" | \"media\" | \"metafields\" | \"category\" | \"unpublishedPublications\"\n > & {\n category: string;\n variants: Array<\n Omit<ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"], \"presentmentPrices\"> & {\n productId?: string;\n images?: Array<ShopifyProductImage>; // from child product if this variant is from a child\n presentmentPrices: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"presentmentPrices\"][\"edges\"][0][\"node\"][];\n marketPrices: Array<{\n marketId: string;\n price: {\n amount: string;\n currencyCode: string;\n };\n compareAtPrice: {\n amount: string;\n currencyCode: string;\n } | null;\n }>;\n // inventoryItem: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"inventoryItem\"];\n }\n >;\n // unpublishedPublications: Array<ShopifyProduct[\"unpublishedPublications\"][\"edges\"][0][\"node\"]>\n // inventoryLevels: Array<{\n // variantId: string;\n // locationId: string;\n // locationName: string;\n // quantity: number;\n // }>;\n related?: Array<string>;\n images: Array<ShopifyProductImage>;\n media: ShopifyProduct[\"media\"][\"edges\"][0][\"node\"][];\n metafields: ShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"][];\n keywords: Array<string>;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n markets?: Array<string>;\n };\n\nexport interface SearchableField extends ResourceDocument {\n field: string;\n enabled: boolean;\n hidden?: boolean;\n points: number;\n allowedMistakes: number;\n mistakePenaltyPercent: number;\n synyonymEnabled: boolean;\n synonymPenaltyPercent: number;\n}\n\nexport interface Boosting {\n key: string;\n fieldName: string;\n operation: Operation;\n value: string;\n points: number;\n}\n\nexport interface Sorting {\n field: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport const Operation = {\n Equals: \"equals\",\n NotEquals: \"not equals\",\n Contains: \"contains\",\n NotContains: \"not contains\",\n LessThan: \"less than\",\n GreaterThan: \"greater than\",\n} as const;\nexport type Operation = typeof Operation[keyof typeof Operation];\n"]}
1
+ {"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;AAUA,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,4CAA4B,CAAA;IAC5B,kDAAkC,CAAA;IAClC,mCAAmB,CAAA;IACnB,oDAAoC,CAAA;IACpC,0DAA0C,CAAA;IAC1C,oDAAoC,CAAA;IACpC,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,oDAAoC,CAAA;AACtC,CAAC,EArBW,YAAY,4BAAZ,YAAY,QAqBvB;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAC/C,0DAAiB,CAAA;IACjB,qEAA4B,CAAA;AAC9B,CAAC,EAHW,qCAAqC,qDAArC,qCAAqC,QAGhD;AAEY,QAAA,0CAA0C,GAA0D;IAC/G,CAAC,qCAAqC,CAAC,MAAM,CAAC,EAAE,iBAAiB;IACjE,CAAC,qCAAqC,CAAC,WAAW,CAAC,EAAE,sCAAsC;CAC5F,CAAC;AAEF,IAAY,mBAaX;AAbD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,4CAAqB,CAAA;IACrB,8CAAuB,CAAA;IACvB,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,2DAAoC,CAAA;IACpC,iEAA0C,CAAA;IAC1C,2DAAoC,CAAA;AACtC,CAAC,EAbW,mBAAmB,mCAAnB,mBAAmB,QAa9B;AAEY,QAAA,yBAAyB,GAAwC;I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AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAmGY,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;CACnB,CAAC","sourcesContent":["import type { ShopifyProduct, ShopifyProductImage } from \"./shopify\";\n\nexport interface ResourceDocument {\n id: string;\n keywords: Array<string>;\n version?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport enum ResourceType {\n ActivityLog = \"activity_log\",\n Product = \"product\",\n Collection = \"collection\",\n Curation = \"curation\",\n CurationPin = \"curation_pin\",\n CurationHiding = \"curation_hiding\",\n Callout = \"callout\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Antonym = \"antonym\",\n Synonym = \"synonym\",\n Task = \"task\",\n SearchableField = \"searchable_field\",\n}\n\nexport enum MerchandisingCalloutAutofillBehaviour {\n Always = \"always\",\n MoreResults = \"more_results\",\n}\n\nexport const MerchandisingCalloutAutofillBehaviourLabel: Record<MerchandisingCalloutAutofillBehaviour, string> = {\n [MerchandisingCalloutAutofillBehaviour.Always]: \"Autofill always\",\n [MerchandisingCalloutAutofillBehaviour.MoreResults]: \"Autofill when there are more results\",\n};\n\nexport enum SharedStoreResource {\n Curation = \"curation\",\n Callout = \"callout\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Synonym = \"synonym\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n}\n\nexport const SharedStoreResourceLabels: Record<SharedStoreResource, string> = {\n [SharedStoreResource.Curation]: \"Curation\",\n [SharedStoreResource.Callout]: \"Callout\",\n [SharedStoreResource.FilterGroup]: \"Filter group\",\n [SharedStoreResource.FilterFacet]: \"Filter facet\",\n [SharedStoreResource.MergedValue]: \"Merged value\",\n [SharedStoreResource.Redirect]: \"Redirect\",\n [SharedStoreResource.Relevancy]: \"Relevancy\",\n [SharedStoreResource.Sort]: \"Sort\",\n [SharedStoreResource.Synonym]: \"Synonym\",\n [SharedStoreResource.SettingsAccount]: \"Settings account\",\n [SharedStoreResource.SettingsAutomation]: \"Settings automation\",\n [SharedStoreResource.SettingsProduct]: \"Settings product\",\n};\n\nexport interface Relevance extends ResourceDocument {\n field: string;\n enabled: boolean;\n importance: number;\n searchType: \"always_search\" | \"search_page\" | \"instant_search\";\n hidden?: boolean;\n}\n\nexport const DefinedFieldType = {\n Array: \"array\",\n Text: \"text\",\n Float: \"float\",\n Long: \"long\",\n Boolean: \"boolean\",\n} as const;\nexport type DefinedFieldType = (typeof DefinedFieldType)[keyof typeof DefinedFieldType] | (string & {});\n\nexport interface DefinedField {\n label: string;\n name: string;\n type: DefinedFieldType;\n}\n\nexport interface Sort extends ResourceDocument {\n name: string;\n handle: string;\n field: string;\n position: number;\n enabled: boolean;\n direction: \"desc\" | \"asc\";\n visibility: \"all\" | \"search\" | \"collection\";\n hidden?: boolean;\n}\n\nexport interface FilterGroup extends ResourceDocument {\n name: string;\n handle: string;\n enabled: boolean;\n pageSize: number;\n collections: Array<string>;\n type: \"search\" | \"collection\";\n paginationType: \"pagination\" | \"load_more\" | \"next_prev\" | \"infinite_scroll\";\n inventoryVisibility: \"show_all\" | \"hide_products\" | \"hide_variants\" | \"hide_all\";\n}\n\nexport interface FilterFacet extends ResourceDocument {\n name: string;\n field: string;\n handle: string;\n position: number;\n enabled: boolean;\n keywords: Array<string>;\n customSortOrder?: string;\n displayType: \"multi\" | \"single\" | \"slider\";\n displayView: \"list\" | \"check\" | \"swatch\" | \"range\" | \"box\";\n displaySize: string;\n displaySliderStep: string;\n displaySliderPrefix: string;\n displaySliderSuffix: string;\n displayRangeOptions: Array<string>;\n settingsShowMore: boolean;\n settingsUppercase: boolean;\n settingsShowSearch: boolean;\n settingsShowFilter: boolean;\n settingsShowEmptyValues: boolean;\n settingsHideUnavailable: boolean;\n settingsCollapsedMobile: boolean;\n settingsCollapsedDesktop: boolean;\n settingsFilterLogic: \"and\" | \"or\";\n valuesShow: \"all\" | \"manual\";\n valuesManual: Array<string>;\n valuesExclude: Array<string>;\n}\n\nexport interface Redirect extends ResourceDocument {\n url: string;\n query: string;\n enabled: boolean;\n hidden?: boolean;\n}\n\nexport interface Curation extends ResourceDocument {\n title: string;\n status: CurationStatus;\n published: boolean;\n searchTerm?: string;\n longRunningTask?: boolean;\n collectionHandle?: string;\n collectionId?: string;\n type: CurationType;\n /** @deprecated */\n boosting?: {\n groupings?: BoostGrouping[];\n sortings?: BoostSorting[];\n };\n sort?: CurationSort;\n schedule?: CurationSchedule;\n scheduleEnabled?: boolean;\n scheduleTimezone?: string;\n hidden?: boolean;\n\n markets: Array<string>;\n\n boostings?: Boosting[];\n sortings?: Sorting[];\n}\n\nexport enum CurationType {\n Search = \"search\",\n Collection = \"collection\",\n}\n\nexport interface CurationSort {\n sortTag?: string;\n sortOption: string;\n sortDirection: \"asc\" | \"desc\";\n sortVariantOption?: \"option1\" | \"option2\" | \"option3\";\n}\n\nexport interface CurationSchedule {\n schedulePublish: string;\n schedulePublishEnabled: boolean;\n scheduleUnpublish: string;\n scheduleUnpublishEnabled: boolean;\n}\n\nexport enum CurationStatus {\n Draft = \"draft\",\n Publishing = \"publishing\",\n Published = \"published\",\n Error = \"error\",\n Unpublishing = \"unpublishing\",\n Resetting = \"resetting\",\n Pinning = \"pinning\",\n Sorting = \"sorting\",\n}\n\nexport interface CurationHiding {\n productId: number;\n}\n\nexport interface Market {\n id: string;\n label: string;\n enabled: boolean;\n publicationId: string;\n locationId: string;\n currencyCode?: string;\n countryCode?: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostGrouping {\n key: string;\n value: string;\n field: string;\n position: number;\n operation: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostSorting {\n key: string;\n field: string;\n query?: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport interface Link {\n content: string;\n url: string;\n key: string;\n}\n\nexport interface Callout extends ResourceDocument {\n type: CalloutType;\n link: string;\n links: Array<Link>;\n // name: string;\n title: string;\n content: string;\n enabled: boolean;\n textColor: string;\n mobileImage: string;\n mobileVideo: string;\n desktopVideo: string;\n desktopImage: string;\n backgroundColor: string;\n visibility: \"desktop\" | \"mobile\" | \"all\";\n displayColumns: string; // @todo this should be a number\n displayRows: string; // @todo this should be a number\n selectedDates?: {\n end: number;\n start: number;\n };\n hidden?: boolean;\n}\n\nexport enum CalloutType {\n Standard = \"standard\",\n Autofill = \"autofill\",\n}\n\nexport enum SynonymType {\n Group = \"group\",\n Oneway = \"oneway\",\n}\nexport interface Synonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n synonyms: Array<string>;\n type: SynonymType;\n hidden?: boolean;\n}\nexport interface Antonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n antonyms: Array<string>;\n hidden?: boolean;\n}\n\nexport interface MergedValue extends ResourceDocument {\n name: string;\n field: string;\n enabled: boolean;\n values: Array<string>;\n hidden?: boolean;\n}\n\nexport interface Collection extends ResourceDocument {\n title: string;\n handle: string;\n shopifyId: string;\n productIds: Array<string>;\n storefrontId: string;\n legacyResourceId: number;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n}\n\n// product is the shopify product with edges and nodes normalised\nexport type Product = ResourceDocument &\n Omit<ShopifyProduct, \"variants\" | \"images\" | \"media\" | \"metafields\" | \"category\" | \"unpublishedPublications\"> & {\n category: string;\n variants: Array<\n Omit<ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"], \"presentmentPrices\"> & {\n productId?: string;\n images?: Array<ShopifyProductImage>; // from child product if this variant is from a child\n presentmentPrices: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"presentmentPrices\"][\"edges\"][0][\"node\"][];\n marketPrices: Array<{\n marketId: string;\n price: {\n amount: string;\n currencyCode: string;\n };\n compareAtPrice: {\n amount: string;\n currencyCode: string;\n } | null;\n }>;\n // inventoryItem: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"inventoryItem\"];\n }\n >;\n // unpublishedPublications: Array<ShopifyProduct[\"unpublishedPublications\"][\"edges\"][0][\"node\"]>\n // inventoryLevels: Array<{\n // variantId: string;\n // locationId: string;\n // locationName: string;\n // quantity: number;\n // }>;\n related?: Array<string>;\n images: Array<ShopifyProductImage>;\n media: ShopifyProduct[\"media\"][\"edges\"][0][\"node\"][];\n metafields: ShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"][];\n keywords: Array<string>;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n markets?: Array<string>;\n };\n\nexport interface SearchableField extends ResourceDocument {\n field: string;\n enabled: boolean;\n hidden?: boolean;\n points: number;\n maxEdits: number;\n mistakePenaltyPercent: number;\n synonymEnabled: boolean;\n synonymPenaltyPercent: number;\n}\n\nexport interface Boosting {\n key: string;\n fieldName: string;\n operation: Operation;\n value: string;\n points: number;\n}\n\nexport interface Sorting {\n field: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport const Operation = {\n Equals: \"equals\",\n NotEquals: \"not equals\",\n Contains: \"contains\",\n NotContains: \"not contains\",\n LessThan: \"less than\",\n GreaterThan: \"greater than\",\n} as const;\nexport type Operation = (typeof Operation)[keyof typeof Operation];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,mDAAiC","sourcesContent":["export * from \"./config\";\nexport * from \"./elastic\";\nexport * from \"./reactivesearch\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,mDAAiC","sourcesContent":["export * from \"./config\";\nexport * from \"./elastic\";\nexport * from \"./reactivesearch\";\n"]}
@@ -1,4 +1,4 @@
1
- import { ElasticDocument, ElasticHit } from "./elastic";
1
+ import type { ElasticDocument, ElasticHit } from "./elastic";
2
2
  export interface ReactivesearchFilterListProps {
3
3
  loading: boolean;
4
4
  error: Error | null;
@@ -1 +1 @@
1
- {"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import { ElasticDocument, ElasticHit } from \"./elastic\";\n\n// props passed to SingleList/MultiList.render\nexport interface ReactivesearchFilterListProps {\n loading: boolean;\n error: Error | null;\n handleChange: (key: string) => void;\n data: { doc_count: number; key: string }[];\n value: string | { [key: string]: boolean };\n rawData: {\n aggregations?: any;\n };\n}\n\n// props passed to ReactiveList.renderPagination\nexport interface ReactivesearchPaginationProps {\n pages: number;\n showEndPage: false;\n totalPages: number;\n currentPage: number;\n setPage: (page: number) => void;\n}\n\n// props passed to ReactiveList.render\n// @todo complete missing types\nexport interface ReactivesearchResultProps {\n error?: ReactivesearchError;\n loading: boolean;\n data: Array<Omit<ElasticHit, \"_source\"> & ElasticDocument>;\n loadMore: () => void;\n customData: unknown;\n promotedData: unknown;\n aggregationData: unknown;\n rawData?: {\n _shards: {\n failed: number;\n skipped: number;\n successful: number;\n total: number;\n };\n took: number;\n status: number;\n timed_out: boolean;\n hits: ElasticHit[];\n };\n resultStats: {\n time: number;\n hidden: number;\n promoted: number;\n currentPage: number;\n numberOfPages: number;\n numberOfResults?: number;\n displayedResults: number;\n };\n streamData: unknown;\n triggerAnalytics: unknown;\n triggerClickAnalytics: unknown;\n}\n\nexport type ResultsDataListenerParams = Pick<\n ReactivesearchResultProps,\n \"data\" | \"resultStats\" | \"rawData\"\n>;\nexport type ResultsDataListener = (params: ResultsDataListenerParams) => void;\n\n// state for the \"page\" component returned by StateProvider when given the keys: [\"isLoading\", \"hits\", \"resultStats\", \"error\"]\nexport interface ReactivesearchSearchStatePage {\n isLoading: boolean;\n hits: {\n hidden: number;\n time: number;\n total: number;\n hits: ElasticHit[];\n };\n resultStats: {\n hidden: number;\n numberOfResults?: number;\n promoted: number;\n time: number;\n };\n error?: ReactivesearchError;\n}\n\nexport interface ReactivesearchError {\n status: number;\n statusText: string;\n}\n"]}
1
+ {"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import type { ElasticDocument, ElasticHit } from \"./elastic\";\n\n// props passed to SingleList/MultiList.render\nexport interface ReactivesearchFilterListProps {\n loading: boolean;\n error: Error | null;\n handleChange: (key: string) => void;\n data: { doc_count: number; key: string }[];\n value: string | { [key: string]: boolean };\n rawData: {\n aggregations?: any;\n };\n}\n\n// props passed to ReactiveList.renderPagination\nexport interface ReactivesearchPaginationProps {\n pages: number;\n showEndPage: false;\n totalPages: number;\n currentPage: number;\n setPage: (page: number) => void;\n}\n\n// props passed to ReactiveList.render\n// @todo complete missing types\nexport interface ReactivesearchResultProps {\n error?: ReactivesearchError;\n loading: boolean;\n data: Array<Omit<ElasticHit, \"_source\"> & ElasticDocument>;\n loadMore: () => void;\n customData: unknown;\n promotedData: unknown;\n aggregationData: unknown;\n rawData?: {\n _shards: {\n failed: number;\n skipped: number;\n successful: number;\n total: number;\n };\n took: number;\n status: number;\n timed_out: boolean;\n hits: ElasticHit[];\n };\n resultStats: {\n time: number;\n hidden: number;\n promoted: number;\n currentPage: number;\n numberOfPages: number;\n numberOfResults?: number;\n displayedResults: number;\n };\n streamData: unknown;\n triggerAnalytics: unknown;\n triggerClickAnalytics: unknown;\n}\n\nexport type ResultsDataListenerParams = Pick<ReactivesearchResultProps, \"data\" | \"resultStats\" | \"rawData\">;\nexport type ResultsDataListener = (params: ResultsDataListenerParams) => void;\n\n// state for the \"page\" component returned by StateProvider when given the keys: [\"isLoading\", \"hits\", \"resultStats\", \"error\"]\nexport interface ReactivesearchSearchStatePage {\n isLoading: boolean;\n hits: {\n hidden: number;\n time: number;\n total: number;\n hits: ElasticHit[];\n };\n resultStats: {\n hidden: number;\n numberOfResults?: number;\n promoted: number;\n time: number;\n };\n error?: ReactivesearchError;\n}\n\nexport interface ReactivesearchError {\n status: number;\n statusText: string;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ProductQuery, BulkQueryProductsWithDraftProductsQuery, ListAppSubscriptionsQuery, ListAppPurchaseOneTimeQuery, BulkQueryProductMarketsWithDraftProductsQuery } from "./graphql";
1
+ import type { BulkQueryProductMarketsWithDraftProductsQuery, BulkQueryProductsWithDraftProductsQuery, ListAppPurchaseOneTimeQuery, ListAppSubscriptionsQuery, ProductQuery } from "./graphql";
2
2
  export type ShopifyProductImage = {
3
3
  __typename: "Image";
4
4
  id?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.js","sourceRoot":"","sources":["../../../src/types/shopify.ts"],"names":[],"mappings":";;;AAsCA,8BAEC;AAED,4CAEC;AAED,gDAEC;AAED,0BAEC;AAED,sCAEC;AAED,kCAEC;AAtBD,SAAgB,SAAS,CAAC,UAA6B;IACrD,OAAO,SAAS,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7C,CAAC;AAED,SAAgB,gBAAgB,CAAC,UAA6B;IAC5D,OAAO,gBAAgB,KAAK,UAAU,CAAC,UAAU,CAAC;AACpD,CAAC;AAED,SAAgB,kBAAkB,CAAC,UAA6B;IAC9D,OAAO,yBAAyB,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7D,CAAC;AAED,SAAgB,OAAO,CAAC,UAA6B;IACnD,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC7F,CAAC;AAED,SAAgB,aAAa,CAAC,UAA6B;IACzD,OAAO,aAAa,KAAK,UAAU,CAAC,UAAU,CAAC;AACjD,CAAC;AAED,SAAgB,WAAW,CAAC,UAA6B;IACvD,OAAO,WAAW,KAAK,UAAU,CAAC,UAAU,CAAC;AAC/C,CAAC;AAED,qCAA0C;AAAjC,wGAAA,aAAa,OAAA","sourcesContent":["import {\n ProductQuery,\n BulkQueryProductsWithDraftProductsQuery,\n ListAppSubscriptionsQuery,\n ListAppPurchaseOneTimeQuery,\n BulkQueryProductMarketsWithDraftProductsQuery,\n} from \"./graphql\";\n\nexport type ShopifyProductImage = {\n __typename: \"Image\";\n id?: string | null;\n altText?: string | null;\n originalSrc: string;\n}\n\n// these are the types from the single \"product\" query, and is what we store in firestore\nexport type ShopifyProduct = NonNullable<ProductQuery[\"product\"]>\nexport type ShopifyVariant = ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"]\n\n// these are the types from the bulk \"product\" query, which should match the above, but we\n// always type on the single query in firestore\nexport type BulkShopifyProduct = BulkQueryProductsWithDraftProductsQuery[\"products\"][\"edges\"][0][\"node\"]\nexport type BulkShopifyProductMarket = BulkQueryProductMarketsWithDraftProductsQuery[\"products\"][\"edges\"][0][\"node\"]\nexport type BulkShopifyVariant = BulkShopifyProduct[\"variants\"][\"edges\"][0][\"node\"]\n\n// these are types for the individual \"export lines\" which shopify exports in the bulk export file\nexport type ShopifyExportProduct = Omit<BulkShopifyProduct, \"variants\" | \"images\" | \"media\" | \"metafields\">\nexport type ShopifyExportProductVariant = Omit<BulkShopifyVariant, \"presentmentPrices\">\nexport type ShopifyExportPresentmentPrice = BulkShopifyVariant[\"presentmentPrices\"][\"edges\"][0][\"node\"] & { __parentId?: string }\nexport type ShopifyExportMedia = BulkShopifyProduct[\"media\"][\"edges\"][0][\"node\"]\nexport type ShopifyExportMetafield = BulkShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"]\nexport type ShopifyExportPublication = BulkShopifyProductMarket[\"unpublishedPublications\"][\"edges\"][0][\"node\"]\n\nexport interface ShopifyExportLine {\n __parentId?: string\n __typename: string\n}\n\nexport function isProduct(exportLine: ShopifyExportLine): exportLine is ShopifyExportProduct {\n return \"Product\" === exportLine.__typename;\n}\n\nexport function isProductVariant(exportLine: ShopifyExportLine): exportLine is ShopifyExportProductVariant {\n return \"ProductVariant\" === exportLine.__typename;\n}\n\nexport function isPresentmentPrice(exportLine: ShopifyExportLine): exportLine is ShopifyExportPresentmentPrice {\n return \"ProductVariantPricePair\" === exportLine.__typename;\n}\n\nexport function isMedia(exportLine: ShopifyExportLine): exportLine is ShopifyExportMedia {\n return [\"Video\", \"Model3d\", \"MediaImage\", \"ExternalVideo\"].includes(exportLine.__typename);\n}\n\nexport function isPublication(exportLine: ShopifyExportLine): exportLine is ShopifyExportPublication {\n return \"Publication\" === exportLine.__typename;\n}\n\nexport function isMetafield(exportLine: ShopifyExportLine): exportLine is ShopifyExportMetafield {\n return \"Metafield\" === exportLine.__typename;\n}\n\nexport { ProductStatus } from \"./graphql\";\n\nexport type ShopifyAppSubscription = NonNullable<\n ListAppSubscriptionsQuery[\"currentAppInstallation\"][\"activeSubscriptions\"][number]\n>\nexport type ShopifyAppPurchaseOneTime = NonNullable<\n ListAppPurchaseOneTimeQuery[\"currentAppInstallation\"][\"oneTimePurchases\"][\"edges\"][number][\"node\"]\n>\n\nexport interface ShopifyExportLine {\n __parentId?: string\n __typename: string\n}\n"]}
1
+ {"version":3,"file":"shopify.js","sourceRoot":"","sources":["../../../src/types/shopify.ts"],"names":[],"mappings":";;;AAwCA,8BAEC;AAED,4CAEC;AAED,gDAEC;AAED,0BAEC;AAED,sCAEC;AAED,kCAEC;AAtBD,SAAgB,SAAS,CAAC,UAA6B;IACrD,OAAO,SAAS,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7C,CAAC;AAED,SAAgB,gBAAgB,CAAC,UAA6B;IAC5D,OAAO,gBAAgB,KAAK,UAAU,CAAC,UAAU,CAAC;AACpD,CAAC;AAED,SAAgB,kBAAkB,CAAC,UAA6B;IAC9D,OAAO,yBAAyB,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7D,CAAC;AAED,SAAgB,OAAO,CAAC,UAA6B;IACnD,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC7F,CAAC;AAED,SAAgB,aAAa,CAAC,UAA6B;IACzD,OAAO,aAAa,KAAK,UAAU,CAAC,UAAU,CAAC;AACjD,CAAC;AAED,SAAgB,WAAW,CAAC,UAA6B;IACvD,OAAO,WAAW,KAAK,UAAU,CAAC,UAAU,CAAC;AAC/C,CAAC;AAED,qCAA0C;AAAjC,wGAAA,aAAa,OAAA","sourcesContent":["import type {\n BulkQueryProductMarketsWithDraftProductsQuery,\n BulkQueryProductsWithDraftProductsQuery,\n ListAppPurchaseOneTimeQuery,\n ListAppSubscriptionsQuery,\n ProductQuery,\n} from \"./graphql\";\n\nexport type ShopifyProductImage = {\n __typename: \"Image\";\n id?: string | null;\n altText?: string | null;\n originalSrc: string;\n};\n\n// these are the types from the single \"product\" query, and is what we store in firestore\nexport type ShopifyProduct = NonNullable<ProductQuery[\"product\"]>;\nexport type ShopifyVariant = ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"];\n\n// these are the types from the bulk \"product\" query, which should match the above, but we\n// always type on the single query in firestore\nexport type BulkShopifyProduct = BulkQueryProductsWithDraftProductsQuery[\"products\"][\"edges\"][0][\"node\"];\nexport type BulkShopifyProductMarket = BulkQueryProductMarketsWithDraftProductsQuery[\"products\"][\"edges\"][0][\"node\"];\nexport type BulkShopifyVariant = BulkShopifyProduct[\"variants\"][\"edges\"][0][\"node\"];\n\n// these are types for the individual \"export lines\" which shopify exports in the bulk export file\nexport type ShopifyExportProduct = Omit<BulkShopifyProduct, \"variants\" | \"images\" | \"media\" | \"metafields\">;\nexport type ShopifyExportProductVariant = Omit<BulkShopifyVariant, \"presentmentPrices\">;\nexport type ShopifyExportPresentmentPrice = BulkShopifyVariant[\"presentmentPrices\"][\"edges\"][0][\"node\"] & {\n __parentId?: string;\n};\nexport type ShopifyExportMedia = BulkShopifyProduct[\"media\"][\"edges\"][0][\"node\"];\nexport type ShopifyExportMetafield = BulkShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"];\nexport type ShopifyExportPublication = BulkShopifyProductMarket[\"unpublishedPublications\"][\"edges\"][0][\"node\"];\n\nexport interface ShopifyExportLine {\n __parentId?: string;\n __typename: string;\n}\n\nexport function isProduct(exportLine: ShopifyExportLine): exportLine is ShopifyExportProduct {\n return \"Product\" === exportLine.__typename;\n}\n\nexport function isProductVariant(exportLine: ShopifyExportLine): exportLine is ShopifyExportProductVariant {\n return \"ProductVariant\" === exportLine.__typename;\n}\n\nexport function isPresentmentPrice(exportLine: ShopifyExportLine): exportLine is ShopifyExportPresentmentPrice {\n return \"ProductVariantPricePair\" === exportLine.__typename;\n}\n\nexport function isMedia(exportLine: ShopifyExportLine): exportLine is ShopifyExportMedia {\n return [\"Video\", \"Model3d\", \"MediaImage\", \"ExternalVideo\"].includes(exportLine.__typename);\n}\n\nexport function isPublication(exportLine: ShopifyExportLine): exportLine is ShopifyExportPublication {\n return \"Publication\" === exportLine.__typename;\n}\n\nexport function isMetafield(exportLine: ShopifyExportLine): exportLine is ShopifyExportMetafield {\n return \"Metafield\" === exportLine.__typename;\n}\n\nexport { ProductStatus } from \"./graphql\";\n\nexport type ShopifyAppSubscription = NonNullable<\n ListAppSubscriptionsQuery[\"currentAppInstallation\"][\"activeSubscriptions\"][number]\n>;\nexport type ShopifyAppPurchaseOneTime = NonNullable<\n ListAppPurchaseOneTimeQuery[\"currentAppInstallation\"][\"oneTimePurchases\"][\"edges\"][number][\"node\"]\n>;\n\nexport interface ShopifyExportLine {\n __parentId?: string;\n __typename: string;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Config } from "../types/config";
1
+ import type { Config } from "../types/config";
2
2
  export declare const getConfigFromCache: () => Config | undefined;
3
3
  export declare const getConfigFromNetwork: (shopifyPermanentDomain: string) => Promise<Config | undefined>;
4
4
  export declare const getConfig: (shopifyPermanentDomain: string) => Promise<Config>;
@@ -31,7 +31,7 @@ const getConfigFromNetwork = (shopifyPermanentDomain) => __awaiter(void 0, void
31
31
  try {
32
32
  configFromNetwork = (_a = (yield fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json()))) === null || _a === void 0 ? void 0 : _a.body;
33
33
  }
34
- catch (error) {
34
+ catch (_error) {
35
35
  configFromNetwork = (_b = (yield fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json()))) === null || _b === void 0 ? void 0 : _b.body;
36
36
  }
37
37
  return configFromNetwork;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utility/config.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEO,MAAM,kBAAkB,GAAG,GAAuB,EAAE;;IACzD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAEV,IAAI,CAAC,KAAK,CACnB,MAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,mCAAI,MAAM,CAClE,CAAC;IAEF,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAA,MAAA,eAAe,CAAC,MAAM,CAAC,KAAK,0CAAE,OAAO,MAAK,KAAK,EAAE,CAAC;YACpD,OAAO;QACT,CAAC;QAED,OAAO,eAAe,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,OAAO;AACT,CAAC,CAAC;AApBW,QA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S,aAsBpB","sourcesContent":["import { Config } from \"../types/config\";\n\nexport const getConfigFromCache = (): Config | undefined => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const configFromCache: {\n config: Config;\n } | null = JSON.parse(\n window.sessionStorage.getItem(\"reactify-search:config\") ?? \"null\"\n );\n\n if (configFromCache) {\n if (configFromCache.config.cache?.enabled === false) {\n return;\n }\n\n return configFromCache.config;\n }\n\n return;\n};\n\nexport const getConfigFromNetwork = async (shopifyPermanentDomain: string): Promise<Config | undefined> => {\n let configFromNetwork: Config | undefined;\n try {\n configFromNetwork = (await fetch(\n `https://config.usereactify.com/?shop=${shopifyPermanentDomain}`\n ).then((response) => response.json()))?.body;\n \n } catch (error) {\n configFromNetwork = (await fetch(\n `https://config.usereactify.com/?shop=${shopifyPermanentDomain}`\n ).then((response) => response.json()))?.body;\n }\n\n return configFromNetwork;\n};\n\nexport const getConfig = async (shopifyPermanentDomain: string): Promise<Config> => {\n const configFromCache = getConfigFromCache();\n if (configFromCache) {\n return configFromCache;\n }\n\n const configFromNetwork = await getConfigFromNetwork(shopifyPermanentDomain);\n\n if (!configFromNetwork) {\n throw new Error(\"Unable to load config\");\n }\n\n if (typeof window !== \"undefined\") {\n window.sessionStorage.setItem(\n \"reactify-search:config\",\n JSON.stringify({\n config: configFromNetwork,\n })\n );\n }\n\n return configFromNetwork;\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utility/config.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEO,MAAM,kBAAkB,GAAG,GAAuB,EAAE;;IACzD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAEV,IAAI,CAAC,KAAK,CAAC,MAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,mCAAI,MAAM,CAAC,CAAC;IAEzF,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAA,MAAA,eAAe,CAA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EACxB,IAAI,CAAC,SAAS,CAAC;YACb,MAAM,EAAE,iBAAiB;SAC1B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA,CAAC;AAtBW,QAAA,SAAS,aAsBpB","sourcesContent":["import type { Config } from \"../types/config\";\n\nexport const getConfigFromCache = (): Config | undefined => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const configFromCache: {\n config: Config;\n } | null = JSON.parse(window.sessionStorage.getItem(\"reactify-search:config\") ?? \"null\");\n\n if (configFromCache) {\n if (configFromCache.config.cache?.enabled === false) {\n return;\n }\n\n return configFromCache.config;\n }\n\n return;\n};\n\nexport const getConfigFromNetwork = async (shopifyPermanentDomain: string): Promise<Config | undefined> => {\n let configFromNetwork: Config | undefined;\n try {\n configFromNetwork = (\n await fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json())\n )?.body;\n } catch (_error) {\n configFromNetwork = (\n await fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json())\n )?.body;\n }\n\n return configFromNetwork;\n};\n\nexport const getConfig = async (shopifyPermanentDomain: string): Promise<Config> => {\n const configFromCache = getConfigFromCache();\n if (configFromCache) {\n return configFromCache;\n }\n\n const configFromNetwork = await getConfigFromNetwork(shopifyPermanentDomain);\n\n if (!configFromNetwork) {\n throw new Error(\"Unable to load config\");\n }\n\n if (typeof window !== \"undefined\") {\n window.sessionStorage.setItem(\n \"reactify-search:config\",\n JSON.stringify({\n config: configFromNetwork,\n })\n );\n }\n\n return configFromNetwork;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { ReactifySearchProviderProps } from "../components";
2
- import { Config, ConfigCuration } from "../types";
1
+ import type { ReactifySearchProviderProps } from "../components";
2
+ import type { Config, ConfigCuration } from "../types";
3
3
  export declare const getCuration: (options: {
4
4
  provider: ReactifySearchProviderProps;
5
5
  config: Config;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCuration = void 0;
4
4
  const getCuration = (options) => {
5
5
  var _a;
6
- const handleOrSearchTerm = options.provider.mode === "collection" ? options.provider.collectionHandle : (_a = options.searchTerm) !== null && _a !== void 0 ? _a : "";
6
+ const handleOrSearchTerm = options.provider.mode === "collection" ? options.provider.collectionHandle : ((_a = options.searchTerm) !== null && _a !== void 0 ? _a : "");
7
7
  const normalisedHandleOrSearchTerm = handleOrSearchTerm.toLowerCase().trim();
8
8
  const globalCuration = options.config.curations.find((curation) => {
9
9
  if (options.provider.mode === "search" || options.provider.mode === "instant-search") {
@@ -1 +1 @@
1
- {"version":3,"file":"curation.js","sourceRoot":"","sources":["../../../src/utility/curation.ts"],"names":[],"mappings":";;;AAGO,MAAM,WAAW,GAAG,CAAC,OAI3B,EAA8B,EAAE;;IAC/B,MAAM,kBAAkB,GACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC;IAExG,MAAM,4BAA4B,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAE7E,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YACrF,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAE,OAAO,QAAQ,CAAC,EAAE,KAAK,UAAU,OAAO,CAAC,QAAQ,CAAC,MAAM,SAAS,CAAC;YAC/F,OAAO,QAAQ,CAAC,EAAE,KAAK,eAAe,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY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FW,QAAA,WAAW,eAmFtB","sourcesContent":["import { ReactifySearchProviderProps } from \"../components\";\nimport { Config, ConfigCuration } from \"../types\";\n\nexport const getCuration = (options: {\n provider: ReactifySearchProviderProps;\n config: Config;\n searchTerm?: string;\n}): ConfigCuration | undefined => {\n const handleOrSearchTerm =\n options.provider.mode === \"collection\" ? options.provider.collectionHandle : options.searchTerm ?? \"\";\n\n const normalisedHandleOrSearchTerm = handleOrSearchTerm.toLowerCase().trim();\n\n const globalCuration = options.config.curations.find((curation) => {\n if (options.provider.mode === \"search\" || options.provider.mode === \"instant-search\") {\n if (options.provider.market) return curation.id === `global_${options.provider.market}_search`;\n return curation.id === \"global_search\";\n }\n if (options.provider.mode === \"collection\") {\n if (options.provider.market) return curation.id === `global_${options.provider.market}_collection`;\n return curation.id === \"global_collection\";\n }\n return false;\n });\n\n const findCuration = () => {\n const curationsMatchingQuery = options.config.curations.filter((curation) => {\n const normalisedSearchTerm = curation.searchTerm?.toLowerCase().trim();\n const normalisedCollectionHandle = curation.collectionHandle?.toLowerCase().trim();\n\n if (\"instant-search\" === options.provider.mode || \"search\" === options.provider.mode) {\n return \"search\" === curation.type && normalisedHandleOrSearchTerm === normalisedSearchTerm;\n }\n\n if (\"collection\" === options.provider.mode) {\n return \"collection\" === curation.type && normalisedHandleOrSearchTerm === normalisedCollectionHandle;\n }\n\n return false;\n });\n\n const curationsMatchingMarketOrNoMarket = curationsMatchingQuery\n .filter((curation) => {\n if (options.provider.market) {\n if (curation.markets?.length === 0) return true;\n return curation.markets?.includes(options.provider.market);\n }\n return curation.markets?.length === 0;\n })\n .sort((curationA, curationB) => {\n return (curationB.markets?.length ?? 0) - (curationA.markets?.length ?? 0);\n });\n\n return curationsMatchingMarketOrNoMarket[0];\n };\n\n const curation = findCuration();\n\n const addGlobalBoosting = (curation: ConfigCuration) => {\n if (!globalCuration) {\n return curation;\n }\n\n const curationHasRules = !!curation.boosting.groupings.length || !!curation.boosting.sortings.length;\n\n if (curationHasRules) {\n return curation;\n }\n\n const curationWithGlobalBoosting = {\n ...curation,\n boosting: globalCuration.boosting,\n } as ConfigCuration;\n\n return curationWithGlobalBoosting;\n };\n\n if (curation) {\n return addGlobalBoosting(curation);\n }\n\n if (globalCuration) {\n return globalCuration;\n }\n\n return undefined;\n};\n"]}
1
+ {"version":3,"file":"curation.js","sourceRoot":"","sources":["../../../src/utility/curation.ts"],"names":[],"mappings":";;;AAGO,MAAM,WAAW,GAAG,CAAC,OAI3B,EAA8B,EAAE;;IAC/B,MAAM,kBAAkB,GACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC;IAE1G,MAAM,4BAA4B,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAE7E,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YACrF,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAE,OAAO,QAAQ,CAAC,EAAE,KAAK,UAAU,OAAO,CAAC,QAAQ,CAAC,MAAM,SAAS,CAAC;YAC/F,OAAO,QAAQ,CAAC,EAAE,KAAK,eAAe,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAE,OAAO,QAAQ,CAAC,EAAE,KAAK,UAAU,OAAO,CAAC,QAAQ,CAAC,MAAM,aAAa,CAAC;YACnG,OAAO,QAAQ,CAAC,EAAE,KAAK,m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QACxC,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;;YAC7B,OAAO,CAAC,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;QAEL,OAAO,iCAAiC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;IAEhC,MAAM,iBAAiB,GAAG,CAAC,QAAwB,EAAE,EAAE;QACrD,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,gBAAgB,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAErG,IAAI,gBAAgB,EAAE,CAAC;YACrB,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,0BAA0B,GAAG,gCAC9B,QAAQ,KACX,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAChB,CAAC;QAEpB,OAAO,0BAA0B,CAAC;IACpC,CAAC,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAnFW,QAAA,WAAW,eAmFtB","sourcesContent":["import type { ReactifySearchProviderProps } from \"../components\";\nimport type { Config, ConfigCuration } from \"../types\";\n\nexport const getCuration = (options: {\n provider: ReactifySearchProviderProps;\n config: Config;\n searchTerm?: string;\n}): ConfigCuration | undefined => {\n const handleOrSearchTerm =\n options.provider.mode === \"collection\" ? options.provider.collectionHandle : (options.searchTerm ?? \"\");\n\n const normalisedHandleOrSearchTerm = handleOrSearchTerm.toLowerCase().trim();\n\n const globalCuration = options.config.curations.find((curation) => {\n if (options.provider.mode === \"search\" || options.provider.mode === \"instant-search\") {\n if (options.provider.market) return curation.id === `global_${options.provider.market}_search`;\n return curation.id === \"global_search\";\n }\n if (options.provider.mode === \"collection\") {\n if (options.provider.market) return curation.id === `global_${options.provider.market}_collection`;\n return curation.id === \"global_collection\";\n }\n return false;\n });\n\n const findCuration = () => {\n const curationsMatchingQuery = options.config.curations.filter((curation) => {\n const normalisedSearchTerm = curation.searchTerm?.toLowerCase().trim();\n const normalisedCollectionHandle = curation.collectionHandle?.toLowerCase().trim();\n\n if (\"instant-search\" === options.provider.mode || \"search\" === options.provider.mode) {\n return \"search\" === curation.type && normalisedHandleOrSearchTerm === normalisedSearchTerm;\n }\n\n if (\"collection\" === options.provider.mode) {\n return \"collection\" === curation.type && normalisedHandleOrSearchTerm === normalisedCollectionHandle;\n }\n\n return false;\n });\n\n const curationsMatchingMarketOrNoMarket = curationsMatchingQuery\n .filter((curation) => {\n if (options.provider.market) {\n if (curation.markets?.length === 0) return true;\n return curation.markets?.includes(options.provider.market);\n }\n return curation.markets?.length === 0;\n })\n .sort((curationA, curationB) => {\n return (curationB.markets?.length ?? 0) - (curationA.markets?.length ?? 0);\n });\n\n return curationsMatchingMarketOrNoMarket[0];\n };\n\n const curation = findCuration();\n\n const addGlobalBoosting = (curation: ConfigCuration) => {\n if (!globalCuration) {\n return curation;\n }\n\n const curationHasRules = !!curation.boosting.groupings.length || !!curation.boosting.sortings.length;\n\n if (curationHasRules) {\n return curation;\n }\n\n const curationWithGlobalBoosting = {\n ...curation,\n boosting: globalCuration.boosting,\n } as ConfigCuration;\n\n return curationWithGlobalBoosting;\n };\n\n if (curation) {\n return addGlobalBoosting(curation);\n }\n\n if (globalCuration) {\n return globalCuration;\n }\n\n return undefined;\n};\n"]}
@@ -16,6 +16,6 @@ exports.debug = {
16
16
  exports.debuggers[namespace](formatter, ...args);
17
17
  },
18
18
  hook: hooks_1.useDebugger,
19
- hookOnce: hooks_1.useDebuggerOnce
19
+ hookOnce: hooks_1.useDebuggerOnce,
20
20
  };
21
21
  //# sourceMappingURL=debug.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utility/debug.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAAwD;AAE3C,QAAA,SAAS,GAAmC,EAAE,CAAC;AAE/C,QAAA,KAAK,GAAG;IACnB,SAAS,EAAE,iBAAiB;IAC5B,GAAG,EAAE,CAAC,SAAiB,EAAE,SAAkB,EAAE,GAAG,IAAgB,EAAE,EAAE;QAClE,IAAI,CAAC,iBAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,iBAAS,CAAC,SAAS,CAAC,GAAG,IAAA,eAAK,EAAC,GAAG,aAAK,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,iBAAS,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,EAAE,mBAAW;IACjB,QAAQ,EAAE,uBAAe;CAC1B,CAAC","sourcesContent":["import Debug from \"debug\";\n\nimport { useDebugger, useDebuggerOnce } from \"../hooks\";\n\nexport const debuggers: Record<string, Debug.Debugger> = {};\n\nexport const debug = {\n namespace: \"reactify-search\",\n log: (namespace: string, formatter?: string, ...args: Array<any>) => {\n if (!debuggers[namespace]) {\n debuggers[namespace] = Debug(`${debug.namespace}:${namespace}`);\n }\n\n debuggers[namespace](formatter, ...args);\n },\n hook: useDebugger,\n hookOnce: useDebuggerOnce\n};\n"]}
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utility/debug.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oCAAwD;AAE3C,QAAA,SAAS,GAAmC,EAAE,CAAC;AAE/C,QAAA,KAAK,GAAG;IACnB,SAAS,EAAE,iBAAiB;IAC5B,GAAG,EAAE,CAAC,SAAiB,EAAE,SAAkB,EAAE,GAAG,IAAgB,EAAE,EAAE;QAClE,IAAI,CAAC,iBAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,iBAAS,CAAC,SAAS,CAAC,GAAG,IAAA,eAAK,EAAC,GAAG,aAAK,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,iBAAS,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,EAAE,mBAAW;IACjB,QAAQ,EAAE,uBAAe;CAC1B,CAAC","sourcesContent":["import Debug from \"debug\";\nimport { useDebugger, useDebuggerOnce } from \"../hooks\";\n\nexport const debuggers: Record<string, Debug.Debugger> = {};\n\nexport const debug = {\n namespace: \"reactify-search\",\n log: (namespace: string, formatter?: string, ...args: Array<any>) => {\n if (!debuggers[namespace]) {\n debuggers[namespace] = Debug(`${debug.namespace}:${namespace}`);\n }\n\n debuggers[namespace](formatter, ...args);\n },\n hook: useDebugger,\n hookOnce: useDebuggerOnce,\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { ReactifySearchProviderProps } from "../components";
2
- import { Config } from "../types";
1
+ import type { ReactifySearchProviderProps } from "../components";
2
+ import type { Config } from "../types";
3
3
  export declare const getFilterStack: (options: {
4
4
  provider: ReactifySearchProviderProps;
5
5
  config: Config;
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/utility/filters.ts"],"names":[],"mappings":";;;AAGO,MAAM,cAAc,GAAG,CAAC,OAG9B,EAAE,EAAE;IACH,yBAAyB;IACzB,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAA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IACzB,CAAC;IAED,+CAA+C;IAC/C,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE5C,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA;AAnDY,QAAA,cAAc,kBAmD1B","sourcesContent":["import { ReactifySearchProviderProps } from \"../components\";\nimport { Config } from \"../types\";\n\nexport const getFilterStack = (options: {\n provider: ReactifySearchProviderProps;\n config: Config;\n}) => {\n // select filters by type\n const filterType = options.provider.mode;\n const matchingFilterss = options.config.filters.filter(\n (filter) => filter.type === filterType\n );\n\n // select filter stack by handle if provided\n if (options.provider.filtersHandle) {\n const matchingFilters = matchingFilterss.find(\n (filterStack) => options.provider.filtersHandle === filterStack.handle\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter stack by collection if provided\n if (options.provider.mode === \"collection\" && options.provider.collectionHandle) {\n const collectionHandle = options.provider.collectionHandle;\n const matchingFilters = matchingFilterss.find((filterStack) =>\n filterStack.collections?.includes(collectionHandle || \"\")\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter with \"default\" handle\n let matchingFilters = matchingFilterss.find(\n (filterStack) => filterStack.handle === \"default\"\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any filter with \"default\" handle\n matchingFilters = options.config.filters.find(\n (filterStack) => filterStack.handle === \"default\"\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any available filter as a last resort\n matchingFilters = options.config.filters[0];\n\n return matchingFilters;\n}"]}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/utility/filters.ts"],"names":[],"mappings":";;;AAGO,MAAM,cAAc,GAAG,CAAC,OAAkE,EAAE,EAAE;IACnG,yBAAyB;IACzB,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EA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AA+C;IAC/C,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE5C,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC;AA1CW,QAAA,cAAc,kBA0CzB","sourcesContent":["import type { ReactifySearchProviderProps } from \"../components\";\nimport type { Config } from \"../types\";\n\nexport const getFilterStack = (options: { provider: ReactifySearchProviderProps; config: Config }) => {\n // select filters by type\n const filterType = options.provider.mode;\n const matchingFilterss = options.config.filters.filter((filter) => filter.type === filterType);\n\n // select filter stack by handle if provided\n if (options.provider.filtersHandle) {\n const matchingFilters = matchingFilterss.find(\n (filterStack) => options.provider.filtersHandle === filterStack.handle\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter stack by collection if provided\n if (options.provider.mode === \"collection\" && options.provider.collectionHandle) {\n const collectionHandle = options.provider.collectionHandle;\n const matchingFilters = matchingFilterss.find((filterStack) =>\n filterStack.collections?.includes(collectionHandle || \"\")\n );\n if (matchingFilters) {\n return matchingFilters;\n }\n }\n\n // select filter with \"default\" handle\n let matchingFilters = matchingFilterss.find((filterStack) => filterStack.handle === \"default\");\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any filter with \"default\" handle\n matchingFilters = options.config.filters.find((filterStack) => filterStack.handle === \"default\");\n if (matchingFilters) {\n return matchingFilters;\n }\n\n // select any available filter as a last resort\n matchingFilters = options.config.filters[0];\n\n return matchingFilters;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { ReactifySearchProviderProps } from "../components/ReactifySearchProvider/ReactifySearchProvider";
1
+ import type React from "react";
2
+ import { type ReactifySearchProviderProps } from "../components/ReactifySearchProvider/ReactifySearchProvider";
3
3
  export declare class ReactifySearchLiquidFactory {
4
4
  providerProps: Omit<ReactifySearchProviderProps, "shopifyPermanentDomain"> & {
5
5
  shopifyPermanentDomain?: string;
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.ReactifySearchLiquidFactory = void 0;
7
- const react_1 = __importDefault(require("react"));
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
5
  const ReactifySearchProvider_1 = require("../components/ReactifySearchProvider/ReactifySearchProvider");
9
6
  class ReactifySearchLiquidFactory {
10
7
  constructor(providerProps) {
@@ -12,7 +9,7 @@ class ReactifySearchLiquidFactory {
12
9
  }
13
10
  getProvider() {
14
11
  const providerProps = this.getProviderProps();
15
- const provider = (props) => (react_1.default.createElement(ReactifySearchProvider_1.ReactifySearchProvider, Object.assign({}, providerProps), props.children));
12
+ const provider = (props) => (0, jsx_runtime_1.jsx)(ReactifySearchProvider_1.ReactifySearchProvider, Object.assign({}, providerProps, { children: props.children }));
16
13
  return provider;
17
14
  }
18
15
  getMountNode() {
@@ -1 +1 @@
1
- {"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,wGAGqE;AAErE,MAAa,2BAA2B;IACtC,YACS,aAGN;QAHM,kBAAa,GAAb,aAAa,CAGnB;IACA,CAAC;IAEJ,WAAW;QACT,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE9C,MAAM,QAAQ,GAET,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,8BAAC,+CAAsB,oBAAK,aAAa,GAAG,KAAK,CAAC,QAAQ,CAA0B,CACrF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,kBAAkB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,IAAI,CAAC,aAAa,CAAC,IAAI,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";\n\nimport {\n ReactifySearchProvider,\n ReactifySearchProviderProps,\n} from \"../components/ReactifySearchProvider/ReactifySearchProvider\";\n\nexport class ReactifySearchLiquidFactory {\n constructor(\n public providerProps: Omit<ReactifySearchProviderProps, \"shopifyPermanentDomain\"> & {\n shopifyPermanentDomain?: string;\n collectionHandle?: string;\n }\n ) {}\n\n getProvider() {\n const providerProps = this.getProviderProps();\n\n const provider: React.FC<{\n children?: React.ReactNode | undefined;\n }> = (props) => (\n <ReactifySearchProvider {...providerProps}>{props.children}</ReactifySearchProvider>\n );\n\n return provider;\n }\n\n getMountNode() {\n const mountNode = document.getElementById(`reactify-mount-${this.providerProps.mode}`);\n if (!mountNode) {\n throw new Error(`Cannot find mount node with ID \"reactify-mount-${this.providerProps.mode}\"`);\n }\n\n return mountNode;\n }\n\n getData() {\n const dataNode = document.getElementById(\"reactify-data\");\n if (!dataNode) {\n throw new Error(`Cannot find data node with ID \"reactify-data\"`);\n }\n\n try {\n const data = JSON.parse(dataNode.innerHTML);\n\n return data;\n } catch {\n throw new Error(\n `Cannot parse the data node with ID \"reactify-data\", check your liquid formatting`\n );\n }\n }\n\n getProviderProps(): ReactifySearchProviderProps {\n const shopifyPermanentDomain =\n this.providerProps.shopifyPermanentDomain ?? (window as any)?.Shopify?.shop;\n\n if (!shopifyPermanentDomain)\n throw new Error(\"Cannot determine shopifyPermanentDomain from window\");\n\n const baseProps = { ...this.providerProps, shopifyPermanentDomain };\n\n if (this.providerProps.mode === \"collection\") {\n const collectionHandle =\n this.providerProps.collectionHandle ?? window.location.pathname.split(\"/\")?.[2];\n if (!collectionHandle) throw new Error(\"Cannot determine collectionHandle from URL\");\n return { ...baseProps, mode: \"collection\", collectionHandle };\n }\n\n\n return baseProps as ReactifySearchProviderProps;\n }\n}\n"]}
1
+ {"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":";;;;AACA,wGAGqE;AAErE,MAAa,2BAA2B;IACtC,YACS,aAGN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a,KAAE,sBAAsB,GAAE,CAAC;QAEpE,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC7C,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,mCAAI,MAAA,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAC;YACzG,IAAI,CAAC,gBAAgB;gBAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YACrF,uCAAY,SAAS,KAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,IAAG;QAChE,CAAC;QAED,OAAO,SAAwC,CAAC;IAClD,CAAC;CACF;AAzDD,kEAyDC","sourcesContent":["import type React from \"react\";\nimport {\n ReactifySearchProvider,\n type ReactifySearchProviderProps,\n} from \"../components/ReactifySearchProvider/ReactifySearchProvider\";\n\nexport class ReactifySearchLiquidFactory {\n constructor(\n public providerProps: Omit<ReactifySearchProviderProps, \"shopifyPermanentDomain\"> & {\n shopifyPermanentDomain?: string;\n collectionHandle?: string;\n }\n ) {}\n\n getProvider() {\n const providerProps = this.getProviderProps();\n\n const provider: React.FC<{\n children?: React.ReactNode | undefined;\n }> = (props) => <ReactifySearchProvider {...providerProps}>{props.children}</ReactifySearchProvider>;\n\n return provider;\n }\n\n getMountNode() {\n const mountNode = document.getElementById(`reactify-mount-${this.providerProps.mode}`);\n if (!mountNode) {\n throw new Error(`Cannot find mount node with ID \"reactify-mount-${this.providerProps.mode}\"`);\n }\n\n return mountNode;\n }\n\n getData() {\n const dataNode = document.getElementById(\"reactify-data\");\n if (!dataNode) {\n throw new Error(`Cannot find data node with ID \"reactify-data\"`);\n }\n\n try {\n const data = JSON.parse(dataNode.innerHTML);\n\n return data;\n } catch {\n throw new Error(`Cannot parse the data node with ID \"reactify-data\", check your liquid formatting`);\n }\n }\n\n getProviderProps(): ReactifySearchProviderProps {\n const shopifyPermanentDomain = this.providerProps.shopifyPermanentDomain ?? (window as any)?.Shopify?.shop;\n\n if (!shopifyPermanentDomain) throw new Error(\"Cannot determine shopifyPermanentDomain from window\");\n\n const baseProps = { ...this.providerProps, shopifyPermanentDomain };\n\n if (this.providerProps.mode === \"collection\") {\n const collectionHandle = this.providerProps.collectionHandle ?? window.location.pathname.split(\"/\")?.[2];\n if (!collectionHandle) throw new Error(\"Cannot determine collectionHandle from URL\");\n return { ...baseProps, mode: \"collection\", collectionHandle };\n }\n\n return baseProps as ReactifySearchProviderProps;\n }\n}\n"]}