@getlupa/client 1.17.9 → 1.17.10

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.
@@ -32639,6 +32639,7 @@ and ensure you are accounting for this risk.
32639
32639
  }
32640
32640
  };
32641
32641
  onMounted(() => {
32642
+ var _a, _b;
32642
32643
  handleResize();
32643
32644
  optionsStore.setSearchResultOptions({
32644
32645
  options: props.options
@@ -32651,6 +32652,9 @@ and ensure you are accounting for this risk.
32651
32652
  } else {
32652
32653
  loadRecommendations();
32653
32654
  }
32655
+ if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
32656
+ (_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
32657
+ }
32654
32658
  window.addEventListener("resize", handleResize);
32655
32659
  });
32656
32660
  onBeforeUnmount(() => {
@@ -32706,6 +32710,7 @@ and ensure you are accounting for this risk.
32706
32710
  return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
32707
32711
  });
32708
32712
  const loadLupaRecommendations = () => __async2(this, null, function* () {
32713
+ var _a, _b;
32709
32714
  recommendationsType.value = "recommendations_lupasearch";
32710
32715
  try {
32711
32716
  loading.value = true;
@@ -32723,6 +32728,7 @@ and ensure you are accounting for this risk.
32723
32728
  yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
32724
32729
  result: { items: result2.recommended }
32725
32730
  });
32731
+ (_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
32726
32732
  } finally {
32727
32733
  loading.value = false;
32728
32734
  }
@@ -40411,17 +40417,8 @@ and ensure you are accounting for this risk.
40411
40417
  );
40412
40418
  productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40413
40419
  });
40414
- const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40420
+ const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40415
40421
  var _a;
40416
- if (!configuration.recommendations) {
40417
- return;
40418
- }
40419
- const resolvedSearchResultsConfiguration = JSON.parse(
40420
- configuration.searchResults
40421
- );
40422
- const resolvedConfiguration = JSON.parse(
40423
- configuration.recommendations
40424
- );
40425
40422
  const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
40426
40423
  const visible = yield waitForElementToBeVisible(
40427
40424
  resolvedConfiguration.containerSelector,
@@ -40440,6 +40437,37 @@ and ensure you are accounting for this risk.
40440
40437
  );
40441
40438
  recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40442
40439
  });
40440
+ const mountAllRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40441
+ if (!configuration.recommendations) {
40442
+ return;
40443
+ }
40444
+ const resolvedSearchResultsConfiguration = JSON.parse(
40445
+ configuration.searchResults
40446
+ );
40447
+ const resolvedConfiguration = JSON.parse(configuration.recommendations);
40448
+ if (Array.isArray(resolvedConfiguration)) {
40449
+ const mountPromises = resolvedConfiguration.map(
40450
+ (recommendation) => mountRecommendations(
40451
+ resolvedSearchResultsConfiguration,
40452
+ recommendation,
40453
+ options,
40454
+ optionOverrides,
40455
+ fetch2,
40456
+ remount
40457
+ )
40458
+ );
40459
+ yield Promise.all(mountPromises);
40460
+ } else {
40461
+ yield mountRecommendations(
40462
+ resolvedSearchResultsConfiguration,
40463
+ resolvedConfiguration,
40464
+ options,
40465
+ optionOverrides,
40466
+ fetch2,
40467
+ remount
40468
+ );
40469
+ }
40470
+ });
40443
40471
  const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
40444
40472
  if (!configuration.genAiChat) {
40445
40473
  return;
@@ -40481,7 +40509,7 @@ and ensure you are accounting for this risk.
40481
40509
  mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
40482
40510
  mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
40483
40511
  mountProductList(configuration, options, optionOverrides, fetch2, remount),
40484
- mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
40512
+ mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
40485
40513
  mountChat(configuration, options, fetch2, remount)
40486
40514
  ];
40487
40515
  yield Promise.all(mountPromises);
@@ -32639,6 +32639,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32639
32639
  }
32640
32640
  };
32641
32641
  onMounted(() => {
32642
+ var _a, _b;
32642
32643
  handleResize();
32643
32644
  optionsStore.setSearchResultOptions({
32644
32645
  options: props.options
@@ -32651,6 +32652,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32651
32652
  } else {
32652
32653
  loadRecommendations();
32653
32654
  }
32655
+ if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
32656
+ (_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
32657
+ }
32654
32658
  window.addEventListener("resize", handleResize);
32655
32659
  });
32656
32660
  onBeforeUnmount(() => {
@@ -32706,6 +32710,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32706
32710
  return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
32707
32711
  });
32708
32712
  const loadLupaRecommendations = () => __async2(this, null, function* () {
32713
+ var _a, _b;
32709
32714
  recommendationsType.value = "recommendations_lupasearch";
32710
32715
  try {
32711
32716
  loading.value = true;
@@ -32723,6 +32728,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32723
32728
  yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
32724
32729
  result: { items: result2.recommended }
32725
32730
  });
32731
+ (_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
32726
32732
  } finally {
32727
32733
  loading.value = false;
32728
32734
  }
@@ -40411,17 +40417,8 @@ const mountProductList = (configuration, options, optionOverrides, fetch2 = true
40411
40417
  );
40412
40418
  productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40413
40419
  });
40414
- const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(exports, null, function* () {
40420
+ const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(exports, null, function* () {
40415
40421
  var _a;
40416
- if (!configuration.recommendations) {
40417
- return;
40418
- }
40419
- const resolvedSearchResultsConfiguration = JSON.parse(
40420
- configuration.searchResults
40421
- );
40422
- const resolvedConfiguration = JSON.parse(
40423
- configuration.recommendations
40424
- );
40425
40422
  const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
40426
40423
  const visible = yield waitForElementToBeVisible(
40427
40424
  resolvedConfiguration.containerSelector,
@@ -40440,6 +40437,37 @@ const mountRecommendations = (configuration, options, optionOverrides, fetch2 =
40440
40437
  );
40441
40438
  recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40442
40439
  });
40440
+ const mountAllRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(exports, null, function* () {
40441
+ if (!configuration.recommendations) {
40442
+ return;
40443
+ }
40444
+ const resolvedSearchResultsConfiguration = JSON.parse(
40445
+ configuration.searchResults
40446
+ );
40447
+ const resolvedConfiguration = JSON.parse(configuration.recommendations);
40448
+ if (Array.isArray(resolvedConfiguration)) {
40449
+ const mountPromises = resolvedConfiguration.map(
40450
+ (recommendation) => mountRecommendations(
40451
+ resolvedSearchResultsConfiguration,
40452
+ recommendation,
40453
+ options,
40454
+ optionOverrides,
40455
+ fetch2,
40456
+ remount
40457
+ )
40458
+ );
40459
+ yield Promise.all(mountPromises);
40460
+ } else {
40461
+ yield mountRecommendations(
40462
+ resolvedSearchResultsConfiguration,
40463
+ resolvedConfiguration,
40464
+ options,
40465
+ optionOverrides,
40466
+ fetch2,
40467
+ remount
40468
+ );
40469
+ }
40470
+ });
40443
40471
  const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(exports, null, function* () {
40444
40472
  if (!configuration.genAiChat) {
40445
40473
  return;
@@ -40481,7 +40509,7 @@ const mount = (_0, ..._1) => __async(exports, [_0, ..._1], function* (configurat
40481
40509
  mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
40482
40510
  mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
40483
40511
  mountProductList(configuration, options, optionOverrides, fetch2, remount),
40484
- mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
40512
+ mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
40485
40513
  mountChat(configuration, options, fetch2, remount)
40486
40514
  ];
40487
40515
  yield Promise.all(mountPromises);
@@ -32637,6 +32637,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32637
32637
  }
32638
32638
  };
32639
32639
  onMounted(() => {
32640
+ var _a, _b;
32640
32641
  handleResize();
32641
32642
  optionsStore.setSearchResultOptions({
32642
32643
  options: props.options
@@ -32649,6 +32650,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32649
32650
  } else {
32650
32651
  loadRecommendations();
32651
32652
  }
32653
+ if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
32654
+ (_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
32655
+ }
32652
32656
  window.addEventListener("resize", handleResize);
32653
32657
  });
32654
32658
  onBeforeUnmount(() => {
@@ -32704,6 +32708,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32704
32708
  return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
32705
32709
  });
32706
32710
  const loadLupaRecommendations = () => __async2(this, null, function* () {
32711
+ var _a, _b;
32707
32712
  recommendationsType.value = "recommendations_lupasearch";
32708
32713
  try {
32709
32714
  loading.value = true;
@@ -32721,6 +32726,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32721
32726
  yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
32722
32727
  result: { items: result2.recommended }
32723
32728
  });
32729
+ (_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
32724
32730
  } finally {
32725
32731
  loading.value = false;
32726
32732
  }
@@ -40409,17 +40415,8 @@ const mountProductList = (configuration, options, optionOverrides, fetch2 = true
40409
40415
  );
40410
40416
  productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40411
40417
  });
40412
- const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(void 0, null, function* () {
40418
+ const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(void 0, null, function* () {
40413
40419
  var _a;
40414
- if (!configuration.recommendations) {
40415
- return;
40416
- }
40417
- const resolvedSearchResultsConfiguration = JSON.parse(
40418
- configuration.searchResults
40419
- );
40420
- const resolvedConfiguration = JSON.parse(
40421
- configuration.recommendations
40422
- );
40423
40420
  const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
40424
40421
  const visible = yield waitForElementToBeVisible(
40425
40422
  resolvedConfiguration.containerSelector,
@@ -40438,6 +40435,37 @@ const mountRecommendations = (configuration, options, optionOverrides, fetch2 =
40438
40435
  );
40439
40436
  recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40440
40437
  });
40438
+ const mountAllRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(void 0, null, function* () {
40439
+ if (!configuration.recommendations) {
40440
+ return;
40441
+ }
40442
+ const resolvedSearchResultsConfiguration = JSON.parse(
40443
+ configuration.searchResults
40444
+ );
40445
+ const resolvedConfiguration = JSON.parse(configuration.recommendations);
40446
+ if (Array.isArray(resolvedConfiguration)) {
40447
+ const mountPromises = resolvedConfiguration.map(
40448
+ (recommendation) => mountRecommendations(
40449
+ resolvedSearchResultsConfiguration,
40450
+ recommendation,
40451
+ options,
40452
+ optionOverrides,
40453
+ fetch2,
40454
+ remount
40455
+ )
40456
+ );
40457
+ yield Promise.all(mountPromises);
40458
+ } else {
40459
+ yield mountRecommendations(
40460
+ resolvedSearchResultsConfiguration,
40461
+ resolvedConfiguration,
40462
+ options,
40463
+ optionOverrides,
40464
+ fetch2,
40465
+ remount
40466
+ );
40467
+ }
40468
+ });
40441
40469
  const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(void 0, null, function* () {
40442
40470
  if (!configuration.genAiChat) {
40443
40471
  return;
@@ -40479,7 +40507,7 @@ const mount = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (configurati
40479
40507
  mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
40480
40508
  mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
40481
40509
  mountProductList(configuration, options, optionOverrides, fetch2, remount),
40482
- mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
40510
+ mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
40483
40511
  mountChat(configuration, options, fetch2, remount)
40484
40512
  ];
40485
40513
  yield Promise.all(mountPromises);
@@ -32641,6 +32641,7 @@ and ensure you are accounting for this risk.
32641
32641
  }
32642
32642
  };
32643
32643
  onMounted(() => {
32644
+ var _a, _b;
32644
32645
  handleResize();
32645
32646
  optionsStore.setSearchResultOptions({
32646
32647
  options: props.options
@@ -32653,6 +32654,9 @@ and ensure you are accounting for this risk.
32653
32654
  } else {
32654
32655
  loadRecommendations();
32655
32656
  }
32657
+ if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
32658
+ (_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
32659
+ }
32656
32660
  window.addEventListener("resize", handleResize);
32657
32661
  });
32658
32662
  onBeforeUnmount(() => {
@@ -32708,6 +32712,7 @@ and ensure you are accounting for this risk.
32708
32712
  return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
32709
32713
  });
32710
32714
  const loadLupaRecommendations = () => __async2(this, null, function* () {
32715
+ var _a, _b;
32711
32716
  recommendationsType.value = "recommendations_lupasearch";
32712
32717
  try {
32713
32718
  loading.value = true;
@@ -32725,6 +32730,7 @@ and ensure you are accounting for this risk.
32725
32730
  yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
32726
32731
  result: { items: result2.recommended }
32727
32732
  });
32733
+ (_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
32728
32734
  } finally {
32729
32735
  loading.value = false;
32730
32736
  }
@@ -40413,17 +40419,8 @@ and ensure you are accounting for this risk.
40413
40419
  );
40414
40420
  productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40415
40421
  });
40416
- const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40422
+ const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40417
40423
  var _a;
40418
- if (!configuration.recommendations) {
40419
- return;
40420
- }
40421
- const resolvedSearchResultsConfiguration = JSON.parse(
40422
- configuration.searchResults
40423
- );
40424
- const resolvedConfiguration = JSON.parse(
40425
- configuration.recommendations
40426
- );
40427
40424
  const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
40428
40425
  const visible = yield waitForElementToBeVisible(
40429
40426
  resolvedConfiguration.containerSelector,
@@ -40442,6 +40439,37 @@ and ensure you are accounting for this risk.
40442
40439
  );
40443
40440
  recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
40444
40441
  });
40442
+ const mountAllRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
40443
+ if (!configuration.recommendations) {
40444
+ return;
40445
+ }
40446
+ const resolvedSearchResultsConfiguration = JSON.parse(
40447
+ configuration.searchResults
40448
+ );
40449
+ const resolvedConfiguration = JSON.parse(configuration.recommendations);
40450
+ if (Array.isArray(resolvedConfiguration)) {
40451
+ const mountPromises = resolvedConfiguration.map(
40452
+ (recommendation) => mountRecommendations(
40453
+ resolvedSearchResultsConfiguration,
40454
+ recommendation,
40455
+ options,
40456
+ optionOverrides,
40457
+ fetch2,
40458
+ remount
40459
+ )
40460
+ );
40461
+ yield Promise.all(mountPromises);
40462
+ } else {
40463
+ yield mountRecommendations(
40464
+ resolvedSearchResultsConfiguration,
40465
+ resolvedConfiguration,
40466
+ options,
40467
+ optionOverrides,
40468
+ fetch2,
40469
+ remount
40470
+ );
40471
+ }
40472
+ });
40445
40473
  const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
40446
40474
  if (!configuration.genAiChat) {
40447
40475
  return;
@@ -40483,7 +40511,7 @@ and ensure you are accounting for this risk.
40483
40511
  mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
40484
40512
  mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
40485
40513
  mountProductList(configuration, options, optionOverrides, fetch2, remount),
40486
- mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
40514
+ mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
40487
40515
  mountChat(configuration, options, fetch2, remount)
40488
40516
  ];
40489
40517
  yield Promise.all(mountPromises);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.17.9",
3
+ "version": "1.17.10",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.17.9",
23
+ "@getlupa/vue": "0.17.10",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",