@getlupa/client 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lupaSearch.iife.js +7 -4
- package/dist/lupaSearch.js +7 -4
- package/dist/lupaSearch.mjs +7 -4
- package/dist/lupaSearch.umd.js +7 -4
- package/dist/src/index.d.ts +2 -2
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -6389,12 +6389,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
6389
6389
|
});
|
|
6390
6390
|
return output;
|
|
6391
6391
|
};
|
|
6392
|
-
const
|
|
6392
|
+
const inputsAreEqual = (input, possibleValues) => {
|
|
6393
6393
|
if (!input) {
|
|
6394
6394
|
return false;
|
|
6395
6395
|
}
|
|
6396
6396
|
const normalizedInput = getNormalizedString(input);
|
|
6397
|
-
return possibleValues.some((v) => getNormalizedString(v)
|
|
6397
|
+
return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
|
|
6398
6398
|
};
|
|
6399
6399
|
const initAnalyticsTracking = (analyticsOptions) => {
|
|
6400
6400
|
try {
|
|
@@ -7401,11 +7401,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7401
7401
|
if (!((_b = (_a = redirections.value) == null ? void 0 : _a.rules) == null ? void 0 : _b.length)) {
|
|
7402
7402
|
return false;
|
|
7403
7403
|
}
|
|
7404
|
-
const redirectTo = redirections.value.rules.find((r) =>
|
|
7404
|
+
const redirectTo = redirections.value.rules.find((r) => inputsAreEqual(input, r.sources));
|
|
7405
7405
|
if (!redirectTo) {
|
|
7406
7406
|
return false;
|
|
7407
7407
|
}
|
|
7408
|
-
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.
|
|
7408
|
+
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.urlTransformer) ? (_d = redirectionOptions.value) == null ? void 0 : _d.urlTransformer(redirectTo == null ? void 0 : redirectTo.target) : redirectTo == null ? void 0 : redirectTo.target;
|
|
7409
|
+
if (url === void 0 || url === null || url === "") {
|
|
7410
|
+
return false;
|
|
7411
|
+
}
|
|
7409
7412
|
if (routingBehavior === "event") {
|
|
7410
7413
|
emitRoutingEvent(url);
|
|
7411
7414
|
} else {
|
package/dist/lupaSearch.js
CHANGED
|
@@ -6389,12 +6389,12 @@ const escapeHtml = (value) => {
|
|
|
6389
6389
|
});
|
|
6390
6390
|
return output;
|
|
6391
6391
|
};
|
|
6392
|
-
const
|
|
6392
|
+
const inputsAreEqual = (input, possibleValues) => {
|
|
6393
6393
|
if (!input) {
|
|
6394
6394
|
return false;
|
|
6395
6395
|
}
|
|
6396
6396
|
const normalizedInput = getNormalizedString(input);
|
|
6397
|
-
return possibleValues.some((v) => getNormalizedString(v)
|
|
6397
|
+
return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
|
|
6398
6398
|
};
|
|
6399
6399
|
const initAnalyticsTracking = (analyticsOptions) => {
|
|
6400
6400
|
try {
|
|
@@ -7401,11 +7401,14 @@ const useRedirectionStore = defineStore("redirections", () => {
|
|
|
7401
7401
|
if (!((_b = (_a = redirections.value) == null ? void 0 : _a.rules) == null ? void 0 : _b.length)) {
|
|
7402
7402
|
return false;
|
|
7403
7403
|
}
|
|
7404
|
-
const redirectTo = redirections.value.rules.find((r) =>
|
|
7404
|
+
const redirectTo = redirections.value.rules.find((r) => inputsAreEqual(input, r.sources));
|
|
7405
7405
|
if (!redirectTo) {
|
|
7406
7406
|
return false;
|
|
7407
7407
|
}
|
|
7408
|
-
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.
|
|
7408
|
+
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.urlTransformer) ? (_d = redirectionOptions.value) == null ? void 0 : _d.urlTransformer(redirectTo == null ? void 0 : redirectTo.target) : redirectTo == null ? void 0 : redirectTo.target;
|
|
7409
|
+
if (url === void 0 || url === null || url === "") {
|
|
7410
|
+
return false;
|
|
7411
|
+
}
|
|
7409
7412
|
if (routingBehavior === "event") {
|
|
7410
7413
|
emitRoutingEvent(url);
|
|
7411
7414
|
} else {
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -6387,12 +6387,12 @@ const escapeHtml = (value) => {
|
|
|
6387
6387
|
});
|
|
6388
6388
|
return output;
|
|
6389
6389
|
};
|
|
6390
|
-
const
|
|
6390
|
+
const inputsAreEqual = (input, possibleValues) => {
|
|
6391
6391
|
if (!input) {
|
|
6392
6392
|
return false;
|
|
6393
6393
|
}
|
|
6394
6394
|
const normalizedInput = getNormalizedString(input);
|
|
6395
|
-
return possibleValues.some((v) => getNormalizedString(v)
|
|
6395
|
+
return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
|
|
6396
6396
|
};
|
|
6397
6397
|
const initAnalyticsTracking = (analyticsOptions) => {
|
|
6398
6398
|
try {
|
|
@@ -7399,11 +7399,14 @@ const useRedirectionStore = defineStore("redirections", () => {
|
|
|
7399
7399
|
if (!((_b = (_a = redirections.value) == null ? void 0 : _a.rules) == null ? void 0 : _b.length)) {
|
|
7400
7400
|
return false;
|
|
7401
7401
|
}
|
|
7402
|
-
const redirectTo = redirections.value.rules.find((r) =>
|
|
7402
|
+
const redirectTo = redirections.value.rules.find((r) => inputsAreEqual(input, r.sources));
|
|
7403
7403
|
if (!redirectTo) {
|
|
7404
7404
|
return false;
|
|
7405
7405
|
}
|
|
7406
|
-
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.
|
|
7406
|
+
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.urlTransformer) ? (_d = redirectionOptions.value) == null ? void 0 : _d.urlTransformer(redirectTo == null ? void 0 : redirectTo.target) : redirectTo == null ? void 0 : redirectTo.target;
|
|
7407
|
+
if (url === void 0 || url === null || url === "") {
|
|
7408
|
+
return false;
|
|
7409
|
+
}
|
|
7407
7410
|
if (routingBehavior === "event") {
|
|
7408
7411
|
emitRoutingEvent(url);
|
|
7409
7412
|
} else {
|
package/dist/lupaSearch.umd.js
CHANGED
|
@@ -6391,12 +6391,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
6391
6391
|
});
|
|
6392
6392
|
return output;
|
|
6393
6393
|
};
|
|
6394
|
-
const
|
|
6394
|
+
const inputsAreEqual = (input, possibleValues) => {
|
|
6395
6395
|
if (!input) {
|
|
6396
6396
|
return false;
|
|
6397
6397
|
}
|
|
6398
6398
|
const normalizedInput = getNormalizedString(input);
|
|
6399
|
-
return possibleValues.some((v) => getNormalizedString(v)
|
|
6399
|
+
return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
|
|
6400
6400
|
};
|
|
6401
6401
|
const initAnalyticsTracking = (analyticsOptions) => {
|
|
6402
6402
|
try {
|
|
@@ -7403,11 +7403,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
7403
7403
|
if (!((_b = (_a = redirections.value) == null ? void 0 : _a.rules) == null ? void 0 : _b.length)) {
|
|
7404
7404
|
return false;
|
|
7405
7405
|
}
|
|
7406
|
-
const redirectTo = redirections.value.rules.find((r) =>
|
|
7406
|
+
const redirectTo = redirections.value.rules.find((r) => inputsAreEqual(input, r.sources));
|
|
7407
7407
|
if (!redirectTo) {
|
|
7408
7408
|
return false;
|
|
7409
7409
|
}
|
|
7410
|
-
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.
|
|
7410
|
+
const url = ((_c = redirectionOptions.value) == null ? void 0 : _c.urlTransformer) ? (_d = redirectionOptions.value) == null ? void 0 : _d.urlTransformer(redirectTo == null ? void 0 : redirectTo.target) : redirectTo == null ? void 0 : redirectTo.target;
|
|
7411
|
+
if (url === void 0 || url === null || url === "") {
|
|
7412
|
+
return false;
|
|
7413
|
+
}
|
|
7411
7414
|
if (routingBehavior === "event") {
|
|
7412
7415
|
emitRoutingEvent(url);
|
|
7413
7416
|
} else {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Environment, SdkOptions, SortDirection, TrackingOptions, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SingleStarRatingElement, ProductListOptions, CategoryFilterOptions, ProductRecommendationOptions, RecommendationABTestingOptions, SearchBoxOptions, SearchContainerOptions, SearchContainerConfigOptions, SearchResultBadgeElement, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, RoutingBehavior, SearchResultsOptions, FacetStyle, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, SearchResultsFilterOptions, ResultFacetOptions, DynamicData, AnchorPosition, SortOptions, SearchResultsSortOptions, ChatOptions } from '@getlupa/vue';
|
|
1
|
+
import type { Environment, SdkOptions, SortDirection, TrackingOptions, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SingleStarRatingElement, ProductListOptions, CategoryFilterOptions, ProductRecommendationOptions, RecommendationABTestingOptions, SearchBoxOptions, SearchContainerOptions, SearchContainerConfigOptions, SearchResultBadgeElement, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, RoutingBehavior, SearchResultsOptions, FacetStyle, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, SearchResultsFilterOptions, ResultFacetOptions, DynamicData, AnchorPosition, SortOptions, SearchResultsSortOptions, ChatOptions, RedirectionOptions } from '@getlupa/vue';
|
|
2
2
|
import { DocumentElementType, SearchBoxPanelType, BadgeType, SearchResultBadgeType } from '@getlupa/vue';
|
|
3
3
|
type MountOptions = {
|
|
4
4
|
fetch: boolean;
|
|
@@ -19,7 +19,7 @@ declare const lupaSearch: {
|
|
|
19
19
|
clearChat: (selector?: string) => void;
|
|
20
20
|
};
|
|
21
21
|
export { DocumentElementType, SearchBoxPanelType, BadgeType };
|
|
22
|
-
export type { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, FacetStyle, Environment, RoutingBehavior, AnchorPosition, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions, ChatOptions };
|
|
22
|
+
export type { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, FacetStyle, Environment, RoutingBehavior, AnchorPosition, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions, ChatOptions, RedirectionOptions };
|
|
23
23
|
declare global {
|
|
24
24
|
interface Window {
|
|
25
25
|
getLupa: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getlupa/client",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
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.7.
|
|
23
|
+
"@getlupa/vue": "0.7.2",
|
|
24
24
|
"@rushstack/eslint-patch": "^1.3.2",
|
|
25
25
|
"@tsconfig/node18": "^2.0.1",
|
|
26
26
|
"@types/jsdom": "^21.1.1",
|