vviinn-widgets 2.18.21 → 2.19.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-cb410762.js → Campaign-a94a827a.js} +17 -1
- package/dist/cjs/cropper-handler_29.cjs.entry.js +1418 -0
- package/dist/cjs/{imageSearch.store-98824653.js → index-48c94264.js} +16016 -11171
- package/dist/cjs/{index-7f1325a7.js → index-a4becaff.js} +683 -303
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +150 -270
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +14 -8
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +12 -14
- package/dist/cjs/vviinn-widgets.cjs.js +10 -3
- package/dist/collection/Image/sizing.spec.js +66 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +2 -16
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +11 -7
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -1
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +40 -37
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +73 -67
- package/dist/collection/components/image-search/search-filters/search-filters.css +4 -23
- package/dist/collection/components/image-search/search-filters/search-filters.js +97 -91
- package/dist/collection/components/vviinn-button/vviinn-button.js +34 -31
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +1 -2
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +161 -156
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +12 -14
- package/dist/collection/components/vviinn-error/vviinn-error.js +12 -12
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +35 -30
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +35 -30
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -121
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +75 -75
- package/dist/collection/components/vviinn-icons/index.js +10 -27
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +120 -67
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +81 -69
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -1
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +27 -28
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +7 -36
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +115 -93
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +12 -14
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +12 -17
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +1 -12
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +12 -9
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +107 -78
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +1 -11
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +11 -7
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -1
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +12 -16
- package/dist/collection/components/vviinn-product-card/render-helpers.js +6 -14
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -415
- package/dist/collection/components/vviinn-slider/arrow.js +1 -2
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +12 -9
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -1
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +87 -82
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +12 -18
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +12 -64
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +371 -360
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +448 -444
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +545 -542
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +2 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +368 -332
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -5
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.e2e.js +26 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +502 -425
- package/dist/collection/geometry/Clip.spec.js +16 -0
- package/dist/collection/geometry/Rectangle.spec.js +66 -0
- package/dist/collection/geometry/Sized.spec.js +16 -0
- package/dist/collection/interfaces/generated.js +0 -4
- package/dist/collection/network/ion/Form.spec.js +43 -0
- package/dist/esm/{index-b31d86ce.js → Campaign-4aa53f29.js} +15 -2
- package/dist/esm/cropper-handler_29.entry.js +1386 -0
- package/dist/esm/{index-590cb67e.js → index-48ef9564.js} +683 -304
- package/dist/esm/{imageSearch.store-9dde5360.js → index-976acf7e.js} +16124 -11292
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +106 -225
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +13 -7
- package/dist/esm/vviinn-vpr-button.entry.js +11 -13
- package/dist/esm/vviinn-widgets.js +7 -3
- package/dist/loader/index.d.ts +9 -0
- package/dist/loader/package.json +1 -0
- package/dist/types/Image/sizing.d.ts +4 -4
- package/dist/types/campaign/Campaign.d.ts +5 -5
- package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +2 -2
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +4 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +2 -0
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -3
- package/dist/types/components/vviinn-slider/arrow.d.ts +2 -2
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -2
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +9 -4
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +8 -0
- package/dist/types/components.d.ts +154 -54
- package/dist/types/error.d.ts +1 -1
- package/dist/types/geometry/Point.d.ts +1 -1
- package/dist/types/geometry/Rectangle.d.ts +1 -1
- package/dist/types/geometry/Sized.d.ts +1 -1
- package/dist/types/interfaces/generated.d.ts +192 -371
- package/dist/types/network/ion/File.d.ts +2 -2
- package/dist/types/network/ion/Form.d.ts +5 -5
- package/dist/types/network/ion/Link.d.ts +1 -1
- package/dist/types/network/ion/ValueObject.d.ts +4 -4
- package/dist/types/network/utils.d.ts +3 -3
- package/dist/types/recommendation/events.d.ts +5 -5
- package/dist/types/recommendation/recommendation.d.ts +1 -1
- package/dist/types/searchSession/searchSession.d.ts +7 -7
- package/dist/types/slider/GridMode.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +98 -23
- package/dist/types/store/imageSearch.store.d.ts +1 -1
- package/dist/types/tracking/models.d.ts +2 -2
- package/dist/types/utils/event/Events.d.ts +1 -1
- package/dist/vviinn-widgets/p-312b0eb7.entry.js +1 -0
- package/dist/vviinn-widgets/p-414b2291.js +1 -0
- package/dist/vviinn-widgets/p-5b50c7e5.entry.js +1 -0
- package/dist/vviinn-widgets/p-8deaa5da.entry.js +1 -0
- package/dist/vviinn-widgets/p-c6209bc1.entry.js +1 -0
- package/{www/build/p-2f9ee951.js → dist/vviinn-widgets/p-d08ce429.js} +1 -1
- package/dist/vviinn-widgets/p-fa17e81f.js +2 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +12 -12
- package/www/build/p-312b0eb7.entry.js +1 -0
- package/www/build/p-414b2291.js +1 -0
- package/www/build/p-5b50c7e5.entry.js +1 -0
- package/www/build/p-8deaa5da.entry.js +1 -0
- package/www/build/p-c6209bc1.entry.js +1 -0
- package/{dist/vviinn-widgets/p-2f9ee951.js → www/build/p-d08ce429.js} +1 -1
- package/www/build/p-d39b7d70.js +161 -0
- package/www/build/p-fa17e81f.js +2 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +2 -2
- package/dist/cjs/Campaign-13258569.js +0 -18
- package/dist/cjs/Handler-176539c8.js +0 -331
- package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
- package/dist/cjs/customized-slots-6e56c354.js +0 -54
- package/dist/cjs/highlight-box_22.cjs.entry.js +0 -770
- package/dist/cjs/index-a99edb90.js +0 -3235
- package/dist/cjs/vviinn-button.cjs.entry.js +0 -21
- package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
- package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -65
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -251
- package/dist/esm/Campaign-90ba7e06.js +0 -14
- package/dist/esm/Handler-f9b8735c.js +0 -309
- package/dist/esm/cropper-handler.entry.js +0 -23
- package/dist/esm/customized-slots-00afe247.js +0 -51
- package/dist/esm/highlight-box_22.entry.js +0 -745
- package/dist/esm/index-4d5b52ba.js +0 -3224
- package/dist/esm/vviinn-button.entry.js +0 -17
- package/dist/esm/vviinn-error.entry.js +0 -15
- package/dist/esm/vviinn-preloader.entry.js +0 -22
- package/dist/esm/vviinn-vps-button.entry.js +0 -61
- package/dist/esm/vviinn-vps-widget.entry.js +0 -247
- package/dist/vviinn-widgets/p-11f61564.js +0 -1
- package/dist/vviinn-widgets/p-12851e97.entry.js +0 -1
- package/dist/vviinn-widgets/p-18fd769b.js +0 -1
- package/dist/vviinn-widgets/p-339c6838.js +0 -1
- package/dist/vviinn-widgets/p-3b2c91c0.entry.js +0 -1
- package/dist/vviinn-widgets/p-45df9f28.entry.js +0 -1
- package/dist/vviinn-widgets/p-57ed5303.entry.js +0 -1
- package/dist/vviinn-widgets/p-69850e5b.js +0 -1
- package/dist/vviinn-widgets/p-7c2f762a.entry.js +0 -1
- package/dist/vviinn-widgets/p-7c3b7388.entry.js +0 -1
- package/dist/vviinn-widgets/p-85006f41.entry.js +0 -1
- package/dist/vviinn-widgets/p-8a3dd76d.entry.js +0 -1
- package/dist/vviinn-widgets/p-99e58be7.entry.js +0 -1
- package/dist/vviinn-widgets/p-a2b450b6.entry.js +0 -1
- package/dist/vviinn-widgets/p-bcc1ccf0.js +0 -1
- package/dist/vviinn-widgets/p-e6fee8d2.js +0 -1
- package/www/build/p-11f61564.js +0 -1
- package/www/build/p-12851e97.entry.js +0 -1
- package/www/build/p-18fd769b.js +0 -1
- package/www/build/p-339c6838.js +0 -1
- package/www/build/p-3b2c91c0.entry.js +0 -1
- package/www/build/p-45df9f28.entry.js +0 -1
- package/www/build/p-57ed5303.entry.js +0 -1
- package/www/build/p-69850e5b.js +0 -1
- package/www/build/p-7c2f762a.entry.js +0 -1
- package/www/build/p-7c3b7388.entry.js +0 -1
- package/www/build/p-85006f41.entry.js +0 -1
- package/www/build/p-8a3dd76d.entry.js +0 -1
- package/www/build/p-99e58be7.entry.js +0 -1
- package/www/build/p-9e2c131a.js +0 -125
- package/www/build/p-a2b450b6.entry.js +0 -1
- package/www/build/p-bcc1ccf0.js +0 -1
- package/www/build/p-e6fee8d2.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getClipValue } from "./Clip";
|
|
2
|
+
it("should return proper clip css string with Rectangular type", async () => {
|
|
3
|
+
const image = {
|
|
4
|
+
width: 100,
|
|
5
|
+
height: 100,
|
|
6
|
+
};
|
|
7
|
+
const selection = {
|
|
8
|
+
x: 10,
|
|
9
|
+
y: 0,
|
|
10
|
+
width: 10,
|
|
11
|
+
height: 10,
|
|
12
|
+
};
|
|
13
|
+
const clip = getClipValue(selection, image);
|
|
14
|
+
const result = "inset(0px 80px 90px 10px)";
|
|
15
|
+
expect(clip).toEqual(result);
|
|
16
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { scaleSelection, getScaleRange, scaleWithSized, } from "./Rectangle";
|
|
2
|
+
it("should return proper scale range", async () => {
|
|
3
|
+
const source = {
|
|
4
|
+
x: 0,
|
|
5
|
+
y: 0,
|
|
6
|
+
width: 50,
|
|
7
|
+
height: 50,
|
|
8
|
+
};
|
|
9
|
+
const target = {
|
|
10
|
+
x: 0,
|
|
11
|
+
y: 0,
|
|
12
|
+
width: 100,
|
|
13
|
+
height: 100,
|
|
14
|
+
};
|
|
15
|
+
const result = {
|
|
16
|
+
x: 0.5,
|
|
17
|
+
y: 0.5,
|
|
18
|
+
};
|
|
19
|
+
expect(getScaleRange(target, source)).toStrictEqual(result);
|
|
20
|
+
});
|
|
21
|
+
it("should scale properly", async () => {
|
|
22
|
+
const source = {
|
|
23
|
+
x: 0,
|
|
24
|
+
y: 0,
|
|
25
|
+
width: 50,
|
|
26
|
+
height: 50,
|
|
27
|
+
};
|
|
28
|
+
const sourceSelection = {
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 0,
|
|
31
|
+
width: 10,
|
|
32
|
+
height: 10,
|
|
33
|
+
};
|
|
34
|
+
const target = {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0,
|
|
37
|
+
width: 100,
|
|
38
|
+
height: 100,
|
|
39
|
+
};
|
|
40
|
+
const result = {
|
|
41
|
+
x: 0,
|
|
42
|
+
y: 0,
|
|
43
|
+
width: 20,
|
|
44
|
+
height: 20,
|
|
45
|
+
};
|
|
46
|
+
expect(scaleSelection(source, sourceSelection, target)).toStrictEqual(result);
|
|
47
|
+
});
|
|
48
|
+
it("should scale rectangle with sizable", async () => {
|
|
49
|
+
const source = {
|
|
50
|
+
width: 100,
|
|
51
|
+
height: 100,
|
|
52
|
+
};
|
|
53
|
+
const target = {
|
|
54
|
+
x: 0.5,
|
|
55
|
+
y: 0.5,
|
|
56
|
+
width: 0.5,
|
|
57
|
+
height: 0.5,
|
|
58
|
+
};
|
|
59
|
+
const result = {
|
|
60
|
+
x: 50,
|
|
61
|
+
y: 50,
|
|
62
|
+
width: 50,
|
|
63
|
+
height: 50,
|
|
64
|
+
};
|
|
65
|
+
expect(scaleWithSized(source)(target)).toStrictEqual(result);
|
|
66
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sizedDivSemigroup } from "./Sized";
|
|
2
|
+
it("should divide two sizables", async () => {
|
|
3
|
+
const source = {
|
|
4
|
+
width: 100,
|
|
5
|
+
height: 100,
|
|
6
|
+
};
|
|
7
|
+
const target = {
|
|
8
|
+
width: 50,
|
|
9
|
+
height: 50,
|
|
10
|
+
};
|
|
11
|
+
const result = {
|
|
12
|
+
width: 0.5,
|
|
13
|
+
height: 0.5,
|
|
14
|
+
};
|
|
15
|
+
expect(sizedDivSemigroup.concat(target, source)).toStrictEqual(result);
|
|
16
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isRight, isLeft } from "fp-ts/lib/Either";
|
|
2
|
+
import { requestFromForm, checkFormFields } from "./Form";
|
|
3
|
+
it("should check data for form fields array", async () => {
|
|
4
|
+
const form = {
|
|
5
|
+
href: "http://nowhere.com",
|
|
6
|
+
rel: ["query-form"],
|
|
7
|
+
value: [{ name: "foo" }, { name: "bar" }],
|
|
8
|
+
};
|
|
9
|
+
const data = {
|
|
10
|
+
foo: "foo_data",
|
|
11
|
+
bar: "bar_data",
|
|
12
|
+
};
|
|
13
|
+
const result = checkFormFields(form.value, data);
|
|
14
|
+
expect(isRight(result)).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it("should fails if data not fit with form fields", async () => {
|
|
17
|
+
const form = {
|
|
18
|
+
href: "http://nowhere.com",
|
|
19
|
+
rel: ["query-form"],
|
|
20
|
+
value: [{ name: "foo" }, { name: "bar" }],
|
|
21
|
+
};
|
|
22
|
+
const data = {
|
|
23
|
+
foo: "foo_data",
|
|
24
|
+
};
|
|
25
|
+
const result = checkFormFields(form.value, data);
|
|
26
|
+
expect(isLeft(result)).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
it("should create proper url", async () => {
|
|
29
|
+
const form = {
|
|
30
|
+
href: "http://nowhere.com",
|
|
31
|
+
rel: ["query-form"],
|
|
32
|
+
value: [{ name: "foo" }, { name: "bar" }],
|
|
33
|
+
};
|
|
34
|
+
const data = {
|
|
35
|
+
foo: "foo_data",
|
|
36
|
+
bar: "bar_data",
|
|
37
|
+
};
|
|
38
|
+
const result = requestFromForm(form, data);
|
|
39
|
+
expect(result).toEqual({
|
|
40
|
+
_tag: "Right",
|
|
41
|
+
right: ["http://nowhere.com?foo=foo_data&bar=bar_data", { method: "GET" }],
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from './index-
|
|
1
|
+
import { h } from './index-48ef9564.js';
|
|
2
2
|
|
|
3
3
|
const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
4
4
|
h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
|
@@ -26,4 +26,17 @@ const VisualSearchIcon = () => (h("svg", { width: "20", height: "20", fill: "non
|
|
|
26
26
|
const CrossIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
27
27
|
h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#161616" })));
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const campaignTypeNames = {
|
|
30
|
+
VPR: "Similar Products",
|
|
31
|
+
VPS: "Visual Search",
|
|
32
|
+
VCS: "Products Cross-Selling",
|
|
33
|
+
};
|
|
34
|
+
const isVPR = (c) => c._tag === "VPR";
|
|
35
|
+
function fold(onVPR, onVCS) {
|
|
36
|
+
return (c) => (isVPR(c) ? onVPR() : onVCS());
|
|
37
|
+
}
|
|
38
|
+
function fromString(s) {
|
|
39
|
+
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { ArrowIcon as A, CheckIcon as C, OnboardingCard1Icon as O, VisualSearchIcon as V, OnboardingCard2Icon as a, OnboardingCard3Icon as b, campaignTypeNames as c, CameraIcon as d, CrossIcon as e, ChevronIcon as f, fromString as g, fold as h };
|