@getlupa/client 0.15.1 → 0.15.3

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.
@@ -9,6 +9,7 @@ export default class AdditionalPanels extends Vue {
9
9
  options: SdkOptions;
10
10
  result: SearchQueryResult;
11
11
  query: string;
12
+ searchString: string;
12
13
  searchResultOptions: SearchResultsOptions;
13
14
  showAll: boolean;
14
15
  get displayShowMore(): boolean;
@@ -35695,6 +35695,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35695
35695
  (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35696
35696
  queryKey: this.query,
35697
35697
  hasResults: true,
35698
+ productId: this.id,
35698
35699
  });
35699
35700
  }
35700
35701
  handleProductEvent(item) {
@@ -36212,11 +36213,14 @@ __decorate([
36212
36213
  __decorate([
36213
36214
  params$9.Getter("query")
36214
36215
  ], AdditionalPanels$1.prototype, "query", void 0);
36216
+ __decorate([
36217
+ params$9.Getter("searchString")
36218
+ ], AdditionalPanels$1.prototype, "searchString", void 0);
36215
36219
  __decorate([
36216
36220
  options$6.State((o) => o.searchResultOptions)
36217
36221
  ], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
36218
36222
  __decorate([
36219
- Watch("query")
36223
+ Watch("searchString")
36220
36224
  ], AdditionalPanels$1.prototype, "handleQueryChange", null);
36221
36225
  AdditionalPanels$1 = __decorate([
36222
36226
  Component({
@@ -40589,7 +40593,7 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40589
40593
  return Boolean((_a = this.dynamicSearchResultData) === null || _a === void 0 ? void 0 : _a.cache);
40590
40594
  }
40591
40595
  enhanceSearchResultsWithDynamicData({ result, mode, }) {
40592
- var _a, _b, _c;
40596
+ var _a, _b, _c, _d, _e, _f;
40593
40597
  return __awaiter$1(this, void 0, void 0, function* () {
40594
40598
  const enabledForMode = mode === "searchBox"
40595
40599
  ? this.isDynamicDataEnabledForSearchBox
@@ -40597,7 +40601,9 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40597
40601
  if (!result || !enabledForMode) {
40598
40602
  return {};
40599
40603
  }
40600
- let requestedIds = (_b = (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((i) => i.id)) !== null && _b !== void 0 ? _b : [];
40604
+ const resultIds = (_b = (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((i) => i.id)) !== null && _b !== void 0 ? _b : [];
40605
+ const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) === null || _c === void 0 ? void 0 : _c.map((q) => q.items.map((i) => i.id))) === null || _d === void 0 ? void 0 : _d.flat()) !== null && _e !== void 0 ? _e : [];
40606
+ let requestedIds = [...resultIds, ...similarQueryResultIds];
40601
40607
  if (this.isCacheEnabled) {
40602
40608
  requestedIds = requestedIds.filter((i) => !this.loadedIds.includes(i));
40603
40609
  }
@@ -40610,7 +40616,7 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40610
40616
  if (!(dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler)) {
40611
40617
  return {};
40612
40618
  }
40613
- const dynamicDataResult = (_c = (yield (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler(requestedIds)))) !== null && _c !== void 0 ? _c : [];
40619
+ const dynamicDataResult = (_f = (yield (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler(requestedIds)))) !== null && _f !== void 0 ? _f : [];
40614
40620
  const seed = {};
40615
40621
  const dynamicDataIdMap = dynamicDataResult.reduce((a, c) => (Object.assign(Object.assign({}, a), { [c.id]: c })), seed);
40616
40622
  return dynamicDataIdMap;
@@ -26,6 +26,7 @@ export declare type CallbackContext = {
26
26
  queryKey: string;
27
27
  hasResults?: boolean;
28
28
  urlQueryString?: string;
29
+ productId?: string;
29
30
  };
30
31
  export declare type SearchResultEventCallbacks = {
31
32
  onSearchResults?: (context: CallbackContext) => unknown;
@@ -9,6 +9,7 @@ export default class AdditionalPanels extends Vue {
9
9
  options: SdkOptions;
10
10
  result: SearchQueryResult;
11
11
  query: string;
12
+ searchString: string;
12
13
  searchResultOptions: SearchResultsOptions;
13
14
  showAll: boolean;
14
15
  get displayShowMore(): boolean;
@@ -35691,6 +35691,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35691
35691
  (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35692
35692
  queryKey: this.query,
35693
35693
  hasResults: true,
35694
+ productId: this.id,
35694
35695
  });
35695
35696
  }
35696
35697
  handleProductEvent(item) {
@@ -36208,11 +36209,14 @@ __decorate([
36208
36209
  __decorate([
36209
36210
  params$9.Getter("query")
36210
36211
  ], AdditionalPanels$1.prototype, "query", void 0);
36212
+ __decorate([
36213
+ params$9.Getter("searchString")
36214
+ ], AdditionalPanels$1.prototype, "searchString", void 0);
36211
36215
  __decorate([
36212
36216
  options$6.State((o) => o.searchResultOptions)
36213
36217
  ], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
36214
36218
  __decorate([
36215
- Watch("query")
36219
+ Watch("searchString")
36216
36220
  ], AdditionalPanels$1.prototype, "handleQueryChange", null);
36217
36221
  AdditionalPanels$1 = __decorate([
36218
36222
  Component({
@@ -40585,7 +40589,7 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40585
40589
  return Boolean((_a = this.dynamicSearchResultData) === null || _a === void 0 ? void 0 : _a.cache);
40586
40590
  }
40587
40591
  enhanceSearchResultsWithDynamicData({ result, mode, }) {
40588
- var _a, _b, _c;
40592
+ var _a, _b, _c, _d, _e, _f;
40589
40593
  return __awaiter$1(this, void 0, void 0, function* () {
40590
40594
  const enabledForMode = mode === "searchBox"
40591
40595
  ? this.isDynamicDataEnabledForSearchBox
@@ -40593,7 +40597,9 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40593
40597
  if (!result || !enabledForMode) {
40594
40598
  return {};
40595
40599
  }
40596
- let requestedIds = (_b = (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((i) => i.id)) !== null && _b !== void 0 ? _b : [];
40600
+ const resultIds = (_b = (_a = result === null || result === void 0 ? void 0 : result.items) === null || _a === void 0 ? void 0 : _a.map((i) => i.id)) !== null && _b !== void 0 ? _b : [];
40601
+ const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) === null || _c === void 0 ? void 0 : _c.map((q) => q.items.map((i) => i.id))) === null || _d === void 0 ? void 0 : _d.flat()) !== null && _e !== void 0 ? _e : [];
40602
+ let requestedIds = [...resultIds, ...similarQueryResultIds];
40597
40603
  if (this.isCacheEnabled) {
40598
40604
  requestedIds = requestedIds.filter((i) => !this.loadedIds.includes(i));
40599
40605
  }
@@ -40606,7 +40612,7 @@ let DynamicDataModule = class DynamicDataModule extends VuexModule {
40606
40612
  if (!(dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler)) {
40607
40613
  return {};
40608
40614
  }
40609
- const dynamicDataResult = (_c = (yield (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler(requestedIds)))) !== null && _c !== void 0 ? _c : [];
40615
+ const dynamicDataResult = (_f = (yield (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.handler(requestedIds)))) !== null && _f !== void 0 ? _f : [];
40610
40616
  const seed = {};
40611
40617
  const dynamicDataIdMap = dynamicDataResult.reduce((a, c) => (Object.assign(Object.assign({}, a), { [c.id]: c })), seed);
40612
40618
  return dynamicDataIdMap;
@@ -26,6 +26,7 @@ export declare type CallbackContext = {
26
26
  queryKey: string;
27
27
  hasResults?: boolean;
28
28
  urlQueryString?: string;
29
+ productId?: string;
29
30
  };
30
31
  export declare type SearchResultEventCallbacks = {
31
32
  onSearchResults?: (context: CallbackContext) => unknown;
@@ -9,6 +9,7 @@ export default class AdditionalPanels extends Vue {
9
9
  options: SdkOptions;
10
10
  result: SearchQueryResult;
11
11
  query: string;
12
+ searchString: string;
12
13
  searchResultOptions: SearchResultsOptions;
13
14
  showAll: boolean;
14
15
  get displayShowMore(): boolean;