@getlupa/client 0.15.0 → 0.15.2

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;
@@ -35676,7 +35676,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35676
35676
  : "";
35677
35677
  }
35678
35678
  handleClick() {
35679
- var _a, _b;
35679
+ var _a, _b, _c, _d;
35680
35680
  this.trackClick({
35681
35681
  queryKey: this.options.queryKey,
35682
35682
  data: {
@@ -35686,14 +35686,16 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35686
35686
  analytics: {
35687
35687
  type: this.query ? "search_product_click" : "select_item",
35688
35688
  label: this.title || this.id || this.link,
35689
+ listLabel: (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.htmlTitleTemplate,
35689
35690
  items: [this.product],
35690
35691
  },
35691
35692
  options: { allowEmptySearchQuery: true },
35692
35693
  },
35693
35694
  });
35694
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
35695
+ (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35695
35696
  queryKey: this.query,
35696
35697
  hasResults: true,
35698
+ productId: this.id,
35697
35699
  });
35698
35700
  }
35699
35701
  handleProductEvent(item) {
@@ -36101,20 +36103,20 @@ const sendGa4AnalyticsEvent = (data, options) => {
36101
36103
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36102
36104
  const params = {
36103
36105
  search_text: data.searchQuery,
36104
- item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
36105
- ecommerce: parseEcommerceData(data, title),
36106
+ item_title: title,
36107
+ ecommerce: parseEcommerceData(data, (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.listLabel),
36106
36108
  };
36107
36109
  window.dataLayer.push(Object.assign({ event: (_e = (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : options.parentEventName }, params));
36108
36110
  };
36109
36111
  const processDebugEvent = (data) => {
36110
- var _a, _b, _c;
36112
+ var _a, _b, _c, _d;
36111
36113
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
36112
36114
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36113
36115
  const params = {
36114
36116
  event: (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type,
36115
36117
  search_text: data.searchQuery,
36116
36118
  item_title: title,
36117
- ecommerce: parseEcommerceData(data, title),
36119
+ ecommerce: parseEcommerceData(data, (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.listLabel),
36118
36120
  };
36119
36121
  console.debug("Analytics debug event:", params);
36120
36122
  };
@@ -36211,11 +36213,14 @@ __decorate([
36211
36213
  __decorate([
36212
36214
  params$9.Getter("query")
36213
36215
  ], AdditionalPanels$1.prototype, "query", void 0);
36216
+ __decorate([
36217
+ params$9.Getter("searchString")
36218
+ ], AdditionalPanels$1.prototype, "searchString", void 0);
36214
36219
  __decorate([
36215
36220
  options$6.State((o) => o.searchResultOptions)
36216
36221
  ], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
36217
36222
  __decorate([
36218
- Watch("query")
36223
+ Watch("searchString")
36219
36224
  ], AdditionalPanels$1.prototype, "handleQueryChange", null);
36220
36225
  AdditionalPanels$1 = __decorate([
36221
36226
  Component({
@@ -38492,6 +38497,7 @@ let SearchResults = class SearchResults extends Vue$1 {
38492
38497
  analytics: {
38493
38498
  type: "view_item_list",
38494
38499
  label: title,
38500
+ listLabel: title,
38495
38501
  items,
38496
38502
  },
38497
38503
  options: { allowEmptySearchQuery: true },
@@ -34,6 +34,7 @@ export declare type TrackableEventData = {
34
34
  analytics?: {
35
35
  type: AnalyticsEventType;
36
36
  label: string;
37
+ listLabel?: string;
37
38
  items?: Record<string, unknown>[];
38
39
  };
39
40
  options?: {
@@ -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;
@@ -35672,7 +35672,7 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35672
35672
  : "";
35673
35673
  }
35674
35674
  handleClick() {
35675
- var _a, _b;
35675
+ var _a, _b, _c, _d;
35676
35676
  this.trackClick({
35677
35677
  queryKey: this.options.queryKey,
35678
35678
  data: {
@@ -35682,14 +35682,16 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35682
35682
  analytics: {
35683
35683
  type: this.query ? "search_product_click" : "select_item",
35684
35684
  label: this.title || this.id || this.link,
35685
+ listLabel: (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.htmlTitleTemplate,
35685
35686
  items: [this.product],
35686
35687
  },
35687
35688
  options: { allowEmptySearchQuery: true },
35688
35689
  },
35689
35690
  });
35690
- (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
35691
+ (_d = (_c = this.searchResultOptions.callbacks) === null || _c === void 0 ? void 0 : _c.onProductClick) === null || _d === void 0 ? void 0 : _d.call(_c, {
35691
35692
  queryKey: this.query,
35692
35693
  hasResults: true,
35694
+ productId: this.id,
35693
35695
  });
35694
35696
  }
35695
35697
  handleProductEvent(item) {
@@ -36097,20 +36099,20 @@ const sendGa4AnalyticsEvent = (data, options) => {
36097
36099
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36098
36100
  const params = {
36099
36101
  search_text: data.searchQuery,
36100
- item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
36101
- ecommerce: parseEcommerceData(data, title),
36102
+ item_title: title,
36103
+ ecommerce: parseEcommerceData(data, (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.listLabel),
36102
36104
  };
36103
36105
  window.dataLayer.push(Object.assign({ event: (_e = (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : options.parentEventName }, params));
36104
36106
  };
36105
36107
  const processDebugEvent = (data) => {
36106
- var _a, _b, _c;
36108
+ var _a, _b, _c, _d;
36107
36109
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
36108
36110
  const title = sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined;
36109
36111
  const params = {
36110
36112
  event: (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type,
36111
36113
  search_text: data.searchQuery,
36112
36114
  item_title: title,
36113
- ecommerce: parseEcommerceData(data, title),
36115
+ ecommerce: parseEcommerceData(data, (_d = data.analytics) === null || _d === void 0 ? void 0 : _d.listLabel),
36114
36116
  };
36115
36117
  console.debug("Analytics debug event:", params);
36116
36118
  };
@@ -36207,11 +36209,14 @@ __decorate([
36207
36209
  __decorate([
36208
36210
  params$9.Getter("query")
36209
36211
  ], AdditionalPanels$1.prototype, "query", void 0);
36212
+ __decorate([
36213
+ params$9.Getter("searchString")
36214
+ ], AdditionalPanels$1.prototype, "searchString", void 0);
36210
36215
  __decorate([
36211
36216
  options$6.State((o) => o.searchResultOptions)
36212
36217
  ], AdditionalPanels$1.prototype, "searchResultOptions", void 0);
36213
36218
  __decorate([
36214
- Watch("query")
36219
+ Watch("searchString")
36215
36220
  ], AdditionalPanels$1.prototype, "handleQueryChange", null);
36216
36221
  AdditionalPanels$1 = __decorate([
36217
36222
  Component({
@@ -38488,6 +38493,7 @@ let SearchResults = class SearchResults extends Vue$1 {
38488
38493
  analytics: {
38489
38494
  type: "view_item_list",
38490
38495
  label: title,
38496
+ listLabel: title,
38491
38497
  items,
38492
38498
  },
38493
38499
  options: { allowEmptySearchQuery: true },
@@ -34,6 +34,7 @@ export declare type TrackableEventData = {
34
34
  analytics?: {
35
35
  type: AnalyticsEventType;
36
36
  label: string;
37
+ listLabel?: string;
37
38
  items?: Record<string, unknown>[];
38
39
  };
39
40
  options?: {
@@ -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;