@coveo/headless 3.28.3-pre.700bd9e9a1 → 3.28.3-pre.71fbb06acc

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.
@@ -800,7 +800,7 @@ var import_bueno5 = require("@coveo/bueno");
800
800
  var import_toolkit7 = require("@reduxjs/toolkit");
801
801
 
802
802
  // src/utils/version.ts
803
- var VERSION = "3.28.3-pre.700bd9e9a1";
803
+ var VERSION = "3.28.3-pre.71fbb06acc";
804
804
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
805
805
 
806
806
  // src/features/configuration/configuration-actions.ts
@@ -1148,7 +1148,7 @@ var import_bueno6 = require("@coveo/bueno");
1148
1148
  var import_toolkit4 = require("@reduxjs/toolkit");
1149
1149
 
1150
1150
  // src/utils/version.ts
1151
- var VERSION = "3.28.3-pre.700bd9e9a1";
1151
+ var VERSION = "3.28.3-pre.71fbb06acc";
1152
1152
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1153
1153
 
1154
1154
  // src/features/configuration/configuration-actions.ts
@@ -10355,7 +10355,11 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10355
10355
  const paginationOffset = getPaginationOffset(action.payload);
10356
10356
  handleFullfilled(state, action.payload.response);
10357
10357
  state.products = action.payload.response.products.map(
10358
- (product, index) => preprocessProduct(product, paginationOffset + index + 1)
10358
+ (product, index) => preprocessProduct(
10359
+ product,
10360
+ paginationOffset + index + 1,
10361
+ action.payload.response.responseId
10362
+ )
10359
10363
  );
10360
10364
  }).addCase(fetchMoreProducts2.fulfilled, (state, action) => {
10361
10365
  if (!action.payload) {
@@ -10365,7 +10369,11 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10365
10369
  handleFullfilled(state, action.payload.response);
10366
10370
  state.products = state.products.concat(
10367
10371
  action.payload.response.products.map(
10368
- (product, index) => preprocessProduct(product, paginationOffset + index + 1)
10372
+ (product, index) => preprocessProduct(
10373
+ product,
10374
+ paginationOffset + index + 1,
10375
+ action.payload?.response.responseId
10376
+ )
10369
10377
  )
10370
10378
  );
10371
10379
  }).addCase(fetchProductListing.pending, (state, action) => {
@@ -10384,13 +10392,15 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10384
10392
  if (currentParentIndex === -1 || childToPromote === void 0) {
10385
10393
  return;
10386
10394
  }
10395
+ const responseId = products[currentParentIndex].responseId;
10387
10396
  const position = products[currentParentIndex].position;
10388
10397
  const { children, totalNumberOfChildren } = products[currentParentIndex];
10389
10398
  const newParent = {
10390
10399
  ...childToPromote,
10391
10400
  children,
10392
10401
  totalNumberOfChildren,
10393
- position
10402
+ position,
10403
+ responseId
10394
10404
  };
10395
10405
  products.splice(currentParentIndex, 1, newParent);
10396
10406
  }).addCase(setView, () => getProductListingInitialState()).addCase(setContext, () => getProductListingInitialState()).addCase(setError, (state, action) => {
@@ -10416,12 +10426,12 @@ function getPaginationOffset(payload) {
10416
10426
  const pagination = payload.response.pagination;
10417
10427
  return pagination.page * pagination.perPage;
10418
10428
  }
10419
- function preprocessProduct(product, position) {
10429
+ function preprocessProduct(product, position, responseId) {
10420
10430
  const isParentAlreadyInChildren = product.children.some(
10421
10431
  (child) => child.permanentid === product.permanentid
10422
10432
  );
10423
10433
  if (product.children.length === 0 || isParentAlreadyInChildren) {
10424
- return { ...product, position };
10434
+ return { ...product, position, responseId };
10425
10435
  }
10426
10436
  const {
10427
10437
  children,
@@ -10431,7 +10441,8 @@ function preprocessProduct(product, position) {
10431
10441
  return {
10432
10442
  ...product,
10433
10443
  children: [restOfProduct, ...children],
10434
- position
10444
+ position,
10445
+ responseId
10435
10446
  };
10436
10447
  }
10437
10448
 
@@ -10633,7 +10644,11 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10633
10644
  action.payload.queryExecuted
10634
10645
  );
10635
10646
  state.products = action.payload.response.products.map(
10636
- (product, index) => preprocessProduct3(product, paginationOffset + index + 1)
10647
+ (product, index) => preprocessProduct3(
10648
+ product,
10649
+ paginationOffset + index + 1,
10650
+ action.payload.response.responseId
10651
+ )
10637
10652
  );
10638
10653
  }).addCase(fetchMoreProducts.fulfilled, (state, action) => {
10639
10654
  if (!action.payload) {
@@ -10647,7 +10662,11 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10647
10662
  );
10648
10663
  state.products = state.products.concat(
10649
10664
  action.payload.response.products.map(
10650
- (product, index) => preprocessProduct3(product, paginationOffset + index + 1)
10665
+ (product, index) => preprocessProduct3(
10666
+ product,
10667
+ paginationOffset + index + 1,
10668
+ action.payload?.response.responseId
10669
+ )
10651
10670
  )
10652
10671
  );
10653
10672
  }).addCase(executeSearch.pending, (state, action) => {
@@ -10666,13 +10685,15 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10666
10685
  if (currentParentIndex === -1 || childToPromote === void 0) {
10667
10686
  return;
10668
10687
  }
10688
+ const responseId = products[currentParentIndex].responseId;
10669
10689
  const position = products[currentParentIndex].position;
10670
10690
  const { children, totalNumberOfChildren } = products[currentParentIndex];
10671
10691
  const newParent = {
10672
10692
  ...childToPromote,
10673
10693
  children,
10674
10694
  totalNumberOfChildren,
10675
- position
10695
+ position,
10696
+ responseId
10676
10697
  };
10677
10698
  products.splice(currentParentIndex, 1, newParent);
10678
10699
  }).addCase(setView, () => getCommerceSearchInitialState()).addCase(setContext, () => getCommerceSearchInitialState()).addCase(setError, (state, action) => {
@@ -10700,12 +10721,12 @@ function getPaginationOffset3(payload) {
10700
10721
  const pagination = payload.response.pagination;
10701
10722
  return pagination.page * pagination.perPage;
10702
10723
  }
10703
- function preprocessProduct3(product, position) {
10724
+ function preprocessProduct3(product, position, responseId) {
10704
10725
  const isParentAlreadyInChildren = product.children.some(
10705
10726
  (child) => child.permanentid === product.permanentid
10706
10727
  );
10707
10728
  if (product.children.length === 0 || isParentAlreadyInChildren) {
10708
- return { ...product, position };
10729
+ return { ...product, position, responseId };
10709
10730
  }
10710
10731
  const {
10711
10732
  children,
@@ -10715,7 +10736,8 @@ function preprocessProduct3(product, position) {
10715
10736
  return {
10716
10737
  ...product,
10717
10738
  children: [restOfProduct, ...children],
10718
- position
10739
+ position,
10740
+ responseId
10719
10741
  };
10720
10742
  }
10721
10743
 
@@ -15676,7 +15698,7 @@ Review the configuration of the above 'ec_'-prefixed fields in your index, and m
15676
15698
  productId: props.options.product.ec_product_id ?? props.options.product.permanentid
15677
15699
  },
15678
15700
  position: props.options.product.position,
15679
- responseId: props.responseIdSelector(engine[stateKey])
15701
+ responseId: props.options.product.responseId ?? props.responseIdSelector(engine[stateKey])
15680
15702
  })
15681
15703
  );
15682
15704
  };