vviinn-widgets 2.216.2 → 2.217.1
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/cjs/{index-BM7VfZ_J.js → index-KB8ruJQe.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/resultsPageUrl-Cki7CFQz.js +45 -0
- package/dist/cjs/{search.store-DX5IRC4l.js → search.store-C82VhK1A.js} +13 -7
- package/dist/cjs/vviinn-button_6.cjs.entry.js +4 -4
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +23 -21
- package/dist/cjs/vviinn-carousel_10.cjs.entry.js +15 -11
- package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-text-search.cjs.entry.js +21 -15
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +3 -5
- package/dist/collection/components/vviinn-results/stories/ResultsTemplate.js +3 -1
- package/dist/collection/components/vviinn-results/vviinn-results.js +24 -5
- package/dist/collection/components/vviinn-shop-the-look/vviinn-shop-the-look.js +1 -1
- package/dist/collection/components/vviinn-suggestions/render-helpers.js +4 -2
- package/dist/collection/components/vviinn-text-search/helpers/handleSuggestionsKeyDown.js +1 -1
- package/dist/collection/components/vviinn-text-search/helpers/renderSuggestions.js +5 -6
- package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +34 -8
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +4 -4
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.js +10 -4
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +23 -4
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +33 -14
- package/dist/collection/helpers/url/resultsPageUrl.js +24 -7
- package/dist/collection/helpers/url/resultsPageUrl.test.js +63 -1
- package/dist/collection/store/search.store.js +13 -6
- package/dist/esm/{index-CmCUlnFh.js → index-CMX-QEzm.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/resultsPageUrl-DbOxfJSz.js +39 -0
- package/dist/esm/{search.store-B0ZhYtWV.js → search.store-Bof_HKxz.js} +13 -7
- package/dist/esm/vviinn-button_6.entry.js +4 -4
- package/dist/esm/vviinn-camera_12.entry.js +23 -21
- package/dist/esm/vviinn-carousel_10.entry.js +15 -11
- package/dist/esm/vviinn-shop-the-look.entry.js +2 -2
- package/dist/esm/vviinn-text-search.entry.js +21 -15
- package/dist/esm/vviinn-vps-button.entry.js +3 -3
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/components/vviinn-filters/helpers/syncRequestFilters.d.ts +3 -1
- package/dist/types/components/vviinn-results/vviinn-results.d.ts +2 -0
- package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +2 -0
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +3 -1
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +3 -1
- package/dist/types/components.d.ts +36 -4
- package/dist/types/helpers/url/resultsPageUrl.d.ts +9 -3
- package/dist/types/store/search.store.d.ts +8 -4
- package/{www/build/p-a3829a7f.entry.js → dist/vviinn-widgets/p-5ee404fb.entry.js} +1 -1
- package/{www/build/p-c64a4923.entry.js → dist/vviinn-widgets/p-756d201c.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-1e7d7fc8.entry.js → p-97099d69.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-DIMfQtwJ.js → p-DM6fTGU7.js} +1 -1
- package/dist/vviinn-widgets/p-DbOxfJSz.js +1 -0
- package/dist/vviinn-widgets/p-dcaf6f35.entry.js +1 -0
- package/dist/vviinn-widgets/p-e4c19fc9.entry.js +1 -0
- package/dist/vviinn-widgets/{p-B--7xBdV.js → p-elxMiKkD.js} +1 -1
- package/dist/vviinn-widgets/{p-df67781e.entry.js → p-fbbf34ba.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/{dist/vviinn-widgets/p-a3829a7f.entry.js → www/build/p-5ee404fb.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-c64a4923.entry.js → www/build/p-756d201c.entry.js} +1 -1
- package/www/build/{p-1e7d7fc8.entry.js → p-97099d69.entry.js} +1 -1
- package/www/build/{p-DIMfQtwJ.js → p-DM6fTGU7.js} +1 -1
- package/www/build/p-DbOxfJSz.js +1 -0
- package/www/build/p-dcaf6f35.entry.js +1 -0
- package/www/build/p-e4c19fc9.entry.js +1 -0
- package/www/build/{p-B--7xBdV.js → p-elxMiKkD.js} +1 -1
- package/www/build/{p-df67781e.entry.js → p-fbbf34ba.entry.js} +1 -1
- package/www/build/{p-64d1f5a3.js → p-fff4758a.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/resultsPageUrl-BMlvrFCW.js +0 -27
- package/dist/esm/resultsPageUrl-niHq9WT6.js +0 -22
- package/dist/vviinn-widgets/p-137944e9.entry.js +0 -1
- package/dist/vviinn-widgets/p-2b96382d.entry.js +0 -1
- package/dist/vviinn-widgets/p-niHq9WT6.js +0 -1
- package/www/build/p-137944e9.entry.js +0 -1
- package/www/build/p-2b96382d.entry.js +0 -1
- package/www/build/p-niHq9WT6.js +0 -1
|
@@ -8591,7 +8591,7 @@ const encodeToBase64UTF8 = (str) => {
|
|
|
8591
8591
|
return btoa(String.fromCharCode.apply(null, utf8Array));
|
|
8592
8592
|
};
|
|
8593
8593
|
|
|
8594
|
-
const version = "2.
|
|
8594
|
+
const version = "2.217.1";
|
|
8595
8595
|
|
|
8596
8596
|
const appStateGlobalDefaults = {
|
|
8597
8597
|
excluded: null,
|
|
@@ -8624,10 +8624,15 @@ const receivedDataDefaults = {
|
|
|
8624
8624
|
autoSuggestCompletions: [],
|
|
8625
8625
|
};
|
|
8626
8626
|
const storeDefaults = Object.assign(Object.assign(Object.assign({}, appStateGlobalDefaults), appStateDefaults), receivedDataDefaults);
|
|
8627
|
-
const
|
|
8628
|
-
const
|
|
8627
|
+
const widgetStore = createStore(storeDefaults);
|
|
8628
|
+
const searchState = widgetStore.state;
|
|
8629
|
+
const onChangeWidgetState = widgetStore.onChange;
|
|
8630
|
+
const componentsStore = createStore(storeDefaults);
|
|
8631
|
+
const componentsState = componentsStore.state;
|
|
8632
|
+
const onChangeComponentsState = componentsStore.onChange;
|
|
8629
8633
|
const shopTheLookDefaults = Object.assign({}, storeDefaults);
|
|
8630
|
-
const
|
|
8634
|
+
const shopTheLookStore = createStore(shopTheLookDefaults);
|
|
8635
|
+
const shopTheLookState = shopTheLookStore.state;
|
|
8631
8636
|
const useStore = (store) => {
|
|
8632
8637
|
switch (store) {
|
|
8633
8638
|
case "widget":
|
|
@@ -8865,12 +8870,13 @@ const makeAutoSuggestRequest = async (store, query, token, apiPath) => {
|
|
|
8865
8870
|
};
|
|
8866
8871
|
return pipe(getTokenWithBody(token, body), setBodyAndHeaders, fromEither, chain$1((request) => autoSuggestClient(request, apiPath)), map((response) => {
|
|
8867
8872
|
var _a, _b;
|
|
8868
|
-
if (response.data.query.trim().toLowerCase() !==
|
|
8873
|
+
if (response.data.query.trim().toLowerCase() !==
|
|
8874
|
+
((_a = state.textSearchQuery) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()))
|
|
8869
8875
|
return response;
|
|
8870
8876
|
const completions = (_b = response.data.completions) !== null && _b !== void 0 ? _b : [];
|
|
8871
8877
|
state.autoSuggestCompletions = completions;
|
|
8872
|
-
const matchingCompletion = completions.find((completion) => completion.suggestion.trim().toLowerCase() ===
|
|
8873
|
-
(completion === null || completion === void 0 ? void 0 : completion.url));
|
|
8878
|
+
const matchingCompletion = completions.find((completion) => completion.suggestion.trim().toLowerCase() ===
|
|
8879
|
+
query.trim().toLowerCase() && (completion === null || completion === void 0 ? void 0 : completion.url));
|
|
8874
8880
|
if (matchingCompletion === null || matchingCompletion === void 0 ? void 0 : matchingCompletion.url) {
|
|
8875
8881
|
state.redirect = { url: matchingCompletion.url, query };
|
|
8876
8882
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, H as Host, c as createEvent, g as getElement, F as Fragment } from './index-RkvPN2Rk.js';
|
|
2
2
|
import { i as instance } from './store-BJxQCbNV.js';
|
|
3
|
-
import { l as getAcceptableFileFormatsForDisplay, h as campaignTypeNames, j as addIfNotEmpty, n as searchState, u as useSearchStore, v as version } from './search.store-
|
|
3
|
+
import { l as getAcceptableFileFormatsForDisplay, h as campaignTypeNames, j as addIfNotEmpty, n as searchState, u as useSearchStore, v as version } from './search.store-Bof_HKxz.js';
|
|
4
4
|
import { s as slotChangeListener, a as addEventListenersWithSignal } from './index-OsoUj2Au.js';
|
|
5
5
|
import { S as SecondaryActionIcon } from './SecondaryActionIcon-FWFzrhba.js';
|
|
6
6
|
import { m as modalParts, c as carouselParts, p as productCardParts, r as recommendationsParts, i as initializeLocale } from './index-BtnjaTty.js';
|
|
@@ -344,17 +344,17 @@ const RecommendationsSidebar = class {
|
|
|
344
344
|
}
|
|
345
345
|
render() {
|
|
346
346
|
var _a;
|
|
347
|
-
return (h(Host, { key: '
|
|
347
|
+
return (h(Host, { key: '1da9acded2d47540c3a92ef4bfe6c1dfad7ba39b', class: this.getClassMap(), style: { display: this.hidden ? "none" : undefined }, exportparts: `body, close-sidebar, ${carouselParts}, ${productCardParts}, ${recommendationsParts}` }, h("div", { key: 'df6276e5001060d9a5b6507b351997eb8f3aab22', class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e), role: this.showInModal ? "dialog" : "region", "aria-modal": this.showInModal ? "true" : undefined, "aria-label": instance.t("a11y.recommendations") }, h("div", { key: '81f8cb97127186a5ae51d69e6c9d815791f7c7c3', class: {
|
|
348
348
|
"sidebar-header": true,
|
|
349
349
|
"contains-source-img": this.isSourceImageValid(),
|
|
350
|
-
}, part: "sidebar-header" }, this.mode !== "set" && (h(Fragment, { key: '
|
|
350
|
+
}, part: "sidebar-header" }, this.mode !== "set" && (h(Fragment, { key: '65f2c04676e8e75895030d117483a55cfe8431cd' }, this.renderSourceImage(), ((_a = this.sidebarTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0 && (h("span", { key: '1a5949d7ef73e7d8fd54da8852b9f6ac3fb24b67', class: "title", part: "recommendations-title" }, this.sidebarTitle || instance.t("discoveryWidgetTitle"))), !!this.sidebarSubtitle && (h("span", { key: 'b373c3999803fc4b53a40f0f31fb17488dfa7e31', class: "subtitle", part: "recommendations-subtitle" }, this.sidebarSubtitle)))), h("button", { key: 'a11032fd9b99cfecb9be506967714620e100cfd7', class: "close-sidebar", onClick: () => {
|
|
351
351
|
this.sidebarState = "closed";
|
|
352
352
|
}, onKeyDown: (event) => {
|
|
353
353
|
if (event.key === "Enter" || event.key === " ") {
|
|
354
354
|
event.preventDefault();
|
|
355
355
|
this.sidebarState = "closed";
|
|
356
356
|
}
|
|
357
|
-
}, part: "close-sidebar", "aria-label": instance.t("a11y.closeButton") }, h(CrossIcon, { key: '
|
|
357
|
+
}, part: "close-sidebar", "aria-label": instance.t("a11y.closeButton") }, h(CrossIcon, { key: '94a609c658ca36192380ee232d956cfc9e77da15' }))), h("div", { key: '4f62b4e918a084cb7b02141df2bba3d612c382cd', class: "sidebar-content", part: "sidebar-content" }, h("vviinn-vpr-widget", { key: '2ca2caa3da08a59eb7e8d724369f2a8343fe1119', token: this.token, currencySign: this.currencySign, pricePrefix: this.pricePrefix, apiPath: this.apiPath, locale: this.locale, numberLocale: this.numberLocale, productId: this.productId, exportparts: `${carouselParts}, ${productCardParts}, ${recommendationsParts}`, imageWidth: this.imageWidth, showMultipleImages: this.showMultipleImages, setItemsAmount: this.setItemsAmount, blockTitle: this.mode !== "set" ? "" : this.sidebarTitle, blockSubtitle: this.mode === "set" ? this.sidebarSubtitle : undefined, mode: this.mode, "campaign-type": this.campaignType, useCarousel: this.useCarousel, onVviinnRecommendationsLoaded: () => {
|
|
358
358
|
this.hidden = false;
|
|
359
359
|
this.sidebarState = "open";
|
|
360
360
|
}, showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, buttonElementId: this.buttonElementId, noResultText: this.noResultText, noResultShow: this.noResultShow, gridArrowsDynamic: this.gridArrowsDynamic, showingInButton: this.showingInButton, excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, closed: this.sidebarState === "closed", opened: this.sidebarState === "open", addToBasketShow: this.addToBasketShow, cssUrl: this.cssUrl, showFilters: this.showFilters, setModeDiscounts: this.setModeDiscounts, updateButtonLocation: this.updateButtonLocation, addPriceContainer: this.addPriceContainer, favoriteShow: this.favoriteShow, isAppended: this.isAppended, showInWidget: this.showInWidget, recommendationsLoading: this.recommendationsLoading, setRecommendationsLoading: this.setRecommendationsLoading, imageResolutionWidth: this.imageResolutionWidth, uiSessionId: this.uiSessionId })))));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-RkvPN2Rk.js';
|
|
2
2
|
import { _ as _functionExports, E as EitherExports, f as fold, b as fromImage, a as divideOnSized, e as isLeft, m as match, O as OptionExports } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { w as toFile, c as makeUploadFileRequest, x as getImageSizes, v as version, h as campaignTypeNames, j as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, y as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, z as resetStore, k as makeTextSearchRequest, A as makeProductListingPageRequest, B as checkDeviceType, p as parseStringToExcluded } from './search.store-
|
|
3
|
+
import { w as toFile, c as makeUploadFileRequest, x as getImageSizes, v as version, h as campaignTypeNames, j as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, y as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, z as resetStore, k as makeTextSearchRequest, A as makeProductListingPageRequest, B as checkDeviceType, p as parseStringToExcluded } from './search.store-Bof_HKxz.js';
|
|
4
4
|
import { s as slotChangeListener, a as addEventListenersWithSignal, p as productCardSlotNames, v as vprIconSlotName, f as findSlotElements, g as getSlotNames, b as setElementInteractivity, S as SlotSkeleton } from './index-OsoUj2Au.js';
|
|
5
|
-
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-
|
|
5
|
+
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-CMX-QEzm.js';
|
|
6
6
|
import { i as instance, t as trackEvent, a as isTrackingEnabled, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
7
7
|
import { M as MIN_SEARCH_AREA_SIZE, S as SUPPORTED_ASPECT_RATIO, a as MIN_IMAGE_SIDE_FOR_CROPPER, C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal, D as DEFAULT_IMAGE_SIZE } from './cropperUtils-CkB6bG3L.js';
|
|
8
8
|
import { r as renderExternalCSS, o as openProductLink } from './openProductLink-CJ9Wo3Ye.js';
|
|
9
9
|
import { i as initializeLocale, d as productCardsGridPart, p as productCardParts, l as listCardParts, e as contentCardParts, f as selectedFiltersParts, g as suggestionsParts, h as filtersParts, j as extendedFiltersParts, m as modalParts, b as searchBarParts, k as searchWidgetFilterParts, n as searchWidgetButtonParts } from './index-BtnjaTty.js';
|
|
10
|
-
import { i as isOnResultsPage,
|
|
10
|
+
import { i as isOnResultsPage, a as parseResultsPageParams, p as parseResultsPageParamNames, c as buildImageSearchRedirectUrl } from './resultsPageUrl-DbOxfJSz.js';
|
|
11
11
|
import { R as RESULTS_WIDGET_IMAGE_RESOLUTION_WIDTH, b as SCROLL_TO_DISCOVERY_DELAY, S as SEARCH_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-rqiiCPBX.js';
|
|
12
12
|
import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-DOMXsA9W.js';
|
|
13
13
|
|
|
@@ -832,7 +832,7 @@ const VviinnResults = class {
|
|
|
832
832
|
],
|
|
833
833
|
], signal);
|
|
834
834
|
const urlParams = this.resultsPageUrl && isOnResultsPage(this.resultsPageUrl)
|
|
835
|
-
? parseResultsPageParams()
|
|
835
|
+
? parseResultsPageParams(window.location.search, parseResultsPageParamNames(this.resultsPageParams))
|
|
836
836
|
: {};
|
|
837
837
|
const effectiveSearchId = this.searchId || urlParams.searchId;
|
|
838
838
|
const effectiveTextSearchQuery = this.textSearchQuery || urlParams.query;
|
|
@@ -979,13 +979,13 @@ const VviinnResults = class {
|
|
|
979
979
|
render() {
|
|
980
980
|
var _a;
|
|
981
981
|
const resultsLength = this.getResults().length;
|
|
982
|
-
return (h(Host, { key: '
|
|
982
|
+
return (h(Host, { key: '2ba9c019be5e6d2a70f299ebd4827baefa671cad', id: "results-block", class: {
|
|
983
983
|
"show-in-widget": this.showInWidget,
|
|
984
984
|
"matching-discovery": this.oneClickDiscoveryMode === "append-slider",
|
|
985
|
-
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: '
|
|
985
|
+
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: '8521abb79a86723af8f18cd66558f8cd56d0d725', class: "nothing-found" }, this.getCurrentErrorType() && (h("vviinn-error", { key: '030f376feaa161d598dc60e2deae0bcde368759a', errorType: this.getCurrentErrorType(), handler: this.resetWidgetState, hasBackground: this.showInWidget, searchType: this.state.searchType }))), h("div", { key: '82a242f74f6a5481b40ec26a977d11465a5c58da', class: {
|
|
986
986
|
hidden: this.showAspectRatioError || resultsLength === 0,
|
|
987
987
|
products: true,
|
|
988
|
-
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: '
|
|
988
|
+
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: 'ed28c78ddfa0826f8ad8a70639e83386d9297c7c', id: "one-click-discovery-append", style: {
|
|
989
989
|
order: ((_a = this.oneClickDiscoveryAppendIndex) !== null && _a !== void 0 ? _a : resultsLength).toString(),
|
|
990
990
|
} }))));
|
|
991
991
|
}
|
|
@@ -1463,7 +1463,9 @@ const splitContentByLocators = (content, annotations) => {
|
|
|
1463
1463
|
};
|
|
1464
1464
|
const getAnnotationFilterKeys = (annotation) => {
|
|
1465
1465
|
var _a, _b, _c;
|
|
1466
|
-
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => "values" in filter
|
|
1466
|
+
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => "values" in filter
|
|
1467
|
+
? filter.values.map((v) => `${filter.column}:${v.value}`)
|
|
1468
|
+
: [])) !== null && _c !== void 0 ? _c : [];
|
|
1467
1469
|
};
|
|
1468
1470
|
const getAnnotationDeeplink = (annotation) => {
|
|
1469
1471
|
for (const item of annotation.data.items) {
|
|
@@ -1478,7 +1480,7 @@ const renderAnnotatedContent = (content, annotations, onAnnotationClick, applied
|
|
|
1478
1480
|
return (h("li", { class: "suggestion-item", part: "suggestion-item", key: key }, segments.map((segment, i) => {
|
|
1479
1481
|
const segmentKey = `${key}-${i}`;
|
|
1480
1482
|
if (segment.type === "text") {
|
|
1481
|
-
return h("span", { key: segmentKey, innerHTML: g.parseInline(segment.content) });
|
|
1483
|
+
return (h("span", { key: segmentKey, innerHTML: g.parseInline(segment.content) }));
|
|
1482
1484
|
}
|
|
1483
1485
|
const deeplink = getAnnotationDeeplink(segment.annotation);
|
|
1484
1486
|
if (deeplink) {
|
|
@@ -1768,7 +1770,7 @@ const VviinnVpsWidget = class {
|
|
|
1768
1770
|
this.showIntervalInputs = false;
|
|
1769
1771
|
/** URL to external CSS file for custom styling */
|
|
1770
1772
|
this.cssUrl = null;
|
|
1771
|
-
/**
|
|
1773
|
+
/** Render results in modal. Set false to redirect or show results on the page. */
|
|
1772
1774
|
this.showResultsInModal = true;
|
|
1773
1775
|
/** Set true when showing the widget in button */
|
|
1774
1776
|
/** @internal */
|
|
@@ -1954,7 +1956,7 @@ const VviinnVpsWidget = class {
|
|
|
1954
1956
|
return this.slidePosition === 1;
|
|
1955
1957
|
}
|
|
1956
1958
|
handleImageSearchRedirect(searchId) {
|
|
1957
|
-
const url = buildImageSearchRedirectUrl(this.resultsPageUrl, searchId);
|
|
1959
|
+
const url = buildImageSearchRedirectUrl(this.resultsPageUrl, searchId, parseResultsPageParamNames(this.resultsPageParams).searchId);
|
|
1958
1960
|
const redirectData = Object.assign(Object.assign({}, this.getBasicEventData()), { url, source: "visual-search", searchId });
|
|
1959
1961
|
const event = this.vviinnRedirect.emit(redirectData);
|
|
1960
1962
|
if (!event.defaultPrevented) {
|
|
@@ -2136,31 +2138,31 @@ const VviinnVpsWidget = class {
|
|
|
2136
2138
|
}
|
|
2137
2139
|
render() {
|
|
2138
2140
|
var _a, _b, _c;
|
|
2139
|
-
return (h(Host, { key: '
|
|
2141
|
+
return (h(Host, { key: '01b4f049543923fb986fc0100118312b076215a1', exportparts: `${modalParts}, ${productCardParts}, ${searchBarParts}, ${searchWidgetFilterParts}, ${searchWidgetButtonParts}, ${productCardsGridPart}, ${suggestionsParts}` }, renderExternalCSS(this.cssUrl), !this.showingInButton && SlotSkeleton("search"), h("vviinn-overlayed-modal", { key: 'c6f39d506801e5b19aedd62d24d7c80ecddf6c0a', class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState, onVviinnWidgetClose: ({ detail }) => {
|
|
2140
2142
|
if (detail.campaignTypeId !== "VPR")
|
|
2141
2143
|
this.handleModalClose();
|
|
2142
2144
|
}, buttonElementId: (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.widgetElementId, widgetVersion: version, hideBackButton: this.mode === "upload" ||
|
|
2143
|
-
(!this.isCameraEnabled && this.isOnboardingSlide()) }, h("vviinn-slider", { key: '
|
|
2145
|
+
(!this.isCameraEnabled && this.isOnboardingSlide()) }, h("vviinn-slider", { key: '07b98067fda24f46e1b34ea8a27a107b0e7cc925', position: this.slidePosition }, h("vviinn-slide", { key: '373b868d121f435fae72799e1d5aed63719bc44a', class: {
|
|
2144
2146
|
"start-page": true,
|
|
2145
2147
|
"camera-enabled": this.isCameraEnabled,
|
|
2146
|
-
} }, h("vviinn-camera", { key: '
|
|
2148
|
+
} }, h("vviinn-camera", { key: '57871a635ec0c3f8fe92e0d983b154f659afff01', token: this.token, onVviinnImageUploadFinished: ({ detail }) => this.handleVviinnImageUploadFinished(detail), onVviinnImageUploadStarted: () => {
|
|
2147
2149
|
this.handleVviinnImageUpload("startCamera");
|
|
2148
|
-
}, apiPath: this.apiPath, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), h("div", { key: '
|
|
2150
|
+
}, apiPath: this.apiPath, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), h("div", { key: '5999da46ea9baeac815578fb2112af5d9248219a', class: {
|
|
2149
2151
|
error: this.haveErrors(),
|
|
2150
|
-
}, id: "start-page_block" }, h("div", { key: '
|
|
2151
|
-
this.state.searchStatus === "error") && (h("div", { key: '
|
|
2152
|
+
}, id: "start-page_block" }, h("div", { key: '63c7fbcbffa30eabe9bf6e1cb58b5cd55cd01bd0', class: "start-page_main-content" }, (this.wrongImageFormat ||
|
|
2153
|
+
this.state.searchStatus === "error") && (h("div", { key: '5aa9c7d3d7ff2cb5d3041f680b18a0356d60f61e', class: "start-page_errors-block" }, this.getCurrentErrorType() && (h("vviinn-error", { key: '686db18d4492c958f5236b0b2e76f2d39e9a08d4', errorType: this.getCurrentErrorType(), handler: this.resetState, hasBackground: true, searchType: this.state.searchType })))), !this.haveErrors() && (h(Fragment, { key: 'f0bbc9a11f5595b87b70add2f18169d0e985e4d6' }, h("vviinn-teaser", { key: '41e84754db32d28f8cfe0666c10ffadd96805e61' }), h("div", { key: '575c73b2ddbcb508af636f381b819c2b112d2b06', class: "buttons-group" }, this.renderButtons()), this.textSearchShow && !this.isResultSlide() && (h("vviinn-text-search", { key: 'ccb9709e6a796c29668954ea6988d5111c8ac5e5', token: this.token, apiPath: this.apiPath, locale: this.locale, showInWidget: this.showInWidget, showOnFirstScreen: true, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), resultsPageUrl: this.resultsPageUrl, autoSuggestShow: this.autoSuggestShow, "save-image-mode": "never" }))))), h("vviinn-privacy-badge", { key: '47e8a7b3bec65c2758ecaf65f0cc8d9af6ea188d', privacyBadgeText: instance.t("privacyBadgeText", {
|
|
2152
2154
|
interpolation: { escapeValue: false },
|
|
2153
|
-
}), class: { invisible: this.haveErrors() } }))), h("vviinn-slide", { key: '
|
|
2155
|
+
}), class: { invisible: this.haveErrors() } }))), h("vviinn-slide", { key: '90b4dbc609191dc60a723d8c1c76eac581ef0ff7', class: {
|
|
2154
2156
|
"results-page": true,
|
|
2155
2157
|
active: this.isResultSlide(),
|
|
2156
|
-
} }, this.isResultSlide() && (h("div", { key: '
|
|
2158
|
+
} }, this.isResultSlide() && (h("div", { key: '0b4410683c1d777267f6277986675f132d6fb389', class: "source-wrapper" }, this.isTextSearch() && (h("vviinn-text-search", { key: '2084be2aa14b17922a1cfa046df7c646935e0d13', token: this.token, showInWidget: this.showInWidget, apiPath: this.apiPath, locale: this.locale, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), resultsPageUrl: this.resultsPageUrl, autoSuggestShow: this.autoSuggestShow, "save-image-mode": "never" })), !this.isTextSearch() && (h("vviinn-cropper", { key: 'de6347c097358595f025e745911d40c166d6c7b1', token: this.token, basicEventData: this.getBasicEventData(), showAspectRatioError: this.showAspectRatioError, apiPath: this.apiPath, showInWidget: this.showInWidget, "save-image-mode": "never" })), h("vviinn-suggestions", { key: '33be481c722028ab35af64b68447ba99c9e3ceb8', showInWidget: this.showInWidget, token: this.token, apiPath: this.apiPath, locale: this.locale }), h("vviinn-selected-filters", { key: '868951037f06f2beb6f8b0f497f15797e166db34', locale: this.locale, currencySign: this.currencySign, showInWidget: this.showInWidget, exportparts: filtersParts }), ((_b = this.state.dynamicFilters) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("div", { key: '464ce9e0159ac8b5da45122c55953e80d940383b', class: {
|
|
2157
2159
|
"filters-wrapper": true,
|
|
2158
2160
|
hidden: this.showAspectRatioError,
|
|
2159
|
-
} }, h("vviinn-filters", { key: '
|
|
2161
|
+
} }, h("vviinn-filters", { key: 'd9549d22f88bb270d4e3221faf545caa6a2bcb12', showInWidget: this.showInWidget, showIntervalInputs: this.showIntervalInputs }), h("vviinn-extended-filters", { key: 'c1c78c38dd71beab583fa7f68d294d23b2d59c44', mode: "preview", showHeader: false, showInWidget: this.showInWidget, locale: this.locale, currencySign: this.currencySign, showIntervalInputs: this.showIntervalInputs }), h("vviinn-extended-filters-button", { key: 'ade4464be96dccd368c4f0e580bb1fec968dbd01', class: {
|
|
2160
2162
|
"extended-filters-button": true,
|
|
2161
2163
|
"has-primary-filters": this.state.dynamicFilters.filter((f) => f.isPrimary)
|
|
2162
2164
|
.length > 0,
|
|
2163
|
-
}, showInWidget: this.showInWidget }))))), this.isResultSlide() && (h(Fragment, { key: '
|
|
2165
|
+
}, showInWidget: this.showInWidget }))))), this.isResultSlide() && (h(Fragment, { key: '36a3a9853b096df62fb977a5799cc7c863f93ca5' }, h("vviinn-results", { key: 'd38adf77a1e2988233991fbc7d2d9beedc7e0375', token: this.token, locale: this.locale, numberLocale: this.numberLocale, pricePrefix: this.pricePrefix, "currency-sign": this.currencySign, apiPath: this.apiPath, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, uiSessionId: this.uiSessionId, widgetElementId: (_c = this.buttonElementId) !== null && _c !== void 0 ? _c : this.widgetElementId, showInWidget: this.showInWidget, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, showMultipleImages: this.showMultipleImages, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, addToBasketShow: this.addToBasketShow, favoriteShow: this.favoriteShow, showAspectRatioError: this.showAspectRatioError, resetWidgetState: this.resetState, replaceSlotsContentInWidget: this.replaceSlotsContent.bind(this), replaceSlotsContentInButton: this.replaceSlotsContentInButton, addPriceContainer: this.addPriceContainer, oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, parentSlots: [...this.parentSlots, ...this.slots], scrollableModalBody: this.modalBody }))))), h("vviinn-extended-filters", { key: 'e40f196666c92c3813ca883732d6e155b7e181d7', class: "modal-extended-filters", mode: "modal", exportparts: extendedFiltersParts, showInWidget: this.showInWidget, locale: this.locale, currencySign: this.currencySign, showIntervalInputs: this.showIntervalInputs }))));
|
|
2164
2166
|
}
|
|
2165
2167
|
get el() { return getElement(this); }
|
|
2166
2168
|
static get watchers() { return {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, f as forceUpdate, F as Fragment, H as Host, g as getElement } from './index-RkvPN2Rk.js';
|
|
2
|
-
import { h as campaignTypeNames, j as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, C as isMobile, D as fromString, E as fold, v as version } from './search.store-
|
|
2
|
+
import { h as campaignTypeNames, j as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, C as isMobile, D as fromString, E as fold, v as version } from './search.store-Bof_HKxz.js';
|
|
3
3
|
import { X as has, Y as tuple, _ as _functionExports, g as requireSemigroup, O as OptionExports, v as pipe$1, N as chainW, Z as makeRequest, L as fromEither, $ as resolveApiPath, a0 as createInitPostRequest, a1 as Apply, a2 as TaskEitherExports, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
4
4
|
import { i as instance, d as defaultConfig, t as trackEvent, a as isTrackingEnabled } from './store-BJxQCbNV.js';
|
|
5
|
-
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, j as announceToScreenReader, m as getIntervalLabel, w as isPriceFilter, k as isSubFilterActive, l as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-
|
|
5
|
+
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, j as announceToScreenReader, m as getIntervalLabel, w as isPriceFilter, k as isSubFilterActive, l as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-CMX-QEzm.js';
|
|
6
6
|
import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH, c as PRODUCT_CARD_IMAGE_RESOLUTION_WIDTH } from './constants-rqiiCPBX.js';
|
|
7
7
|
import { s as slotChangeListener, a as addEventListenersWithSignal, i as isElementInSelector, S as SlotSkeleton } from './index-OsoUj2Au.js';
|
|
8
8
|
import { o as energyLabelParts, i as initializeLocale, j as extendedFiltersParts, h as filtersParts, q as imageParts, e as contentCardParts, l as listCardParts, p as productCardParts, t as priceRangeParts } from './index-BtnjaTty.js';
|
|
@@ -425,9 +425,7 @@ const VviinnCarousel = class {
|
|
|
425
425
|
if (!calculatedColumnsAmount || isNaN(calculatedColumnsAmount)) {
|
|
426
426
|
const cssColumnsAmount = parseInt(styleSheet.getPropertyValue(CAROUSEL_COLUMNS_CSS_VAR));
|
|
427
427
|
this.columns =
|
|
428
|
-
cssColumnsAmount >= 1
|
|
429
|
-
? cssColumnsAmount
|
|
430
|
-
: DEFAULT_COLUMNS_NUMBER;
|
|
428
|
+
cssColumnsAmount >= 1 ? cssColumnsAmount : DEFAULT_COLUMNS_NUMBER;
|
|
431
429
|
}
|
|
432
430
|
else {
|
|
433
431
|
this.columns = calculatedColumnsAmount;
|
|
@@ -560,10 +558,10 @@ const VviinnCarousel = class {
|
|
|
560
558
|
}
|
|
561
559
|
render() {
|
|
562
560
|
var _a, _b, _c, _d, _e;
|
|
563
|
-
return (h(Host, { key: '
|
|
561
|
+
return (h(Host, { key: '17df2493a9d19208c12c0655f9a66ac120217a75', class: this.getClassMap() }, h("div", { key: 'e23e8c0b69f6948a1f8cf4f21b774761a745eda5', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (h("vviinn-product-card", { key: 'a43b88e69f1a6023deb7bdb85542beabaeb433b8', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: (_b = (_a = this.sourceProduct.image) === null || _a === void 0 ? void 0 : _a.thumbnail) !== null && _b !== void 0 ? _b : (_c = this.sourceProduct.image) === null || _c === void 0 ? void 0 : _c.original, images: this.sourceProduct.images, showMultipleImages: this.showMultipleImages, disableMobileSwiper: true, entityType: this.sourceProduct.entityType, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_d = this.sourceProduct.basePrice) === null || _d === void 0 ? void 0 : _d.actual, baseSalePrice: (_e = this.sourceProduct.basePrice) === null || _e === void 0 ? void 0 : _e.sale, addPriceContainer: this.addPriceContainer, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currencySign: this.currencySign, pricePrefix: this.pricePrefix, isSetMode: this.isSetMode, locale: this.locale, numberLocale: this.numberLocale, favoriteShow: this.favoriteShow, customLabels: getCustomLabels(this.sourceProduct), responsive: true })), h("div", { key: '9c96c18a6a8baa6fe399b05422d50b4b5e04fe3f', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (h(Fragment, { key: 'ecb5092972959988a16a92917c6e66ce8921a182' }, h("button", { key: '2c010f6e44921a9059ba7b4461ef3789a98b8c25', class: {
|
|
564
562
|
prev: true,
|
|
565
563
|
"grid-arrows-dynamic": this.gridArrowsDynamic && this.isGridMode,
|
|
566
|
-
}, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button carousel-button-prev", disabled: this.isFirst(), "aria-label": instance.t("buttons.previous") }, h(ChevronIcon, { key: '
|
|
564
|
+
}, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button carousel-button-prev", disabled: this.isFirst(), "aria-label": instance.t("buttons.previous") }, h(ChevronIcon, { key: 'ab45bd9d910d09a55687d3f30fa406b3a73447ab' })), h("button", { key: '6abf98f21ab7298eabebc269d536a5a9e1d79b40', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button carousel-button-next", disabled: this.isLast(), "aria-label": instance.t("buttons.next") }, h(ChevronIcon, { key: '1509f1cebeaf3855c189c1f0739a0248342e72b0' })))))), this.showBullets() && (h("div", { key: '1e550f3d478c4ed419932b228d7266abddd8d9c1', class: "bullets" }, this.renderBullets()))));
|
|
567
565
|
}
|
|
568
566
|
get el() { return getElement(this); }
|
|
569
567
|
static get watchers() { return {
|
|
@@ -11712,8 +11710,7 @@ const VviinnVprWidget = class {
|
|
|
11712
11710
|
(_a = this.setRecommendationsLoading) === null || _a === void 0 ? void 0 : _a.call(this, loading);
|
|
11713
11711
|
};
|
|
11714
11712
|
this.showNoResultText = () => !this.recommendationsLoading &&
|
|
11715
|
-
(this.recommendations.length === 0 ||
|
|
11716
|
-
this.hasErrorOnLoad);
|
|
11713
|
+
(this.recommendations.length === 0 || this.hasErrorOnLoad);
|
|
11717
11714
|
this.productCardEventDataToEventBody = (eventData) => {
|
|
11718
11715
|
const { productRank, productId} = eventData, rest = __rest(eventData, ["productRank", "productId", "campaignTypeId", "discount"]);
|
|
11719
11716
|
return Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
|
|
@@ -11955,9 +11952,16 @@ const VviinnVprWidget = class {
|
|
|
11955
11952
|
empty: this.recommendations.length == 0,
|
|
11956
11953
|
[this.mode]: true,
|
|
11957
11954
|
"show-in-widget": this.showInWidget,
|
|
11958
|
-
}, role: "region", "aria-label": !this.showingInButton ? instance.t("a11y.recommendations") : undefined, "aria-busy": isLoading ? "true" : "false", "aria-live": isLoading ? "polite" : "off" }, h(Fragment, null, renderExternalCSS(this.cssUrl), SlotSkeleton("discovery"), (this.isSetMode ||
|
|
11955
|
+
}, role: "region", "aria-label": !this.showingInButton ? instance.t("a11y.recommendations") : undefined, "aria-busy": isLoading ? "true" : "false", "aria-live": isLoading ? "polite" : "off" }, h(Fragment, null, renderExternalCSS(this.cssUrl), SlotSkeleton("discovery"), (this.isSetMode ||
|
|
11956
|
+
this.blockTitle !== "" ||
|
|
11957
|
+
!!this.blockSubtitle) && (h("div", { class: "widget-header" }, h("div", null, this.blockTitle !== "" && (h("h2", { part: "recommendations-title" }, h("slot", { name: "vviinn-recommendations-title" }, (_a = this.blockTitle) !== null && _a !== void 0 ? _a : (this.isSetMode
|
|
11959
11958
|
? instance.t("setMode.widgetTitle")
|
|
11960
|
-
: instance.t("discoveryWidgetTitle"))))), (this.isSetMode || !!this.blockSubtitle) && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, this.blockSubtitle ||
|
|
11959
|
+
: instance.t("discoveryWidgetTitle"))))), (this.isSetMode || !!this.blockSubtitle) && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, this.blockSubtitle ||
|
|
11960
|
+
(this.isSetMode
|
|
11961
|
+
? instance.t("setMode.widgetSubtitle")
|
|
11962
|
+
: ""))))), this.isSetMode &&
|
|
11963
|
+
this.updateButtonLocation !== "onItem" &&
|
|
11964
|
+
this.recommendations.length > 0 ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, instance.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (h("div", { class: "filters-header " }, this.showFilters && h("vviinn-filters", null), this.showExtendedFilters && (h("vviinn-extended-filters", { showingInButton: this.showingInButton, locale: this.locale, currencySign: this.currencySign })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), this.showNoResultText() && (h("div", { class: "no-result-text", role: "status" }, this.noResultText.length
|
|
11961
11965
|
? this.noResultText
|
|
11962
11966
|
: instance.t("noResultText"))))));
|
|
11963
11967
|
}
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement
|
|
|
2
2
|
import { a as divideOnSized, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
3
3
|
import { C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal } from './cropperUtils-CkB6bG3L.js';
|
|
4
4
|
import { g as getSwiperStyles, c as configureSwiperElement, r as register, e as extractSlideIndex, s as setupIntersectionObserver } from './swiper-element-Er2KrWw1.js';
|
|
5
|
-
import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-
|
|
5
|
+
import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-Bof_HKxz.js';
|
|
6
6
|
import { S as SecondaryActionIcon } from './SecondaryActionIcon-FWFzrhba.js';
|
|
7
7
|
import { i as initializeLocale, a as shopTheLookParts } from './index-BtnjaTty.js';
|
|
8
8
|
import { d as defaultConfig } from './store-BJxQCbNV.js';
|
|
@@ -1377,7 +1377,7 @@ const VviinnShopTheLook = class {
|
|
|
1377
1377
|
}, TIMING.SEARCH_DEBOUNCE_DELAY);
|
|
1378
1378
|
}
|
|
1379
1379
|
render() {
|
|
1380
|
-
return (h(Host, { key: '4734dcdc0c1a7d206970c8baf08e257077e952f9', exportparts: shopTheLookParts }, renderExternalCSS(this.cssUrl), h("div", { key: '129438fdcf114bd903ad6888287e060e5fdc3948', class: `shop-the-look-container ${this.showModal ? "modal-open" : ""} ${this.showCropper ? "with-cropper" : ""} widget-style-${this.widgetStyle}` }, h("div", { key: '04e037ad029930bd366920ca79e0ae7becebaf2c', class: "main-content" }, this.renderSwiperWrapper(), this.showLoadingSpinner && (h("div", { key: '18ca739ed4cf0b1167fd8976fdab0c5e6e0ee410', class: "search-loader" }, h("vviinn-preloader", { key: 'efd47991fa32bf315c4985f98f0c14ccbf6f5a72' })))), this.renderModalWrapper(), h("div", { key: '332adbe2912fb61f82f9cf0488a13f7c9a0a405c', class: "actions-container", part: "shop-the-look-actions-container" }, this.uploadMode && (h("div", { key: '55c748ffeded24b97801683454f9a1b8675f6ed6', class: "upload-button-container" }, h("button", { key: '7cfa399b98e254bd12bff706cf6c4bea42dce684', class: "upload-button", part: "shop-the-look-upload-button", onClick: () => { var _a; return (_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click(); }, disabled: this.showLoadingSpinner }, h("span", { key: '
|
|
1380
|
+
return (h(Host, { key: '4734dcdc0c1a7d206970c8baf08e257077e952f9', exportparts: shopTheLookParts }, renderExternalCSS(this.cssUrl), h("div", { key: '129438fdcf114bd903ad6888287e060e5fdc3948', class: `shop-the-look-container ${this.showModal ? "modal-open" : ""} ${this.showCropper ? "with-cropper" : ""} widget-style-${this.widgetStyle}` }, h("div", { key: '04e037ad029930bd366920ca79e0ae7becebaf2c', class: "main-content" }, this.renderSwiperWrapper(), this.showLoadingSpinner && (h("div", { key: '18ca739ed4cf0b1167fd8976fdab0c5e6e0ee410', class: "search-loader" }, h("vviinn-preloader", { key: 'efd47991fa32bf315c4985f98f0c14ccbf6f5a72' })))), this.renderModalWrapper(), h("div", { key: '332adbe2912fb61f82f9cf0488a13f7c9a0a405c', class: "actions-container", part: "shop-the-look-actions-container" }, this.uploadMode && (h("div", { key: '55c748ffeded24b97801683454f9a1b8675f6ed6', class: "upload-button-container" }, h("button", { key: '7cfa399b98e254bd12bff706cf6c4bea42dce684', class: "upload-button", part: "shop-the-look-upload-button", onClick: () => { var _a; return (_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click(); }, disabled: this.showLoadingSpinner }, h("span", { key: '48b59d82816a50b6f98bbf68c8a6849679437852', class: "upload-button-icon", part: "shop-the-look-upload-button-icon" }, h("slot", { key: '14f12cf7f44a39ba4f1d9cbecb6fa3558ae5fd5d', name: "vviinn-image-upload-icon" }, h(UploadActionIconVariant, { key: '1937cea6010c0a21182e88f365f188a65b0f3a70' }))), h("span", { key: 'd62a5ee1ac2c17a663dda26cb0debd83821510c0', class: "upload-button-text", part: "shop-the-look-upload-button-text" }, h("slot", { key: '42a4910a590a2b258dccb2a3ace5da8f60099791', name: "upload-button-text" }))), h("input", { key: '242e2ed2e319428ebde6dff7df8c37b60d33a8f1', type: "file", class: "visually-hidden", accept: getAcceptableFileFormats(), onChange: this.handleFileUpload, ref: (el) => (this.fileInput = el) }))), this.showNavigation() &&
|
|
1381
1381
|
renderNavigation(this.swiperActiveIndex, this.totalImages, this.handleNavigatePrev, this.handleNavigateNext)))));
|
|
1382
1382
|
}
|
|
1383
1383
|
get el() { return getElement(this); }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-RkvPN2Rk.js';
|
|
2
2
|
import { _ as _functionExports, f as fold } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { d as setTextSearchQuery, e as clearAutoSuggestCompletions, f as makeAutoSuggestRequest, v as version, h as campaignTypeNames, j as addIfNotEmpty, k as makeTextSearchRequest, u as useSearchStore } from './search.store-
|
|
3
|
+
import { d as setTextSearchQuery, e as clearAutoSuggestCompletions, f as makeAutoSuggestRequest, v as version, h as campaignTypeNames, j as addIfNotEmpty, k as makeTextSearchRequest, u as useSearchStore } from './search.store-Bof_HKxz.js';
|
|
4
4
|
import { s as slotChangeListener, f as findSlotElements } from './index-OsoUj2Au.js';
|
|
5
5
|
import { i as instance, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
6
6
|
import { i as initializeLocale, b as searchBarParts, s as searchModalFirstScreenParts } from './index-BtnjaTty.js';
|
|
7
|
-
import { i as isOnResultsPage, b as buildTextSearchRedirectUrl } from './resultsPageUrl-
|
|
7
|
+
import { i as isOnResultsPage, b as buildTextSearchRedirectUrl, p as parseResultsPageParamNames } from './resultsPageUrl-DbOxfJSz.js';
|
|
8
8
|
|
|
9
9
|
const TextSearchIcon = () => (h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
10
10
|
h("path", { d: "M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z", fill: "#525252" }),
|
|
@@ -144,16 +144,15 @@ const highlightMatch = (suggestion, query) => {
|
|
|
144
144
|
const before = suggestion.slice(0, matchIndex);
|
|
145
145
|
const match = suggestion.slice(matchIndex, matchIndex + query.length);
|
|
146
146
|
const after = suggestion.slice(matchIndex + query.length);
|
|
147
|
-
return [
|
|
148
|
-
before,
|
|
149
|
-
h("span", { class: "suggestion-highlight" }, match),
|
|
150
|
-
after,
|
|
151
|
-
];
|
|
147
|
+
return [before, h("span", { class: "suggestion-highlight" }, match), after];
|
|
152
148
|
};
|
|
153
149
|
const renderSuggestions = (completions, query, activeIndex, onSelect) => {
|
|
154
150
|
if (!completions.length || !query)
|
|
155
151
|
return null;
|
|
156
|
-
return (h("ul", { class: "suggestions-container", part: "suggestions-container", role: "listbox", id: "suggestions-listbox" }, completions.map((completion, index) => (h("li", { id: `suggestion-${index}`, class: {
|
|
152
|
+
return (h("ul", { class: "suggestions-container", part: "suggestions-container", role: "listbox", id: "suggestions-listbox" }, completions.map((completion, index) => (h("li", { id: `suggestion-${index}`, class: {
|
|
153
|
+
"suggestion-item": true,
|
|
154
|
+
"suggestion-item--active": index === activeIndex,
|
|
155
|
+
}, part: "suggestion-item", role: "option", "aria-selected": index === activeIndex ? "true" : "false", onMouseDown: (e) => {
|
|
157
156
|
e.preventDefault();
|
|
158
157
|
onSelect(completion);
|
|
159
158
|
} }, highlightMatch(completion.suggestion, query))))));
|
|
@@ -280,7 +279,7 @@ const VviinnTextSearch = class {
|
|
|
280
279
|
!this.showInWidget &&
|
|
281
280
|
!isOnResultsPage(this.resultsPageUrl);
|
|
282
281
|
if (shouldRedirectToResultsPage) {
|
|
283
|
-
const redirectUrl = buildTextSearchRedirectUrl(this.resultsPageUrl, queryToUse);
|
|
282
|
+
const redirectUrl = buildTextSearchRedirectUrl(this.resultsPageUrl, queryToUse, parseResultsPageParamNames(this.resultsPageParams).query);
|
|
284
283
|
this.handleTextSearchRedirect(redirectUrl, "text-search", queryToUse);
|
|
285
284
|
return;
|
|
286
285
|
}
|
|
@@ -404,15 +403,22 @@ const VviinnTextSearch = class {
|
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
405
|
render() {
|
|
407
|
-
return (h(Host, { key: '
|
|
406
|
+
return (h(Host, { key: '34d054620af49581af6c5038ccb24fc983394d84', exportparts: `${searchBarParts}, ${searchModalFirstScreenParts}` }, h("div", { key: 'b63cd15fffa92ce9f2783107702b293c087350b3', class: "text-search-container", part: "text-search-container" }, h("input", Object.assign({ key: 'dcb2a15f10e3ce65c5e154472179943a8a2732ea', class: "text-search-input", part: "text-search-input", type: "text", placeholder: this.getPlaceholderText(), value: this.state.textSearchQuery || "", onInput: (event) => this.handleInputChange(event), onKeyDown: this.handleKeyDown, onBlur: this.autoSuggestShow ? this.hideSuggestions : undefined }, (this.autoSuggestShow && {
|
|
408
407
|
role: "combobox",
|
|
409
408
|
"aria-autocomplete": "list",
|
|
410
|
-
"aria-expanded": this.autoSuggestCompletions.length > 0 &&
|
|
409
|
+
"aria-expanded": this.autoSuggestCompletions.length > 0 &&
|
|
410
|
+
!!this.state.textSearchQuery
|
|
411
|
+
? "true"
|
|
412
|
+
: "false",
|
|
411
413
|
"aria-controls": "suggestions-listbox",
|
|
412
|
-
"aria-activedescendant": this.activeSuggestionIndex >= 0
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
"aria-activedescendant": this.activeSuggestionIndex >= 0
|
|
415
|
+
? `suggestion-${this.activeSuggestionIndex}`
|
|
416
|
+
: undefined,
|
|
417
|
+
}))), this.mode === "extended" && (h("vviinn-vps-button", Object.assign({ key: '0102857f6f6f800687f17ace2d90aee1d14cb3eb', token: this.token, locale: this.locale, apiPath: this.apiPath, addStyle: false, showResultsInModal: false, resultsPageUrl: this.resultsPageUrl, resultsPageParams: this.resultsPageParams }, (this.exampleImageSource && {
|
|
418
|
+
exampleImageSource: this.exampleImageSource,
|
|
419
|
+
}), (this.cssUrl != null && { cssUrl: this.cssUrl }), (this.visualSearchMode && { mode: this.visualSearchMode }), { parentSlots: this.slots }))), this.mode === "basic" && (h("slot", { key: '2be782a7f2ec3ec21809c9075f495ca4ed3167e8', name: "vviinn-text-search-actions" })), (this.mode === "extended" || this.showInWidget) &&
|
|
420
|
+
this.recognition && (h("button", { key: '8711e6f5dd1412cef9d9e655f2f9b0e5bebd3272', class: "speech-button", part: "speech-button", "aria-label": instance.t("a11y.speechButton"), onClick: this.handleSpeech, onKeyDown: (event) => this.handleButtonKeyDown(event, this.handleSpeech) }, h(MicIcon, { key: '66f8b01114ed126495208d6db96050d39a6924f9' }), this.isShowRecording() && (h("span", { key: 'afa850af213c41a356aa09dc712e91cf425a4f79', class: "recording-indicator" })))), h("button", { key: '8ce59d9f6214e8db235910359069c005066d4a83', class: "text-search-button", part: "text-search-button", onClick: () => this.handleTextSearch(), onKeyDown: (event) => this.handleButtonKeyDown(event, this.handleTextSearch), disabled: this.state.searchStatus === "loading", "aria-label": instance.t("a11y.textSearchButton") }, this.isShowPreloader() ? (h("vviinn-preloader", null)) : (h("slot", { name: "vviinn-text-search-icon" }, h(TextSearchIcon, null))))), this.autoSuggestShow &&
|
|
421
|
+
renderSuggestions(this.autoSuggestCompletions, this.state.textSearchQuery, this.activeSuggestionIndex, this.selectSuggestion), this.showTooltip && (h("p", { key: 'f82df73e88ba1dbf4c86bb1aa56c9a921ab76ee0', class: "text-search-tooltip", part: "text-search-tooltip" }, instance.t(this.tooltipText)))));
|
|
416
422
|
}
|
|
417
423
|
get el() { return getElement(this); }
|
|
418
424
|
};
|
|
@@ -80,7 +80,7 @@ const VviinnVpsButton = class {
|
|
|
80
80
|
this.showIntervalInputs = false;
|
|
81
81
|
/** URL to external CSS file for custom styling */
|
|
82
82
|
this.cssUrl = null;
|
|
83
|
-
/**
|
|
83
|
+
/** Render results in modal. Set false to redirect or show results on the page. */
|
|
84
84
|
this.showResultsInModal = true;
|
|
85
85
|
/** @internal */
|
|
86
86
|
this.parentSlots = [];
|
|
@@ -152,8 +152,8 @@ const VviinnVpsButton = class {
|
|
|
152
152
|
}
|
|
153
153
|
render() {
|
|
154
154
|
const { ariaLabel, buttonIcon } = this.getButtonConfig();
|
|
155
|
-
return (h(Host, { key: '
|
|
156
|
-
(this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, imageResolutionWidth: this.imageResolutionWidth, showMultipleImages: this.showMultipleImages, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow, autoSuggestShow: this.autoSuggestShow, addToBasketShow: this.addToBasketShow, addPriceContainer: this.addPriceContainer, showIntervalInputs: this.showIntervalInputs, replaceSlotsContentInButton: this.replaceSlotsContent.bind(this), oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, favoriteShow: this.favoriteShow, showResultsInModal: this.showResultsInModal, resultsPageUrl: this.resultsPageUrl, parentSlots: [...this.parentSlots, ...this.slots], cssUrl: this.cssUrl })));
|
|
155
|
+
return (h(Host, { key: 'b5274974a697ae4d65dc7204c5c35de228625b89', role: this.buttonPressed ? undefined : "button", "aria-label": this.buttonPressed ? undefined : ariaLabel, exportparts: `vviinn-button, ${searchModalFirstScreenParts}` }, h("vviinn-button", { key: '7e7f103a1dacc33b385da58fa1e3d33c10369e09', addStyle: this.addStyle, part: "vviinn-button", tabindex: this.buttonPressed ? undefined : "0", onClick: this.buttonPressed ? undefined : this.handleActivation, onKeyDown: this.buttonPressed ? undefined : this.handleKeyDown }, h("slot", { key: 'e23e07b5789a62e7d3cadf407adf2b65a376947b' }, buttonIcon)), SlotSkeleton("search"), h("vviinn-vps-widget", { key: 'd092bd2fc87aaba40cc44a13d050cb309b0cd50c', mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, numberLocale: this.numberLocale, apiPath: this.apiPath, pricePrefix: this.pricePrefix, campaignId: this.campaignId, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton, buttonElementId: this.el.id, active: this.buttonPressed &&
|
|
156
|
+
(this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, imageResolutionWidth: this.imageResolutionWidth, showMultipleImages: this.showMultipleImages, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow, autoSuggestShow: this.autoSuggestShow, addToBasketShow: this.addToBasketShow, addPriceContainer: this.addPriceContainer, showIntervalInputs: this.showIntervalInputs, replaceSlotsContentInButton: this.replaceSlotsContent.bind(this), oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, favoriteShow: this.favoriteShow, showResultsInModal: this.showResultsInModal, resultsPageUrl: this.resultsPageUrl, resultsPageParams: this.resultsPageParams, parentSlots: [...this.parentSlots, ...this.slots], cssUrl: this.cssUrl })));
|
|
157
157
|
}
|
|
158
158
|
get el() { return getElement(this); }
|
|
159
159
|
static get watchers() { return {
|