@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":"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,0CAA0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;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AA6FX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;AAC3B,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAgBD,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,yCAAuB,CAAA;IACvB,iCAAe,CAAA;IACf,+CAA6B,CAAA;IAC7B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAgED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,oCAAqB,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;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
|
+
{"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,qC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ACZ,OAAO,EAAE,SAAS;CACV,CAAC;AA+FX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;AAC3B,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAgBD,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,yCAAuB,CAAA;IACvB,iCAAe,CAAA;IACf,+CAA6B,CAAA;IAC7B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAgED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,oCAAqB,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 +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\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ProductQuery, BulkQueryProductsWithDraftProductsQuery, ListAppSubscriptionsQuery, ListAppPurchaseOneTimeQuery, BulkQueryProductMarketsWithDraftProductsQuery } 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":";;;
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Config } from "../types/config";
|
|
2
2
|
export declare const getConfigFromCache: () => Config | undefined;
|
|
3
|
-
export declare const getConfigFromNetwork: (shopifyPermanentDomain: string) => Promise<Config | undefined>;
|
|
4
|
-
export declare const getConfig: (shopifyPermanentDomain: string) => Promise<Config>;
|
|
3
|
+
export declare const getConfigFromNetwork: (shopifyPermanentDomain: string, configBaseUrl?: string) => Promise<Config | undefined>;
|
|
4
|
+
export declare const getConfig: (shopifyPermanentDomain: string, configBaseUrl?: string) => Promise<Config>;
|
|
@@ -25,24 +25,27 @@ const getConfigFromCache = () => {
|
|
|
25
25
|
return;
|
|
26
26
|
};
|
|
27
27
|
exports.getConfigFromCache = getConfigFromCache;
|
|
28
|
-
const getConfigFromNetwork = (shopifyPermanentDomain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
const getConfigFromNetwork = (shopifyPermanentDomain, configBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
let configFromNetwork;
|
|
31
|
+
const url = configBaseUrl || "https://config.usereactify.com/";
|
|
32
|
+
const apiUrl = new URL(url);
|
|
33
|
+
apiUrl.searchParams.set("shop", shopifyPermanentDomain);
|
|
31
34
|
try {
|
|
32
|
-
configFromNetwork = (_a = (yield fetch(
|
|
35
|
+
configFromNetwork = (_a = (yield fetch(apiUrl.toString()).then((response) => response.json()))) === null || _a === void 0 ? void 0 : _a.body;
|
|
33
36
|
}
|
|
34
|
-
catch (
|
|
35
|
-
configFromNetwork = (_b = (yield fetch(
|
|
37
|
+
catch (error) {
|
|
38
|
+
configFromNetwork = (_b = (yield fetch(apiUrl.toString()).then((response) => response.json()))) === null || _b === void 0 ? void 0 : _b.body;
|
|
36
39
|
}
|
|
37
40
|
return configFromNetwork;
|
|
38
41
|
});
|
|
39
42
|
exports.getConfigFromNetwork = getConfigFromNetwork;
|
|
40
|
-
const getConfig = (shopifyPermanentDomain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
const getConfig = (shopifyPermanentDomain, configBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
44
|
const configFromCache = (0, exports.getConfigFromCache)();
|
|
42
45
|
if (configFromCache) {
|
|
43
46
|
return configFromCache;
|
|
44
47
|
}
|
|
45
|
-
const configFromNetwork = yield (0, exports.getConfigFromNetwork)(shopifyPermanentDomain);
|
|
48
|
+
const configFromNetwork = yield (0, exports.getConfigFromNetwork)(shopifyPermanentDomain, configBaseUrl);
|
|
46
49
|
if (!configFromNetwork) {
|
|
47
50
|
throw new Error("Unable to load config");
|
|
48
51
|
}
|
|
@@ -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,
|
|
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,C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AS,GAAG,CACvB,sBAA8B,EAC9B,aAAsB,EACL,EAAE;IACnB,MAAM,eAAe,GAAG,IAAA,0BAAkB,GAAE,CAAC;IAC7C,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,IAAA,4BAAoB,EAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;IAE5F,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,OAAO,CAC3B,wBAAwB,EACxB,IAAI,CAAC,SAAS,CAAC;YACb,MAAM,EAAE,iBAAiB;SAC1B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA,CAAC;AAzBW,QAAA,SAAS,aAyBpB","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 (\n shopifyPermanentDomain: string,\n configBaseUrl?: string\n): Promise<Config | undefined> => {\n let configFromNetwork: Config | undefined;\n const url = configBaseUrl || \"https://config.usereactify.com/\";\n const apiUrl = new URL(url);\n apiUrl.searchParams.set(\"shop\", shopifyPermanentDomain);\n\n try {\n configFromNetwork = (await fetch(apiUrl.toString()).then((response) => response.json()))?.body;\n\n } catch (error) {\n configFromNetwork = (await fetch(apiUrl.toString()).then((response) => response.json()))?.body;\n }\n\n return configFromNetwork;\n};\n\nexport const getConfig = async (\n shopifyPermanentDomain: string,\n configBaseUrl?: string\n): Promise<Config> => {\n const configFromCache = getConfigFromCache();\n if (configFromCache) {\n return configFromCache;\n }\n\n const configFromNetwork = await getConfigFromNetwork(shopifyPermanentDomain, configBaseUrl);\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
|
|
2
|
-
import
|
|
1
|
+
import { ReactifySearchProviderProps } from "../components";
|
|
2
|
+
import { 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 : (
|
|
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,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,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 { 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utility/debug.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ReactifySearchProviderProps } from "../components";
|
|
2
|
+
import { 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,
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/utility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B,CAAC;IAED,0CAA0C;IAC1C,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAC3C,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,CAClD,CAAC;IACF,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC;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,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ReactifySearchProviderProps } from "../components/ReactifySearchProvider/ReactifySearchProvider";
|
|
3
3
|
export declare class ReactifySearchLiquidFactory {
|
|
4
4
|
providerProps: Omit<ReactifySearchProviderProps, "shopifyPermanentDomain"> & {
|
|
5
5
|
shopifyPermanentDomain?: string;
|
|
@@ -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.ReactifySearchLiquidFactory = void 0;
|
|
4
|
-
const
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
5
8
|
const ReactifySearchProvider_1 = require("../components/ReactifySearchProvider/ReactifySearchProvider");
|
|
6
9
|
class ReactifySearchLiquidFactory {
|
|
7
10
|
constructor(providerProps) {
|
|
@@ -9,7 +12,7 @@ class ReactifySearchLiquidFactory {
|
|
|
9
12
|
}
|
|
10
13
|
getProvider() {
|
|
11
14
|
const providerProps = this.getProviderProps();
|
|
12
|
-
const provider = (props) => (
|
|
15
|
+
const provider = (props) => (react_1.default.createElement(ReactifySearchProvider_1.ReactifySearchProvider, Object.assign({}, providerProps), props.children));
|
|
13
16
|
return provider;
|
|
14
17
|
}
|
|
15
18
|
getMountNode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquid.js","sourceRoot":"","sources":["../../../src/utility/liquid.tsx"],"names":[],"mappings":"
|
|
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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;YAC7C,MAAM,gBAAgB,GACpB,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,mCAAI,MAAA,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAC;YAClF,IAAI,CAAC,gBAAgB;gBAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YACrF,uCAAY,SAAS,KAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,IAAG;QAChE,CAAC;QAGD,OAAO,SAAwC,CAAC;IAClD,CAAC;CACF;AAjED,kEAiEC","sourcesContent":["import React from \"react\";\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,6 +1,6 @@
|
|
|
1
1
|
import { ReactiveList } from "@usereactify/search-internals";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { ReactifySearchProviderProps } from "../components";
|
|
3
|
+
import { Config, ConfigFilter, ConfigFilterFacet, ResultsDataListener } from "../types";
|
|
4
4
|
export type GeneratePropsFilterGroupOptions = {
|
|
5
5
|
provider: ReactifySearchProviderProps;
|
|
6
6
|
config: Config;
|
|
@@ -201,16 +201,235 @@ export declare const getPropsSensorCustom: (options: GeneratePropsSensorOptions)
|
|
|
201
201
|
export declare const getPropsSensorCollection: (options: GeneratePropsSensorOptions) => {
|
|
202
202
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
203
203
|
componentId: string;
|
|
204
|
-
customQuery: () =>
|
|
204
|
+
customQuery: () => {
|
|
205
|
+
query: {
|
|
206
|
+
bool: {
|
|
207
|
+
should: ({
|
|
208
|
+
nested: {
|
|
209
|
+
path: string;
|
|
210
|
+
query: {
|
|
211
|
+
term: {
|
|
212
|
+
"collections.handle.keyword": string;
|
|
213
|
+
"curations.collectionHandle.keyword"?: undefined;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
} | {
|
|
218
|
+
nested: {
|
|
219
|
+
path: string;
|
|
220
|
+
query: {
|
|
221
|
+
term: {
|
|
222
|
+
"curations.collectionHandle.keyword": string;
|
|
223
|
+
"collections.handle.keyword"?: undefined;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
})[];
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
} | null;
|
|
231
|
+
} | null;
|
|
232
|
+
export declare const getPropsSensorCollectionWeighted: ({ provider, config }: GeneratePropsSensorOptions) => {
|
|
233
|
+
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
234
|
+
componentId: string;
|
|
235
|
+
customQuery: () => {
|
|
236
|
+
query: {
|
|
237
|
+
function_score: {
|
|
238
|
+
query: {
|
|
239
|
+
bool: {
|
|
240
|
+
must: Record<string, any>[];
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
functions: ({
|
|
244
|
+
filter: {
|
|
245
|
+
wildcard: {
|
|
246
|
+
[x: string]: string;
|
|
247
|
+
};
|
|
248
|
+
bool?: undefined;
|
|
249
|
+
term?: undefined;
|
|
250
|
+
range?: undefined;
|
|
251
|
+
};
|
|
252
|
+
weight: number;
|
|
253
|
+
} | {
|
|
254
|
+
filter: {
|
|
255
|
+
bool: {
|
|
256
|
+
must_not: {
|
|
257
|
+
wildcard: {
|
|
258
|
+
[x: string]: string;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
wildcard?: undefined;
|
|
263
|
+
term?: undefined;
|
|
264
|
+
range?: undefined;
|
|
265
|
+
};
|
|
266
|
+
weight: number;
|
|
267
|
+
} | {
|
|
268
|
+
filter: {
|
|
269
|
+
term: {
|
|
270
|
+
[x: string]: string;
|
|
271
|
+
};
|
|
272
|
+
wildcard?: undefined;
|
|
273
|
+
bool?: undefined;
|
|
274
|
+
range?: undefined;
|
|
275
|
+
};
|
|
276
|
+
weight: number;
|
|
277
|
+
} | {
|
|
278
|
+
filter: {
|
|
279
|
+
range: {
|
|
280
|
+
[x: string]: {
|
|
281
|
+
gt: number;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
wildcard?: undefined;
|
|
285
|
+
bool?: undefined;
|
|
286
|
+
term?: undefined;
|
|
287
|
+
};
|
|
288
|
+
weight: number;
|
|
289
|
+
} | {
|
|
290
|
+
filter: {
|
|
291
|
+
range: {
|
|
292
|
+
[x: string]: {
|
|
293
|
+
lt: number;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
wildcard?: undefined;
|
|
297
|
+
bool?: undefined;
|
|
298
|
+
term?: undefined;
|
|
299
|
+
};
|
|
300
|
+
weight: number;
|
|
301
|
+
})[];
|
|
302
|
+
score_mode: string;
|
|
303
|
+
boost_mode: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
205
307
|
} | null;
|
|
206
|
-
export declare const
|
|
308
|
+
export declare const getPropsSensorSearchWeighted: ({ provider, config, searchTerm, }: GeneratePropsSensorOptions & {
|
|
207
309
|
searchTerm?: string;
|
|
208
310
|
}) => {
|
|
209
311
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
210
312
|
componentId: string;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
313
|
+
customQuery: () => {
|
|
314
|
+
query: {
|
|
315
|
+
function_score: {
|
|
316
|
+
query: {
|
|
317
|
+
bool: {
|
|
318
|
+
should: {
|
|
319
|
+
match: {
|
|
320
|
+
[x: string]: {
|
|
321
|
+
query: string;
|
|
322
|
+
fuzziness: number;
|
|
323
|
+
analyzer: string;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
}[];
|
|
327
|
+
terms?: {
|
|
328
|
+
markets: string[];
|
|
329
|
+
} | undefined;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
functions: ({
|
|
333
|
+
filter: {
|
|
334
|
+
wildcard: {
|
|
335
|
+
[x: string]: string;
|
|
336
|
+
};
|
|
337
|
+
bool?: undefined;
|
|
338
|
+
term?: undefined;
|
|
339
|
+
range?: undefined;
|
|
340
|
+
};
|
|
341
|
+
weight: number;
|
|
342
|
+
} | {
|
|
343
|
+
filter: {
|
|
344
|
+
bool: {
|
|
345
|
+
must_not: {
|
|
346
|
+
wildcard: {
|
|
347
|
+
[x: string]: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
wildcard?: undefined;
|
|
352
|
+
term?: undefined;
|
|
353
|
+
range?: undefined;
|
|
354
|
+
};
|
|
355
|
+
weight: number;
|
|
356
|
+
} | {
|
|
357
|
+
filter: {
|
|
358
|
+
term: {
|
|
359
|
+
[x: string]: string;
|
|
360
|
+
};
|
|
361
|
+
wildcard?: undefined;
|
|
362
|
+
bool?: undefined;
|
|
363
|
+
range?: undefined;
|
|
364
|
+
};
|
|
365
|
+
weight: number;
|
|
366
|
+
} | {
|
|
367
|
+
filter: {
|
|
368
|
+
range: {
|
|
369
|
+
[x: string]: {
|
|
370
|
+
gt: number;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
wildcard?: undefined;
|
|
374
|
+
bool?: undefined;
|
|
375
|
+
term?: undefined;
|
|
376
|
+
};
|
|
377
|
+
weight: number;
|
|
378
|
+
} | {
|
|
379
|
+
filter: {
|
|
380
|
+
range: {
|
|
381
|
+
[x: string]: {
|
|
382
|
+
lt: number;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
wildcard?: undefined;
|
|
386
|
+
bool?: undefined;
|
|
387
|
+
term?: undefined;
|
|
388
|
+
};
|
|
389
|
+
weight: number;
|
|
390
|
+
} | {
|
|
391
|
+
filter: {
|
|
392
|
+
match: {
|
|
393
|
+
[x: string]: {
|
|
394
|
+
query: string;
|
|
395
|
+
fuzziness: number;
|
|
396
|
+
analyzer: string;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
bool?: undefined;
|
|
400
|
+
};
|
|
401
|
+
weight: number;
|
|
402
|
+
} | {
|
|
403
|
+
filter: {
|
|
404
|
+
bool: {
|
|
405
|
+
must_not: {
|
|
406
|
+
match: {
|
|
407
|
+
[x: string]: {
|
|
408
|
+
query: string;
|
|
409
|
+
fuzziness: number;
|
|
410
|
+
analyzer: string;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
must: {
|
|
415
|
+
match: {
|
|
416
|
+
[x: string]: {
|
|
417
|
+
query: string;
|
|
418
|
+
fuzziness: number;
|
|
419
|
+
analyzer: string;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
match?: undefined;
|
|
425
|
+
};
|
|
426
|
+
weight: number;
|
|
427
|
+
})[];
|
|
428
|
+
score_mode: string;
|
|
429
|
+
boost_mode: string;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
};
|
|
214
433
|
} | null;
|
|
215
434
|
export declare const getPropsSensorPublished: (options: GeneratePropsSensorOptions) => {
|
|
216
435
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|