vviinn-widgets 2.20.21 → 2.20.29

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.
Files changed (97) hide show
  1. package/dist/cjs/highlight-box_22.cjs.entry.js +25 -10
  2. package/dist/cjs/i18next-74ff3413.js +2258 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-1c24894e.js → package-fc932371.js} +1 -1
  5. package/dist/cjs/vviinn-carousel_3.cjs.entry.js +86 -65
  6. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -1
  7. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +4 -2
  8. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +69 -2
  10. package/dist/cjs/vviinn-widgets.cjs.js +1 -1
  11. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +2 -1
  12. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +19 -1
  13. package/dist/collection/components/vviinn-modal/vviinn-modal.css +20 -2
  14. package/dist/collection/components/vviinn-modal/vviinn-modal.js +12 -1
  15. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +43 -1
  16. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +43 -1
  17. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +43 -1
  18. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +2 -1
  19. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +25 -1
  20. package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +1 -1
  21. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +2 -1
  22. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +24 -1
  23. package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +5 -1
  24. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +29 -4
  25. package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +5 -2
  26. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +26 -12
  27. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +3 -0
  28. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +9 -4
  29. package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +10 -8
  30. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +22 -10
  31. package/dist/collection/locale/index.js +1 -0
  32. package/dist/collection/locale/resources-vpr.js +12 -0
  33. package/dist/collection/locale/resources-vps.js +60 -0
  34. package/dist/esm/highlight-box_22.entry.js +25 -10
  35. package/dist/esm/i18next-387f2b0a.js +2256 -0
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/package-e2f2d588.js +3 -0
  38. package/dist/esm/vviinn-carousel_3.entry.js +86 -65
  39. package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -1
  40. package/dist/esm/vviinn-vpr-button.entry.js +4 -2
  41. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  42. package/dist/esm/vviinn-vps-widget.entry.js +69 -2
  43. package/dist/esm/vviinn-widgets.js +1 -1
  44. package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
  45. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
  46. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +2 -0
  47. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +2 -0
  48. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +2 -0
  49. package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
  50. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -0
  51. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +5 -2
  52. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +5 -4
  53. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +3 -2
  54. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +3 -2
  55. package/dist/types/components.d.ts +48 -20
  56. package/dist/types/locale/index.d.ts +1 -0
  57. package/dist/types/locale/resources-vpr.d.ts +2 -0
  58. package/dist/types/locale/resources-vps.d.ts +2 -0
  59. package/dist/vviinn-widgets/p-2e76a5c3.js +1 -0
  60. package/dist/vviinn-widgets/p-51dd5bb7.entry.js +1 -0
  61. package/dist/vviinn-widgets/p-5283bad8.entry.js +1 -0
  62. package/dist/vviinn-widgets/p-643545b1.entry.js +1 -0
  63. package/dist/vviinn-widgets/p-a4d06752.entry.js +1 -0
  64. package/dist/vviinn-widgets/p-c06f6765.entry.js +1 -0
  65. package/dist/vviinn-widgets/p-d99266bf.js +1 -0
  66. package/dist/vviinn-widgets/p-df710209.entry.js +1 -0
  67. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  68. package/package.json +3 -2
  69. package/www/build/p-2e76a5c3.js +1 -0
  70. package/www/build/p-51dd5bb7.entry.js +1 -0
  71. package/www/build/p-5283bad8.entry.js +1 -0
  72. package/www/build/p-643545b1.entry.js +1 -0
  73. package/www/build/p-9e468d0a.js +161 -0
  74. package/www/build/p-a4d06752.entry.js +1 -0
  75. package/www/build/p-c06f6765.entry.js +1 -0
  76. package/www/build/p-d99266bf.js +1 -0
  77. package/www/build/p-df710209.entry.js +1 -0
  78. package/www/build/p-e0153ae2.css +6 -0
  79. package/www/build/vviinn-widgets.esm.js +1 -1
  80. package/www/index.html +4 -1
  81. package/dist/esm/package-4909a9ed.js +0 -3
  82. package/dist/vviinn-widgets/p-1aa66c1a.entry.js +0 -1
  83. package/dist/vviinn-widgets/p-4cb106e3.entry.js +0 -1
  84. package/dist/vviinn-widgets/p-637925f0.entry.js +0 -1
  85. package/dist/vviinn-widgets/p-6a189f8f.js +0 -1
  86. package/dist/vviinn-widgets/p-a1c3ccce.entry.js +0 -1
  87. package/dist/vviinn-widgets/p-ab973311.entry.js +0 -1
  88. package/dist/vviinn-widgets/p-e5fbf695.entry.js +0 -1
  89. package/www/build/p-1aa66c1a.entry.js +0 -1
  90. package/www/build/p-3fe5816c.js +0 -1
  91. package/www/build/p-4cb106e3.entry.js +0 -1
  92. package/www/build/p-637925f0.entry.js +0 -1
  93. package/www/build/p-6a189f8f.js +0 -1
  94. package/www/build/p-a1c3ccce.entry.js +0 -1
  95. package/www/build/p-a67898be.css +0 -1
  96. package/www/build/p-ab973311.entry.js +0 -1
  97. package/www/build/p-e5fbf695.entry.js +0 -1
@@ -2,11 +2,15 @@ import { Host, h } from "@stencil/core";
2
2
  import { slotChangeListener } from "../../../customized-slots";
3
3
  import { OnboardingCard1Icon } from "../../../vviinn-icons";
4
4
  export class VviinnOnboardingCard1 {
5
+ constructor() {
6
+ this.cardTitle = undefined;
7
+ this.cardText = undefined;
8
+ }
5
9
  componentWillLoad() {
6
10
  slotChangeListener(this, this.el);
7
11
  }
8
12
  render() {
9
- return (h(Host, null, h("slot", { name: "onboarding-card-1-icon" }, h(OnboardingCard1Icon, null)), h("slot", { name: "onboarding-card-1-text" }, h("div", { class: "text" }, h("h4", null, "Starte die Bildsuche"), h("p", null, "Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera.")))));
13
+ return (h(Host, null, h("slot", { name: "onboarding-card-1-icon" }, h(OnboardingCard1Icon, null)), h("slot", { name: "onboarding-card-1-text" }, h("div", { class: "text" }, h("h4", null, this.cardTitle), h("p", null, this.cardText)))));
10
14
  }
11
15
  static get is() { return "vviinn-onboarding-card-1"; }
12
16
  static get encapsulation() { return "shadow"; }
@@ -20,5 +24,43 @@ export class VviinnOnboardingCard1 {
20
24
  "$": ["../onboarding-card.css"]
21
25
  };
22
26
  }
27
+ static get properties() {
28
+ return {
29
+ "cardTitle": {
30
+ "type": "string",
31
+ "mutable": false,
32
+ "complexType": {
33
+ "original": "string",
34
+ "resolved": "string",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": ""
42
+ },
43
+ "attribute": "card-title",
44
+ "reflect": false
45
+ },
46
+ "cardText": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "attribute": "card-text",
61
+ "reflect": false
62
+ }
63
+ };
64
+ }
23
65
  static get elementRef() { return "el"; }
24
66
  }
@@ -2,11 +2,15 @@ import { Host, h } from "@stencil/core";
2
2
  import { OnboardingCard2Icon } from "../../../vviinn-icons";
3
3
  import { slotChangeListener } from "../../../customized-slots";
4
4
  export class VviinnOnboardingCard2 {
5
+ constructor() {
6
+ this.cardTitle = undefined;
7
+ this.cardText = undefined;
8
+ }
5
9
  componentWillLoad() {
6
10
  slotChangeListener(this, this.el);
7
11
  }
8
12
  render() {
9
- return (h(Host, null, h("slot", { name: "onboarding-card-2-icon" }, h(OnboardingCard2Icon, null)), h("slot", { name: "onboarding-card-2-text" }, h("div", { class: "text" }, h("h4", null, "Verfeiner Deine Suche"), h("p", null, "Du kannst den Bildrahmen selber festlegen und so die Produkte genau ausw\u00E4hlen.")))));
13
+ return (h(Host, null, h("slot", { name: "onboarding-card-2-icon" }, h(OnboardingCard2Icon, null)), h("slot", { name: "onboarding-card-2-text" }, h("div", { class: "text" }, h("h4", null, this.cardTitle), h("p", null, this.cardText)))));
10
14
  }
11
15
  static get is() { return "vviinn-onboarding-card-2"; }
12
16
  static get encapsulation() { return "shadow"; }
@@ -20,5 +24,43 @@ export class VviinnOnboardingCard2 {
20
24
  "$": ["../onboarding-card.css"]
21
25
  };
22
26
  }
27
+ static get properties() {
28
+ return {
29
+ "cardTitle": {
30
+ "type": "string",
31
+ "mutable": false,
32
+ "complexType": {
33
+ "original": "string",
34
+ "resolved": "string",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": ""
42
+ },
43
+ "attribute": "card-title",
44
+ "reflect": false
45
+ },
46
+ "cardText": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "attribute": "card-text",
61
+ "reflect": false
62
+ }
63
+ };
64
+ }
23
65
  static get elementRef() { return "el"; }
24
66
  }
@@ -2,11 +2,15 @@ import { Host, h } from "@stencil/core";
2
2
  import { OnboardingCard3Icon } from "../../../vviinn-icons";
3
3
  import { slotChangeListener } from "../../../customized-slots";
4
4
  export class VviinnOnboardingCard3 {
5
+ constructor() {
6
+ this.cardTitle = undefined;
7
+ this.cardText = undefined;
8
+ }
5
9
  componentWillLoad() {
6
10
  slotChangeListener(this, this.el);
7
11
  }
8
12
  render() {
9
- return (h(Host, null, h("slot", { name: "onboarding-card-3-icon" }, h(OnboardingCard3Icon, null)), h("slot", { name: "onboarding-card-3-text" }, h("div", { class: "text" }, h("h4", null, "Ohne Hintergrund"), h("p", null, "Die besten Ergebnisse erh\u00E4ltst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist.")))));
13
+ return (h(Host, null, h("slot", { name: "onboarding-card-3-icon" }, h(OnboardingCard3Icon, null)), h("slot", { name: "onboarding-card-3-text" }, h("div", { class: "text" }, h("h4", null, this.cardTitle), h("p", null, this.cardText)))));
10
14
  }
11
15
  static get is() { return "vviinn-onboarding-card-3"; }
12
16
  static get encapsulation() { return "shadow"; }
@@ -20,5 +24,43 @@ export class VviinnOnboardingCard3 {
20
24
  "$": ["../onboarding-card.css"]
21
25
  };
22
26
  }
27
+ static get properties() {
28
+ return {
29
+ "cardTitle": {
30
+ "type": "string",
31
+ "mutable": false,
32
+ "complexType": {
33
+ "original": "string",
34
+ "resolved": "string",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": ""
42
+ },
43
+ "attribute": "card-title",
44
+ "reflect": false
45
+ },
46
+ "cardText": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "attribute": "card-text",
61
+ "reflect": false
62
+ }
63
+ };
64
+ }
23
65
  static get elementRef() { return "el"; }
24
66
  }
@@ -1,11 +1,12 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import i18next from "i18next";
2
3
  import { slotChangeListener } from "../customized-slots";
3
4
  export class VviinnOnboarding {
4
5
  componentWillLoad() {
5
6
  slotChangeListener(this, this.el);
6
7
  }
7
8
  render() {
8
- return (h(Host, null, h("slot", { name: "vviinn-onboarding-title" }, h("h3", null, "So funktioniert es")), h("vviinn-slider", { showArrows: true }, h("vviinn-slide", null, h("vviinn-onboarding-card-1", null)), h("vviinn-slide", null, h("vviinn-onboarding-card-2", null)), h("vviinn-slide", null, h("vviinn-onboarding-card-3", null)))));
9
+ return (h(Host, null, h("slot", { name: "vviinn-onboarding-title" }, h("h3", null, i18next.t("onboardingBlock.onboardingTitleText"))), h("vviinn-slider", { showArrows: true }, h("vviinn-slide", null, h("vviinn-onboarding-card-1", { cardTitle: i18next.t("onboardingBlock.onboardingCard1.title"), cardText: i18next.t("onboardingBlock.onboardingCard1.text") })), h("vviinn-slide", null, h("vviinn-onboarding-card-2", { cardTitle: i18next.t("onboardingBlock.onboardingCard2.title"), cardText: i18next.t("onboardingBlock.onboardingCard2.text") })), h("vviinn-slide", null, h("vviinn-onboarding-card-3", { cardTitle: i18next.t("onboardingBlock.onboardingCard3.title"), cardText: i18next.t("onboardingBlock.onboardingCard3.text") })))));
9
10
  }
10
11
  static get is() { return "vviinn-onboarding"; }
11
12
  static get encapsulation() { return "shadow"; }
@@ -1,11 +1,14 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { slotChangeListener } from "../customized-slots";
3
3
  export class VviinnPrivacyBadge {
4
+ constructor() {
5
+ this.privacyBadgeText = undefined;
6
+ }
4
7
  componentWillLoad() {
5
8
  slotChangeListener(this, this.el);
6
9
  }
7
10
  render() {
8
- return (h(Host, null, h("slot", null, h("div", { class: "content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" }, h("defs", null), h("path", { fill: "#525252", d: "M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z" }), h("path", { fill: "#525252", d: "M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z" })), h("slot", { name: "vviinn-privacy-badge-text" }, h("p", null, "Durch das Hochladen eines Bildes willigst Du in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivit\u00E4t gel\u00F6scht."))))));
11
+ return (h(Host, null, h("slot", null, h("div", { class: "content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" }, h("defs", null), h("path", { fill: "#525252", d: "M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z" }), h("path", { fill: "#525252", d: "M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z" })), h("slot", { name: "vviinn-privacy-badge-text" }, h("p", null, this.privacyBadgeText))))));
9
12
  }
10
13
  static get is() { return "vviinn-privacy-badge"; }
11
14
  static get encapsulation() { return "shadow"; }
@@ -19,5 +22,26 @@ export class VviinnPrivacyBadge {
19
22
  "$": ["vviinn-privacy-badge.css"]
20
23
  };
21
24
  }
25
+ static get properties() {
26
+ return {
27
+ "privacyBadgeText": {
28
+ "type": "string",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "string",
32
+ "resolved": "string",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": false,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "attribute": "privacy-badge-text",
42
+ "reflect": false
43
+ }
44
+ };
45
+ }
22
46
  static get elementRef() { return "el"; }
23
47
  }
@@ -37,7 +37,7 @@ Default.args = {
37
37
  imageWidth: 240,
38
38
  dimmedBackground: false,
39
39
  brand: "Ronald Schmitt",
40
- locale: "en-US",
40
+ locale: "de-DE",
41
41
  currency: "€",
42
42
  deeplink: "",
43
43
  image: "https://www.moebel-shop.de/media/image/e3/e9/28/0749295-001_600x600.jpg",
@@ -1,11 +1,12 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import i18next from "i18next";
2
3
  import { slotChangeListener } from "../customized-slots";
3
4
  export class VviinnTeaser {
4
5
  componentWillLoad() {
5
6
  slotChangeListener(this, this.el);
6
7
  }
7
8
  render() {
8
- return (h(Host, null, h("slot", null, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" }, h("defs", null), h("path", { fill: "#C6C6C6", d: "M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z" }), h("path", { fill: "#C6C6C6", d: "M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z" })), h("span", { class: "vviinn-teaser-text" }, h("slot", { name: "vviinn-teaser-text" }, "Finde Produkte auf ", h("br", null), " einem Foto")))));
9
+ return (h(Host, null, h("slot", null, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" }, h("defs", null), h("path", { fill: "#C6C6C6", d: "M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z" }), h("path", { fill: "#C6C6C6", d: "M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z" })), h("span", { class: "vviinn-teaser-text" }, h("slot", { name: "vviinn-teaser-text" }, i18next.t("teaserText_1"), h("br", null), i18next.t("teaserText_2"))))));
9
10
  }
10
11
  static get is() { return "vviinn-teaser"; }
11
12
  static get encapsulation() { return "shadow"; }
@@ -13,6 +13,7 @@ export class RecommendationsSidebar {
13
13
  this.campaigns = "";
14
14
  this.campaignType = undefined;
15
15
  this.color = undefined;
16
+ this.locale = undefined;
16
17
  this.imageWidth = 300;
17
18
  this.currencySign = "€";
18
19
  this.noResultText = undefined;
@@ -51,7 +52,7 @@ export class RecommendationsSidebar {
51
52
  return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
52
53
  }
53
54
  render() {
54
- return (h(Host, { class: this.getClassMap() }, h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, h("span", { class: "title", part: "title" }, this.sidebarTitle), h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, h(CrossIcon, null))), h("main", { part: "sidebar-content" }, h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onVviinnRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, currencySign: this.currencySign, apiPath: this.apiPath, buttonElementId: this.buttonElementId, noResultText: this.noResultText, noResultShow: this.noResultShow, gridArrowsDynamic: this.gridArrowsDynamic, showingInButton: this.showingInButton, excluded: this.excluded, productDetailNewTab: this.productDetailNewTab })))));
55
+ return (h(Host, { class: this.getClassMap() }, h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, h("span", { class: "title", part: "title" }, this.sidebarTitle), h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, h(CrossIcon, null))), h("main", { part: "sidebar-content" }, h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onVviinnRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, currencySign: this.currencySign, apiPath: this.apiPath, locale: this.locale, buttonElementId: this.buttonElementId, noResultText: this.noResultText, noResultShow: this.noResultShow, gridArrowsDynamic: this.gridArrowsDynamic, showingInButton: this.showingInButton, excluded: this.excluded, productDetailNewTab: this.productDetailNewTab })))));
55
56
  }
56
57
  renderSourceImage() {
57
58
  return (h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
@@ -271,6 +272,28 @@ export class RecommendationsSidebar {
271
272
  "attribute": "color",
272
273
  "reflect": false
273
274
  },
275
+ "locale": {
276
+ "type": "string",
277
+ "mutable": false,
278
+ "complexType": {
279
+ "original": "Locale",
280
+ "resolved": "\"de-DE\" | \"en-US\"",
281
+ "references": {
282
+ "Locale": {
283
+ "location": "import",
284
+ "path": "../../../locale"
285
+ }
286
+ }
287
+ },
288
+ "required": false,
289
+ "optional": false,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": ""
293
+ },
294
+ "attribute": "locale",
295
+ "reflect": false
296
+ },
274
297
  "imageWidth": {
275
298
  "type": "number",
276
299
  "mutable": false,
@@ -23,6 +23,7 @@ const Template = (args) => `<vviinn-vpr-button token="${args.token}"
23
23
  position="${args.position}"
24
24
  add-style="${args.addStyle}"
25
25
  sidebar-title="${args.sidebarTitle}"
26
+ locale="${args.locale}"
26
27
  currency-sign="${args.currencySign}"
27
28
  modal-scrollbar="${args.modalScrollbar}"
28
29
  mode="${args.mode}"
@@ -35,6 +36,7 @@ const Template = (args) => `<vviinn-vpr-button token="${args.token}"
35
36
  grid-arrows-dynamic="${args.gridArrowsDynamic}"
36
37
  source-image="${args.sourceImage}"
37
38
  excluded="${args.excluded}"
39
+ api-path="${args.apiPath}"
38
40
  ></vviinn-vpr-button>`;
39
41
  export const Default = Template.bind({});
40
42
  Default.storyName = "Button";
@@ -51,12 +53,14 @@ Default.args = {
51
53
  position: "bottom",
52
54
  sourceImage: "https://www.moebel-shop.de/media/image/e3/e9/28/0749295-001_600x600.jpg",
53
55
  imageWidth: "300",
56
+ locale: "en-US",
54
57
  currencySign: "€",
55
58
  addStyle: true,
56
59
  modalScrollbar: false,
57
60
  noResultShow: true,
58
- noResultText: "No results! Please, try again later.",
61
+ noResultText: "",
59
62
  gridArrowsDynamic: false,
63
+ apiPath: "https://api.vviinn.com",
60
64
  };
61
65
  Default.parameters = {
62
66
  design: {
@@ -20,12 +20,13 @@ export class VviinnVprButton {
20
20
  this.modalScrollbar = false;
21
21
  this.campaigns = "";
22
22
  this.campaignType = "VPR";
23
+ this.locale = "de-DE";
23
24
  this.color = "";
24
25
  this.addStyle = true;
25
26
  this.mode = "continuity";
26
27
  this.imageWidth = 300;
27
28
  this.currencySign = "€";
28
- this.noResultText = "No results! Please, try again later.";
29
+ this.noResultText = "";
29
30
  this.noResultShow = true;
30
31
  this.gridArrowsDynamic = false;
31
32
  this.excluded = "";
@@ -48,6 +49,7 @@ export class VviinnVprButton {
48
49
  sidebar.campaigns = this.campaigns;
49
50
  sidebar.campaignType = this.campaignType;
50
51
  sidebar.color = this.color;
52
+ sidebar.locale = this.locale;
51
53
  sidebar.mode = this.position === "right" ? "grid" : this.mode;
52
54
  sidebar.imageWidth = this.imageWidth;
53
55
  sidebar.currencySign = this.currencySign;
@@ -166,7 +168,7 @@ export class VviinnVprButton {
166
168
  "optional": false,
167
169
  "docs": {
168
170
  "tags": [],
169
- "text": "Sidebar title"
171
+ "text": "Sidebar title (change it to fit your locale)"
170
172
  },
171
173
  "attribute": "sidebar-title",
172
174
  "reflect": false,
@@ -231,6 +233,29 @@ export class VviinnVprButton {
231
233
  "reflect": false,
232
234
  "defaultValue": "\"VPR\""
233
235
  },
236
+ "locale": {
237
+ "type": "string",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "Locale",
241
+ "resolved": "\"de-DE\" | \"en-US\"",
242
+ "references": {
243
+ "Locale": {
244
+ "location": "import",
245
+ "path": "../../locale"
246
+ }
247
+ }
248
+ },
249
+ "required": false,
250
+ "optional": false,
251
+ "docs": {
252
+ "tags": [],
253
+ "text": "The locale for currency formatting and text localization"
254
+ },
255
+ "attribute": "locale",
256
+ "reflect": false,
257
+ "defaultValue": "\"de-DE\""
258
+ },
234
259
  "color": {
235
260
  "type": "string",
236
261
  "mutable": false,
@@ -338,11 +363,11 @@ export class VviinnVprButton {
338
363
  "optional": false,
339
364
  "docs": {
340
365
  "tags": [],
341
- "text": "The message is displayed when no results"
366
+ "text": "A custom message is displayed when no results"
342
367
  },
343
368
  "attribute": "no-result-text",
344
369
  "reflect": false,
345
- "defaultValue": "\"No results! Please, try again later.\""
370
+ "defaultValue": "\"\""
346
371
  },
347
372
  "noResultShow": {
348
373
  "type": "boolean",
@@ -30,6 +30,7 @@ const Template = (args) => `
30
30
  no-result-text="${args.noResultText}"
31
31
  no-result-show="${args.noResultShow}"
32
32
  excluded="${args.excluded}"
33
+ api-path="${args.apiPath}"
33
34
  >
34
35
  </vviinn-vpr-widget>
35
36
  `;
@@ -52,8 +53,9 @@ Grid.args = {
52
53
  cssUrl: "",
53
54
  showScroll: false,
54
55
  noResultShow: true,
55
- noResultText: "No results! Please, try again later.",
56
+ noResultText: "",
56
57
  gridArrowsDynamic: false,
58
+ apiPath: "https://api.vviinn.com",
57
59
  };
58
60
  Grid.decorators = [gridDecorator];
59
61
  export const Continuity = Template.bind({});
@@ -75,7 +77,8 @@ Continuity.args = {
75
77
  cssUrl: "",
76
78
  showScroll: false,
77
79
  noResultShow: true,
78
- noResultText: "No results! Please, try again later.",
80
+ noResultText: "",
79
81
  gridArrowsDynamic: false,
82
+ apiPath: "https://api.vviinn.com",
80
83
  };
81
84
  Continuity.decorators = [continuityDecorator];
@@ -11,21 +11,23 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  import { Host, h, Fragment, } from "@stencil/core";
14
- import { version } from "../../../package.json";
14
+ import i18next from "i18next";
15
15
  import { pipe } from "fp-ts/lib/function";
16
+ import { Subject } from "rxjs";
17
+ import { v4 as uuidv4 } from "uuid";
16
18
  import * as TE from "fp-ts/lib/TaskEither";
17
19
  import * as E from "fp-ts/lib/Either";
20
+ import { version } from "../../../package.json";
18
21
  import { createBearAuthedHeader } from "./token-helpers";
19
22
  import { state } from "../../store/store";
20
23
  import { campaignTypeNames } from "../../campaign/Campaign";
21
24
  import { getRecommendationsService } from "../../campaign/CampaignService";
22
25
  import { imageSearchState } from "../../store/imageSearch.store";
23
- import { Subject } from "rxjs";
24
- import { v4 as uuidv4 } from "uuid";
25
26
  import { createTrackingApi } from "../../openApi";
26
27
  import { createProductClickVprEvent, createProductViewVprEvent, createWidgetVprEvent, } from "../../tracking";
27
28
  import { checkEmpryString } from "../../utils/option/option";
28
29
  import { parseExcluded } from "../../utils/collections/collectionsUtils";
30
+ import { resources } from "../../locale/resources-vpr";
29
31
  /**
30
32
  * @part product-card - Product Card itself.
31
33
  * @part product-part - Will be deprecated. Use "product-card" instead.
@@ -68,7 +70,7 @@ export class VviinnVprWidget {
68
70
  this.campaigns = "";
69
71
  this.color = "";
70
72
  this.gridArrowsDynamic = false;
71
- this.noResultText = "No results! Please, try again later.";
73
+ this.noResultText = "";
72
74
  this.noResultShow = true;
73
75
  this.showScroll = true;
74
76
  this.cssUrl = null;
@@ -159,6 +161,11 @@ export class VviinnVprWidget {
159
161
  this.trackingApi
160
162
  .trackEvent(widgetOpenEvent)
161
163
  .then(this.setTrackingDeactivated);
164
+ i18next.init({
165
+ lng: this.locale,
166
+ fallbackLng: "de-DE",
167
+ resources,
168
+ });
162
169
  }
163
170
  disconnectedCallback() {
164
171
  if (this.trackingDeactivated)
@@ -222,7 +229,9 @@ export class VviinnVprWidget {
222
229
  empty: this.recommendations.length == 0,
223
230
  [this.mode]: true,
224
231
  }, "aria-hidden": "false" }, h(Fragment, null, this.renderExternalCSS(), h("style", null, state.fallbackStyles), h("h2", { part: "recommendations-title" }, this.blockTitle), this.recommendations.length > 0 &&
225
- (this.useCarousel ? this.renderCarousel() : this.renderResults()), this.recommendations.length === 0 && this.hasErrorOnLoad && (h("p", { class: "no-result-text" }, this.noResultText)))));
232
+ (this.useCarousel ? this.renderCarousel() : this.renderResults()), this.recommendations.length === 0 && this.hasErrorOnLoad && (h("p", { class: "no-result-text" }, this.noResultText.length
233
+ ? this.noResultText
234
+ : i18next.t("noResultText"))))));
226
235
  }
227
236
  renderRecommendation(recommendation, index) {
228
237
  return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, productType: recommendation.productType, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard(), campaignTypeId: this.campaignType, index: index, widgetElementId: this.id, widgetVersion: version }));
@@ -265,7 +274,7 @@ export class VviinnVprWidget {
265
274
  "optional": false,
266
275
  "docs": {
267
276
  "tags": [],
268
- "text": "Widget\u2019s title"
277
+ "text": "Widget\u2019s title (change it to fit your locale)"
269
278
  },
270
279
  "attribute": "block-title",
271
280
  "reflect": false,
@@ -427,15 +436,20 @@ export class VviinnVprWidget {
427
436
  "type": "string",
428
437
  "mutable": false,
429
438
  "complexType": {
430
- "original": "string",
431
- "resolved": "string",
432
- "references": {}
439
+ "original": "Locale",
440
+ "resolved": "\"de-DE\" | \"en-US\"",
441
+ "references": {
442
+ "Locale": {
443
+ "location": "import",
444
+ "path": "../../locale"
445
+ }
446
+ }
433
447
  },
434
448
  "required": false,
435
449
  "optional": false,
436
450
  "docs": {
437
451
  "tags": [],
438
- "text": "The locale for currency formatting"
452
+ "text": "The locale for currency formatting and text localization"
439
453
  },
440
454
  "attribute": "locale",
441
455
  "reflect": false,
@@ -507,11 +521,11 @@ export class VviinnVprWidget {
507
521
  "optional": false,
508
522
  "docs": {
509
523
  "tags": [],
510
- "text": "The message is displayed when no results"
524
+ "text": "A custom message is displayed when no results"
511
525
  },
512
526
  "attribute": "no-result-text",
513
527
  "reflect": false,
514
- "defaultValue": "\"No results! Please, try again later.\""
528
+ "defaultValue": "\"\""
515
529
  },
516
530
  "noResultShow": {
517
531
  "type": "boolean",
@@ -31,6 +31,7 @@ const Template = (args) => `
31
31
  locale="${args.locale}"
32
32
  mode="${args.mode}"
33
33
  product-detail-new-tab="${args.productDetailNewTab}"
34
+ api-path="${args.apiPath}"
34
35
  ></vviinn-vps-button>`;
35
36
  export const Modal = Template.bind({});
36
37
  Modal.storyName = "Modal";
@@ -43,6 +44,7 @@ Modal.args = {
43
44
  locale: "en-US",
44
45
  currencySign: "€",
45
46
  addStyle: true,
47
+ apiPath: "https://api.vviinn.com",
46
48
  };
47
49
  export const Upload = Template.bind({});
48
50
  Upload.args = {
@@ -54,4 +56,5 @@ Upload.args = {
54
56
  locale: "en-US",
55
57
  currencySign: "€",
56
58
  addStyle: true,
59
+ apiPath: "https://api.vviinn.com",
57
60
  };
@@ -131,15 +131,20 @@ export class VviinnVpsButton {
131
131
  "type": "string",
132
132
  "mutable": false,
133
133
  "complexType": {
134
- "original": "string",
135
- "resolved": "string",
136
- "references": {}
134
+ "original": "Locale",
135
+ "resolved": "\"de-DE\" | \"en-US\"",
136
+ "references": {
137
+ "Locale": {
138
+ "location": "import",
139
+ "path": "../../locale"
140
+ }
141
+ }
137
142
  },
138
143
  "required": false,
139
144
  "optional": false,
140
145
  "docs": {
141
146
  "tags": [],
142
- "text": "The locale for currency formatting"
147
+ "text": "The locale for currency formatting and text localization"
143
148
  },
144
149
  "attribute": "locale",
145
150
  "reflect": false,
@@ -7,14 +7,15 @@ export default {
7
7
  },
8
8
  },
9
9
  };
10
- const Template = ({ token, campaignId, currencySign, locale, active, excluded, productDetailNewTab, }) => `
11
- <vviinn-vps-widget token="${token}"
12
- campaign-id="${campaignId}"
13
- currency-sign="${currencySign}"
14
- locale="${locale}"
15
- active="${active}"
16
- excluded="${excluded}"
17
- product-detail-new-tab="${productDetailNewTab}"
10
+ const Template = (args) => `
11
+ <vviinn-vps-widget token="${args.token}"
12
+ campaign-id="${args.campaignId}"
13
+ currency-sign="${args.currencySign}"
14
+ locale="${args.locale}"
15
+ active="${args.active}"
16
+ excluded="${args.excluded}"
17
+ product-detail-new-tab="${args.productDetailNewTab}"
18
+ api-path="${args.apiPath}"
18
19
  >
19
20
  </vviinn-vps-widget>`;
20
21
  export const Default = Template.bind({});
@@ -26,6 +27,7 @@ Default.args = {
26
27
  locale: "en-US",
27
28
  currencySign: "€",
28
29
  active: true,
30
+ apiPath: "https://api.vviinn.com",
29
31
  };
30
32
  Default.storyName = "Main";
31
33
  Default.decorators = [