@sledge-app/react-instant-search 0.0.128 → 1.0.1

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.
@@ -2346,6 +2346,23 @@ const ProductGrid = ({
2346
2346
  const { id: variant_id = "", title: variant_title = "", price = "", sku = "" } = (variants == null ? void 0 : variants.length) ? variants[0] : {};
2347
2347
  let isLoadingAddToCart = clickedAddToCartId == variant_id;
2348
2348
  let isOutOfStock = (variants == null ? void 0 : variants.length) && Object.hasOwn(variants[0], "inventory_quantity") ? !variants[0].inventory_quantity && showOptionOutOfStock : false;
2349
+ const addToCartTrigger$2 = async () => {
2350
+ if (sourceApp === "wishlist") {
2351
+ await addToCartTrigger$1({
2352
+ productId: id
2353
+ });
2354
+ } else if (sourceApp === "instant-search") {
2355
+ await addToCartTrigger({
2356
+ productId: id
2357
+ });
2358
+ }
2359
+ };
2360
+ const productClickTrigger$1 = async () => {
2361
+ if (sourceApp === "instant-search")
2362
+ productClickTrigger({
2363
+ productId: id
2364
+ });
2365
+ };
2349
2366
  const getCards = cards ? cards({
2350
2367
  product: {
2351
2368
  ...product,
@@ -2366,7 +2383,9 @@ const ProductGrid = ({
2366
2383
  } : {}
2367
2384
  },
2368
2385
  showPopupComponent,
2369
- setShowPopupComponent
2386
+ setShowPopupComponent,
2387
+ addToCartTrigger: addToCartTrigger$2,
2388
+ productClickTrigger: productClickTrigger$1
2370
2389
  }) : null;
2371
2390
  return cards ? /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: isComponentJsVersion ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: getCards } }) : getCards }, index) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card", children: [
2372
2391
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-content", children: [