@usereactify/search 5.0.0-beta.0 → 5.0.0-beta.11
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 +67 -0
- package/dist/package.json +8 -3
- package/dist/src/components/{example → Example}/ExampleFilterList.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilterList.js +21 -0
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterRange.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterRange.js +5 -4
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterSlider.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterSlider.js +4 -3
- package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleFilterStack.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleFilterStack.js +1 -0
- package/dist/src/components/Example/ExampleFilterStack.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultCardCallout.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultCardCallout.js +5 -4
- package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultCardProduct.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultCardProduct.js +19 -0
- package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationLoadMore.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultPaginationLoadMore.js +2 -1
- package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationNextPrev.d.ts +1 -1
- package/dist/src/components/{example → Example}/ExampleResultPaginationNextPrev.js +4 -3
- package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleResultPaginationNumbered.d.ts +1 -1
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js +27 -0
- package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/{example → Example}/ExampleSortby.d.ts +1 -1
- package/dist/src/components/Example/ExampleSortby.js +13 -0
- package/dist/src/components/Example/ExampleSortby.js.map +1 -0
- package/dist/src/components/{example → Example}/index.d.ts +0 -0
- package/dist/src/components/{example → Example}/index.js +1 -0
- package/dist/src/components/Example/index.js.map +1 -0
- package/dist/src/components/{filter → Filter}/Filter.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/Filter.js +8 -19
- package/dist/src/components/Filter/Filter.js.map +1 -0
- package/dist/src/components/{filter → Filter}/FilterStack.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/FilterStack.js +1 -0
- package/dist/src/components/Filter/FilterStack.js.map +1 -0
- package/dist/src/components/{filter → Filter}/index.d.ts +0 -0
- package/dist/src/components/{filter → Filter}/index.js +1 -0
- package/dist/src/components/Filter/index.js.map +1 -0
- package/dist/src/components/{context → ReactifySearchBase}/ReactifySearchBase.d.ts +0 -0
- package/dist/src/components/{context → ReactifySearchBase}/ReactifySearchBase.js +28 -37
- package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +1 -0
- package/dist/src/components/{context → ReactifySearchBase}/index.d.ts +0 -0
- package/dist/src/components/{context → ReactifySearchBase}/index.js +1 -0
- package/dist/src/components/ReactifySearchBase/index.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultCardCallout.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultCardCallout.js +4 -5
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultCardProduct.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultCardProduct.js +5 -18
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationLoadMore.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationLoadMore.js +1 -0
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationNextPrev.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationNextPrev.js +1 -0
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultPaginationNumbered.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultPaginationNumbered.js +1 -0
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultStack.d.ts +0 -0
- package/dist/src/components/{result → Result}/ResultStack.js +9 -8
- package/dist/src/components/Result/ResultStack.js.map +1 -0
- package/dist/src/components/{result → Result}/ResultStateProvider.d.ts +1 -1
- package/dist/src/components/{result → Result}/ResultStateProvider.js +5 -1
- package/dist/src/components/Result/ResultStateProvider.js.map +1 -0
- package/dist/src/components/{result → Result}/index.d.ts +0 -0
- package/dist/src/components/{result → Result}/index.js +1 -0
- package/dist/src/components/Result/index.js.map +1 -0
- package/dist/src/components/{search → Search}/SearchInput.d.ts +0 -0
- package/dist/src/components/{search → Search}/SearchInput.js +1 -0
- package/dist/src/components/Search/SearchInput.js.map +1 -0
- package/dist/src/components/{search → Search}/index.d.ts +0 -0
- package/dist/src/components/{search → Search}/index.js +1 -0
- package/dist/src/components/Search/index.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorCollection.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorCollection.js +1 -0
- package/dist/src/components/Sensor/SensorCollection.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorInventoryAvailable.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorInventoryAvailable.js +2 -1
- package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorPublished.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorPublished.js +1 -0
- package/dist/src/components/Sensor/SensorPublished.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSearch.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSearch.js +1 -0
- package/dist/src/components/Sensor/SensorSearch.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSort.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSort.js +2 -19
- package/dist/src/components/Sensor/SensorSort.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorSortScore.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorSortScore.js +1 -0
- package/dist/src/components/Sensor/SensorSortScore.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/SensorStack.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/SensorStack.js +1 -0
- package/dist/src/components/Sensor/SensorStack.js.map +1 -0
- package/dist/src/components/{sensor → Sensor}/index.d.ts +0 -0
- package/dist/src/components/{sensor → Sensor}/index.js +1 -0
- package/dist/src/components/Sensor/index.js.map +1 -0
- package/dist/src/components/{sortby → Sortby}/Sortby.d.ts +0 -0
- package/dist/src/components/{sortby → Sortby}/Sortby.js +1 -0
- package/dist/src/components/Sortby/Sortby.js.map +1 -0
- package/dist/src/components/{sortby → Sortby}/index.d.ts +0 -0
- package/dist/src/components/{sortby → Sortby}/index.js +1 -0
- package/dist/src/components/Sortby/index.js.map +1 -0
- package/dist/src/components/{utility → Utility}/UtilityAuthenticatedReactiveBase.d.ts +0 -0
- package/dist/src/components/{utility → Utility}/UtilityAuthenticatedReactiveBase.js +4 -3
- package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -0
- package/dist/src/components/{utility → Utility}/index.d.ts +0 -0
- package/dist/src/components/{utility → Utility}/index.js +1 -0
- package/dist/src/components/Utility/index.js.map +1 -0
- package/dist/src/components/index.d.ts +8 -8
- package/dist/src/components/index.js +9 -8
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/index.d.ts +3 -3
- package/dist/src/hooks/reactivesearch/index.js +4 -3
- package/dist/src/hooks/reactivesearch/index.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +3 -2
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +3 -1
- package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -0
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.d.ts +5 -0
- package/dist/src/hooks/reactivesearch/{useReactiveResultStackProps.js → useReactiveReactiveListProps.js} +7 -5
- package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -0
- package/dist/src/hooks/useAnalytics.js +3 -0
- package/dist/src/hooks/useAnalytics.js.map +1 -0
- package/dist/src/hooks/useConfig.js +10 -8
- package/dist/src/hooks/useConfig.js.map +1 -0
- package/dist/src/hooks/useCuration.js +17 -3
- package/dist/src/hooks/useCuration.js.map +1 -0
- package/dist/src/hooks/useDebugger.d.ts +1 -0
- package/dist/src/hooks/useDebugger.js +15 -0
- package/dist/src/hooks/useDebugger.js.map +1 -0
- package/dist/src/hooks/useFilterCollapsedState.js +1 -0
- package/dist/src/hooks/useFilterCollapsedState.js.map +1 -0
- package/dist/src/hooks/useFilterListProps.js +37 -9
- package/dist/src/hooks/useFilterListProps.js.map +1 -0
- package/dist/src/hooks/useFilterStack.d.ts +3 -1
- package/dist/src/hooks/useFilterStack.js +7 -1
- package/dist/src/hooks/useFilterStack.js.map +1 -0
- package/dist/src/hooks/useFilters.js +8 -3
- package/dist/src/hooks/useFilters.js.map +1 -0
- package/dist/src/hooks/usePagination.d.ts +2 -2
- package/dist/src/hooks/usePagination.js +29 -17
- package/dist/src/hooks/usePagination.js.map +1 -0
- package/dist/src/hooks/usePaginationLoadMore.d.ts +3 -2
- package/dist/src/hooks/usePaginationLoadMore.js +15 -12
- package/dist/src/hooks/usePaginationLoadMore.js.map +1 -0
- package/dist/src/hooks/useProductPrice.js +1 -0
- package/dist/src/hooks/useProductPrice.js.map +1 -0
- package/dist/src/hooks/useReactifySearchContext.js +1 -0
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -0
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.js +20 -6
- package/dist/src/hooks/useSearch.js.map +1 -0
- package/dist/src/hooks/useSortby.js +22 -5
- package/dist/src/hooks/useSortby.js.map +1 -0
- package/dist/src/index.js +46 -3
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/config.js +1 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/elastic.js +1 -0
- package/dist/src/types/elastic.js.map +1 -0
- package/dist/src/types/firestore.js +1 -0
- package/dist/src/types/firestore.js.map +1 -0
- package/dist/src/types/graphql.js +1 -0
- package/dist/src/types/graphql.js.map +1 -0
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/reactivesearch.js +1 -0
- package/dist/src/types/reactivesearch.js.map +1 -0
- package/dist/src/types/shopify.js +1 -0
- package/dist/src/types/shopify.js.map +1 -0
- package/dist/src/utility/debug.d.ts +10 -0
- package/dist/src/utility/debug.js +39 -0
- package/dist/src/utility/debug.js.map +1 -0
- package/dist/src/utility/index.d.ts +1 -0
- package/dist/src/utility/index.js +14 -0
- package/dist/src/utility/index.js.map +1 -0
- package/package.json +8 -3
- package/dist/src/components/example/ExampleFilterList.js +0 -19
- package/dist/src/components/example/ExampleResultCardProduct.js +0 -18
- package/dist/src/components/example/ExampleResultPaginationNumbered.js +0 -26
- package/dist/src/components/example/ExampleSortby.js +0 -12
- package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.d.ts +0 -17
package/dist/src/types/index.js
CHANGED
|
@@ -0,0 +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\";"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactivesearch.js","sourceRoot":"","sources":["../../../src/types/reactivesearch.ts"],"names":[],"mappings":"","sourcesContent":["import { ElasticDocument, ElasticHit } from \"./elastic\";\n\n// props passed to SingleList/MultiList.render\nexport interface ReactivesearchFilterProps {\n loading: boolean;\n error: Error | null;\n handleChange: (value: string) => void;\n data: { doc_count: number; key: string }[];\n value: string | { [key: string]: boolean };\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: (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\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopify.js","sourceRoot":"","sources":["../../../src/types/shopify.ts"],"names":[],"mappings":";;;AAoCA,SAAgB,SAAS,CACvB,UAA6B;IAE7B,OAAO,SAAS,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7C,CAAC;AAJD,8BAIC;AAED,SAAgB,gBAAgB,CAC9B,UAA6B;IAE7B,OAAO,gBAAgB,KAAK,UAAU,CAAC,UAAU,CAAC;AACpD,CAAC;AAJD,4CAIC;AAED,SAAgB,kBAAkB,CAChC,UAA6B;IAE7B,OAAO,yBAAyB,KAAK,UAAU,CAAC,UAAU,CAAC;AAC7D,CAAC;AAJD,gDAIC;AAED,SAAgB,OAAO,CACrB,UAA6B;IAE7B,OAAO,OAAO,KAAK,UAAU,CAAC,UAAU,CAAC;AAC3C,CAAC;AAJD,0BAIC;AAED,SAAgB,OAAO,CACrB,UAA6B;IAE7B,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CACjE,UAAU,CAAC,UAAU,CACtB,CAAC;AACJ,CAAC;AAND,0BAMC;AAED,SAAgB,WAAW,CACzB,UAA6B;IAE7B,OAAO,WAAW,KAAK,UAAU,CAAC,UAAU,CAAC;AAC/C,CAAC;AAJD,kCAIC","sourcesContent":["import { ProductQuery, BulkQueryProductsQuery } from \"./graphql\";\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 =\n BulkQueryProductsQuery[\"products\"][\"edges\"][0][\"node\"];\nexport type BulkShopifyVariant =\n 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<\n BulkShopifyProduct,\n \"variants\" | \"images\" | \"media\" | \"metafields\"\n>;\nexport type ShopifyExportProductVariant = Omit<\n BulkShopifyVariant,\n \"presentmentPrices\"\n>;\nexport type ShopifyExportPresentmentPrice =\n BulkShopifyVariant[\"presentmentPrices\"][\"edges\"][0][\"node\"];\nexport type ShopifyExportImage =\n BulkShopifyProduct[\"images\"][\"edges\"][0][\"node\"];\nexport type ShopifyExportMedia =\n BulkShopifyProduct[\"media\"][\"edges\"][0][\"node\"];\nexport type ShopifyExportMetafield =\n BulkShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"];\n\nexport interface ShopifyExportLine {\n __parentId?: string;\n __typename: string;\n}\n\nexport function isProduct(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportProduct {\n return \"Product\" === exportLine.__typename;\n}\n\nexport function isProductVariant(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportProductVariant {\n return \"ProductVariant\" === exportLine.__typename;\n}\n\nexport function isPresentmentPrice(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportPresentmentPrice {\n return \"ProductVariantPricePair\" === exportLine.__typename;\n}\n\nexport function isImage(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportImage {\n return \"Image\" === exportLine.__typename;\n}\n\nexport function isMedia(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportMedia {\n return [\"Video\", \"Model3d\", \"MediaImage\", \"ExternalVideo\"].includes(\n exportLine.__typename\n );\n}\n\nexport function isMetafield(\n exportLine: ShopifyExportLine\n): exportLine is ShopifyExportMetafield {\n return \"Metafield\" === exportLine.__typename;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/react";
|
|
2
|
+
export declare const debug: {
|
|
3
|
+
namespace: string;
|
|
4
|
+
log: (namespace: string, formatter?: string | undefined, ...args: Array<any>) => void;
|
|
5
|
+
breadcrumb: (breadcrumb: Partial<Sentry.Breadcrumb> & {
|
|
6
|
+
message: string;
|
|
7
|
+
category: "search" | "sort" | "pagination" | "filter" | "curation";
|
|
8
|
+
}) => void;
|
|
9
|
+
hook: (namespace: string, message: string, value: unknown) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.debug = void 0;
|
|
26
|
+
const debug_1 = __importDefault(require("debug"));
|
|
27
|
+
const Sentry = __importStar(require("@sentry/react"));
|
|
28
|
+
const hooks_1 = require("../hooks");
|
|
29
|
+
exports.debug = {
|
|
30
|
+
namespace: "reactify-search",
|
|
31
|
+
log: (namespace, formatter, ...args) => {
|
|
32
|
+
(0, debug_1.default)(`${exports.debug.namespace}:${namespace}`)(formatter, ...args);
|
|
33
|
+
},
|
|
34
|
+
breadcrumb: (breadcrumb) => {
|
|
35
|
+
Sentry.addBreadcrumb(Object.assign(Object.assign({ level: "debug", type: "query" }, breadcrumb), { category: `${exports.debug.namespace}:${breadcrumb.category}` }));
|
|
36
|
+
},
|
|
37
|
+
hook: hooks_1.useDebugger,
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utility/debug.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,sDAAwC;AAExC,oCAAuC;AAE1B,QAAA,KAAK,GAAG;IACnB,SAAS,EAAE,iBAAiB;IAC5B,GAAG,EAAE,CAAC,SAAiB,EAAE,SAAkB,EAAE,GAAG,IAAgB,EAAE,EAAE;QAClE,IAAA,eAAK,EAAC,GAAG,aAAK,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC/D,CAAC;IACD,UAAU,EAAE,CACV,UAGC,EACD,EAAE;QACF,MAAM,CAAC,aAAa,+BAClB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,IACV,UAAU,KACb,QAAQ,EAAE,GAAG,aAAK,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,EAAE,IACrD,CAAC;IACL,CAAC;IACD,IAAI,EAAE,mBAAW;CAClB,CAAC","sourcesContent":["import Debug from \"debug\";\nimport * as Sentry from \"@sentry/react\";\n\nimport { useDebugger } from \"../hooks\";\n\nexport const debug = {\n namespace: \"reactify-search\",\n log: (namespace: string, formatter?: string, ...args: Array<any>) => {\n Debug(`${debug.namespace}:${namespace}`)(formatter, ...args);\n },\n breadcrumb: (\n breadcrumb: Partial<Sentry.Breadcrumb> & {\n message: string;\n category: \"search\" | \"sort\" | \"pagination\" | \"filter\" | \"curation\";\n }\n ) => {\n Sentry.addBreadcrumb({\n level: \"debug\",\n type: \"query\",\n ...breadcrumb,\n category: `${debug.namespace}:${breadcrumb.category}`,\n });\n },\n hook: useDebugger,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./debug";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./debug"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB","sourcesContent":["export * from \"./debug\";"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usereactify/search",
|
|
3
3
|
"description": "React UI library for Reactify Search",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.11",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
"watch": "tsc --watch",
|
|
15
15
|
"release": "standard-version --prerelease rc",
|
|
16
16
|
"release:beta": "standard-version --prerelease beta",
|
|
17
|
-
"
|
|
17
|
+
"prebuild": "rimraf dist",
|
|
18
|
+
"build": "tsc",
|
|
18
19
|
"prettier": "prettier --write .",
|
|
19
|
-
"storybook": "start-storybook -p 6006"
|
|
20
|
+
"storybook": "start-storybook -p 6006",
|
|
21
|
+
"sentry:release:new": "sentry-cli releases new $npm_package_version",
|
|
22
|
+
"sentry:release:upload": "sentry-cli releases files $npm_package_version upload-sourcemaps dist",
|
|
23
|
+
"sentry:release:finalize": "sentry-cli releases finalize $npm_package_version"
|
|
20
24
|
},
|
|
21
25
|
"husky": {
|
|
22
26
|
"hooks": {
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
"@appbaseio/reactivesearch": "^3.14.0",
|
|
47
51
|
"@commitlint/cli": "13.2.0",
|
|
48
52
|
"@commitlint/config-conventional": "13.2.0",
|
|
53
|
+
"@sentry/cli": "2.5.0",
|
|
49
54
|
"@storybook/addon-actions": "6.3.10",
|
|
50
55
|
"@storybook/addon-essentials": "6.3.10",
|
|
51
56
|
"@storybook/addon-links": "6.3.10",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleFilterList = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const ExampleFilterList = (props) => {
|
|
9
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10
|
-
react_1.default.createElement("h1", null, props.filter.name),
|
|
11
|
-
react_1.default.createElement("ul", null, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key },
|
|
12
|
-
react_1.default.createElement("label", null,
|
|
13
|
-
react_1.default.createElement("input", { value: option.key, type: "checkbox", checked: option.checked, onChange: ({ target: { value } }) => props.filterListProps.handleChange(value) }),
|
|
14
|
-
option.key,
|
|
15
|
-
" (",
|
|
16
|
-
option.doc_count,
|
|
17
|
-
")")))))));
|
|
18
|
-
};
|
|
19
|
-
exports.ExampleFilterList = ExampleFilterList;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleResultCardProduct = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const ExampleResultCardProduct = (props) => {
|
|
9
|
-
return (react_1.default.createElement("article", { ref: props.itemRef },
|
|
10
|
-
react_1.default.createElement("a", { onClick: props.handleClick, href: `/products/${props.product.handle}` },
|
|
11
|
-
props.product.image && (react_1.default.createElement("img", { src: props.product.image, width: "100%" })),
|
|
12
|
-
props.product.title),
|
|
13
|
-
react_1.default.createElement("span", null, props.formattedPrice),
|
|
14
|
-
props.onSale && (react_1.default.createElement("span", { style: {
|
|
15
|
-
textDecoration: "line-through"
|
|
16
|
-
} }, props.formattedCompareAtPrice))));
|
|
17
|
-
};
|
|
18
|
-
exports.ExampleResultCardProduct = ExampleResultCardProduct;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleResultPaginationNumbered = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const ExampleResultPaginationNumbered = (props) => {
|
|
9
|
-
return (react_1.default.createElement("nav", null,
|
|
10
|
-
props.currentPage > 0 && (react_1.default.createElement("a", { rel: "prev", href: props.buildPagePath(props.currentPage), onClick: (event) => props.handlePageChange(props.currentPage - 1, event) }, "Prev")),
|
|
11
|
-
!props.pagesToShow.includes(0) && (react_1.default.createElement("a", { href: props.buildPagePath(1), onClick: (event) => props.handlePageChange(0, event), rel: 0 === props.currentPage - 1 ? `prev` : undefined }, "1")),
|
|
12
|
-
!props.pagesToShow.includes(1) && react_1.default.createElement("span", null, "..."),
|
|
13
|
-
props.pagesToShow.map((page) => page === props.currentPage ? (react_1.default.createElement("span", { key: page + 1 }, page + 1)) : (react_1.default.createElement("a", { key: page + 1, href: props.buildPagePath(page + 1), onClick: (event) => props.handlePageChange(page, event), rel: page === props.currentPage + 1
|
|
14
|
-
? `next`
|
|
15
|
-
: page === props.currentPage - 1
|
|
16
|
-
? `prev`
|
|
17
|
-
: undefined }, page + 1))),
|
|
18
|
-
!props.pagesToShow.includes(props.totalPages - 2) && react_1.default.createElement("span", null, "..."),
|
|
19
|
-
!props.pagesToShow.includes(props.totalPages - 1) && (react_1.default.createElement("a", { href: props.buildPagePath(props.totalPages), onClick: (event) => props.handlePageChange(props.totalPages - 1, event), rel: props.totalPages - 1 === props.currentPage + 1
|
|
20
|
-
? `next`
|
|
21
|
-
: props.totalPages - 1 === props.currentPage - 1
|
|
22
|
-
? `prev`
|
|
23
|
-
: undefined }, props.totalPages)),
|
|
24
|
-
props.currentPage + 1 < props.totalPages && (react_1.default.createElement("a", { rel: "next", href: props.buildPagePath(props.currentPage + 2), onClick: (event) => props.handlePageChange(props.currentPage + 1, event) }, "Next"))));
|
|
25
|
-
};
|
|
26
|
-
exports.ExampleResultPaginationNumbered = ExampleResultPaginationNumbered;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExampleSortby = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const ExampleSortby = (props) => {
|
|
9
|
-
var _a;
|
|
10
|
-
return (react_1.default.createElement("select", { value: (_a = props.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: (event) => props.setSortOption(event.target.value) }, props.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, value: sortOption.handle }, sortOption.name)))));
|
|
11
|
-
};
|
|
12
|
-
exports.ExampleSortby = ExampleSortby;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const useReactiveResultStackProps: (options: {
|
|
2
|
-
pageSize?: number;
|
|
3
|
-
}) => {
|
|
4
|
-
size: number;
|
|
5
|
-
URLParams: boolean;
|
|
6
|
-
showLoader: boolean;
|
|
7
|
-
dataField: string;
|
|
8
|
-
showResultStats: boolean;
|
|
9
|
-
react: {
|
|
10
|
-
and: string[];
|
|
11
|
-
};
|
|
12
|
-
componentId: string;
|
|
13
|
-
scrollOnChange: boolean;
|
|
14
|
-
pagination: boolean;
|
|
15
|
-
infiniteScroll: boolean;
|
|
16
|
-
renderNoResults: () => null;
|
|
17
|
-
};
|