@usereactify/search 5.59.1-beta.0 → 5.60.0-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.
- package/CHANGELOG.md +6 -2
- package/dist/package.json +5 -7
- package/dist/src/components/ClearAll/ClearAll.d.ts +1 -1
- package/dist/src/components/ClearAll/ClearAll.js +9 -4
- package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
- package/dist/src/components/CustomComponent/CustomComponent.d.ts +1 -1
- package/dist/src/components/CustomComponent/CustomComponent.js +2 -2
- package/dist/src/components/CustomComponent/CustomComponent.js.map +1 -1
- package/dist/src/components/Example/ExampleClearAll.d.ts +2 -2
- package/dist/src/components/Example/ExampleClearAll.js +5 -2
- package/dist/src/components/Example/ExampleClearAll.js.map +1 -1
- package/dist/src/components/Example/ExampleCustomComponent.d.ts +1 -1
- package/dist/src/components/Example/ExampleCustomComponent.js +7 -3
- package/dist/src/components/Example/ExampleCustomComponent.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterList.d.ts +2 -2
- package/dist/src/components/Example/ExampleFilterList.js +66 -31
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterRange.d.ts +2 -2
- package/dist/src/components/Example/ExampleFilterRange.js +12 -2
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterSlider.d.ts +2 -2
- package/dist/src/components/Example/ExampleFilterSlider.js +18 -11
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
- package/dist/src/components/Example/ExampleFilters.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilters.js +8 -3
- package/dist/src/components/Example/ExampleFilters.js.map +1 -1
- package/dist/src/components/Example/ExampleFiltersSelected.d.ts +2 -2
- package/dist/src/components/Example/ExampleFiltersSelected.js +24 -3
- package/dist/src/components/Example/ExampleFiltersSelected.js.map +1 -1
- package/dist/src/components/Example/ExampleHookUseFilters.d.ts +1 -1
- package/dist/src/components/Example/ExampleHookUseFilters.js +10 -3
- package/dist/src/components/Example/ExampleHookUseFilters.js.map +1 -1
- package/dist/src/components/Example/ExampleHookUseResults.d.ts +1 -1
- package/dist/src/components/Example/ExampleHookUseResults.js +8 -3
- package/dist/src/components/Example/ExampleHookUseResults.js.map +1 -1
- package/dist/src/components/Example/ExampleHookUseSearch.js +2 -2
- package/dist/src/components/Example/ExampleHookUseSearch.js.map +1 -1
- package/dist/src/components/Example/ExampleHookUseSortBy.js +1 -2
- package/dist/src/components/Example/ExampleHookUseSortBy.js.map +1 -1
- package/dist/src/components/Example/ExampleProductCardWeight.d.ts +1 -1
- package/dist/src/components/Example/ExampleProductCardWeight.js +47 -14
- package/dist/src/components/Example/ExampleProductCardWeight.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.d.ts +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +6 -2
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.d.ts +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +6 -2
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.d.ts +1 -1
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +6 -2
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -1
- package/dist/src/components/Example/ExampleResultCardCallout.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardCallout.js +4 -2
- package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.d.ts +2 -2
- package/dist/src/components/Example/ExampleResultCardProduct.js +12 -2
- package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.d.ts +2 -2
- package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.js +5 -2
- package/dist/src/components/Example/ExampleResultPaginationInfiniteScroll.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +2 -2
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js +5 -2
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +2 -2
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js +7 -2
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +2 -2
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js +20 -6
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Example/ExampleResults.d.ts +1 -1
- package/dist/src/components/Example/ExampleResults.js +10 -7
- package/dist/src/components/Example/ExampleResults.js.map +1 -1
- package/dist/src/components/Example/ExampleSearch.d.ts +1 -1
- package/dist/src/components/Example/ExampleSearch.js +2 -2
- package/dist/src/components/Example/ExampleSearch.js.map +1 -1
- package/dist/src/components/Example/ExampleSortBy.d.ts +2 -2
- package/dist/src/components/Example/ExampleSortBy.js +5 -2
- package/dist/src/components/Example/ExampleSortBy.js.map +1 -1
- package/dist/src/components/Example/ExampleStats.d.ts +2 -2
- package/dist/src/components/Example/ExampleStats.js +8 -2
- package/dist/src/components/Example/ExampleStats.js.map +1 -1
- package/dist/src/components/Example/ExampleSuggestions.d.ts +2 -2
- package/dist/src/components/Example/ExampleSuggestions.js +7 -2
- package/dist/src/components/Example/ExampleSuggestions.js.map +1 -1
- package/dist/src/components/Example/index.d.ts +6 -6
- package/dist/src/components/Example/index.js +6 -6
- package/dist/src/components/Example/index.js.map +1 -1
- package/dist/src/components/Filter/Filter.d.ts +1 -1
- package/dist/src/components/Filter/Filter.js +35 -30
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/Filters.d.ts +4 -4
- package/dist/src/components/Filter/Filters.js +6 -3
- package/dist/src/components/Filter/Filters.js.map +1 -1
- package/dist/src/components/Filter/FiltersSelected.d.ts +1 -1
- package/dist/src/components/Filter/FiltersSelected.js +9 -4
- package/dist/src/components/Filter/FiltersSelected.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +2 -2
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +8 -20
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/Result/ResultCardCallout.d.ts +2 -2
- package/dist/src/components/Result/ResultCardCallout.js +2 -3
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
- package/dist/src/components/Result/ResultCardProduct.d.ts +1 -1
- package/dist/src/components/Result/ResultCardProduct.js +3 -4
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationInfiniteScroll.d.ts +3 -3
- package/dist/src/components/Result/ResultPaginationInfiniteScroll.js +6 -3
- package/dist/src/components/Result/ResultPaginationInfiniteScroll.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +3 -3
- package/dist/src/components/Result/ResultPaginationLoadMore.js +6 -3
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +3 -3
- package/dist/src/components/Result/ResultPaginationNextPrev.js +6 -3
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.d.ts +3 -3
- package/dist/src/components/Result/ResultPaginationNumbered.js +6 -3
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Result/ResultStateProvider.d.ts +2 -2
- package/dist/src/components/Result/ResultStateProvider.js +3 -3
- package/dist/src/components/Result/ResultStateProvider.js.map +1 -1
- package/dist/src/components/Result/Results.d.ts +2 -2
- package/dist/src/components/Result/Results.js +52 -50
- package/dist/src/components/Result/Results.js.map +1 -1
- package/dist/src/components/Result/index.d.ts +4 -4
- package/dist/src/components/Result/index.js +4 -4
- package/dist/src/components/Result/index.js.map +1 -1
- package/dist/src/components/Search/Search.d.ts +1 -1
- package/dist/src/components/Search/Search.js +6 -3
- package/dist/src/components/Search/Search.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollection.d.ts +1 -1
- package/dist/src/components/Sensor/SensorCollection.js +2 -2
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
- package/dist/src/components/Sensor/SensorCollectionWeighted.d.ts +1 -0
- package/dist/src/components/Sensor/SensorCollectionWeighted.js +21 -0
- package/dist/src/components/Sensor/SensorCollectionWeighted.js.map +1 -0
- package/dist/src/components/Sensor/SensorCustom.d.ts +2 -1
- package/dist/src/components/Sensor/SensorCustom.js +6 -5
- package/dist/src/components/Sensor/SensorCustom.js.map +1 -1
- package/dist/src/components/Sensor/SensorExplain.js +2 -2
- package/dist/src/components/Sensor/SensorExplain.js.map +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.d.ts +1 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js +2 -2
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
- package/dist/src/components/Sensor/SensorPublished.d.ts +1 -1
- package/dist/src/components/Sensor/SensorPublished.js +2 -2
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.d.ts +2 -1
- package/dist/src/components/Sensor/SensorSearchTerm.js +124 -19
- package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearchWeighted.d.ts +1 -0
- package/dist/src/components/Sensor/SensorSearchWeighted.js +22 -0
- package/dist/src/components/Sensor/SensorSearchWeighted.js.map +1 -0
- package/dist/src/components/Sensor/SensorSort.d.ts +1 -1
- package/dist/src/components/Sensor/SensorSort.js +2 -2
- package/dist/src/components/Sensor/SensorSort.js.map +1 -1
- package/dist/src/components/Sensor/Sensors.d.ts +3 -1
- package/dist/src/components/Sensor/Sensors.js +48 -14
- package/dist/src/components/Sensor/Sensors.js.map +1 -1
- package/dist/src/components/Sensor/index.d.ts +9 -7
- package/dist/src/components/Sensor/index.js +10 -6
- package/dist/src/components/Sensor/index.js.map +1 -1
- package/dist/src/components/SortBy/SortBy.d.ts +1 -1
- package/dist/src/components/SortBy/SortBy.js +6 -3
- package/dist/src/components/SortBy/SortBy.js.map +1 -1
- package/dist/src/components/Stats/Stats.d.ts +2 -2
- package/dist/src/components/Stats/Stats.js +5 -2
- package/dist/src/components/Stats/Stats.js.map +1 -1
- package/dist/src/components/Suggestions/Suggestions.d.ts +1 -1
- package/dist/src/components/Suggestions/Suggestions.js +8 -7
- package/dist/src/components/Suggestions/Suggestions.js.map +1 -1
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.d.ts +1 -1
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js +3 -3
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -1
- package/dist/src/components/Utility/index.js.map +1 -1
- package/dist/src/components/index.d.ts +2 -2
- package/dist/src/components/index.js +2 -2
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/hooks/index.d.ts +11 -11
- package/dist/src/hooks/index.js +11 -11
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/react-slider/useReactSliderProps.d.ts +2 -2
- package/dist/src/hooks/react-slider/useReactSliderProps.js +6 -6
- package/dist/src/hooks/react-slider/useReactSliderProps.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +2 -2
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
- package/dist/src/hooks/useAnalytics.js.map +1 -1
- package/dist/src/hooks/useConfig.d.ts +1 -1
- package/dist/src/hooks/useConfig.js +1 -1
- package/dist/src/hooks/useConfig.js.map +1 -1
- package/dist/src/hooks/useCuration.d.ts +1 -1
- package/dist/src/hooks/useCuration.js +25 -9
- package/dist/src/hooks/useCuration.js.map +1 -1
- package/dist/src/hooks/useDebugger.js +3 -3
- package/dist/src/hooks/useDebugger.js.map +1 -1
- package/dist/src/hooks/useFilterCollapsedState.d.ts +1 -1
- package/dist/src/hooks/useFilterCollapsedState.js.map +1 -1
- package/dist/src/hooks/useFilterListProps.d.ts +2 -2
- package/dist/src/hooks/useFilterListProps.js +11 -7
- package/dist/src/hooks/useFilterListProps.js.map +1 -1
- package/dist/src/hooks/useFilterRangeProps.d.ts +1 -1
- package/dist/src/hooks/useFilterRangeProps.js +14 -11
- package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/useFilterSliderProps.d.ts +1 -1
- package/dist/src/hooks/useFilterSliderProps.js +9 -10
- package/dist/src/hooks/useFilterSliderProps.js.map +1 -1
- package/dist/src/hooks/useFilters.d.ts +1 -1
- package/dist/src/hooks/useFilters.js +7 -4
- package/dist/src/hooks/useFilters.js.map +1 -1
- package/dist/src/hooks/useIndices.js +2 -2
- package/dist/src/hooks/useIndices.js.map +1 -1
- package/dist/src/hooks/usePagination.d.ts +1 -1
- package/dist/src/hooks/usePagination.js +14 -6
- package/dist/src/hooks/usePagination.js.map +1 -1
- package/dist/src/hooks/usePaginationLoadable.d.ts +1 -1
- package/dist/src/hooks/usePaginationLoadable.js +5 -3
- package/dist/src/hooks/usePaginationLoadable.js.map +1 -1
- package/dist/src/hooks/useProductPrice.d.ts +1 -1
- package/dist/src/hooks/useProductPrice.js +1 -3
- package/dist/src/hooks/useProductPrice.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.d.ts +1 -1
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/dist/src/hooks/useResults.d.ts +1 -1
- package/dist/src/hooks/useResults.js +4 -4
- package/dist/src/hooks/useResults.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.js +9 -8
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useSortBy.d.ts +1 -1
- package/dist/src/hooks/useSortBy.js +1 -1
- package/dist/src/hooks/useSortBy.js.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/config.d.ts +1 -1
- package/dist/src/types/config.js.map +1 -1
- package/dist/src/types/elastic.d.ts +11 -8
- package/dist/src/types/elastic.js.map +1 -1
- package/dist/src/types/firestore.d.ts +5 -5
- package/dist/src/types/firestore.js.map +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/reactivesearch.d.ts +1 -1
- package/dist/src/types/reactivesearch.js.map +1 -1
- package/dist/src/types/shopify.d.ts +1 -1
- package/dist/src/types/shopify.js.map +1 -1
- package/dist/src/utility/config.d.ts +3 -3
- package/dist/src/utility/config.js +9 -6
- package/dist/src/utility/config.js.map +1 -1
- package/dist/src/utility/curation.d.ts +2 -2
- package/dist/src/utility/curation.js +1 -1
- package/dist/src/utility/curation.js.map +1 -1
- package/dist/src/utility/debug.js +1 -1
- package/dist/src/utility/debug.js.map +1 -1
- package/dist/src/utility/filters.d.ts +2 -2
- package/dist/src/utility/filters.js.map +1 -1
- package/dist/src/utility/liquid.d.ts +2 -2
- package/dist/src/utility/liquid.js +5 -2
- package/dist/src/utility/liquid.js.map +1 -1
- package/dist/src/utility/props.d.ts +226 -7
- package/dist/src/utility/props.js +109 -62
- package/dist/src/utility/props.js.map +1 -1
- package/dist/src/utility/queries.d.ts +393 -0
- package/dist/src/utility/queries.js +197 -0
- package/dist/src/utility/queries.js.map +1 -0
- package/dist/src/utility/server.d.ts +1 -1
- package/dist/src/utility/server.js +4 -4
- package/dist/src/utility/server.js.map +1 -1
- package/dist/src/utility/sortOption.d.ts +2 -2
- package/dist/src/utility/sortOption.js.map +1 -1
- package/package.json +5 -7
- package/dist/src/search-request-builder/base-builders.d.ts +0 -18
- package/dist/src/search-request-builder/base-builders.js +0 -184
- package/dist/src/search-request-builder/base-builders.js.map +0 -1
- package/dist/src/search-request-builder/curation-builders.d.ts +0 -2
- package/dist/src/search-request-builder/curation-builders.js +0 -44
- package/dist/src/search-request-builder/curation-builders.js.map +0 -1
- package/dist/src/search-request-builder/index.d.ts +0 -3
- package/dist/src/search-request-builder/index.js +0 -12
- package/dist/src/search-request-builder/index.js.map +0 -1
- package/dist/src/search-request-builder/search-request-builder.d.ts +0 -3
- package/dist/src/search-request-builder/search-request-builder.js +0 -54
- package/dist/src/search-request-builder/search-request-builder.js.map +0 -1
- package/dist/src/search-request-builder/types.d.ts +0 -105
- package/dist/src/search-request-builder/types.js +0 -30
- package/dist/src/search-request-builder/types.js.map +0 -1
- package/dist/src/search-request-builder/utils.d.ts +0 -27
- package/dist/src/search-request-builder/utils.js +0 -144
- package/dist/src/search-request-builder/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sensors.js","sourceRoot":"","sources":["../../../../src/components/Sensor/Sensors.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sensors.js","sourceRoot":"","sources":["../../../../src/components/Sensor/Sensors.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAuD;AAEvD,6CAA0C;AAC1C,uDAAoD;AACpD,yDAAsD;AACtD,yDAAsD;AACtD,yEAAsE;AACtE,iDAA8C;AAC9C,yEAAsE;AACtE,iEAA8D;AAC9D,mDAAgD;AAMzC,MAAM,OAAO,GAA2B,GAAG,EAAE;;IAClD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAEvD,MAAM,4BAA4B,GAAG,MAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,QAAQ,CAAC,kCAAkC,CAAC,mCAAI,KAAK,CAAC;IAChH,MAAM,gCAAgC,GACpC,MAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,QAAQ,CAAC,sCAAsC,CAAC,mCAAI,KAAK,CAAC;IAEjF,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACnE,IAAI,4BAA4B,EAAE,CAAC;YACjC,OAAO,CACL;gBACE,8BAAC,uBAAU,OAAG;gBACd,8BAAC,iCAAe,OAAG;gBACnB,8BAAC,2CAAoB,OAAG;gBACxB,8BAAC,mDAAwB,OAAG;gBAC5B,8BAAC,2BAAY,OAAG;gBAChB,8BAAC,6BAAa,OAAG,CAChB,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,CACL;YACE,8BAAC,uBAAU,OAAG;YACd,8BAAC,iCAAe,OAAG;YACnB,8BAAC,mCAAgB,OAAG;YACpB,8BAAC,mDAAwB,OAAG;YAC5B,8BAAC,2BAAY,OAAG,CACf,CACJ,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAClC,IAAI,gCAAgC,EAAE,CAAC;YACrC,OAAO,CACL;gBACE,8BAAC,uBAAU,OAAG;gBACd,8BAAC,iCAAe,OAAG;gBACnB,8BAAC,mDAAwB,OAAG;gBAC5B,8BAAC,mDAAwB,OAAG;gBAC5B,8BAAC,2BAAY,OAAG;gBAChB,8BAAC,6BAAa,OAAG,CAChB,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,CACL;YACE,8BAAC,uBAAU,OAAG;YACd,8BAAC,iCAAe,OAAG;YACnB,8BAAC,mCAAgB,OAAG;YACpB,8BAAC,mDAAwB,OAAG;YAC5B,8BAAC,2BAAY,OAAG,CACf,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxDW,QAAA,OAAO,WAwDlB","sourcesContent":["import React from \"react\";\n\nimport { useReactifySearchContext } from \"../../hooks\";\n\nimport { SensorSort } from \"./SensorSort\";\nimport { SensorPublished } from \"./SensorPublished\";\nimport { SensorCollection } from \"./SensorCollection\";\nimport { SensorSearchTerm } from \"./SensorSearchTerm\";\nimport { SensorInventoryAvailable } from \"./SensorInventoryAvailable\";\nimport { SensorCustom } from \"./SensorCustom\";\nimport { SensorCollectionWeighted } from \"./SensorCollectionWeighted\";\nimport { SensorSearchWeighted } from \"./SensorSearchWeighted\";\nimport { SensorExplain } from \"./SensorExplain\";\n\nexport type SensorsProps = {\n /** This component does not support any props */\n};\n\nexport const Sensors: React.FC<SensorsProps> = () => {\n const { config, options } = useReactifySearchContext();\n\n const useWeightedBaseSearchRequest = config.featureFlags?.includes(\"use_weighted_base_search_request\") ?? false;\n const useWeightedCurationSearchRequest =\n config.featureFlags?.includes(\"use_weighted_curation_search_request\") ?? false;\n\n if (options.mode === \"search\" || options.mode === \"instant-search\") {\n if (useWeightedBaseSearchRequest) {\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorSearchWeighted />\n <SensorInventoryAvailable />\n <SensorCustom />\n <SensorExplain />\n </>\n );\n }\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorSearchTerm />\n <SensorInventoryAvailable />\n <SensorCustom />\n </>\n );\n }\n\n if (options.mode === \"collection\") {\n if (useWeightedCurationSearchRequest) {\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorCollectionWeighted />\n <SensorInventoryAvailable />\n <SensorCustom />\n <SensorExplain />\n </>\n );\n }\n return (\n <>\n <SensorSort />\n <SensorPublished />\n <SensorCollection />\n <SensorInventoryAvailable />\n <SensorCustom />\n </>\n );\n }\n\n return null;\n};\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./SensorExplain";
|
|
5
|
-
export * from "./SensorInventoryAvailable";
|
|
1
|
+
import { ReactifySearchMode } from "../../hooks";
|
|
2
|
+
import { Config } from "../../types";
|
|
3
|
+
export * from "./SensorSort";
|
|
6
4
|
export * from "./SensorPublished";
|
|
5
|
+
export * from "./SensorCollection";
|
|
7
6
|
export * from "./SensorSearchTerm";
|
|
8
|
-
export * from "./
|
|
7
|
+
export * from "./SensorInventoryAvailable";
|
|
8
|
+
export * from "./SensorCollectionWeighted";
|
|
9
|
+
export * from "./SensorSearchWeighted";
|
|
10
|
+
export * from "./SensorExplain";
|
|
9
11
|
export * from "./Sensors";
|
|
10
|
-
export declare const SENSOR_IDS: (mode: ReactifySearchMode, config: Config,
|
|
12
|
+
export declare const SENSOR_IDS: (mode: ReactifySearchMode, config: Config, variation?: string) => string[];
|
|
@@ -15,27 +15,31 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.SENSOR_IDS = void 0;
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./SensorExplain"), exports);
|
|
20
|
-
__exportStar(require("./SensorInventoryAvailable"), exports);
|
|
18
|
+
__exportStar(require("./SensorSort"), exports);
|
|
21
19
|
__exportStar(require("./SensorPublished"), exports);
|
|
20
|
+
__exportStar(require("./SensorCollection"), exports);
|
|
22
21
|
__exportStar(require("./SensorSearchTerm"), exports);
|
|
23
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./SensorInventoryAvailable"), exports);
|
|
23
|
+
__exportStar(require("./SensorCollectionWeighted"), exports);
|
|
24
|
+
__exportStar(require("./SensorSearchWeighted"), exports);
|
|
25
|
+
__exportStar(require("./SensorExplain"), exports);
|
|
24
26
|
__exportStar(require("./Sensors"), exports);
|
|
25
27
|
// This is consumed by the react prop in various components
|
|
26
|
-
const SENSOR_IDS = (mode, config,
|
|
28
|
+
const SENSOR_IDS = (mode, config, variation) => {
|
|
27
29
|
const sensorIds = [
|
|
28
30
|
"SensorSort",
|
|
29
31
|
"SensorPublished",
|
|
30
32
|
"SensorCollection",
|
|
31
33
|
"SensorSearchTerm",
|
|
32
34
|
"SensorInventoryAvailable",
|
|
35
|
+
"SensorCollectionWeighted",
|
|
36
|
+
"SensorSearchWeighted",
|
|
33
37
|
"SensorExplain",
|
|
34
38
|
];
|
|
35
39
|
const sensorType = mode === "collection" ? "collection" : "search";
|
|
36
40
|
const customSensors = sensorType === "collection" ? config.sensors.collection : config.sensors.search;
|
|
37
41
|
if (customSensors.length > 0) {
|
|
38
|
-
sensorIds.push(...customSensors.map((
|
|
42
|
+
sensorIds.push(...customSensors.map((item, index) => `SensorCustom_${index}`));
|
|
39
43
|
}
|
|
40
44
|
return sensorIds;
|
|
41
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sensor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sensor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,qDAAmC;AACnC,6DAA2C;AAC3C,6DAA2C;AAC3C,yDAAuC;AACvC,kDAAgC;AAEhC,4CAA0B;AAE1B,2DAA2D;AACpD,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,MAAc,EAAE,SAAkB,EAAE,EAAE;IACzF,MAAM,SAAS,GAAG;QAChB,YAAY;QACZ,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,0BAA0B;QAC1B,0BAA0B;QAC1B,sBAAsB;QACtB,eAAe;KAChB,CAAC;IAEF,MAAM,UAAU,GACd,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;IAElD,MAAM,aAAa,GAAG,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;IACtG,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AArBW,QAAA,UAAU,cAqBrB","sourcesContent":["import { ReactifySearchMode } from \"../../hooks\";\nimport { Config } from \"../../types\";\n\nexport * from \"./SensorSort\";\nexport * from \"./SensorPublished\";\nexport * from \"./SensorCollection\";\nexport * from \"./SensorSearchTerm\";\nexport * from \"./SensorInventoryAvailable\";\nexport * from \"./SensorCollectionWeighted\";\nexport * from \"./SensorSearchWeighted\";\nexport * from \"./SensorExplain\";\n\nexport * from \"./Sensors\";\n\n// This is consumed by the react prop in various components\nexport const SENSOR_IDS = (mode: ReactifySearchMode, config: Config, variation?: string) => {\n const sensorIds = [\n \"SensorSort\",\n \"SensorPublished\",\n \"SensorCollection\",\n \"SensorSearchTerm\",\n \"SensorInventoryAvailable\",\n \"SensorCollectionWeighted\",\n \"SensorSearchWeighted\",\n \"SensorExplain\",\n ];\n \n const sensorType = \n mode === \"collection\" ? \"collection\" : \"search\";\n \n const customSensors = sensorType === \"collection\" ? config.sensors.collection : config.sensors.search;\n if (customSensors.length > 0) {\n sensorIds.push(...customSensors.map((item, index) => `SensorCustom_${index}`));\n }\n\n return sensorIds;\n};\n"]}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.SortBy = void 0;
|
|
4
|
-
const
|
|
5
|
-
const components_1 = require("../../components");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
6
8
|
const hooks_1 = require("../../hooks");
|
|
9
|
+
const components_1 = require("../../components");
|
|
7
10
|
const SortBy = (props) => {
|
|
8
11
|
var _a;
|
|
9
12
|
const sortByHook = (0, hooks_1.useSortBy)();
|
|
10
13
|
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleSortBy;
|
|
11
|
-
return
|
|
14
|
+
return react_1.default.createElement(RenderComponent, Object.assign({}, sortByHook));
|
|
12
15
|
};
|
|
13
16
|
exports.SortBy = SortBy;
|
|
14
17
|
//# sourceMappingURL=SortBy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortBy.js","sourceRoot":"","sources":["../../../../src/components/SortBy/SortBy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortBy.js","sourceRoot":"","sources":["../../../../src/components/SortBy/SortBy.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAwC;AACxC,iDAAiD;AAO1C,MAAM,MAAM,GAA0B,CAAC,KAAK,EAAE,EAAE;;IACrD,MAAM,UAAU,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE/B,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,0BAAa,CAAC;IAEtD,OAAO,8BAAC,eAAe,oBAAK,UAAU,EAAI,CAAC;AAC7C,CAAC,CAAC;AANW,QAAA,MAAM,UAMjB","sourcesContent":["import React from \"react\";\n\nimport { useSortBy } from \"../../hooks\";\nimport { ExampleSortBy } from \"../../components\";\n\nexport type SortByProps = {\n /** Render method called once for all sort options */\n render?: React.FC<ReturnType<typeof useSortBy>>;\n};\n\nexport const SortBy: React.FC<SortByProps> = (props) => {\n const sortByHook = useSortBy();\n\n const RenderComponent = props.render ?? ExampleSortBy;\n\n return <RenderComponent {...sortByHook} />;\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ElasticHit, ReactivesearchError } from "../../types";
|
|
3
3
|
export type StatsProps = {
|
|
4
4
|
/** Render method */
|
|
5
5
|
render?: React.FC<{
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Stats = void 0;
|
|
4
|
-
const
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
5
8
|
const components_1 = require("../../components");
|
|
6
9
|
const Stats = (props) => {
|
|
7
10
|
var _a;
|
|
8
11
|
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleStats;
|
|
9
|
-
return (
|
|
12
|
+
return (react_1.default.createElement(components_1.ResultStateProvider, { render: (renderProps) => react_1.default.createElement(RenderComponent, Object.assign({}, renderProps)) }));
|
|
10
13
|
};
|
|
11
14
|
exports.Stats = Stats;
|
|
12
15
|
//# sourceMappingURL=Stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.js","sourceRoot":"","sources":["../../../../src/components/Stats/Stats.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stats.js","sourceRoot":"","sources":["../../../../src/components/Stats/Stats.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,iDAAqE;AAsB9D,MAAM,KAAK,GAAyB,CAAC,KAAK,EAAE,EAAE;;IACnD,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,yBAAY,CAAC;IAErD,OAAO,CACL,8BAAC,gCAAmB,IAClB,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,8BAAC,eAAe,oBAAK,WAAW,EAAI,GAC7D,CACH,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,KAAK,SAQhB","sourcesContent":["import React from \"react\";\n\nimport { ElasticHit, ReactivesearchError } from \"../../types\";\nimport { ResultStateProvider, ExampleStats } from \"../../components\";\n\nexport type StatsProps = {\n /** Render method */\n render?: React.FC<{\n isLoading: boolean;\n hits: {\n hidden: number;\n time: number;\n total: number;\n hits: Array<ElasticHit>;\n };\n resultStats: {\n hidden: number;\n numberOfResults?: number;\n promoted: number;\n time: number;\n };\n error?: ReactivesearchError;\n }>;\n};\n\nexport const Stats: React.FC<StatsProps> = (props) => {\n const RenderComponent = props.render ?? ExampleStats;\n\n return (\n <ResultStateProvider\n render={(renderProps) => <RenderComponent {...renderProps} />}\n />\n );\n};\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Suggestions = void 0;
|
|
4
|
-
const
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
5
8
|
const components_1 = require("../../components");
|
|
6
9
|
const hooks_1 = require("../../hooks");
|
|
7
10
|
const Suggestions = (props) => {
|
|
@@ -10,7 +13,7 @@ const Suggestions = (props) => {
|
|
|
10
13
|
const reactifySearchContext = (0, hooks_1.useReactifySearchContext)();
|
|
11
14
|
const { searchTerm } = (0, hooks_1.useSearch)();
|
|
12
15
|
const sensorIds = (0, components_1.SENSOR_IDS)(reactifySearchContext.options.mode, reactifySearchContext.config);
|
|
13
|
-
return (
|
|
16
|
+
return (react_1.default.createElement(components_1.CustomComponent, { componentId: "SensorSuggestions", defaultQuery: () => {
|
|
14
17
|
return {
|
|
15
18
|
suggest: {
|
|
16
19
|
suggestions: {
|
|
@@ -19,13 +22,11 @@ const Suggestions = (props) => {
|
|
|
19
22
|
field: props.field,
|
|
20
23
|
gram_size: 2,
|
|
21
24
|
confidence: 0,
|
|
22
|
-
direct_generator: [
|
|
23
|
-
{
|
|
25
|
+
direct_generator: [{
|
|
24
26
|
field: props.field,
|
|
25
27
|
suggest_mode: "always",
|
|
26
28
|
min_word_length: 1,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
+
}],
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
},
|
|
@@ -46,7 +47,7 @@ const Suggestions = (props) => {
|
|
|
46
47
|
text: option.text,
|
|
47
48
|
}));
|
|
48
49
|
}
|
|
49
|
-
return
|
|
50
|
+
return react_1.default.createElement(RenderComponent, Object.assign({}, props));
|
|
50
51
|
} }));
|
|
51
52
|
};
|
|
52
53
|
exports.Suggestions = Suggestions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Suggestions.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Suggestions.js","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAI0B;AAC1B,uCAAkE;AAa3D,MAAM,WAAW,GAA+B,CAAC,KAAK,EAAE,EAAE;;IAC/D,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,+BAAkB,CAAC;IAE3D,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAEzD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iBAAS,GAAE,CAAC;IAEnC,MAAM,SAAS,GAAG,IAAA,uBAAU,EAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAE/F,OAAO,CACL,8BAAC,4BAAe,IACd,WAAW,EAAC,mBAAmB,EAC/B,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;gBACL,OAAO,EAAE;oBACP,WAAW,EAAE;wBACX,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE;4BACN,KAAK,EAAE,KAAK,CAAC,KAAK;4BAClB,SAAS,EAAE,CAAC;4BACZ,UAAU,EAAE,CAAC;4BACb,gBAAgB,EAAE,CAAC;oCACjB,KAAK,EAAE,KAAK,CAAC,KAAK;oCAClB,YAAY,EAAE,QAAQ;oCACtB,eAAe,EAAE,CAAC;iCACnB,CAAC;yBACH;qBACF;iBACF;aACF,CAAC;QACJ,CAAC,EACD,KAAK,EAAE;YACL,GAAG,EAAE,SAAS;SACf,EACD,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;;YACtB,MAAM,KAAK,GAEP;gBACF,WAAW,EAAE,EAAE;aAChB,CAAC;YAEF,IAAI,MAAA,MAAA,WAAW,CAAC,OAAO,0CAAE,OAAO,0CAAE,WAAW,CAAC,MAAM,EAAE,CAAC;gBACrD,MAAM,OAAO,GAAG,MAAA,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,OAAO,CAAC;gBACrH,KAAK,CAAC,WAAW,GAAI,OAAiD;qBACnE,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC;qBAC9C,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,WAAC,OAAA,CAAC,CAAC,MAAA,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;qBACnG,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;oBAChB,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAC,CAAC;YACR,CAAC;YAED,OAAO,8BAAC,eAAe,oBAAK,KAAK,EAAI,CAAC;QACxC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,WAAW,eAuDtB","sourcesContent":["import React from \"react\";\n\nimport {\n CustomComponent,\n ExampleSuggestions,\n SENSOR_IDS,\n} from \"../../components\";\nimport { useReactifySearchContext, useSearch } from \"../../hooks\";\n\nexport type SuggestionsProps = {\n /** The field which should be used for autocompletion */\n field: \"title\";\n /** Render method */\n render?: React.FC<{\n suggestions: Array<{\n text: string;\n }>;\n }>;\n};\n\nexport const Suggestions: React.FC<SuggestionsProps> = (props) => {\n const RenderComponent = props.render ?? ExampleSuggestions;\n\n const reactifySearchContext = useReactifySearchContext();\n\n const { searchTerm } = useSearch();\n\n const sensorIds = SENSOR_IDS(reactifySearchContext.options.mode, reactifySearchContext.config);\n\n return (\n <CustomComponent\n componentId=\"SensorSuggestions\"\n defaultQuery={() => {\n return {\n suggest: {\n suggestions: {\n text: searchTerm,\n phrase: {\n field: props.field,\n gram_size: 2,\n confidence: 0,\n direct_generator: [{\n field: props.field,\n suggest_mode: \"always\",\n min_word_length: 1,\n }],\n },\n },\n },\n };\n }}\n react={{\n and: sensorIds,\n }}\n render={(renderProps) => {\n const props: React.ComponentProps<\n NonNullable<SuggestionsProps[\"render\"]>\n > = {\n suggestions: [],\n };\n\n if (renderProps.rawData?.suggest?.suggestions.length) {\n const options = renderProps.rawData.suggest.suggestions[renderProps.rawData.suggest.suggestions.length - 1]?.options;\n props.suggestions = (options as Array<{ text: string; freq: number }>)\n .filter((option) => option.text !== searchTerm)\n .filter((option) => !(reactifySearchContext.config.suggestions.exclude ?? []).includes(option.text))\n .map((option) => ({\n text: option.text,\n }));\n }\n\n return <RenderComponent {...props} />;\n }}\n />\n );\n};\n"]}
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UtilityAuthenticatedReactiveBase = void 0;
|
|
7
|
-
const
|
|
8
|
-
const ReactiveBase_1 = __importDefault(require("@usereactify/search-internals/lib/components/basic/ReactiveBase"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const hooks_1 = require("../../hooks");
|
|
9
|
+
const ReactiveBase_1 = __importDefault(require("@usereactify/search-internals/lib/components/basic/ReactiveBase"));
|
|
10
10
|
const UtilityAuthenticatedReactiveBase = (props) => {
|
|
11
11
|
const reactiveBaseProps = (0, hooks_1.useReactiveBaseProps)();
|
|
12
|
-
return
|
|
12
|
+
return react_1.default.createElement(ReactiveBase_1.default, Object.assign({}, reactiveBaseProps), props.children);
|
|
13
13
|
};
|
|
14
14
|
exports.UtilityAuthenticatedReactiveBase = UtilityAuthenticatedReactiveBase;
|
|
15
15
|
//# sourceMappingURL=UtilityAuthenticatedReactiveBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityAuthenticatedReactiveBase.js","sourceRoot":"","sources":["../../../../src/components/Utility/UtilityAuthenticatedReactiveBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UtilityAuthenticatedReactiveBase.js","sourceRoot":"","sources":["../../../../src/components/Utility/UtilityAuthenticatedReactiveBase.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,uCAAmD;AACnD,mHAA2F;AAOpF,MAAM,gCAAgC,GAC3C,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,GAAE,CAAC;IAEjD,OAAO,8BAAC,sBAAY,oBAAK,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAgB,CAAC;AAC9E,CAAC,CAAC;AALS,QAAA,gCAAgC,oCAKzC","sourcesContent":["import React from \"react\";\nimport { useReactiveBaseProps } from \"../../hooks\";\nimport ReactiveBase from \"@usereactify/search-internals/lib/components/basic/ReactiveBase\";\n\nexport type UtilityAuthenticatedReactiveBaseProps = {\n /** Standard react children */\n children?: React.ReactNode | undefined;\n};\n\nexport const UtilityAuthenticatedReactiveBase: React.FC<UtilityAuthenticatedReactiveBaseProps> =\n (props) => {\n const reactiveBaseProps = useReactiveBaseProps();\n\n return <ReactiveBase {...reactiveBaseProps}>{props.children}</ReactiveBase>;\n };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD","sourcesContent":["export * from \"./UtilityAuthenticatedReactiveBase\"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD","sourcesContent":["export * from \"./UtilityAuthenticatedReactiveBase\";"]}
|
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ClearAll"), exports);
|
|
18
|
-
__exportStar(require("./CustomComponent"), exports);
|
|
19
17
|
__exportStar(require("./Example"), exports);
|
|
18
|
+
__exportStar(require("./CustomComponent"), exports);
|
|
19
|
+
__exportStar(require("./ClearAll"), exports);
|
|
20
20
|
__exportStar(require("./Filter"), exports);
|
|
21
21
|
__exportStar(require("./ReactifySearchProvider"), exports);
|
|
22
22
|
__exportStar(require("./Result"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,6CAA2B;AAC3B,2CAAyB;AACzB,2DAAyC;AACzC,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,gDAA8B;AAC9B,4CAA0B","sourcesContent":["export * from \"./Example\";\nexport * from \"./CustomComponent\";\nexport * from \"./ClearAll\";\nexport * from \"./Filter\";\nexport * from \"./ReactifySearchProvider\";\nexport * from \"./Result\";\nexport * from \"./Search\";\nexport * from \"./Sensor\";\nexport * from \"./SortBy\";\nexport * from \"./Stats\";\nexport * from \"./Suggestions\";\nexport * from \"./Utility\";\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export * from "./reactivesearch";
|
|
2
|
-
export * from "./useAnalytics";
|
|
3
|
-
export * from "./useConfig";
|
|
4
|
-
export * from "./useCuration";
|
|
5
2
|
export * from "./useDebugger";
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./useFilterListProps";
|
|
8
|
-
export * from "./useFilterRangeProps";
|
|
9
|
-
export * from "./useFilterSliderProps";
|
|
10
|
-
export * from "./useFilters";
|
|
11
|
-
export * from "./useIndices";
|
|
3
|
+
export * from "./useSortBy";
|
|
12
4
|
export * from "./usePagination";
|
|
13
5
|
export * from "./usePaginationLoadable";
|
|
6
|
+
export * from "./useSearch";
|
|
7
|
+
export * from "./useCuration";
|
|
8
|
+
export * from "./useAnalytics";
|
|
9
|
+
export * from "./useFilters";
|
|
14
10
|
export * from "./useProductPrice";
|
|
11
|
+
export * from "./useFilterListProps";
|
|
12
|
+
export * from "./useFilterRangeProps";
|
|
13
|
+
export * from "./useFilterSliderProps";
|
|
14
|
+
export * from "./useFilterCollapsedState";
|
|
15
|
+
export * from "./useConfig";
|
|
15
16
|
export * from "./useReactifySearchContext";
|
|
16
17
|
export * from "./useResults";
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./useSortBy";
|
|
18
|
+
export * from "./useIndices";
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -15,21 +15,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./reactivesearch"), exports);
|
|
18
|
-
__exportStar(require("./useAnalytics"), exports);
|
|
19
|
-
__exportStar(require("./useConfig"), exports);
|
|
20
|
-
__exportStar(require("./useCuration"), exports);
|
|
21
18
|
__exportStar(require("./useDebugger"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./useFilterListProps"), exports);
|
|
24
|
-
__exportStar(require("./useFilterRangeProps"), exports);
|
|
25
|
-
__exportStar(require("./useFilterSliderProps"), exports);
|
|
26
|
-
__exportStar(require("./useFilters"), exports);
|
|
27
|
-
__exportStar(require("./useIndices"), exports);
|
|
19
|
+
__exportStar(require("./useSortBy"), exports);
|
|
28
20
|
__exportStar(require("./usePagination"), exports);
|
|
29
21
|
__exportStar(require("./usePaginationLoadable"), exports);
|
|
22
|
+
__exportStar(require("./useSearch"), exports);
|
|
23
|
+
__exportStar(require("./useCuration"), exports);
|
|
24
|
+
__exportStar(require("./useAnalytics"), exports);
|
|
25
|
+
__exportStar(require("./useFilters"), exports);
|
|
30
26
|
__exportStar(require("./useProductPrice"), exports);
|
|
27
|
+
__exportStar(require("./useFilterListProps"), exports);
|
|
28
|
+
__exportStar(require("./useFilterRangeProps"), exports);
|
|
29
|
+
__exportStar(require("./useFilterSliderProps"), exports);
|
|
30
|
+
__exportStar(require("./useFilterCollapsedState"), exports);
|
|
31
|
+
__exportStar(require("./useConfig"), exports);
|
|
31
32
|
__exportStar(require("./useReactifySearchContext"), exports);
|
|
32
33
|
__exportStar(require("./useResults"), exports);
|
|
33
|
-
__exportStar(require("./
|
|
34
|
-
__exportStar(require("./useSortBy"), exports);
|
|
34
|
+
__exportStar(require("./useIndices"), exports);
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AAEjC,gDAA8B;AAC9B,8CAA4B;AAC5B,kDAAgC;AAChC,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,iDAA+B;AAC/B,+CAA6B;AAC7B,oDAAkC;AAClC,uDAAqC;AACrC,wDAAsC;AACtC,yDAAuC;AACvC,4DAA0C;AAC1C,8CAA4B;AAC5B,6DAA2C;AAC3C,+CAA6B;AAC7B,+CAA6B","sourcesContent":["export * from \"./reactivesearch\";\n\nexport * from \"./useDebugger\";\nexport * from \"./useSortBy\";\nexport * from \"./usePagination\";\nexport * from \"./usePaginationLoadable\";\nexport * from \"./useSearch\";\nexport * from \"./useCuration\";\nexport * from \"./useAnalytics\";\nexport * from \"./useFilters\";\nexport * from \"./useProductPrice\";\nexport * from \"./useFilterListProps\";\nexport * from \"./useFilterRangeProps\";\nexport * from \"./useFilterSliderProps\";\nexport * from \"./useFilterCollapsedState\";\nexport * from \"./useConfig\";\nexport * from \"./useReactifySearchContext\";\nexport * from \"./useResults\";\nexport * from \"./useIndices\";\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { ConfigFilterFacet } from "../../types";
|
|
3
|
+
import ReactSlider from "react-slider";
|
|
4
4
|
export declare const useReactSliderProps: (filter: ConfigFilterFacet, filterValue: [number, number] | [], filterRange: [number, number], handleChange: (value: [number, number]) => void) => Pick<React.ComponentProps<typeof ReactSlider>, "value" | "defaultValue" | "min" | "max" | "step" | "pearling" | "minDistance" | "onChange">;
|
|
@@ -9,22 +9,22 @@ const useReactSliderProps = (filter, filterValue, filterRange, handleChange) =>
|
|
|
9
9
|
const reactSliderProps = react_1.default.useMemo(() => {
|
|
10
10
|
var _a;
|
|
11
11
|
const filterValueParsed = [
|
|
12
|
-
parseInt((filterValue[0] ? filterValue[0] : filterRange[0]).toFixed(0)
|
|
13
|
-
parseInt((filterValue[1] ? filterValue[1] : filterRange[1]).toFixed(0)
|
|
12
|
+
parseInt((filterValue[0] ? filterValue[0] : filterRange[0]).toFixed(0)),
|
|
13
|
+
parseInt((filterValue[1] ? filterValue[1] : filterRange[1]).toFixed(0)),
|
|
14
14
|
];
|
|
15
15
|
const filterRangeParsed = [
|
|
16
|
-
parseInt(filterRange[0].toFixed(0)
|
|
17
|
-
parseInt(filterRange[1].toFixed(0)
|
|
16
|
+
parseInt(filterRange[0].toFixed(0)),
|
|
17
|
+
parseInt(filterRange[1].toFixed(0)),
|
|
18
18
|
];
|
|
19
19
|
return {
|
|
20
20
|
value: filterValueParsed,
|
|
21
21
|
defaultValue: [filterRangeParsed[0], filterRangeParsed[1]],
|
|
22
22
|
min: filterRangeParsed[0],
|
|
23
23
|
max: filterRangeParsed[1],
|
|
24
|
-
step: parseInt((_a = filter.displaySliderStep) !== null && _a !== void 0 ? _a : "5"
|
|
24
|
+
step: parseInt((_a = filter.displaySliderStep) !== null && _a !== void 0 ? _a : "5"),
|
|
25
25
|
pearling: true,
|
|
26
26
|
minDistance: 0,
|
|
27
|
-
onChange: (value) =>
|
|
27
|
+
onChange: (value) => Array.isArray(value) ? handleChange([value[0], value[1]]) : {},
|
|
28
28
|
};
|
|
29
29
|
}, [filter.displaySliderStep, filterValue, filterRange, handleChange]);
|
|
30
30
|
return reactSliderProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactSliderProps.js","sourceRoot":"","sources":["../../../../src/hooks/react-slider/useReactSliderProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAInB,MAAM,mBAAmB,GAAG,CACjC,MAAyB,EACzB,WAAkC,EAClC,WAA6B,EAC7B,YAA+C,
|
|
1
|
+
{"version":3,"file":"useReactSliderProps.js","sourceRoot":"","sources":["../../../../src/hooks/react-slider/useReactSliderProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAInB,MAAM,mBAAmB,GAAG,CACjC,MAAyB,EACzB,WAAkC,EAClC,WAA6B,EAC7B,YAA+C,EAW/C,EAAE;IACF,MAAM,gBAAgB,GAAG,eAAK,CAAC,OAAO,CAEpC,GAAG,EAAE;;QACL,MAAM,iBAAiB,GAAqB;YAC1C,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACvE,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACxE,CAAC;QACF,MAAM,iBAAiB,GAAqB;YAC1C,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACnC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACpC,CAAC;QAEF,OAAO;YACL,KAAK,EAAE,iBAAiB;YACxB,YAAY,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;YAC1D,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;YACzB,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;YACzB,IAAI,EAAE,QAAQ,CAAC,MAAA,MAAM,CAAC,iBAAiB,mCAAI,GAAG,CAAC;YAC/C,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,CAAC;YACd,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SACjE,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAEvE,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AA1CW,QAAA,mBAAmB,uBA0C9B","sourcesContent":["import React from \"react\";\nimport { ConfigFilterFacet } from \"../../types\";\nimport ReactSlider from \"react-slider\";\n\nexport const useReactSliderProps = (\n filter: ConfigFilterFacet,\n filterValue: [number, number] | [],\n filterRange: [number, number],\n handleChange: (value: [number, number]) => void\n): Pick<\n React.ComponentProps<typeof ReactSlider>,\n | \"value\"\n | \"defaultValue\"\n | \"min\"\n | \"max\"\n | \"step\"\n | \"pearling\"\n | \"minDistance\"\n | \"onChange\"\n> => {\n const reactSliderProps = React.useMemo<\n ReturnType<typeof useReactSliderProps>\n >(() => {\n const filterValueParsed: [number, number] = [\n parseInt((filterValue[0] ? filterValue[0] : filterRange[0]).toFixed(0)),\n parseInt((filterValue[1] ? filterValue[1] : filterRange[1]).toFixed(0)),\n ];\n const filterRangeParsed: [number, number] = [\n parseInt(filterRange[0].toFixed(0)),\n parseInt(filterRange[1].toFixed(0)),\n ];\n\n return {\n value: filterValueParsed,\n defaultValue: [filterRangeParsed[0], filterRangeParsed[1]],\n min: filterRangeParsed[0],\n max: filterRangeParsed[1],\n step: parseInt(filter.displaySliderStep ?? \"5\"),\n pearling: true,\n minDistance: 0,\n onChange: (value) =>\n Array.isArray(value) ? handleChange([value[0], value[1]]) : {},\n };\n }, [filter.displaySliderStep, filterValue, filterRange, handleChange]);\n\n return reactSliderProps;\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactiveBaseProps } from "@usereactify/search-internals/lib/components/basic/ReactiveBase";
|
|
2
2
|
export declare const replaceDocCountWithParent: (response: any) => any;
|
|
3
3
|
export declare const useReactiveBaseProps: () => ReactiveBaseProps;
|
|
@@ -10,7 +10,7 @@ const props_1 = require("../../utility/props");
|
|
|
10
10
|
const replaceDocCountWithParent = (response) => {
|
|
11
11
|
Object.entries(response)
|
|
12
12
|
.filter(([key]) => key !== "doc_count")
|
|
13
|
-
.forEach(([
|
|
13
|
+
.forEach(([key, value]) => {
|
|
14
14
|
var _a;
|
|
15
15
|
(_a = value.buckets) === null || _a === void 0 ? void 0 : _a.forEach((bucket) => {
|
|
16
16
|
if (bucket.parent_docs) {
|
|
@@ -33,7 +33,7 @@ const useReactiveBaseProps = () => {
|
|
|
33
33
|
const reactiveBaseProps = react_1.default.useMemo(() => {
|
|
34
34
|
var _a;
|
|
35
35
|
return (Object.assign(Object.assign({}, reactiveBasePropsShared), { initialState: (_a = options.preload) === null || _a === void 0 ? void 0 : _a.state, headers: Object.assign(Object.assign({}, reactiveBasePropsShared.headers), { "x-reactify-ga": (0, hooks_1.getCookie)("_rs_ga") }) }));
|
|
36
|
-
}, [(_a = options.preload) === null || _a === void 0 ? void 0 : _a.state
|
|
36
|
+
}, [options.index, config.endpoint, options.credentials, options.theme, (_a = options.preload) === null || _a === void 0 ? void 0 : _a.state]);
|
|
37
37
|
return reactiveBaseProps;
|
|
38
38
|
};
|
|
39
39
|
exports.useReactiveBaseProps = useReactiveBaseProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveBaseProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveBaseProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"useReactiveBaseProps.js","sourceRoot":"","sources":["../../../../src/hooks/reactivesearch/useReactiveBaseProps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,uCAAkE;AAGlE,+CAAmD;AAE5C,MAAM,yBAAyB,GAAG,CAAC,QAAa,EAAE,EAAE;IACzD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,WAAW,CAAC;SACtC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAgB,EAAE,EAAE;;QACvC,MAAA,KAAK,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,MAAW,EAAE,EAAE;YACrC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;gBACvB,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;gBAChD,OAAO,MAAM,CAAC,WAAW,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAbW,QAAA,yBAAyB,6BAapC;AAEK,MAAM,oBAAoB,GAAG,GAAsB,EAAE;;IAC1D,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAEvD,MAAM,uBAAuB,GAAG,IAAA,oBAAY,EAAC;QAC3C,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAA;IAEF,MAAM,iBAAiB,GAAG,eAAK,CAAC,OAAO,CACrC,GAAG,EAAE;;QAAC,OAAA,iCACD,uBAAuB,KAC1B,YAAY,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,EACpC,OAAO,kCACF,uBAAuB,CAAC,OAAO,KAClC,eAAe,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC,OAEtC,CAAA;KAAA,EACF,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,CAAC,CAC7F,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAtBW,QAAA,oBAAoB,wBAsB/B","sourcesContent":["import React from \"react\";\nimport { ReactiveBaseProps } from \"@usereactify/search-internals/lib/components/basic/ReactiveBase\";\n\nimport { getCookie, useReactifySearchContext } from \"../../hooks\";\n\nimport pkg from \"../../../package.json\";\nimport { getPropsBase } from \"../../utility/props\";\n\nexport const replaceDocCountWithParent = (response: any) => {\n Object.entries(response)\n .filter(([key]) => key !== \"doc_count\")\n .forEach(([key, value]: [string, any]) => {\n value.buckets?.forEach((bucket: any) => {\n if (bucket.parent_docs) {\n bucket.doc_count = bucket.parent_docs.doc_count;\n delete bucket.parent_docs;\n }\n });\n });\n\n return response;\n};\n\nexport const useReactiveBaseProps = (): ReactiveBaseProps => {\n const { options, config } = useReactifySearchContext();\n \n const reactiveBasePropsShared = getPropsBase({\n provider: options,\n config: config,\n query: options.query,\n })\n\n const reactiveBaseProps = React.useMemo<ReactiveBaseProps>(\n () => ({\n ...reactiveBasePropsShared,\n initialState: options.preload?.state,\n headers: {\n ...reactiveBasePropsShared.headers,\n \"x-reactify-ga\": getCookie(\"_rs_ga\"),\n },\n }),\n [options.index, config.endpoint, options.credentials, options.theme, options.preload?.state]\n );\n\n return reactiveBaseProps;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnalytics.js","sourceRoot":"","sources":["../../../src/hooks/useAnalytics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useAnalytics.js","sourceRoot":"","sources":["../../../src/hooks/useAnalytics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAQA,8BAeC;AAvBD,kDAA0B;AAE1B,sEAAqC;AAErC,oCAAoD;AACpD,wCAAmC;AAGnC,SAAgB,SAAS,CAAC,IAAY;;IACpC,IAAI,CAAC;QACH,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,MAAA,MAAA,MAAM,CAAC,GAAG,EAAE,0CAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,mCAAI,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAEM,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IACjE,MAAM,KAAK,GAAG,CAAO,KAAiB,EAAE,EAAE;;QACxC,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CACV,IAAI,KAAK,CACP,4EAA4E,CAC7E,CACF,CAAC;YAEF,OAAO;QACT,CAAC;QAED,MAAM,WAAW,GAA2B;YAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,EAAE,mCAAI,EAAE;YAC5B,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,EAAE;YACnC,gBAAgB,EAAE,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE;YAC/E,cAAc,EAAE,EAAE;SACnB,CAAC;QAEF,eAAK,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QAEvD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,eAAK,CAAC,IAAI,CACf,2CAA2C,EAC3C;YACE,MAAM;YACN,WAAW;SACZ,EACD;YACE,OAAO,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,sBAAsB;gBACjD,iBAAiB,EAAE,OAAO,CAAC,IAAI;gBAC/B,sBAAsB,EAAE,OAAO,CAAC,QAAQ;gBACxC,2BAA2B,EAAE,sBAAG,CAAC,OAAO;gBACxC,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC;aACrC;SACF,CACF,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC,CAAC;AA3CW,QAAA,YAAY,gBA2CvB;AAEF,SAAS,cAAc,CAAC,KAAiB;IACvC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,IAAI,MAAM,GAAiB,EAAE,CAAC;IAE9B,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,GAC5C;iBACF;aACF,CAAC;YAEF,MAAM;QAER,KAAK,aAAa;YAChB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,GAC5C;iBACF;aACF,CAAC;YAEF,MAAM;QAER,KAAK,aAAa;YAChB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,cAAc;YACjB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,eAAe;YAClB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,gBAAgB;YACnB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,kBAAkB;YACrB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,YAAY;YACf,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;QAER,KAAK,cAAc;YACjB,MAAM,GAAG;gBACP;oBACE,SAAS;oBACT,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;YAEF,MAAM;IACV,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import axios from \"axios\";\n\nimport pkg from \"../../package.json\";\n\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\nimport { getCuration } from \"../utility/curation\";\n\nexport function getCookie(name: string): string {\n try {\n if (typeof window === \"undefined\") {\n return \"\";\n }\n\n const cookie = `; ${document.cookie}`.split(`; ${name}=`);\n if (cookie.length === 2) {\n return cookie.pop()?.split(\";\").shift() ?? \"\";\n }\n } catch (error) {\n console.error(error);\n }\n\n return \"\";\n}\n\nexport const useAnalytics = () => {\n const { options, search, curation } = useReactifySearchContext();\n const track = async (event: TrackEvent) => {\n if (!options.shopifyPermanentDomain) {\n console.warn(\n new Error(\n 'Unable to send tracking event, missing value for \"shopifyPermanentDomain\".'\n )\n );\n\n return;\n }\n\n const attribution: TrackEvent.Attribution = {\n market: options.market,\n curation: curation?.id ?? \"\",\n searchTerm: search.searchTerm ?? \"\",\n collectionHandle: options.mode === \"collection\" ? options.collectionHandle : \"\",\n recommendation: \"\",\n };\n\n debug.log(\"useAnalytics\", \"track\", event, attribution);\n\n const events = getTrackEvents(event);\n return axios.post(\n `https://analytics.usereactify.com/record/`,\n {\n events,\n attribution,\n },\n {\n headers: {\n \"x-reactify-shop\": options.shopifyPermanentDomain,\n \"x-reactify-mode\": options.mode,\n \"x-reactify-client-id\": options.clientId,\n \"x-reactify-client-version\": pkg.version,\n \"x-reactify-ga\": getCookie(\"_rs_ga\"),\n },\n }\n );\n };\n\n return { track };\n};\n\nfunction getTrackEvents(event: TrackEvent): TrackEvent[] {\n const { eventName } = event;\n let events: TrackEvent[] = [];\n\n switch (eventName) {\n case \"search\":\n events = [\n {\n eventName,\n payload: {\n ...event.payload,\n searchTerm: event.payload.searchTerm.trim(),\n },\n },\n ];\n\n break;\n\n case \"zeroResults\":\n events = [\n {\n eventName,\n payload: {\n ...event.payload,\n searchTerm: event.payload.searchTerm.trim(),\n },\n },\n ];\n\n break;\n\n case \"viewProduct\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"clickProduct\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"viewPromotion\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"clickPromotion\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"paginationChange\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"sortChange\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n\n case \"filterChange\":\n events = [\n {\n eventName,\n payload: event.payload,\n },\n ];\n\n break;\n }\n\n return events;\n}\n\nexport type TrackEvent =\n | TrackEvent.SearchEvent\n | TrackEvent.ZeroResultsEvent\n | TrackEvent.ViewProductEvent\n | TrackEvent.ClickProductEvent\n | TrackEvent.ViewPromotionEvent\n | TrackEvent.ClickPromotionEvent\n | TrackEvent.PaginationChangeEvent\n | TrackEvent.SortChangeEvent\n | TrackEvent.FilterChangeEvent;\n\nexport namespace TrackEvent {\n export interface SearchEvent {\n eventName: \"search\";\n payload: SearchEvent.Payload;\n }\n\n export namespace SearchEvent {\n export interface Payload {\n searchTerm: string;\n }\n }\n\n export interface ZeroResultsEvent {\n eventName: \"zeroResults\";\n payload: ZeroResultsEvent.Payload;\n }\n\n export namespace ZeroResultsEvent {\n export interface Payload {\n searchTerm: string;\n }\n }\n\n export interface ViewProductEvent {\n eventName: \"viewProduct\";\n payload: ViewProductEvent.Payload;\n }\n\n export namespace ViewProductEvent {\n export interface Payload {\n elasticProduct: Product;\n }\n }\n\n export interface ClickProductEvent {\n eventName: \"clickProduct\";\n payload: ClickProductEvent.Payload;\n }\n\n export namespace ClickProductEvent {\n export interface Payload {\n elasticProduct: Product;\n }\n }\n\n export interface ViewPromotionEvent {\n eventName: \"viewPromotion\";\n payload: ViewPromotionEvent.Payload;\n }\n\n export namespace ViewPromotionEvent {\n export interface Payload {\n link: string;\n title: string;\n }\n }\n\n export interface ClickPromotionEvent {\n eventName: \"clickPromotion\";\n payload: ClickPromotionEvent.Payload;\n }\n\n export namespace ClickPromotionEvent {\n export interface Payload {\n link: string;\n title: string;\n }\n }\n\n export interface PaginationChangeEvent {\n eventName: \"paginationChange\";\n payload: PaginationChangeEvent.Payload;\n }\n\n export namespace PaginationChangeEvent {\n export interface Payload {\n page: number;\n source: \"search\" | \"collection\";\n }\n }\n\n export interface SortChangeEvent {\n eventName: \"sortChange\";\n payload: SortChangeEvent.Payload;\n }\n\n export namespace SortChangeEvent {\n export interface Payload {\n type: string;\n }\n }\n\n export interface FilterChangeEvent {\n eventName: \"filterChange\";\n payload: FilterChangeEvent.Payload;\n }\n\n export namespace FilterChangeEvent {\n export interface Payload {\n name: string;\n value: string;\n }\n }\n\n export interface Product {\n id: number;\n title: string;\n }\n export interface Attribution {\n market?: string;\n curation?: string;\n searchTerm?: string;\n collectionHandle?: string;\n recommendation?: string;\n }\n}\n"]}
|
|
@@ -42,7 +42,7 @@ const useConfig = (shopifyPermanentDomain, preloadedConfig, configBaseUrl) => {
|
|
|
42
42
|
try {
|
|
43
43
|
json = yield fetch(url).then((response) => response.json());
|
|
44
44
|
}
|
|
45
|
-
catch (
|
|
45
|
+
catch (error) {
|
|
46
46
|
json = yield fetch(url).then((response) => response.json());
|
|
47
47
|
}
|
|
48
48
|
setConfig(json.body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.js","sourceRoot":"","sources":["../../../src/hooks/useConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"useConfig.js","sourceRoot":"","sources":["../../../src/hooks/useConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAG1B,wCAAmC;AAE5B,MAAM,SAAS,GAAG,CACvB,sBAA8B,EAC9B,eAAwB,EACxB,aAAsB,EAGtB,EAAE;IACF,2EAA2E;IAC3E,MAAM,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QACtC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAER,IAAI,CAAC,KAAK,CAAC,MAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,mCAAI,MAAM,CAAC,CAAC;QAEzF,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAA,MAAA,aAAa,CAAC,MAAM,CAAC,KAAK,0CAAE,OAAO,MAAK,KAAK,EAAE,CAAC;gBAClD,OAAO;YACT,CAAC;YAED,OAAO,aAAa,CAAC,MAAM,CAAC;QAC9B,CAAC;QAED,OAAO;IACT,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAqB,YAAY,CAAC,CAAC;IAE7E,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,CAAC,GAAS,EAAE;YACV,MAAM,YAAY,GAAG,IAAI,eAAe,EAAE,CAAC;YAC3C,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;YAEjD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,IAAI,iCAAiC,CAAC,CAAC;YACxE,GAAG,CAAC,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;YAErC,IAAI,IAAS,CAAC;YACd,IAAI,CAAC;gBACH,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9D,CAAC;YAED,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACjG,CAAC,CAAA,CAAC,EAAE,CAAC;IACP,CAAC,EAAE,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC,CAAC;IAE5C,eAAK,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE1C,OAAO;QACL,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,eAAe;KAClC,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,SAAS,aAuDpB","sourcesContent":["import React from \"react\";\n\nimport { Config } from \"../types/config\";\nimport { debug } from \"../utility\";\n\nexport const useConfig = (\n shopifyPermanentDomain: string,\n preloadedConfig?: Config,\n configBaseUrl?: string\n): {\n config: Config | undefined;\n} => {\n // synchronously returns cached and non-expired config from session storage\n const cachedConfig = React.useMemo(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const sessionConfig: {\n config: Config;\n } | null = JSON.parse(window.sessionStorage.getItem(\"reactify-search:config\") ?? \"null\");\n\n if (sessionConfig) {\n if (sessionConfig.config.cache?.enabled === false) {\n return;\n }\n\n return sessionConfig.config;\n }\n\n return;\n }, []);\n\n const [config, setConfig] = React.useState<Config | undefined>(cachedConfig);\n\n React.useEffect(() => {\n (async () => {\n const searchParams = new URLSearchParams();\n searchParams.set(\"shop\", shopifyPermanentDomain);\n\n const url = new URL(configBaseUrl || \"https://config.usereactify.com/\");\n url.search = searchParams.toString();\n\n let json: any;\n try {\n json = await fetch(url).then((response) => response.json());\n } catch (error) {\n json = await fetch(url).then((response) => response.json());\n }\n\n setConfig(json.body);\n window.sessionStorage.setItem(\"reactify-search:config\", JSON.stringify({ config: json.body }));\n })();\n }, [shopifyPermanentDomain, configBaseUrl]);\n\n debug.hook(\"useConfig\", \"config\", config);\n\n return {\n config: config ?? preloadedConfig,\n };\n};\n"]}
|