@usereactify/search 5.0.0-beta.1 → 5.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/package.json +70 -0
  3. package/dist/src/components/Example/ExampleFilterList.d.ts +4 -0
  4. package/dist/src/components/Example/ExampleFilterList.js +21 -0
  5. package/dist/src/components/Example/ExampleFilterList.js.map +1 -0
  6. package/dist/src/components/Example/ExampleFilterRange.d.ts +4 -0
  7. package/dist/src/components/Example/ExampleFilterRange.js +22 -0
  8. package/dist/src/components/Example/ExampleFilterRange.js.map +1 -0
  9. package/dist/src/components/Example/ExampleFilterSlider.d.ts +4 -0
  10. package/dist/src/components/Example/ExampleFilterSlider.js +21 -0
  11. package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -0
  12. package/dist/src/components/Example/ExampleFilterStack.d.ts +4 -0
  13. package/dist/src/components/Example/ExampleFilterStack.js +14 -0
  14. package/dist/src/components/Example/ExampleFilterStack.js.map +1 -0
  15. package/dist/src/components/Example/ExampleResultCardCallout.d.ts +4 -0
  16. package/dist/src/components/Example/ExampleResultCardCallout.js +22 -0
  17. package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -0
  18. package/dist/src/components/Example/ExampleResultCardProduct.d.ts +4 -0
  19. package/dist/src/components/Example/ExampleResultCardProduct.js +19 -0
  20. package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -0
  21. package/dist/src/components/Example/ExampleResultPaginationLoadMore.d.ts +4 -0
  22. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js +12 -0
  23. package/dist/src/components/Example/ExampleResultPaginationLoadMore.js.map +1 -0
  24. package/dist/src/components/Example/ExampleResultPaginationNextPrev.d.ts +4 -0
  25. package/dist/src/components/Example/ExampleResultPaginationNextPrev.js +14 -0
  26. package/dist/src/components/Example/ExampleResultPaginationNextPrev.js.map +1 -0
  27. package/dist/src/components/Example/ExampleResultPaginationNumbered.d.ts +4 -0
  28. package/dist/src/components/Example/ExampleResultPaginationNumbered.js +27 -0
  29. package/dist/src/components/Example/ExampleResultPaginationNumbered.js.map +1 -0
  30. package/dist/src/components/Example/ExampleSortby.d.ts +4 -0
  31. package/dist/src/components/Example/ExampleSortby.js +13 -0
  32. package/dist/src/components/Example/ExampleSortby.js.map +1 -0
  33. package/dist/src/components/Example/index.d.ts +10 -0
  34. package/dist/src/components/Example/index.js +23 -0
  35. package/dist/src/components/Example/index.js.map +1 -0
  36. package/dist/src/components/Filter/Filter.d.ts +20 -0
  37. package/dist/src/components/Filter/Filter.js +78 -0
  38. package/dist/src/components/Filter/Filter.js.map +1 -0
  39. package/dist/src/components/Filter/FilterStack.d.ts +7 -0
  40. package/dist/src/components/Filter/FilterStack.js +17 -0
  41. package/dist/src/components/Filter/FilterStack.js.map +1 -0
  42. package/dist/src/components/Filter/index.d.ts +2 -0
  43. package/dist/src/components/Filter/index.js +15 -0
  44. package/dist/src/components/Filter/index.js.map +1 -0
  45. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.d.ts +42 -0
  46. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js +131 -0
  47. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +1 -0
  48. package/dist/src/components/ReactifySearchBase/index.d.ts +1 -0
  49. package/dist/src/components/ReactifySearchBase/index.js +14 -0
  50. package/dist/src/components/ReactifySearchBase/index.js.map +1 -0
  51. package/dist/src/components/Result/ResultCardCallout.d.ts +12 -0
  52. package/dist/src/components/Result/ResultCardCallout.js +45 -0
  53. package/dist/src/components/Result/ResultCardCallout.js.map +1 -0
  54. package/dist/src/components/Result/ResultCardProduct.d.ts +13 -0
  55. package/dist/src/components/Result/ResultCardProduct.js +50 -0
  56. package/dist/src/components/Result/ResultCardProduct.js.map +1 -0
  57. package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +7 -0
  58. package/dist/src/components/Result/ResultPaginationLoadMore.js +17 -0
  59. package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -0
  60. package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +7 -0
  61. package/dist/src/components/Result/ResultPaginationNextPrev.js +17 -0
  62. package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -0
  63. package/dist/src/components/Result/ResultPaginationNumbered.d.ts +7 -0
  64. package/dist/src/components/Result/ResultPaginationNumbered.js +20 -0
  65. package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -0
  66. package/dist/src/components/Result/ResultStack.d.ts +40 -0
  67. package/dist/src/components/Result/ResultStack.js +108 -0
  68. package/dist/src/components/Result/ResultStack.js.map +1 -0
  69. package/dist/src/components/Result/ResultStateProvider.d.ts +6 -0
  70. package/dist/src/components/Result/ResultStateProvider.js +14 -0
  71. package/dist/src/components/Result/ResultStateProvider.js.map +1 -0
  72. package/dist/src/components/Result/index.d.ts +7 -0
  73. package/dist/src/components/Result/index.js +20 -0
  74. package/dist/src/components/Result/index.js.map +1 -0
  75. package/dist/src/components/Search/SearchInput.d.ts +8 -0
  76. package/dist/src/components/Search/SearchInput.js +18 -0
  77. package/dist/src/components/Search/SearchInput.js.map +1 -0
  78. package/dist/src/components/Search/index.d.ts +1 -0
  79. package/dist/src/components/Search/index.js +14 -0
  80. package/dist/src/components/Search/index.js.map +1 -0
  81. package/dist/src/components/Sensor/SensorCollection.d.ts +2 -0
  82. package/dist/src/components/Sensor/SensorCollection.js +45 -0
  83. package/dist/src/components/Sensor/SensorCollection.js.map +1 -0
  84. package/dist/src/components/Sensor/SensorInventoryAvailable.d.ts +2 -0
  85. package/dist/src/components/Sensor/SensorInventoryAvailable.js +53 -0
  86. package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -0
  87. package/dist/src/components/Sensor/SensorPublished.d.ts +2 -0
  88. package/dist/src/components/Sensor/SensorPublished.js +17 -0
  89. package/dist/src/components/Sensor/SensorPublished.js.map +1 -0
  90. package/dist/src/components/Sensor/SensorSearch.d.ts +2 -0
  91. package/dist/src/components/Sensor/SensorSearch.js +83 -0
  92. package/dist/src/components/Sensor/SensorSearch.js.map +1 -0
  93. package/dist/src/components/Sensor/SensorSort.d.ts +2 -0
  94. package/dist/src/components/Sensor/SensorSort.js +187 -0
  95. package/dist/src/components/Sensor/SensorSort.js.map +1 -0
  96. package/dist/src/components/Sensor/SensorSortScore.d.ts +2 -0
  97. package/dist/src/components/Sensor/SensorSortScore.js +13 -0
  98. package/dist/src/components/Sensor/SensorSortScore.js.map +1 -0
  99. package/dist/src/components/Sensor/SensorStack.d.ts +3 -0
  100. package/dist/src/components/Sensor/SensorStack.js +32 -0
  101. package/dist/src/components/Sensor/SensorStack.js.map +1 -0
  102. package/dist/src/components/Sensor/index.d.ts +8 -0
  103. package/dist/src/components/Sensor/index.js +30 -0
  104. package/dist/src/components/Sensor/index.js.map +1 -0
  105. package/dist/src/components/Sortby/Sortby.d.ts +7 -0
  106. package/dist/src/components/Sortby/Sortby.js +17 -0
  107. package/dist/src/components/Sortby/Sortby.js.map +1 -0
  108. package/dist/src/components/Sortby/index.d.ts +1 -0
  109. package/dist/src/components/Sortby/index.js +14 -0
  110. package/dist/src/components/Sortby/index.js.map +1 -0
  111. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.d.ts +2 -0
  112. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js +15 -0
  113. package/dist/src/components/Utility/UtilityAuthenticatedReactiveBase.js.map +1 -0
  114. package/dist/src/components/Utility/index.d.ts +1 -0
  115. package/dist/src/components/Utility/index.js +14 -0
  116. package/dist/src/components/Utility/index.js.map +1 -0
  117. package/dist/src/components/index.d.ts +8 -0
  118. package/dist/src/components/index.js +21 -0
  119. package/dist/src/components/index.js.map +1 -0
  120. package/dist/src/hooks/index.d.ts +15 -0
  121. package/dist/src/hooks/index.js +28 -0
  122. package/dist/src/hooks/index.js.map +1 -0
  123. package/dist/src/hooks/reactivesearch/index.d.ts +8 -0
  124. package/dist/src/hooks/reactivesearch/index.js +21 -0
  125. package/dist/src/hooks/reactivesearch/index.js.map +1 -0
  126. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.d.ts +7 -0
  127. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +45 -0
  128. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -0
  129. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +26 -0
  130. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +71 -0
  131. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -0
  132. package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.d.ts +73 -0
  133. package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +23 -0
  134. package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -0
  135. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.d.ts +70 -0
  136. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +23 -0
  137. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -0
  138. package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.d.ts +67 -0
  139. package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +107 -0
  140. package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -0
  141. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.d.ts +68 -0
  142. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +23 -0
  143. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -0
  144. package/dist/src/hooks/reactivesearch/useReactiveReactProp.d.ts +3 -0
  145. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +26 -0
  146. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -0
  147. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.d.ts +5 -0
  148. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js +33 -0
  149. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -0
  150. package/dist/src/hooks/useAnalytics.d.ts +95 -0
  151. package/dist/src/hooks/useAnalytics.js +113 -0
  152. package/dist/src/hooks/useAnalytics.js.map +1 -0
  153. package/dist/src/hooks/useConfig.d.ts +4 -0
  154. package/dist/src/hooks/useConfig.js +83 -0
  155. package/dist/src/hooks/useConfig.js.map +1 -0
  156. package/dist/src/hooks/useCuration.d.ts +2 -0
  157. package/dist/src/hooks/useCuration.js +66 -0
  158. package/dist/src/hooks/useCuration.js.map +1 -0
  159. package/dist/src/hooks/useDebugger.d.ts +1 -0
  160. package/dist/src/hooks/useDebugger.js +15 -0
  161. package/dist/src/hooks/useDebugger.js.map +1 -0
  162. package/dist/src/hooks/useFilterCollapsedState.d.ts +8 -0
  163. package/dist/src/hooks/useFilterCollapsedState.js +28 -0
  164. package/dist/src/hooks/useFilterCollapsedState.js.map +1 -0
  165. package/dist/src/hooks/useFilterListProps.d.ts +12 -0
  166. package/dist/src/hooks/useFilterListProps.js +63 -0
  167. package/dist/src/hooks/useFilterListProps.js.map +1 -0
  168. package/dist/src/hooks/useFilterStack.d.ts +4 -0
  169. package/dist/src/hooks/useFilterStack.js +52 -0
  170. package/dist/src/hooks/useFilterStack.js.map +1 -0
  171. package/dist/src/hooks/useFilters.d.ts +4 -0
  172. package/dist/src/hooks/useFilters.js +27 -0
  173. package/dist/src/hooks/useFilters.js.map +1 -0
  174. package/dist/src/hooks/usePagination.d.ts +14 -0
  175. package/dist/src/hooks/usePagination.js +109 -0
  176. package/dist/src/hooks/usePagination.js.map +1 -0
  177. package/dist/src/hooks/usePaginationLoadMore.d.ts +15 -0
  178. package/dist/src/hooks/usePaginationLoadMore.js +38 -0
  179. package/dist/src/hooks/usePaginationLoadMore.js.map +1 -0
  180. package/dist/src/hooks/useProductPrice.d.ts +10 -0
  181. package/dist/src/hooks/useProductPrice.js +64 -0
  182. package/dist/src/hooks/useProductPrice.js.map +1 -0
  183. package/dist/src/hooks/useReactifySearchContext.d.ts +78 -0
  184. package/dist/src/hooks/useReactifySearchContext.js +11 -0
  185. package/dist/src/hooks/useReactifySearchContext.js.map +1 -0
  186. package/dist/src/hooks/useSearch.d.ts +8 -0
  187. package/dist/src/hooks/useSearch.js +50 -0
  188. package/dist/src/hooks/useSearch.js.map +1 -0
  189. package/dist/src/hooks/useSortby.d.ts +6 -0
  190. package/dist/src/hooks/useSortby.js +58 -0
  191. package/dist/src/hooks/useSortby.js.map +1 -0
  192. package/dist/src/index.d.ts +3 -0
  193. package/dist/src/index.js +61 -0
  194. package/dist/src/index.js.map +1 -0
  195. package/dist/src/types/config.d.ts +26 -0
  196. package/dist/src/types/config.js +3 -0
  197. package/dist/src/types/config.js.map +1 -0
  198. package/dist/src/types/elastic.d.ts +209 -0
  199. package/dist/src/types/elastic.js +19 -0
  200. package/dist/src/types/elastic.js.map +1 -0
  201. package/dist/src/types/firestore.d.ts +280 -0
  202. package/dist/src/types/firestore.js +19 -0
  203. package/dist/src/types/firestore.js.map +1 -0
  204. package/dist/src/types/graphql.d.ts +26545 -0
  205. package/dist/src/types/graphql.js +4688 -0
  206. package/dist/src/types/graphql.js.map +1 -0
  207. package/dist/src/types/index.d.ts +3 -0
  208. package/dist/src/types/index.js +16 -0
  209. package/dist/src/types/index.js.map +1 -0
  210. package/dist/src/types/reactivesearch.d.ts +73 -0
  211. package/dist/src/types/reactivesearch.js +3 -0
  212. package/dist/src/types/reactivesearch.js.map +1 -0
  213. package/dist/src/types/shopify.d.ts +21 -0
  214. package/dist/src/types/shopify.js +28 -0
  215. package/dist/src/types/shopify.js.map +1 -0
  216. package/dist/src/utility/debug.d.ts +12 -0
  217. package/dist/src/utility/debug.js +43 -0
  218. package/dist/src/utility/debug.js.map +1 -0
  219. package/dist/src/utility/index.d.ts +1 -0
  220. package/dist/src/utility/index.js +14 -0
  221. package/dist/src/utility/index.js.map +1 -0
  222. package/package.json +8 -3
@@ -0,0 +1,3 @@
1
+ export * from "./config";
2
+ export * from "./elastic";
3
+ export * from "./reactivesearch";
@@ -0,0 +1,16 @@
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("./config"), exports);
14
+ __exportStar(require("./elastic"), exports);
15
+ __exportStar(require("./reactivesearch"), exports);
16
+ //# sourceMappingURL=index.js.map
@@ -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,73 @@
1
+ import { ElasticDocument, ElasticHit } from "./elastic";
2
+ export interface ReactivesearchFilterProps {
3
+ loading: boolean;
4
+ error: Error | null;
5
+ handleChange: (value: string) => void;
6
+ data: {
7
+ doc_count: number;
8
+ key: string;
9
+ }[];
10
+ value: string | {
11
+ [key: string]: boolean;
12
+ };
13
+ }
14
+ export interface ReactivesearchPaginationProps {
15
+ pages: number;
16
+ showEndPage: false;
17
+ totalPages: number;
18
+ currentPage: number;
19
+ setPage: (page: number) => void;
20
+ }
21
+ export interface ReactivesearchResultProps {
22
+ error?: ReactivesearchError;
23
+ loading: boolean;
24
+ data: (Omit<ElasticHit, "_source"> & ElasticDocument)[];
25
+ loadMore: () => void;
26
+ customData: unknown;
27
+ promotedData: unknown;
28
+ aggregationData: unknown;
29
+ rawData?: {
30
+ _shards: {
31
+ failed: number;
32
+ skipped: number;
33
+ successful: number;
34
+ total: number;
35
+ };
36
+ took: number;
37
+ status: number;
38
+ timed_out: boolean;
39
+ hits: ElasticHit[];
40
+ };
41
+ resultStats: {
42
+ time: number;
43
+ hidden: number;
44
+ promoted: number;
45
+ currentPage: number;
46
+ numberOfPages: number;
47
+ numberOfResults?: number;
48
+ displayedResults: number;
49
+ };
50
+ streamData: unknown;
51
+ triggerAnalytics: unknown;
52
+ triggerClickAnalytics: unknown;
53
+ }
54
+ export interface ReactivesearchSearchStatePage {
55
+ isLoading: boolean;
56
+ hits: {
57
+ hidden: number;
58
+ time: number;
59
+ total: number;
60
+ hits: ElasticHit[];
61
+ };
62
+ resultStats: {
63
+ hidden: number;
64
+ numberOfResults?: number;
65
+ promoted: number;
66
+ time: number;
67
+ };
68
+ error?: ReactivesearchError;
69
+ }
70
+ export interface ReactivesearchError {
71
+ status: number;
72
+ statusText: string;
73
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=reactivesearch.js.map
@@ -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,21 @@
1
+ import { ProductQuery, BulkQueryProductsQuery } from "./graphql";
2
+ export declare type ShopifyProduct = NonNullable<ProductQuery["product"]>;
3
+ export declare type ShopifyVariant = ShopifyProduct["variants"]["edges"][0]["node"];
4
+ export declare type BulkShopifyProduct = BulkQueryProductsQuery["products"]["edges"][0]["node"];
5
+ export declare type BulkShopifyVariant = BulkShopifyProduct["variants"]["edges"][0]["node"];
6
+ export declare type ShopifyExportProduct = Omit<BulkShopifyProduct, "variants" | "images" | "media" | "metafields">;
7
+ export declare type ShopifyExportProductVariant = Omit<BulkShopifyVariant, "presentmentPrices">;
8
+ export declare type ShopifyExportPresentmentPrice = BulkShopifyVariant["presentmentPrices"]["edges"][0]["node"];
9
+ export declare type ShopifyExportImage = BulkShopifyProduct["images"]["edges"][0]["node"];
10
+ export declare type ShopifyExportMedia = BulkShopifyProduct["media"]["edges"][0]["node"];
11
+ export declare type ShopifyExportMetafield = BulkShopifyProduct["metafields"]["edges"][0]["node"];
12
+ export interface ShopifyExportLine {
13
+ __parentId?: string;
14
+ __typename: string;
15
+ }
16
+ export declare function isProduct(exportLine: ShopifyExportLine): exportLine is ShopifyExportProduct;
17
+ export declare function isProductVariant(exportLine: ShopifyExportLine): exportLine is ShopifyExportProductVariant;
18
+ export declare function isPresentmentPrice(exportLine: ShopifyExportLine): exportLine is ShopifyExportPresentmentPrice;
19
+ export declare function isImage(exportLine: ShopifyExportLine): exportLine is ShopifyExportImage;
20
+ export declare function isMedia(exportLine: ShopifyExportLine): exportLine is ShopifyExportMedia;
21
+ export declare function isMetafield(exportLine: ShopifyExportLine): exportLine is ShopifyExportMetafield;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isMetafield = exports.isMedia = exports.isImage = exports.isPresentmentPrice = exports.isProductVariant = exports.isProduct = void 0;
4
+ function isProduct(exportLine) {
5
+ return "Product" === exportLine.__typename;
6
+ }
7
+ exports.isProduct = isProduct;
8
+ function isProductVariant(exportLine) {
9
+ return "ProductVariant" === exportLine.__typename;
10
+ }
11
+ exports.isProductVariant = isProductVariant;
12
+ function isPresentmentPrice(exportLine) {
13
+ return "ProductVariantPricePair" === exportLine.__typename;
14
+ }
15
+ exports.isPresentmentPrice = isPresentmentPrice;
16
+ function isImage(exportLine) {
17
+ return "Image" === exportLine.__typename;
18
+ }
19
+ exports.isImage = isImage;
20
+ function isMedia(exportLine) {
21
+ return ["Video", "Model3d", "MediaImage", "ExternalVideo"].includes(exportLine.__typename);
22
+ }
23
+ exports.isMedia = isMedia;
24
+ function isMetafield(exportLine) {
25
+ return "Metafield" === exportLine.__typename;
26
+ }
27
+ exports.isMetafield = isMetafield;
28
+ //# sourceMappingURL=shopify.js.map
@@ -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,12 @@
1
+ import Debug from "debug";
2
+ import * as Sentry from "@sentry/react";
3
+ export declare const debuggers: Record<string, Debug.Debugger>;
4
+ export declare const debug: {
5
+ namespace: string;
6
+ log: (namespace: string, formatter?: string | undefined, ...args: Array<any>) => void;
7
+ breadcrumb: (breadcrumb: Partial<Sentry.Breadcrumb> & {
8
+ message: string;
9
+ category: "search" | "sort" | "pagination" | "filter" | "curation";
10
+ }) => void;
11
+ hook: (namespace: string, message: string, value: unknown) => void;
12
+ };
@@ -0,0 +1,43 @@
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 = exports.debuggers = void 0;
26
+ const debug_1 = __importDefault(require("debug"));
27
+ const Sentry = __importStar(require("@sentry/react"));
28
+ const hooks_1 = require("../hooks");
29
+ exports.debuggers = {};
30
+ exports.debug = {
31
+ namespace: "reactify-search",
32
+ log: (namespace, formatter, ...args) => {
33
+ if (!exports.debuggers[namespace]) {
34
+ exports.debuggers[namespace] = (0, debug_1.default)(`${exports.debug.namespace}:${namespace}`);
35
+ }
36
+ exports.debuggers[namespace](formatter, ...args);
37
+ },
38
+ breadcrumb: (breadcrumb) => {
39
+ Sentry.addBreadcrumb(Object.assign(Object.assign({ level: "debug", type: "query" }, breadcrumb), { category: `${exports.debug.namespace}:${breadcrumb.category}` }));
40
+ },
41
+ hook: hooks_1.useDebugger,
42
+ };
43
+ //# 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,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;YACzB,iBAAS,CAAC,SAAS,CAAC,GAAG,IAAA,eAAK,EAAC,GAAG,aAAK,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;SACjE;QAED,iBAAS,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3C,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 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 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.1",
4
+ "version": "5.0.0-beta.12",
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
- "build": "rimraf dist && tsc",
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",