@sledge-app/react-instant-search 0.0.53 → 0.0.55

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.
@@ -633,7 +633,7 @@ const Trigger = (props) => {
633
633
  var _a, _b, _c;
634
634
  const { data, forceActive = false, hidden = false, onAfterAddWishlist, onAfterRemoveWishlist } = props;
635
635
  const { productId, productVariantId } = data || {};
636
- const { isRenderApp, triggerRenderMultipleComponent, sledgeAnonymId, isAvoidOverlapWhenBlurring } = React__default.useContext(SledgeContext);
636
+ const { isRenderApp, triggerRenderMultipleComponent, sledgeAnonymId } = React__default.useContext(SledgeContext);
637
637
  const defaultColorIcon = "#767676";
638
638
  const defaultTypeIcon = "outline";
639
639
  const activeColorIcon = "#F85538";
@@ -759,7 +759,7 @@ const Trigger = (props) => {
759
759
  setTypeIcon(defaultTypeIcon);
760
760
  }
761
761
  }, [isWishlist]);
762
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isLoading && !hidden && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sledge-wishlist__trigger-block ${isAvoidOverlapWhenBlurring ? "sledge__avoid-overlap-when-blurring" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
762
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !isLoading && !hidden && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-wishlist__trigger-block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
763
763
  "span",
764
764
  {
765
765
  className: "sledge-wishlist__trigger",
@@ -1174,7 +1174,7 @@ const Rating = (props) => {
1174
1174
  var _a;
1175
1175
  const { value, size = "md", data, withSkeletonLoading = true, isScrollToElementWidget = true } = props;
1176
1176
  const { productId } = data || {};
1177
- const { isRenderApp } = React__default.useContext(SledgeContext);
1177
+ const { isRenderApp, triggerRenderMultipleComponent } = React__default.useContext(SledgeContext);
1178
1178
  const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
1179
1179
  const [isLoading, setIsLoading] = React__default.useState(true);
1180
1180
  const [sizing, setSizing] = React__default.useState({
@@ -1237,6 +1237,14 @@ const Rating = (props) => {
1237
1237
  React__default.useEffect(() => {
1238
1238
  if (!(isRenderApp == null ? void 0 : isRenderApp.productReview))
1239
1239
  return;
1240
+ if (typeof window !== "undefined") {
1241
+ window.sledgeProductReviewRatingUpdate = () => {
1242
+ var _a2, _b;
1243
+ if (((_b = (_a2 = triggerRenderMultipleComponent == null ? void 0 : triggerRenderMultipleComponent.productReview) == null ? void 0 : _a2.rating) == null ? void 0 : _b.value) !== productId)
1244
+ return;
1245
+ handleProductRatingInfo();
1246
+ };
1247
+ }
1240
1248
  if (size === "xs") {
1241
1249
  setSizing({
1242
1250
  width: 14.4,
@@ -1257,7 +1265,7 @@ const Rating = (props) => {
1257
1265
  if (isProductIdChanged)
1258
1266
  setIsFirstLoading(true);
1259
1267
  handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING) || "");
1260
- }, [isRenderApp, productId]);
1268
+ }, [isRenderApp, productId, triggerRenderMultipleComponent]);
1261
1269
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-product-review__rating", onClick: handleOnClick, children: isFirstLoading && withSkeletonLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonLoading.Item, { width: "230px", height: "28px", color: "grey-100", rounded: "md" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1262
1270
  /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "none" }, id: "sledge-product-review-rating-icon-svg-store", children: [
1263
1271
  /* @__PURE__ */ jsxRuntimeExports.jsx("symbol", { id: "sledge-product-review-icons-rating-icon-fill", viewBox: "0 0 30 29", fill: fill_color || "#23BC45", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -2642,7 +2650,7 @@ const SearchIconWidgetPopup = () => {
2642
2650
  const SearchResultWidget$1 = "";
2643
2651
  const SearchResultWidget = (props) => {
2644
2652
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2645
- const { isRenderApp, isJsVersion, isAvoidOverlapWhenBlurring } = React__default.useContext(SledgeContext);
2653
+ const { isRenderApp, isJsVersion } = React__default.useContext(SledgeContext);
2646
2654
  const { layoutType = "default", query, data, children, onAfterAddToCart, onAfterAddWishlist, onAfterRemoveWishlist, onAfterRenderProduct } = props;
2647
2655
  const { keyword: queryKeyword = "" } = query || {};
2648
2656
  const { collectionId } = data || {};
@@ -3081,7 +3089,7 @@ const SearchResultWidget = (props) => {
3081
3089
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__result-data-summary-select-field-item", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonLoading.Item, { width: "150px", height: "42px", color: "grey-100", rounded: "lg" }) })
3082
3090
  ] })
3083
3091
  ] });
3084
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sledge-instant-search__result-container`, ref: searchResultContainerRef, children: [
3092
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sledge-instant-search__result-container", ref: searchResultContainerRef, children: [
3085
3093
  isFirstLoading ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${layoutType === "default" && (allowedTabs == null ? void 0 : allowedTabs.length) ? "sledge-instant-search__result-tab" : "sledge-instant-search__result-tab-no-index"}`, children: layoutType === "default" && (allowedTabs == null ? void 0 : allowedTabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "sledge-instant-search__result-tab-list", children: allowedTabs.map((item) => {
3086
3094
  const { name, index, total } = item;
3087
3095
  let isActive = clickedTabIndexId === index;