@sledge-app/react-instant-search 2.0.13 → 2.0.14

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.
@@ -4337,7 +4337,7 @@ const ProductCard = React__default.memo((props) => {
4337
4337
  display_button_add_to_cart_style = {}
4338
4338
  } = setting || {};
4339
4339
  const { product, variants } = item || {};
4340
- const { id, title, image, url, vendor = "", currency, handle } = product || {};
4340
+ const { id, title, image, url, vendor = "", currency, handle, images } = product || {};
4341
4341
  const {
4342
4342
  id: variant_id = "",
4343
4343
  admin_graphql_api_id: variant_admin_graphql_api_id = "",
@@ -4350,6 +4350,7 @@ const ProductCard = React__default.memo((props) => {
4350
4350
  const defaultSelectedVariantStock = (variants == null ? void 0 : variants.length) && Object.hasOwn(variants[0], "inventory_quantity") ? variants[0].inventory_quantity : 0;
4351
4351
  const defaultSelectedVariantInventoryManagement = (variants == null ? void 0 : variants.length) && Object.hasOwn(variants[0], "inventory_management") ? variants[0].inventory_management : null;
4352
4352
  const defaultSelectedVariantInventoryPolicy = (variants == null ? void 0 : variants.length) && Object.hasOwn(variants[0], "inventory_policy") ? variants[0].inventory_policy : "";
4353
+ const secondaryImage = images == null ? void 0 : images[1];
4353
4354
  const [selectedVariantId, setSelectedVariantId] = React__default.useState(defaultSelectedVariantId);
4354
4355
  const [selectedVariantStock, setSelectedVariantStock] = React__default.useState(defaultSelectedVariantStock);
4355
4356
  const [selectedVariantInventoryManagement, setSelectedVariantInventoryManagement] = React__default.useState(defaultSelectedVariantInventoryManagement);
@@ -4537,27 +4538,37 @@ const ProductCard = React__default.memo((props) => {
4537
4538
  } : {}
4538
4539
  }
4539
4540
  ),
4540
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-featured-image-element", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4541
- "img",
4542
- {
4543
- ref: imageRef,
4544
- ...hasEntryImage ? {
4545
- src: (image == null ? void 0 : image.src) || `${CDN_URL}/images/blank-image.png`,
4546
- ["loaded"]: ""
4547
- } : {
4548
- ["data-src"]: (image == null ? void 0 : image.src) || `${CDN_URL}/images/blank-image.png`
4549
- },
4550
- alt: "sledge-card-image",
4551
- loading: "lazy",
4552
- className: "sledge__product-grid-card-image-featured-image",
4553
- onError: ({ currentTarget }) => {
4554
- if (!currentTarget)
4555
- return;
4556
- currentTarget.onerror = null;
4557
- currentTarget.src = `${CDN_URL}/images/blank-image.png`;
4541
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge__product-grid-card-featured-image-element", children: [
4542
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
4543
+ "img",
4544
+ {
4545
+ ref: imageRef,
4546
+ ...hasEntryImage ? {
4547
+ src: (image == null ? void 0 : image.src) || `${CDN_URL}/images/blank-image.png`,
4548
+ ["loaded"]: ""
4549
+ } : {
4550
+ ["data-src"]: (image == null ? void 0 : image.src) || `${CDN_URL}/images/blank-image.png`
4551
+ },
4552
+ alt: "sledge-card-image",
4553
+ loading: "lazy",
4554
+ className: "sledge__product-grid-card-image-featured-image",
4555
+ onError: ({ currentTarget }) => {
4556
+ if (!currentTarget)
4557
+ return;
4558
+ currentTarget.onerror = null;
4559
+ currentTarget.src = `${CDN_URL}/images/blank-image.png`;
4560
+ }
4558
4561
  }
4559
- }
4560
- ) }),
4562
+ ),
4563
+ secondaryImage && /* @__PURE__ */ jsxRuntimeExports.jsx(
4564
+ "img",
4565
+ {
4566
+ src: secondaryImage == null ? void 0 : secondaryImage.src,
4567
+ alt: "sledge-card-image",
4568
+ className: "sledge__product-grid-card-image-featured-image sledge__product-grid-card-image-featured-image--secondary"
4569
+ }
4570
+ )
4571
+ ] }),
4561
4572
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge__product-grid-card-variant-images", children: (_g = (_f = product == null ? void 0 : product.images) == null ? void 0 : _f.map) == null ? void 0 : _g.call(_f, (image2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
4562
4573
  "img",
4563
4574
  {
@@ -8001,8 +8012,8 @@ const ResultWrapper = (props) => {
8001
8012
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-wrapper", "data-filter-layout": (_a = displaySettings == null ? void 0 : displaySettings.filter) == null ? void 0 : _a.layout, children });
8002
8013
  };
8003
8014
  const ResultData = (props) => {
8004
- const { children } = props;
8005
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data", children });
8015
+ const { children, className = "" } = props;
8016
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-instant-search__result-data ${className}`, children });
8006
8017
  };
8007
8018
  const ResultDataKeyword = (props) => {
8008
8019
  const { children } = props;
@@ -8299,7 +8310,7 @@ const EnterpriseLayout = (props) => {
8299
8310
  ((_d = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _d.hide_search_bar) ? null : searchField,
8300
8311
  ((_e = displaySettings == null ? void 0 : displaySettings.search) == null ? void 0 : _e.show_switch_view_option) ? /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnGridSelectorWrapper, { children: columnGridSelector }) }) : null
8301
8312
  ] }),
8302
- /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { children: [
8313
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ResultData, { className: openFilterToggle ? "" : "sledge__has-closed-filter-toggle", children: [
8303
8314
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-instant-search__result-filter-toggle-panel ${"animated"}`, "data-filter-toggle": openFilterToggle ? "open" : "closed", children: filterVertical == null ? void 0 : filterVertical({
8304
8315
  filterLayoutType: "standard",
8305
8316
  isSkeleton: Boolean(!isAllowedFilterTree && isFirstLoading || isAllowedFilterTree && isLoadingProduct || isLoadingSetting)