@getlupa/client 1.17.8 → 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.
- package/dist/lupaSearch.iife.js +43 -14
- package/dist/lupaSearch.js +43 -14
- package/dist/lupaSearch.mjs +43 -14
- package/dist/lupaSearch.umd.js +43 -14
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -13457,7 +13457,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
13457
13457
|
var _a, _b, _c, _d;
|
|
13458
13458
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
13459
13459
|
label: (_d = (_c = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[f2.key]) != null ? _c : (_b = facets2 == null ? void 0 : facets2.find((ft) => ft.key === f2.key)) == null ? void 0 : _b.label) != null ? _d : capitalize$1(f2.key),
|
|
13460
|
-
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
13460
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations),
|
|
13461
|
+
originalValue: f2.value
|
|
13461
13462
|
});
|
|
13462
13463
|
});
|
|
13463
13464
|
};
|
|
@@ -26563,7 +26564,7 @@ and ensure you are accounting for this risk.
|
|
|
26563
26564
|
toggleTermFilter(
|
|
26564
26565
|
// TODO: Fix any
|
|
26565
26566
|
paramsStore.appendParams,
|
|
26566
|
-
{ type: "terms", value: filter2.
|
|
26567
|
+
{ type: "terms", value: filter2.originalValue, key: filter2.key },
|
|
26567
26568
|
optionStore.getQueryParamName,
|
|
26568
26569
|
currentFilters.value
|
|
26569
26570
|
);
|
|
@@ -26571,7 +26572,7 @@ and ensure you are accounting for this risk.
|
|
|
26571
26572
|
case "hierarchy":
|
|
26572
26573
|
toggleHierarchyFilter(
|
|
26573
26574
|
paramsStore.appendParams,
|
|
26574
|
-
{ type: "hierarchy", value: filter2.
|
|
26575
|
+
{ type: "hierarchy", value: filter2.originalValue, key: filter2.key },
|
|
26575
26576
|
optionStore.getQueryParamName,
|
|
26576
26577
|
currentFilters.value,
|
|
26577
26578
|
true
|
|
@@ -32638,6 +32639,7 @@ and ensure you are accounting for this risk.
|
|
|
32638
32639
|
}
|
|
32639
32640
|
};
|
|
32640
32641
|
onMounted(() => {
|
|
32642
|
+
var _a, _b;
|
|
32641
32643
|
handleResize();
|
|
32642
32644
|
optionsStore.setSearchResultOptions({
|
|
32643
32645
|
options: props.options
|
|
@@ -32650,6 +32652,9 @@ and ensure you are accounting for this risk.
|
|
|
32650
32652
|
} else {
|
|
32651
32653
|
loadRecommendations();
|
|
32652
32654
|
}
|
|
32655
|
+
if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
|
|
32656
|
+
(_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
|
|
32657
|
+
}
|
|
32653
32658
|
window.addEventListener("resize", handleResize);
|
|
32654
32659
|
});
|
|
32655
32660
|
onBeforeUnmount(() => {
|
|
@@ -32705,6 +32710,7 @@ and ensure you are accounting for this risk.
|
|
|
32705
32710
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
32706
32711
|
});
|
|
32707
32712
|
const loadLupaRecommendations = () => __async2(this, null, function* () {
|
|
32713
|
+
var _a, _b;
|
|
32708
32714
|
recommendationsType.value = "recommendations_lupasearch";
|
|
32709
32715
|
try {
|
|
32710
32716
|
loading.value = true;
|
|
@@ -32722,6 +32728,7 @@ and ensure you are accounting for this risk.
|
|
|
32722
32728
|
yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
|
|
32723
32729
|
result: { items: result2.recommended }
|
|
32724
32730
|
});
|
|
32731
|
+
(_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
|
|
32725
32732
|
} finally {
|
|
32726
32733
|
loading.value = false;
|
|
32727
32734
|
}
|
|
@@ -40410,17 +40417,8 @@ and ensure you are accounting for this risk.
|
|
|
40410
40417
|
);
|
|
40411
40418
|
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40412
40419
|
});
|
|
40413
|
-
const mountRecommendations = (
|
|
40420
|
+
const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
40414
40421
|
var _a;
|
|
40415
|
-
if (!configuration.recommendations) {
|
|
40416
|
-
return;
|
|
40417
|
-
}
|
|
40418
|
-
const resolvedSearchResultsConfiguration = JSON.parse(
|
|
40419
|
-
configuration.searchResults
|
|
40420
|
-
);
|
|
40421
|
-
const resolvedConfiguration = JSON.parse(
|
|
40422
|
-
configuration.recommendations
|
|
40423
|
-
);
|
|
40424
40422
|
const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
|
|
40425
40423
|
const visible = yield waitForElementToBeVisible(
|
|
40426
40424
|
resolvedConfiguration.containerSelector,
|
|
@@ -40439,6 +40437,37 @@ and ensure you are accounting for this risk.
|
|
|
40439
40437
|
);
|
|
40440
40438
|
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40441
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
|
+
});
|
|
40442
40471
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
40443
40472
|
if (!configuration.genAiChat) {
|
|
40444
40473
|
return;
|
|
@@ -40480,7 +40509,7 @@ and ensure you are accounting for this risk.
|
|
|
40480
40509
|
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
40481
40510
|
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
40482
40511
|
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
40483
|
-
|
|
40512
|
+
mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
40484
40513
|
mountChat(configuration, options, fetch2, remount)
|
|
40485
40514
|
];
|
|
40486
40515
|
yield Promise.all(mountPromises);
|
package/dist/lupaSearch.js
CHANGED
|
@@ -13457,7 +13457,8 @@ const getLabeledFilters = (filters, facets2, translations) => {
|
|
|
13457
13457
|
var _a, _b, _c, _d;
|
|
13458
13458
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
13459
13459
|
label: (_d = (_c = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[f2.key]) != null ? _c : (_b = facets2 == null ? void 0 : facets2.find((ft) => ft.key === f2.key)) == null ? void 0 : _b.label) != null ? _d : capitalize$1(f2.key),
|
|
13460
|
-
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
13460
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations),
|
|
13461
|
+
originalValue: f2.value
|
|
13461
13462
|
});
|
|
13462
13463
|
});
|
|
13463
13464
|
};
|
|
@@ -26563,7 +26564,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
26563
26564
|
toggleTermFilter(
|
|
26564
26565
|
// TODO: Fix any
|
|
26565
26566
|
paramsStore.appendParams,
|
|
26566
|
-
{ type: "terms", value: filter2.
|
|
26567
|
+
{ type: "terms", value: filter2.originalValue, key: filter2.key },
|
|
26567
26568
|
optionStore.getQueryParamName,
|
|
26568
26569
|
currentFilters.value
|
|
26569
26570
|
);
|
|
@@ -26571,7 +26572,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
26571
26572
|
case "hierarchy":
|
|
26572
26573
|
toggleHierarchyFilter(
|
|
26573
26574
|
paramsStore.appendParams,
|
|
26574
|
-
{ type: "hierarchy", value: filter2.
|
|
26575
|
+
{ type: "hierarchy", value: filter2.originalValue, key: filter2.key },
|
|
26575
26576
|
optionStore.getQueryParamName,
|
|
26576
26577
|
currentFilters.value,
|
|
26577
26578
|
true
|
|
@@ -32638,6 +32639,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32638
32639
|
}
|
|
32639
32640
|
};
|
|
32640
32641
|
onMounted(() => {
|
|
32642
|
+
var _a, _b;
|
|
32641
32643
|
handleResize();
|
|
32642
32644
|
optionsStore.setSearchResultOptions({
|
|
32643
32645
|
options: props.options
|
|
@@ -32650,6 +32652,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32650
32652
|
} else {
|
|
32651
32653
|
loadRecommendations();
|
|
32652
32654
|
}
|
|
32655
|
+
if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
|
|
32656
|
+
(_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
|
|
32657
|
+
}
|
|
32653
32658
|
window.addEventListener("resize", handleResize);
|
|
32654
32659
|
});
|
|
32655
32660
|
onBeforeUnmount(() => {
|
|
@@ -32705,6 +32710,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32705
32710
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
32706
32711
|
});
|
|
32707
32712
|
const loadLupaRecommendations = () => __async2(this, null, function* () {
|
|
32713
|
+
var _a, _b;
|
|
32708
32714
|
recommendationsType.value = "recommendations_lupasearch";
|
|
32709
32715
|
try {
|
|
32710
32716
|
loading.value = true;
|
|
@@ -32722,6 +32728,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32722
32728
|
yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
|
|
32723
32729
|
result: { items: result2.recommended }
|
|
32724
32730
|
});
|
|
32731
|
+
(_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
|
|
32725
32732
|
} finally {
|
|
32726
32733
|
loading.value = false;
|
|
32727
32734
|
}
|
|
@@ -40410,17 +40417,8 @@ const mountProductList = (configuration, options, optionOverrides, fetch2 = true
|
|
|
40410
40417
|
);
|
|
40411
40418
|
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40412
40419
|
});
|
|
40413
|
-
const mountRecommendations = (
|
|
40420
|
+
const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(exports, null, function* () {
|
|
40414
40421
|
var _a;
|
|
40415
|
-
if (!configuration.recommendations) {
|
|
40416
|
-
return;
|
|
40417
|
-
}
|
|
40418
|
-
const resolvedSearchResultsConfiguration = JSON.parse(
|
|
40419
|
-
configuration.searchResults
|
|
40420
|
-
);
|
|
40421
|
-
const resolvedConfiguration = JSON.parse(
|
|
40422
|
-
configuration.recommendations
|
|
40423
|
-
);
|
|
40424
40422
|
const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
|
|
40425
40423
|
const visible = yield waitForElementToBeVisible(
|
|
40426
40424
|
resolvedConfiguration.containerSelector,
|
|
@@ -40439,6 +40437,37 @@ const mountRecommendations = (configuration, options, optionOverrides, fetch2 =
|
|
|
40439
40437
|
);
|
|
40440
40438
|
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40441
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
|
+
});
|
|
40442
40471
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(exports, null, function* () {
|
|
40443
40472
|
if (!configuration.genAiChat) {
|
|
40444
40473
|
return;
|
|
@@ -40480,7 +40509,7 @@ const mount = (_0, ..._1) => __async(exports, [_0, ..._1], function* (configurat
|
|
|
40480
40509
|
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
40481
40510
|
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
40482
40511
|
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
40483
|
-
|
|
40512
|
+
mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
40484
40513
|
mountChat(configuration, options, fetch2, remount)
|
|
40485
40514
|
];
|
|
40486
40515
|
yield Promise.all(mountPromises);
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -13455,7 +13455,8 @@ const getLabeledFilters = (filters, facets2, translations) => {
|
|
|
13455
13455
|
var _a, _b, _c, _d;
|
|
13456
13456
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
13457
13457
|
label: (_d = (_c = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[f2.key]) != null ? _c : (_b = facets2 == null ? void 0 : facets2.find((ft) => ft.key === f2.key)) == null ? void 0 : _b.label) != null ? _d : capitalize$1(f2.key),
|
|
13458
|
-
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
13458
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations),
|
|
13459
|
+
originalValue: f2.value
|
|
13459
13460
|
});
|
|
13460
13461
|
});
|
|
13461
13462
|
};
|
|
@@ -26561,7 +26562,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
26561
26562
|
toggleTermFilter(
|
|
26562
26563
|
// TODO: Fix any
|
|
26563
26564
|
paramsStore.appendParams,
|
|
26564
|
-
{ type: "terms", value: filter2.
|
|
26565
|
+
{ type: "terms", value: filter2.originalValue, key: filter2.key },
|
|
26565
26566
|
optionStore.getQueryParamName,
|
|
26566
26567
|
currentFilters.value
|
|
26567
26568
|
);
|
|
@@ -26569,7 +26570,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
26569
26570
|
case "hierarchy":
|
|
26570
26571
|
toggleHierarchyFilter(
|
|
26571
26572
|
paramsStore.appendParams,
|
|
26572
|
-
{ type: "hierarchy", value: filter2.
|
|
26573
|
+
{ type: "hierarchy", value: filter2.originalValue, key: filter2.key },
|
|
26573
26574
|
optionStore.getQueryParamName,
|
|
26574
26575
|
currentFilters.value,
|
|
26575
26576
|
true
|
|
@@ -32636,6 +32637,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32636
32637
|
}
|
|
32637
32638
|
};
|
|
32638
32639
|
onMounted(() => {
|
|
32640
|
+
var _a, _b;
|
|
32639
32641
|
handleResize();
|
|
32640
32642
|
optionsStore.setSearchResultOptions({
|
|
32641
32643
|
options: props.options
|
|
@@ -32648,6 +32650,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32648
32650
|
} else {
|
|
32649
32651
|
loadRecommendations();
|
|
32650
32652
|
}
|
|
32653
|
+
if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
|
|
32654
|
+
(_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
|
|
32655
|
+
}
|
|
32651
32656
|
window.addEventListener("resize", handleResize);
|
|
32652
32657
|
});
|
|
32653
32658
|
onBeforeUnmount(() => {
|
|
@@ -32703,6 +32708,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32703
32708
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
32704
32709
|
});
|
|
32705
32710
|
const loadLupaRecommendations = () => __async2(this, null, function* () {
|
|
32711
|
+
var _a, _b;
|
|
32706
32712
|
recommendationsType.value = "recommendations_lupasearch";
|
|
32707
32713
|
try {
|
|
32708
32714
|
loading.value = true;
|
|
@@ -32720,6 +32726,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32720
32726
|
yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
|
|
32721
32727
|
result: { items: result2.recommended }
|
|
32722
32728
|
});
|
|
32729
|
+
(_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
|
|
32723
32730
|
} finally {
|
|
32724
32731
|
loading.value = false;
|
|
32725
32732
|
}
|
|
@@ -40408,17 +40415,8 @@ const mountProductList = (configuration, options, optionOverrides, fetch2 = true
|
|
|
40408
40415
|
);
|
|
40409
40416
|
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40410
40417
|
});
|
|
40411
|
-
const mountRecommendations = (
|
|
40418
|
+
const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(void 0, null, function* () {
|
|
40412
40419
|
var _a;
|
|
40413
|
-
if (!configuration.recommendations) {
|
|
40414
|
-
return;
|
|
40415
|
-
}
|
|
40416
|
-
const resolvedSearchResultsConfiguration = JSON.parse(
|
|
40417
|
-
configuration.searchResults
|
|
40418
|
-
);
|
|
40419
|
-
const resolvedConfiguration = JSON.parse(
|
|
40420
|
-
configuration.recommendations
|
|
40421
|
-
);
|
|
40422
40420
|
const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
|
|
40423
40421
|
const visible = yield waitForElementToBeVisible(
|
|
40424
40422
|
resolvedConfiguration.containerSelector,
|
|
@@ -40437,6 +40435,37 @@ const mountRecommendations = (configuration, options, optionOverrides, fetch2 =
|
|
|
40437
40435
|
);
|
|
40438
40436
|
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40439
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
|
+
});
|
|
40440
40469
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(void 0, null, function* () {
|
|
40441
40470
|
if (!configuration.genAiChat) {
|
|
40442
40471
|
return;
|
|
@@ -40478,7 +40507,7 @@ const mount = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (configurati
|
|
|
40478
40507
|
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
40479
40508
|
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
40480
40509
|
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
40481
|
-
|
|
40510
|
+
mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
40482
40511
|
mountChat(configuration, options, fetch2, remount)
|
|
40483
40512
|
];
|
|
40484
40513
|
yield Promise.all(mountPromises);
|
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -13459,7 +13459,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
13459
13459
|
var _a, _b, _c, _d;
|
|
13460
13460
|
return __spreadProps2(__spreadValues2({}, f2), {
|
|
13461
13461
|
label: (_d = (_c = (_a = translations == null ? void 0 : translations.keyTranslations) == null ? void 0 : _a[f2.key]) != null ? _c : (_b = facets2 == null ? void 0 : facets2.find((ft) => ft.key === f2.key)) == null ? void 0 : _b.label) != null ? _d : capitalize$1(f2.key),
|
|
13462
|
-
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations)
|
|
13462
|
+
value: getTranslatedFacetValue({ key: f2.key }, { title: f2.value }, translations),
|
|
13463
|
+
originalValue: f2.value
|
|
13463
13464
|
});
|
|
13464
13465
|
});
|
|
13465
13466
|
};
|
|
@@ -26565,7 +26566,7 @@ and ensure you are accounting for this risk.
|
|
|
26565
26566
|
toggleTermFilter(
|
|
26566
26567
|
// TODO: Fix any
|
|
26567
26568
|
paramsStore.appendParams,
|
|
26568
|
-
{ type: "terms", value: filter2.
|
|
26569
|
+
{ type: "terms", value: filter2.originalValue, key: filter2.key },
|
|
26569
26570
|
optionStore.getQueryParamName,
|
|
26570
26571
|
currentFilters.value
|
|
26571
26572
|
);
|
|
@@ -26573,7 +26574,7 @@ and ensure you are accounting for this risk.
|
|
|
26573
26574
|
case "hierarchy":
|
|
26574
26575
|
toggleHierarchyFilter(
|
|
26575
26576
|
paramsStore.appendParams,
|
|
26576
|
-
{ type: "hierarchy", value: filter2.
|
|
26577
|
+
{ type: "hierarchy", value: filter2.originalValue, key: filter2.key },
|
|
26577
26578
|
optionStore.getQueryParamName,
|
|
26578
26579
|
currentFilters.value,
|
|
26579
26580
|
true
|
|
@@ -32640,6 +32641,7 @@ and ensure you are accounting for this risk.
|
|
|
32640
32641
|
}
|
|
32641
32642
|
};
|
|
32642
32643
|
onMounted(() => {
|
|
32644
|
+
var _a, _b;
|
|
32643
32645
|
handleResize();
|
|
32644
32646
|
optionsStore.setSearchResultOptions({
|
|
32645
32647
|
options: props.options
|
|
@@ -32652,6 +32654,9 @@ and ensure you are accounting for this risk.
|
|
|
32652
32654
|
} else {
|
|
32653
32655
|
loadRecommendations();
|
|
32654
32656
|
}
|
|
32657
|
+
if ((_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onMounted) {
|
|
32658
|
+
(_b = props.options.recommendationCallbacks) == null ? void 0 : _b.onMounted();
|
|
32659
|
+
}
|
|
32655
32660
|
window.addEventListener("resize", handleResize);
|
|
32656
32661
|
});
|
|
32657
32662
|
onBeforeUnmount(() => {
|
|
@@ -32707,6 +32712,7 @@ and ensure you are accounting for this risk.
|
|
|
32707
32712
|
return typeof props.options.itemId === "string" || typeof props.options.itemId === "number" || Array.isArray(props.options.itemId) ? props.options.itemId : extractValue(props.options.itemId);
|
|
32708
32713
|
});
|
|
32709
32714
|
const loadLupaRecommendations = () => __async2(this, null, function* () {
|
|
32715
|
+
var _a, _b;
|
|
32710
32716
|
recommendationsType.value = "recommendations_lupasearch";
|
|
32711
32717
|
try {
|
|
32712
32718
|
loading.value = true;
|
|
@@ -32724,6 +32730,7 @@ and ensure you are accounting for this risk.
|
|
|
32724
32730
|
yield dynamicDataStore.enhanceSearchResultsWithDynamicData({
|
|
32725
32731
|
result: { items: result2.recommended }
|
|
32726
32732
|
});
|
|
32733
|
+
(_b = (_a = props.options.recommendationCallbacks) == null ? void 0 : _a.onRecommenderResults) == null ? void 0 : _b.call(_a, result2.recommended);
|
|
32727
32734
|
} finally {
|
|
32728
32735
|
loading.value = false;
|
|
32729
32736
|
}
|
|
@@ -40412,17 +40419,8 @@ and ensure you are accounting for this risk.
|
|
|
40412
40419
|
);
|
|
40413
40420
|
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40414
40421
|
});
|
|
40415
|
-
const mountRecommendations = (
|
|
40422
|
+
const mountRecommendations = (resolvedSearchResultsConfiguration, resolvedConfiguration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
40416
40423
|
var _a;
|
|
40417
|
-
if (!configuration.recommendations) {
|
|
40418
|
-
return;
|
|
40419
|
-
}
|
|
40420
|
-
const resolvedSearchResultsConfiguration = JSON.parse(
|
|
40421
|
-
configuration.searchResults
|
|
40422
|
-
);
|
|
40423
|
-
const resolvedConfiguration = JSON.parse(
|
|
40424
|
-
configuration.recommendations
|
|
40425
|
-
);
|
|
40426
40424
|
const allowedMountUrls = resolvedConfiguration.allowedMountUrls;
|
|
40427
40425
|
const visible = yield waitForElementToBeVisible(
|
|
40428
40426
|
resolvedConfiguration.containerSelector,
|
|
@@ -40441,6 +40439,37 @@ and ensure you are accounting for this risk.
|
|
|
40441
40439
|
);
|
|
40442
40440
|
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
40443
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
|
+
});
|
|
40444
40473
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
40445
40474
|
if (!configuration.genAiChat) {
|
|
40446
40475
|
return;
|
|
@@ -40482,7 +40511,7 @@ and ensure you are accounting for this risk.
|
|
|
40482
40511
|
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
40483
40512
|
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
40484
40513
|
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
40485
|
-
|
|
40514
|
+
mountAllRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
40486
40515
|
mountChat(configuration, options, fetch2, remount)
|
|
40487
40516
|
];
|
|
40488
40517
|
yield Promise.all(mountPromises);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.17.
|
|
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.
|
|
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",
|