@sledge-app/react-instant-search 2.0.44 → 2.0.45

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.
@@ -11478,9 +11478,20 @@ const SearchWidget = (props) => {
11478
11478
  handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);
11479
11479
  }, [previewSettings]);
11480
11480
  React__default.useEffect(() => {
11481
+ var _a2, _b2;
11481
11482
  if (!isRenderAppInstantSearch)
11482
11483
  return;
11483
11484
  handleSettings(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);
11485
+ if (typeof window !== "undefined") {
11486
+ if ((_b2 = (_a2 = window == null ? void 0 : window.sledge) == null ? void 0 : _a2.instantSearch) == null ? void 0 : _b2.searchWidget)
11487
+ window.sledge.instantSearch.searchWidget.search = (keyword2 = "") => {
11488
+ var _a3, _b3;
11489
+ if (!(keyword2 == null ? void 0 : keyword2.length))
11490
+ return;
11491
+ setKeyword(keyword2);
11492
+ (_b3 = (_a3 = searchFieldRef == null ? void 0 : searchFieldRef.current) == null ? void 0 : _a3.focus) == null ? void 0 : _b3.call(_a3);
11493
+ };
11494
+ }
11484
11495
  }, [isRenderAppInstantSearch]);
11485
11496
  useEffectOnChange(() => {
11486
11497
  const INSTANT_SEARCH_SETTING = instantSearchPreviewSettings || JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING) || null);