@ppg_pl/pallete 2.0.23 → 2.0.26

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 (90) hide show
  1. package/README.md +12 -5
  2. package/dist/cjs/{index-53e78fc8.js → index-d74cbc0d.js} +33 -2
  3. package/dist/cjs/index-d74cbc0d.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js.map +1 -1
  6. package/dist/cjs/my-backdrop_8.cjs.entry.js +1651 -1286
  7. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  8. package/dist/cjs/pallete.cjs.js +2 -2
  9. package/dist/cjs/pallete.cjs.js.map +1 -1
  10. package/dist/collection/components/my-backdrop/my-backdrop.css +7 -0
  11. package/dist/collection/components/my-colorbox/my-colorbox.css +7 -0
  12. package/dist/collection/components/my-colorinfo/assets/Shape.svg +4 -0
  13. package/dist/collection/components/my-colorinfo/assets/close.png +0 -0
  14. package/dist/collection/components/my-colorinfo/assets/shape.png +0 -0
  15. package/dist/collection/components/my-colorinfo/my-colorinfo.css +350 -0
  16. package/dist/collection/components/my-colorinfo/my-colorinfo.js +135 -1
  17. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
  18. package/dist/collection/components/my-component/my-component.js +68 -1
  19. package/dist/collection/components/my-component/my-component.js.map +1 -1
  20. package/dist/collection/components/my-modal/my-modal.css +8 -239
  21. package/dist/collection/components/my-modal/my-modal.js +42 -2
  22. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  23. package/dist/collection/components/my-search/my-search.css +7 -0
  24. package/dist/collection/components/my-slider/index.js +9 -6
  25. package/dist/collection/components/my-slider/index.js.map +1 -1
  26. package/dist/collection/components/my-slider/my-slider.css +12 -3
  27. package/dist/collection/types.js.map +1 -1
  28. package/dist/components/index3.js +10 -7
  29. package/dist/components/index3.js.map +1 -1
  30. package/dist/components/my-backdrop2.js +1 -1
  31. package/dist/components/my-backdrop2.js.map +1 -1
  32. package/dist/components/my-colorbox2.js +1 -1
  33. package/dist/components/my-colorbox2.js.map +1 -1
  34. package/dist/components/my-colorinfo2.js +46 -3
  35. package/dist/components/my-colorinfo2.js.map +1 -1
  36. package/dist/components/my-component.js +15 -3
  37. package/dist/components/my-component.js.map +1 -1
  38. package/dist/components/my-modal2.js +1589 -1274
  39. package/dist/components/my-modal2.js.map +1 -1
  40. package/dist/components/my-search2.js +1 -1
  41. package/dist/components/my-search2.js.map +1 -1
  42. package/dist/esm/{index-b0145abf.js → index-45a30349.js} +33 -2
  43. package/dist/esm/index-45a30349.js.map +1 -0
  44. package/dist/esm/loader.js +3 -3
  45. package/dist/esm/loader.js.map +1 -1
  46. package/dist/esm/my-backdrop_8.entry.js +1651 -1286
  47. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  48. package/dist/esm/pallete.js +3 -3
  49. package/dist/esm/pallete.js.map +1 -1
  50. package/dist/pallete/assets/Shape.svg +4 -0
  51. package/dist/pallete/assets/shape.png +0 -0
  52. package/dist/pallete/p-2394bcec.entry.js +2 -0
  53. package/dist/pallete/p-2394bcec.entry.js.map +1 -0
  54. package/dist/pallete/p-a3449132.js +3 -0
  55. package/dist/pallete/p-a3449132.js.map +1 -0
  56. package/dist/pallete/pallete.css +1 -1
  57. package/dist/pallete/pallete.esm.js +1 -1
  58. package/dist/pallete/pallete.esm.js.map +1 -1
  59. package/dist/types/components/my-colorinfo/my-colorinfo.d.ts +11 -1
  60. package/dist/types/components/my-component/my-component.d.ts +9 -0
  61. package/dist/types/components/my-modal/my-modal.d.ts +3 -1
  62. package/dist/types/components.d.ts +24 -2
  63. package/dist/types/types.d.ts +4 -0
  64. package/package.json +5 -4
  65. package/www/build/assets/Shape.svg +4 -0
  66. package/www/build/assets/shape.png +0 -0
  67. package/www/build/p-2394bcec.entry.js +2 -0
  68. package/www/build/p-2394bcec.entry.js.map +1 -0
  69. package/www/build/p-a3449132.js +3 -0
  70. package/www/build/p-a3449132.js.map +1 -0
  71. package/www/build/p-c5910eb7.js +2 -0
  72. package/www/build/p-f8a0208d.css +1 -0
  73. package/www/build/pallete.css +1 -1
  74. package/www/build/pallete.esm.js +1 -1
  75. package/www/build/pallete.esm.js.map +1 -1
  76. package/www/index.html +62 -10
  77. package/dist/cjs/index-53e78fc8.js.map +0 -1
  78. package/dist/esm/index-b0145abf.js.map +0 -1
  79. package/dist/pallete/p-bdb05818.entry.js +0 -2
  80. package/dist/pallete/p-bdb05818.entry.js.map +0 -1
  81. package/dist/pallete/p-c6a049a2.js +0 -3
  82. package/dist/pallete/p-c6a049a2.js.map +0 -1
  83. package/www/build/p-bdb05818.entry.js +0 -2
  84. package/www/build/p-bdb05818.entry.js.map +0 -1
  85. package/www/build/p-c6a049a2.js +0 -3
  86. package/www/build/p-c6a049a2.js.map +0 -1
  87. /package/www/{build/assets → assets}/fonts/Galatea-Regular.eot +0 -0
  88. /package/www/{build/assets → assets}/fonts/Galatea-Regular.ttf +0 -0
  89. /package/www/{build/assets → assets}/fonts/Galatea-Regular.woff +0 -0
  90. /package/www/{build/assets → assets}/fonts/Galatea-Regular.woff2 +0 -0
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
2
2
 
3
- const myBackdropCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}my-backdrop{width:100%;height:100%;background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:100;left:0;top:0}";
3
+ const myBackdropCss = "@font-face{font-family:\"Galatea\";src:url(\"/assets/fonts/Galatea-Regular.woff2\") format(\"woff2\"), url(\"/assets/fonts/Galatea-Regular.woff\") format(\"woff\"), url(\"/assets/fonts/Galatea-Regular.ttf\") format(\"truetype\");font-weight:normal;font-style:normal;font-display:swap}.pallete-wrapper *{font-family:\"Galatea\", sans-serif}my-backdrop{width:100%;height:100%;background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:100;left:0;top:0}";
4
4
 
5
5
  const MyBackdrop = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -1 +1 @@
1
- {"file":"my-backdrop2.js","mappings":";;AAAA,MAAM,aAAa,GAAG,wKAAwK;;MCMjL,UAAU;;;;;EACrB,MAAM;IACJ,OAAO,IAAI,CAAC;GACb;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-backdrop/my-backdrop.scss?tag=my-backdrop","./src/components/my-backdrop/my-backdrop.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\nmy-backdrop {\n width: 100%;\n height: 100%;\n background-color: $backdrop_black;\n position: fixed;\n z-index: 100;\n left: 0;\n top: 0;\n}\n","import { Component } from '@stencil/core';\n\n@Component({\n tag: 'my-backdrop',\n styleUrl: 'my-backdrop.scss',\n})\nexport class MyBackdrop {\n render() {\n return null;\n }\n}\n"],"version":3}
1
+ {"file":"my-backdrop2.js","mappings":";;AAAA,MAAM,aAAa,GAAG,ocAAoc;;MCM7c,UAAU;;;;;EACrB,MAAM;IACJ,OAAO,IAAI,CAAC;GACb;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-backdrop/my-backdrop.scss?tag=my-backdrop","./src/components/my-backdrop/my-backdrop.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\nmy-backdrop {\n width: 100%;\n height: 100%;\n background-color: $backdrop_black;\n position: fixed;\n z-index: 100;\n left: 0;\n top: 0;\n}\n","import { Component } from '@stencil/core';\n\n@Component({\n tag: 'my-backdrop',\n styleUrl: 'my-backdrop.scss',\n})\nexport class MyBackdrop {\n render() {\n return null;\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
2
2
  import { s as setDataLayer } from './gtmUtils.js';
3
3
  import { A as APIURL, a as accessToken } from './index2.js';
4
4
 
5
- const myColorboxCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-color-box{width:125px;height:125px;display:block;margin-bottom:5px;cursor:pointer;display:flex;flex-direction:column;justify-content:flex-end;position:relative}@media (max-width: 1024px){.my-color-box{width:65px;height:65px}}.my-color-box .color-name{width:100%;background-color:#fff;padding:15px 0px 10px;border-top-left-radius:15px;border-top-right-radius:15px;opacity:0;transition:0.3s opacity ease-in-out;font-size:10px;color:#232323;text-transform:lowercase}.my-color-box.active .color-name{opacity:1}.my-color-box.categoryactive{width:120px;height:115px}.my-color-box.categoryactive .color-name{opacity:1}@media (max-width: 1024px){.my-color-box.categoryactive{width:72px;height:72px}}.my-color-box:hover .color-name{opacity:1}";
5
+ const myColorboxCss = "@font-face{font-family:\"Galatea\";src:url(\"/assets/fonts/Galatea-Regular.woff2\") format(\"woff2\"), url(\"/assets/fonts/Galatea-Regular.woff\") format(\"woff\"), url(\"/assets/fonts/Galatea-Regular.ttf\") format(\"truetype\");font-weight:normal;font-style:normal;font-display:swap}.pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-color-box{width:125px;height:125px;display:block;margin-bottom:5px;cursor:pointer;display:flex;flex-direction:column;justify-content:flex-end;position:relative}@media (max-width: 1024px){.my-color-box{width:65px;height:65px}}.my-color-box .color-name{width:100%;background-color:#fff;padding:15px 0px 10px;border-top-left-radius:15px;border-top-right-radius:15px;opacity:0;transition:0.3s opacity ease-in-out;font-size:10px;color:#232323;text-transform:lowercase}.my-color-box.active .color-name{opacity:1}.my-color-box.categoryactive{width:120px;height:115px}.my-color-box.categoryactive .color-name{opacity:1}@media (max-width: 1024px){.my-color-box.categoryactive{width:72px;height:72px}}.my-color-box:hover .color-name{opacity:1}";
6
6
 
7
7
  const MyColorBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  constructor() {
@@ -1 +1 @@
1
- {"file":"my-colorbox2.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,0xBAA0xB;;MCSnyB,UAAU;;;;IAWrB,eAAU,GAAG;MACX,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC7B,YAAY,CAAC;UACX,KAAK,EAAE,YAAY;UACnB,IAA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,OAAO,MAAM,WAAW,IAAI,CAAC,iBAAiB,CAAC,QAAQ,iBAAiB,WAAW,GAAG,GAAG,EAAE;QACxJ,UAAU,EAAE,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,iBAAiB,IAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK;QACpG,MAAM,EAAE,IAAI,CAAC,gBAAgB,GAAG,aAAa,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE;OACjF,IAED,WAAK,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,IAAI,CAAO,CACrC,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorbox/my-colorbox.scss?tag=my-colorbox","./src/components/my-colorbox/my-colorbox.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.my-color-box {\n width: 125px;\n height: 125px;\n display: block;\n margin-bottom: 5px;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n position: relative;\n\n @media (max-width: $medium) {\n width: 65px;\n height: 65px;\n }\n .color-name {\n width: 100%;\n background-color: $white;\n padding: 15px 0px 10px;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n opacity: 0;\n transition: 0.3s opacity ease-in-out;\n font-size: 10px;\n color: $black;\n text-transform: lowercase;\n }\n &.active {\n .color-name {\n opacity: 1;\n }\n }\n\n &.categoryactive {\n width: 120px;\n height: 115px;\n .color-name {\n opacity: 1;\n }\n\n @media (max-width: $medium) {\n width: 72px;\n height: 72px;\n }\n }\n &:hover {\n .color-name {\n opacity: 1;\n }\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { ColorBoxyIsImageInsteadHex } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorbox',\n styleUrl: 'my-colorbox.scss',\n})\nexport class MyColorBox {\n private checkTimeout: ReturnType<typeof setTimeout> | undefined;\n\n @Prop() color: string;\n @Prop() name: string;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() isActive?: boolean;\n @Prop() isCategoryActive?: boolean;\n @Prop() isImageInsteadHex?: ColorBoxyIsImageInsteadHex;\n\n colorCheck = () => {\n this.checkTimeout = setTimeout(() => {\n setDataLayer({\n event: 'ColorCheck',\n shop: this.shop,\n product: this.product,\n color: this.name,\n });\n }, 2000);\n };\n\n colorUnCheck = () => {\n if (this.checkTimeout) clearTimeout(this.checkTimeout);\n this.checkTimeout = undefined;\n };\n\n darkenColor = (color: string) => {\n const red = parseInt(color[1] + color[2], 16) - 20;\n const green = parseInt(color[3] + color[4], 16) - 20;\n const blue = parseInt(color[5] + color[6], 16) - 20;\n return `rgb(${red},${green},${blue})`;\n };\n\n render() {\n return (\n <div\n onMouseEnter={() => this.colorCheck()}\n onMouseLeave={() => this.colorUnCheck()}\n class={`my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`}\n style={{\n backgroundSize: this.isImageInsteadHex?.isImageInsteadHex ? 'cover' : '',\n backgroundImage: this.isImageInsteadHex?.isImageInsteadHex ? `url(${APIURL}/assets/${this.isImageInsteadHex.bigImage}?access_token=${accessToken})` : '',\n background: this.isImageInsteadHex?.isImageInsteadHex ? this.isImageInsteadHex.bigImage : this.color,\n border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',\n }}\n >\n <div class=\"color-name\">{this.name}</div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"my-colorbox2.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,sjCAAsjC;;MCS/jC,UAAU;;;;IAWrB,eAAU,GAAG;MACX,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC7B,YAAY,CAAC;UACX,KAAK,EAAE,YAAY;UACnB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,IAA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E;QACxJ,UAAU,EAAE,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,iBAAiB,IAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK;QACpG,MAAM,EAAE,IAAI,CAAC,gBAAgB,GAAG,aAAa,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE;OACjF,IAED,WAAK,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,IAAI,CAAO,CACrC,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorbox/my-colorbox.scss?tag=my-colorbox","./src/components/my-colorbox/my-colorbox.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.my-color-box {\n width: 125px;\n height: 125px;\n display: block;\n margin-bottom: 5px;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n position: relative;\n\n @media (max-width: $medium) {\n width: 65px;\n height: 65px;\n }\n .color-name {\n width: 100%;\n background-color: $white;\n padding: 15px 0px 10px;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n opacity: 0;\n transition: 0.3s opacity ease-in-out;\n font-size: 10px;\n color: $black;\n text-transform: lowercase;\n }\n &.active {\n .color-name {\n opacity: 1;\n }\n }\n\n &.categoryactive {\n width: 120px;\n height: 115px;\n .color-name {\n opacity: 1;\n }\n\n @media (max-width: $medium) {\n width: 72px;\n height: 72px;\n }\n }\n &:hover {\n .color-name {\n opacity: 1;\n }\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { ColorBoxyIsImageInsteadHex } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorbox',\n styleUrl: 'my-colorbox.scss',\n})\nexport class MyColorBox {\n private checkTimeout: ReturnType<typeof setTimeout> | undefined;\n\n @Prop() color: string;\n @Prop() name: string;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() isActive?: boolean;\n @Prop() isCategoryActive?: boolean;\n @Prop() isImageInsteadHex?: ColorBoxyIsImageInsteadHex;\n\n colorCheck = () => {\n this.checkTimeout = setTimeout(() => {\n setDataLayer({\n event: 'ColorCheck',\n shop: this.shop,\n product: this.product,\n color: this.name,\n });\n }, 2000);\n };\n\n colorUnCheck = () => {\n if (this.checkTimeout) clearTimeout(this.checkTimeout);\n this.checkTimeout = undefined;\n };\n\n darkenColor = (color: string) => {\n const red = parseInt(color[1] + color[2], 16) - 20;\n const green = parseInt(color[3] + color[4], 16) - 20;\n const blue = parseInt(color[5] + color[6], 16) - 20;\n return `rgb(${red},${green},${blue})`;\n };\n\n render() {\n return (\n <div\n onMouseEnter={() => this.colorCheck()}\n onMouseLeave={() => this.colorUnCheck()}\n class={`my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`}\n style={{\n backgroundSize: this.isImageInsteadHex?.isImageInsteadHex ? 'cover' : '',\n backgroundImage: this.isImageInsteadHex?.isImageInsteadHex ? `url(${APIURL}/assets/${this.isImageInsteadHex.bigImage}?access_token=${accessToken})` : '',\n background: this.isImageInsteadHex?.isImageInsteadHex ? this.isImageInsteadHex.bigImage : this.color,\n border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',\n }}\n >\n <div class=\"color-name\">{this.name}</div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -3,11 +3,14 @@ import { s as setDataLayer } from './gtmUtils.js';
3
3
  import { A as APIURL, a as accessToken } from './index2.js';
4
4
  import { d as defineCustomElement$1 } from './index3.js';
5
5
 
6
+ const myColorinfoCss = "@font-face{font-family:\"Galatea\";src:url(\"/assets/fonts/Galatea-Regular.woff2\") format(\"woff2\"), url(\"/assets/fonts/Galatea-Regular.woff\") format(\"woff\"), url(\"/assets/fonts/Galatea-Regular.ttf\") format(\"truetype\");font-weight:normal;font-style:normal;font-display:swap}.pallete-wrapper.sc-my-colorinfo *.sc-my-colorinfo{font-family:\"Galatea\", sans-serif}.boxes__box-content.sc-my-colorinfo{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.boxes__box-content.sc-my-colorinfo .closebtn.sc-my-colorinfo{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.boxes__box-content.sc-my-colorinfo{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.boxes__box-content.sc-my-colorinfo{margin:0 auto}}.boxes__box-content__info.sc-my-colorinfo{width:40%;padding:50px 40px;position:relative;display:flex;flex-direction:column;justify-content:space-between}@media (max-width: 1024px){.boxes__box-content__info.sc-my-colorinfo{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.boxes__box-content__info.sc-my-colorinfo{min-height:auto}}.boxes__box-content__info__header.sc-my-colorinfo{display:flex;flex-direction:column;align-items:flex-start}.boxes__box-content__info.sc-my-colorinfo h2.sc-my-colorinfo{font-size:35px;font-weight:normal;margin-bottom:30px;color:#232323}@media (max-width: 768px){.boxes__box-content__info.sc-my-colorinfo h2.sc-my-colorinfo{font-size:16px;text-align:center;margin-bottom:15px;margin-top:5px}}.boxes__box-content__info.sc-my-colorinfo h4.sc-my-colorinfo{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.boxes__box-content__info__value.sc-my-colorinfo{display:flex;flex-direction:column;align-items:flex-start;gap:20px}@media (max-width: 1024px){.boxes__box-content__info__value.sc-my-colorinfo{justify-content:flex-start;margin-top:30px}}@media (max-width: 768px){.boxes__box-content__info__value.sc-my-colorinfo{flex-direction:column}}@media (max-width: 768px){.boxes__box-content__info__value-image.sc-my-colorinfo{margin:0 auto;margin-bottom:10px}}.boxes__box-content__info__value-image.sc-my-colorinfo img.sc-my-colorinfo{width:114px;object-fit:cover}@media (max-width: 1024px){.boxes__box-content__info__value-image.sc-my-colorinfo img.sc-my-colorinfo{width:75px}}.boxes__box-content__info__value-product.sc-my-colorinfo{color:#232323;margin-left:10px}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo h2.sc-my-colorinfo{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo h2.sc-my-colorinfo{font-size:16px}}.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo{font-size:20px;margin-top:0px;margin-bottom:0px}.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo:last-of-type{margin-bottom:0}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo p.sc-my-colorinfo{font-size:10px}}@media (max-width: 1024px){.boxes__box-content__info__value-product.sc-my-colorinfo>div.sc-my-colorinfo{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.boxes__box-content__info__value-product.sc-my-colorinfo>div.sc-my-colorinfo{flex-direction:column}}.boxes__box-content__info__tester.sc-my-colorinfo{display:flex;flex-direction:column;gap:15px;width:100%}@media (max-width: 1024px){.boxes__box-content__info__tester.sc-my-colorinfo{text-align:center}}.boxes__box-content__info__tester.sc-my-colorinfo .tester-text.sc-my-colorinfo h2.sc-my-colorinfo{margin:0 0 10px;font-size:18px;font-weight:700}.boxes__box-content__info__tester.sc-my-colorinfo .tester-text.sc-my-colorinfo p.sc-my-colorinfo{margin:0;font-size:14px}.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo{display:flex;align-items:center;gap:15px}@media (max-width: 1024px){.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo{flex-direction:column}.boxes__box-content__info__tester.sc-my-colorinfo .tester-buy.sc-my-colorinfo button.sc-my-colorinfo{margin:0;max-width:100%}}.boxes__box-content__info__tester.sc-my-colorinfo .price.sc-my-colorinfo{font-size:20px;font-weight:600}.boxes__box-content__slider.sc-my-colorinfo{width:60%;min-width:60%;max-width:60%;position:relative}@media (max-width: 1024px){.boxes__box-content__slider.sc-my-colorinfo{width:100%;display:block;min-width:100%;max-width:100%}}.boxes__box-content__slider.sc-my-colorinfo .color-big-image.sc-my-colorinfo{width:100%;height:100%;object-fit:cover}@media (max-width: 1024px){.boxes__box-content__slider.sc-my-colorinfo .color-big-image.sc-my-colorinfo{height:300px}}.boxes__box-content__white.sc-my-colorinfo .tester-text.sc-my-colorinfo,.boxes__box-content__white.sc-my-colorinfo .tester-buy.sc-my-colorinfo{color:#fff}.boxes__box-content__white.sc-my-colorinfo h2.sc-my-colorinfo{color:#fff}.button.sc-my-colorinfo,a.button.sc-my-colorinfo{background-color:#fff;font-size:16px;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);border-radius:22px;padding:10px 35px;color:#232323;text-decoration:none;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer;display:flex;align-items:center;gap:5px}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo{display:inline-flex}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo svg.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo svg.sc-my-colorinfo{display:block}.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo path.sc-my-colorinfo,.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo .shape-icon__path.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo path.sc-my-colorinfo,a.button.sc-my-colorinfo .shape-icon.sc-my-colorinfo .shape-icon__path.sc-my-colorinfo{fill:currentColor;transition:fill 0.7s ease-in-out}.button.fit.sc-my-colorinfo,a.button.fit.sc-my-colorinfo{padding:10px 15px}.button.sc-my-colorinfo:hover,a.button.sc-my-colorinfo:hover{color:#fff;background-color:#232323}.button.brown.sc-my-colorinfo,a.button.brown.sc-my-colorinfo{background-color:#3c2114;color:#fff}.button.brown.sc-my-colorinfo:hover,a.button.brown.sc-my-colorinfo:hover{color:#fff;background-color:#232323}.button.inverse.sc-my-colorinfo,a.button.inverse.sc-my-colorinfo{background-color:#232323;color:#fff}.button.inverse.sc-my-colorinfo:hover,a.button.inverse.sc-my-colorinfo:hover{color:#232323;background-color:#fff}.button.inverse.sc-my-colorinfo svg.sc-my-colorinfo path.sc-my-colorinfo,a.button.inverse.sc-my-colorinfo svg.sc-my-colorinfo path.sc-my-colorinfo{fill:#fff}.button.sc-my-colorinfo:disabled,a.button.sc-my-colorinfo:disabled{cursor:not-allowed;background-color:white;opacity:0.5}.button.sc-my-colorinfo:disabled.brown,a.button.sc-my-colorinfo:disabled.brown{background-color:black;color:white;opacity:0.5}.button.sc-my-colorinfo:disabled.inverse,a.button.sc-my-colorinfo:disabled.inverse{background-color:black;color:white;opacity:0.5}.button.sc-my-colorinfo:disabled:hover,a.button.sc-my-colorinfo:disabled:hover{background-color:inherit;color:inherit;opacity:0.5}@media (max-width: 1024px){.button.sc-my-colorinfo,a.button.sc-my-colorinfo{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.button.sc-my-colorinfo,a.button.sc-my-colorinfo{margin:0 auto}}.divider.sc-my-colorinfo{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.divider.sc-my-colorinfo{margin:10px 0px;display:none}}";
7
+
6
8
  const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
9
  constructor() {
8
10
  super();
9
11
  this.__registerHost();
10
12
  this.closeInfoBox = createEvent(this, "closeInfoBox", 7);
13
+ this.addToBasket = createEvent(this, "addToBasket", 7);
11
14
  this.goToProduct = () => {
12
15
  var _a;
13
16
  this.currentColor &&
@@ -43,14 +46,48 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
43
46
  this.capitalizeFirstLetter = (string) => {
44
47
  return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();
45
48
  };
49
+ this.isVeryLightBackground = () => {
50
+ var _a, _b;
51
+ if (this.currentColor.imageInsteadHex)
52
+ return true;
53
+ const hex = (_b = (_a = this.currentColor.hex) === null || _a === void 0 ? void 0 : _a.replace('#', '')) !== null && _b !== void 0 ? _b : '';
54
+ if (hex.length !== 6 && hex.length !== 3)
55
+ return false;
56
+ const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;
57
+ const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;
58
+ const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;
59
+ const luminance = 0.299 * r + 0.587 * g + 0.114 * b;
60
+ return luminance > 0.96; // only near-white: dark button; rest: white button
61
+ };
62
+ this.getButtonClass = () => {
63
+ if (this.currentColor.imageInsteadHex)
64
+ return 'brown';
65
+ return this.isVeryLightBackground() ? 'inverse' : '';
66
+ };
67
+ this.handleAddToBasket = () => {
68
+ var _a;
69
+ if (!((_a = this.availableTesters) === null || _a === void 0 ? void 0 : _a.id_product_attribute))
70
+ return;
71
+ this.buttonBlocked = true;
72
+ this.addToBasket.emit({
73
+ id: this.availableTesters.id_product_attribute,
74
+ });
75
+ setTimeout(() => {
76
+ this.buttonBlocked = false;
77
+ }, 10000);
78
+ };
46
79
  this.currentColor = undefined;
47
80
  this.shop = undefined;
48
81
  this.product = undefined;
49
82
  this.baselink = undefined;
83
+ this.availableTesters = undefined;
84
+ this.price = undefined;
50
85
  this.data = null;
51
86
  this.isMobile = false;
52
87
  this.infoBoxWidth = undefined;
53
88
  this.closeImage = 'close.png';
89
+ this.shapeImage = 'Shape.svg';
90
+ this.buttonBlocked = false;
54
91
  }
55
92
  render() {
56
93
  var _a;
@@ -59,17 +96,23 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
59
96
  maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
60
97
  } }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
61
98
  maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
62
- } }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("h2", null, this.capitalizeFirstLetter(this.currentColor.name)), !this.isMobile && h("h4", null, this.currentColor.number), h("div", { class: "boxes__box-content__info__value" }, h("div", { class: "boxes__box-content__info__value-product" }, this.isMobile && h("div", { class: 'divider' }), this.currentColor && ((_a = this.currentColor.links) === null || _a === void 0 ? void 0 : _a.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (h("a", { onClick: this.goToProduct, href: this.getHref(), class: `button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
99
+ } }, h("div", { class: "boxes__box-content__info__header" }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("h2", null, this.capitalizeFirstLetter(this.currentColor.name)), !this.isMobile && h("h4", null, this.currentColor.number), this.currentColor && ((_a = this.currentColor.links) === null || _a === void 0 ? void 0 : _a.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (h("a", { onClick: this.goToProduct, href: this.getHref(), class: `button ${this.getButtonClass()}` }, "wybierz kolor"))), h("div", { class: "boxes__box-content__info__value" }, h("div", { class: "divider" }), h("div", { class: "boxes__box-content__info__tester" }, ' ', h("div", { class: "divider" }), h("div", { class: "tester-text" }, h("h2", null, "Zam\u00F3w tester"), h("p", null, "Sprawd\u017A go na swojej \u015Bcianie.")), h("div", { class: "tester-buy" }, h("div", { class: "price" }, this.price ? `${this.price} zł` : ''), h("button", { class: `button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`, onClick: this.handleAddToBasket, disabled: !this.availableTesters || this.buttonBlocked }, h("span", { class: "shape-icon", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "16", viewBox: "0 0 15 16" }, h("path", { class: "shape-icon__path", transform: "translate(0.0867462 0)", d: "M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z" }))), this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
63
100
  }
64
- }, [0, "my-colorinfo", {
101
+ static get assetsDirs() { return ["assets"]; }
102
+ static get style() { return myColorinfoCss; }
103
+ }, [2, "my-colorinfo", {
65
104
  "currentColor": [16],
66
105
  "shop": [1],
67
106
  "product": [1],
68
107
  "baselink": [1],
108
+ "availableTesters": [16],
109
+ "price": [2],
69
110
  "data": [16],
70
111
  "isMobile": [4, "is-mobile"],
71
112
  "infoBoxWidth": [2, "info-box-width"],
72
- "closeImage": [1, "close-image"]
113
+ "closeImage": [1, "close-image"],
114
+ "shapeImage": [1, "shape-image"],
115
+ "buttonBlocked": [4, "button-blocked"]
73
116
  }]);
74
117
  function defineCustomElement() {
75
118
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"my-colorinfo2.js","mappings":";;;;;MAQa,WAAW;;;;;IAYtB,gBAAW,GAAG;;MACZ,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI;SAC/B,CAAC,CAAC;MACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,uBAAkB,GAAG;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,wBAAmB,GAAG;;MACpB,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;QACrC,OAAO,WAAK,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,MA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I,CAAC,IAAI,CAAC,CAAA,KAC3F,SACE,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,UAAU,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,GAAG,SAAS,GAAG,EAAE,EAAE,oBAG/G,CACL,CACG,CACF,CACF,EACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorinfo/my-colorinfo.tsx"],"sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n\n @Event() closeInfoBox: EventEmitter;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n\n <div class=\"boxes__box-content__info__value\">\n {/* <div class=\"boxes__box-content__info__value-image\">\n {this.currentColor?.image! && <img src={`${APIURL}/assets/${this.currentColor.image}?access_token=${accessToken}`} alt=\"color-image\" />}\n </div> */}\n <div class=\"boxes__box-content__info__value-product\">\n {/* <div>\n {!this.isMobile && <p>Produkt:</p>}\n {this.isMobile && <h2>{this.currentColor?.name}</h2>} <p>{this.product}</p>\n </div> */}\n\n {this.isMobile && <div class={'divider'}></div>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a\n onClick={this.goToProduct}\n href={this.getHref()}\n class={`button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}`}\n >\n wybierz kolor\n </a>\n )}\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"],"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1C,GAAG,EACJ,WAAK,KAAK,EAAC,SAAS,GAAO,EAC3B,WAAK,KAAK,EAAC,aAAa,IACtB,kCAAqB,EACrB,uDAAoC,CAChC,EACN,WAAK,KAAK,EAAC,YAAY,IACrB,WAAK,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,KAAK,GAAG,EAAE,CAAO,EAE/D,cACE,KAAK,EAAE,cAAc,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,UAAU,GAAG,EAAE,EAAE,EACxF,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,aAAa,IAEtD,YAAM,KAAK,EAAC,YAAY,iBAAa,MAAM,IACzC,WAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,IAChF,YACE,KAAK,EAAC,kBAAkB,EACxB,SAAS,EAAC,wBAAwB,EAClC,CAAC,EAAC,ynDAAynD,GAC3nD,CACE,CACD,EAGN,IAAI,CAAC,aAAa,GAAG,oBAAoB,GAAG,CAAC,IAAI,CAAC,gBAAgB,GAAG,4BAA4B,GAAG,kBAAkB,CAChH,CACL,CACF,CACF,CACF,EACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorinfo/my-colorinfo.scss?tag=my-colorinfo&encapsulation=scoped","./src/components/my-colorinfo/my-colorinfo.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.boxes__box-content {\n width: 100%;\n margin-bottom: 5px;\n height: 500px;\n text-align: left;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: relative;\n\n .closebtn {\n position: absolute;\n right: 10px;\n top: 10px;\n width: 53px;\n height: 53px;\n cursor: pointer;\n object-fit: cover;\n z-index: 9999;\n }\n\n @media (max-width: $medium) {\n flex-direction: column-reverse;\n height: auto;\n }\n\n @media (max-width: $small) {\n margin: 0 auto;\n }\n\n &__info {\n width: 40%;\n padding: 50px 40px;\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media (max-width: $medium) {\n width: 100%;\n padding: 15px;\n min-height: 100px;\n }\n\n @media (max-width: $small) {\n min-height: auto;\n }\n\n &__header {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n h2 {\n font-size: 35px;\n font-weight: normal;\n margin-bottom: 30px;\n color: $black;\n\n @media (max-width: $small) {\n font-size: 16px;\n text-align: center;\n margin-bottom: 15px;\n margin-top: 5px;\n }\n }\n\n h4 {\n margin-top: 0px;\n margin-bottom: 15px;\n font-size: 16px;\n color: $grey;\n }\n\n &__value {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 20px;\n\n @media (max-width: $medium) {\n justify-content: flex-start;\n margin-top: 30px;\n }\n\n @media (max-width: $small) {\n flex-direction: column;\n }\n\n &-image {\n @media (max-width: $small) {\n margin: 0 auto;\n margin-bottom: 10px;\n }\n\n img {\n width: 114px;\n object-fit: cover;\n\n @media (max-width: $medium) {\n width: 75px;\n }\n }\n }\n\n &-product {\n color: $black;\n margin-left: 10px;\n\n h2 {\n @media (max-width: $medium) {\n font-size: 26px;\n margin: 0;\n margin-right: 10px;\n }\n\n @media (max-width: $small) {\n font-size: 16px;\n }\n }\n\n p {\n font-size: 20px;\n margin-top: 0px;\n margin-bottom: 0px;\n\n &:last-of-type {\n margin-bottom: 20px;\n\n @media (max-width: $medium) {\n margin-bottom: 0;\n }\n }\n\n @media (max-width: $small) {\n font-size: 10px;\n }\n }\n\n > div {\n @media (max-width: $medium) {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n }\n\n @media (max-width: $small) {\n flex-direction: column;\n }\n }\n }\n }\n\n &__tester {\n display: flex;\n flex-direction: column;\n gap: 15px;\n width: 100%;\n\n @media (max-width: $medium) {\n text-align: center;\n }\n\n .tester-text {\n h2 {\n margin: 0 0 10px;\n font-size: 18px;\n font-weight: 700;\n }\n\n p {\n margin: 0;\n font-size: 14px;\n }\n }\n\n .tester-buy {\n display: flex;\n align-items: center;\n gap: 15px;\n\n @media (max-width: $medium) {\n flex-direction: column;\n\n button {\n margin: 0;\n max-width: 100%;\n }\n }\n }\n\n .price {\n font-size: 20px;\n font-weight: 600;\n }\n }\n }\n\n &__slider {\n width: 60%;\n min-width: 60%;\n max-width: 60%;\n position: relative;\n\n @media (max-width: $medium) {\n width: 100%;\n display: block;\n min-width: 100%;\n max-width: 100%;\n }\n\n .color-big-image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n\n @media (max-width: $medium) {\n height: 300px;\n }\n }\n }\n\n &__white {\n .tester-text,\n .tester-buy {\n color: $white;\n }\n\n h2 {\n color: $white;\n }\n }\n}\n\n.button,\na.button {\n background-color: $white;\n font-size: 16px;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n border-radius: 22px;\n padding: 10px 35px;\n color: $black;\n text-decoration: none;\n text-align: center;\n transition: all 0.7s ease-in-out;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 5px;\n\n .shape-icon {\n display: inline-flex;\n\n svg {\n display: block;\n }\n\n path,\n .shape-icon__path {\n fill: currentColor;\n transition: fill 0.7s ease-in-out;\n }\n }\n\n &.fit {\n padding: 10px 15px;\n }\n\n &:hover {\n color: $white;\n background-color: $black;\n }\n\n &.brown {\n background-color: $brown;\n color: $white;\n\n &:hover {\n color: $white;\n background-color: $black;\n }\n }\n\n &.inverse {\n background-color: $black;\n color: $white;\n\n &:hover {\n color: $black;\n background-color: $white;\n }\n\n svg {\n path {\n fill: $white;\n }\n }\n }\n\n &:disabled {\n cursor: not-allowed;\n background-color: lighten($white_shadow, 20%);\n opacity: 0.5;\n\n &.brown {\n background-color: darken($brown, 20%);\n color: lighten($white, 20%);\n opacity: 0.5;\n }\n\n &.inverse {\n background-color: darken($black, 20%);\n color: lighten($white, 20%);\n opacity: 0.5;\n }\n\n &:hover {\n background-color: inherit;\n color: inherit;\n opacity: 0.5;\n }\n }\n\n @media (max-width: $medium) {\n max-width: 150px;\n font-size: 13px;\n padding: 12px 25px;\n }\n\n @media (max-width: $small) {\n margin: 0 auto;\n }\n}\n\n.divider {\n border: 1px solid $grey;\n opacity: 0.2;\n margin-bottom: 20px;\n\n @media (max-width: $small) {\n margin: 10px 0px;\n display: none;\n }\n}\n\n","import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n styleUrl: 'my-colorinfo.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() availableTesters: AvailableTester | null;\n @Prop() price: number | null;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @Prop() shapeImage = 'Shape.svg';\n @Prop() buttonBlocked = false;\n\n @Event() closeInfoBox: EventEmitter;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n isVeryLightBackground = (): boolean => {\n if (this.currentColor.imageInsteadHex) return true;\n const hex = this.currentColor.hex?.replace('#', '') ?? '';\n if (hex.length !== 6 && hex.length !== 3) return false;\n const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;\n const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;\n const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;\n const luminance = 0.299 * r + 0.587 * g + 0.114 * b;\n return luminance > 0.96; // only near-white: dark button; rest: white button\n };\n\n getButtonClass = () => {\n if (this.currentColor.imageInsteadHex) return 'brown';\n return this.isVeryLightBackground() ? 'inverse' : '';\n };\n\n handleAddToBasket = () => {\n if (!this.availableTesters?.id_product_attribute) return;\n this.buttonBlocked = true;\n this.addToBasket.emit({\n id: this.availableTesters.id_product_attribute,\n });\n\n setTimeout(() => {\n this.buttonBlocked = false;\n }, 10000);\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n <div class=\"boxes__box-content__info__header\">\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a onClick={this.goToProduct} href={this.getHref()} class={`button ${this.getButtonClass()}`}>\n wybierz kolor\n </a>\n )}\n </div>\n <div class=\"boxes__box-content__info__value\">\n <div class=\"divider\"></div>\n\n <div class=\"boxes__box-content__info__tester\">\n {' '}\n <div class=\"divider\"></div>\n <div class=\"tester-text\">\n <h2>Zamów tester</h2>\n <p>Sprawdź go na swojej ścianie.</p>\n </div>\n <div class=\"tester-buy\">\n <div class=\"price\">{this.price ? `${this.price} zł` : ''}</div>\n\n <button\n class={`button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`}\n onClick={this.handleAddToBasket}\n disabled={!this.availableTesters || this.buttonBlocked}\n >\n <span class=\"shape-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"16\" viewBox=\"0 0 15 16\">\n <path\n class=\"shape-icon__path\"\n transform=\"translate(0.0867462 0)\"\n d=\"M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z\"\n />\n </svg>\n </span>\n \n\n {this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'}\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$8 } from './my-backdrop2.js';
3
3
  import { d as defineCustomElement$7 } from './my-colorbox2.js';
4
4
  import { d as defineCustomElement$6 } from './my-colorinfo2.js';
@@ -129,10 +129,13 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
129
129
  constructor() {
130
130
  super();
131
131
  this.__registerHost();
132
+ this.addToBasket = createEvent(this, "addToBasket", 7);
132
133
  this.shop = undefined;
133
134
  this.product = undefined;
134
135
  this.baselink = undefined;
135
136
  this.colorname = undefined;
137
+ this.available_testers = undefined;
138
+ this.price = undefined;
136
139
  this.show = false;
137
140
  this.readyToClose = false;
138
141
  }
@@ -149,10 +152,17 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
149
152
  this.show = false;
150
153
  this.readyToClose = false;
151
154
  }
155
+ addToBasketHandler(event) {
156
+ const { id } = event.detail;
157
+ return id;
158
+ }
152
159
  render() {
153
160
  let content = null;
154
161
  if (this.show) {
155
- content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname })];
162
+ content = [
163
+ h("my-backdrop", null),
164
+ h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname, available_testers: this.available_testers ? JSON.parse(this.available_testers) : null, price: this.price }),
165
+ ];
156
166
  }
157
167
  return (h("div", { onClick: () => {
158
168
  if (this.readyToClose) {
@@ -176,11 +186,13 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
176
186
  "product": [1],
177
187
  "baselink": [1],
178
188
  "colorname": [1],
189
+ "available_testers": [1],
190
+ "price": [2],
179
191
  "show": [32],
180
192
  "readyToClose": [32],
181
193
  "open": [64],
182
194
  "close": [64]
183
- }, [[0, "readyToCLose", "setReadyToCloseHandler"], [0, "close", "closeModalHandler"]]]);
195
+ }, [[0, "readyToCLose", "setReadyToCloseHandler"], [0, "close", "closeModalHandler"], [0, "addToBasket", "addToBasketHandler"]]]);
184
196
  function defineCustomElement$1() {
185
197
  if (typeof customElements === "undefined") {
186
198
  return;
@@ -1 +1 @@
1
- {"file":"my-component.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CA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C7C;EAGD,iBAAiB;IACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;GAC3B;EAED,MAAM;IACJ,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;MACb,OAAO,GAAG,CAAC,sBAA2B,EAAE,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,GAAa,CAAC,CAAC;KAChK;IACD,QACE,WACE,OAAO,EAAE;QACP,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;OACF,IAED,EAAC,MAAM,QACL,kBACG;;;;;;;;;kEASqD,CAC/C,CACF,EACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO,EAC5C,oBACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["RenderTypes"],"sources":["./node_modules/@stencil/helmet/dist/util.js","./node_modules/@stencil/helmet/dist/dom.js","./node_modules/@stencil/helmet/dist/render.js","./node_modules/@stencil/helmet/dist/stencil-helmet.js","./src/components/my-component/my-component.scss?tag=my-component&encapsulation=scoped","./src/components/my-component/my-component.tsx"],"sourcesContent":["const isObject = (val) => !Array.isArray(val) && val !== null && typeof val === 'object';\nexport const hasAttributes = ({ vattrs }, requiredAttrs = []) => isObject(vattrs) && requiredAttrs.every(vattrs.hasOwnProperty.bind(vattrs));\nexport const isTextNode = ({ vtext }) => typeof vtext === 'string';\n// Can't use instanceof HTMLElement because MockHTMLElement during pre-rendering isn't\nexport const isElement = (val) => typeof val === 'object' && val.nodeType === 1 && typeof val.ownerDocument === 'object';\nexport const isElementArray = (val) => Array.isArray(val) && val.every(isElement);\n","import { isElement, isElementArray } from './util';\nexport const createElement = ({ vtag, vattrs, vchildren, vtext }, utils) => {\n if (vtext != null) {\n return document.createTextNode(vtext);\n }\n const element = document.createElement(vtag);\n if (vattrs != null) {\n for (const key in vattrs) {\n element.setAttribute(key, vattrs[key]);\n }\n }\n if (vchildren != null) {\n utils.forEach(vchildren, (child) => {\n element.appendChild(createElement(child, utils));\n });\n }\n return element;\n};\nexport const shouldApplyToHead = (val) => isElement(val) || (isElementArray(val) && val.length === 2);\nexport const applyToHead = (element) => {\n if (Array.isArray(element)) {\n return document.head.replaceChild(element[0], element[1]);\n }\n return document.head.appendChild(element);\n};\n","import { hasAttributes, isTextNode } from './util';\nimport { createElement } from './dom';\nconst hasChildren = (node) => Array.isArray(node.vchildren);\nconst getFirstChild = (vchildren, utils) => {\n let firstChild = null;\n utils.forEach(vchildren || [], (c, i) => {\n if (i === 0) {\n firstChild = c;\n return;\n }\n });\n return firstChild;\n};\nfunction title(node, head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return [createElement(node, utils), head.querySelector('title')];\n }\n}\nfunction meta(node, head, utils) {\n var _a, _b, _c;\n const namePropKey = ((_a = node.vattrs) === null || _a === void 0 ? void 0 : _a.property) ? 'property' : 'name';\n const namePropValue = ((_b = node.vattrs) === null || _b === void 0 ? void 0 : _b.property) || ((_c = node.vattrs) === null || _c === void 0 ? void 0 : _c.name);\n const existingElement = head.querySelector(`meta[${namePropKey}=\"${namePropValue}\"]`);\n if (existingElement !== null) {\n return [createElement(node, utils), existingElement];\n }\n else {\n return createElement(node, utils);\n }\n}\nfunction link(node, _head, utils) {\n if (!hasChildren(node)) {\n return createElement(node, utils);\n }\n}\nfunction style(node, _head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return createElement(node, utils);\n }\n}\nfunction script(node, _head, utils) {\n if (hasChildren(node) || hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nfunction base(node, _head, utils) {\n if (!hasChildren(node) && hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nconst template = createElement;\nconst noscript = createElement; // SSR only\nconst types = {\n title,\n meta,\n link,\n style,\n script,\n base,\n template,\n noscript,\n};\nexport default types;\n","import RenderTypes from './render';\nimport { shouldApplyToHead, applyToHead } from './dom';\nconst headExists = document && document.head;\nconst validTagNames = Object.keys(RenderTypes);\nconst isValidNode = (node) => validTagNames.indexOf(node.vtag) > -1;\nconst renderNode = (node, utils) => RenderTypes[node.vtag](node, document.head, utils);\nexport const Helmet = (_props, children, utils) => {\n if (!headExists) {\n return null;\n }\n const rendered = [];\n const validChildren = [];\n utils.forEach(children, (n) => {\n if (isValidNode(n)) {\n validChildren.push(n);\n rendered.push(renderNode(n, utils));\n }\n });\n // Build an HTMLElement for each provided virtual child\n rendered\n .filter(shouldApplyToHead)\n .forEach(applyToHead);\n return null;\n};\nexport default Helmet;\n",".pallete-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n","import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [<my-backdrop></my-backdrop>, <my-modal shop={this.shop} product={this.product} baselink={this.baselink} selectedcolor={this.colorname}></my-modal>];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"my-component.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AAClF,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACtI,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnE;AACO,MAAM,SAAS,GAAG,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG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E,IAAI,CAAC,QAAQ,EACvB,aAAa,EAAE,IAAI,CAAC,SAAS,EAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,EACrF,KAAK,EAAE,IAAI,CAAC,KAAK,GACP;OACb,CAAC;KACH;IACD,QACE,WACE,OAAO,EAAE;QACP,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;OACF,IAED,EAAC,MAAM,QACL,kBACG;;;;;;;;;kEASqD,CAC/C,CACF,EACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO,EAC5C,oBACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["RenderTypes"],"sources":["./node_modules/.pnpm/@stencil+helmet@0.3.3/node_modules/@stencil/helmet/dist/util.js","./node_modules/.pnpm/@stencil+helmet@0.3.3/node_modules/@stencil/helmet/dist/dom.js","./node_modules/.pnpm/@stencil+helmet@0.3.3/node_modules/@stencil/helmet/dist/render.js","./node_modules/.pnpm/@stencil+helmet@0.3.3/node_modules/@stencil/helmet/dist/stencil-helmet.js","./src/components/my-component/my-component.scss?tag=my-component&encapsulation=scoped","./src/components/my-component/my-component.tsx"],"sourcesContent":["const isObject = (val) => !Array.isArray(val) && val !== null && typeof val === 'object';\nexport const hasAttributes = ({ vattrs }, requiredAttrs = []) => isObject(vattrs) && requiredAttrs.every(vattrs.hasOwnProperty.bind(vattrs));\nexport const isTextNode = ({ vtext }) => typeof vtext === 'string';\n// Can't use instanceof HTMLElement because MockHTMLElement during pre-rendering isn't\nexport const isElement = (val) => typeof val === 'object' && val.nodeType === 1 && typeof val.ownerDocument === 'object';\nexport const isElementArray = (val) => Array.isArray(val) && val.every(isElement);\n","import { isElement, isElementArray } from './util';\nexport const createElement = ({ vtag, vattrs, vchildren, vtext }, utils) => {\n if (vtext != null) {\n return document.createTextNode(vtext);\n }\n const element = document.createElement(vtag);\n if (vattrs != null) {\n for (const key in vattrs) {\n element.setAttribute(key, vattrs[key]);\n }\n }\n if (vchildren != null) {\n utils.forEach(vchildren, (child) => {\n element.appendChild(createElement(child, utils));\n });\n }\n return element;\n};\nexport const shouldApplyToHead = (val) => isElement(val) || (isElementArray(val) && val.length === 2);\nexport const applyToHead = (element) => {\n if (Array.isArray(element)) {\n return document.head.replaceChild(element[0], element[1]);\n }\n return document.head.appendChild(element);\n};\n","import { hasAttributes, isTextNode } from './util';\nimport { createElement } from './dom';\nconst hasChildren = (node) => Array.isArray(node.vchildren);\nconst getFirstChild = (vchildren, utils) => {\n let firstChild = null;\n utils.forEach(vchildren || [], (c, i) => {\n if (i === 0) {\n firstChild = c;\n return;\n }\n });\n return firstChild;\n};\nfunction title(node, head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return [createElement(node, utils), head.querySelector('title')];\n }\n}\nfunction meta(node, head, utils) {\n var _a, _b, _c;\n const namePropKey = ((_a = node.vattrs) === null || _a === void 0 ? void 0 : _a.property) ? 'property' : 'name';\n const namePropValue = ((_b = node.vattrs) === null || _b === void 0 ? void 0 : _b.property) || ((_c = node.vattrs) === null || _c === void 0 ? void 0 : _c.name);\n const existingElement = head.querySelector(`meta[${namePropKey}=\"${namePropValue}\"]`);\n if (existingElement !== null) {\n return [createElement(node, utils), existingElement];\n }\n else {\n return createElement(node, utils);\n }\n}\nfunction link(node, _head, utils) {\n if (!hasChildren(node)) {\n return createElement(node, utils);\n }\n}\nfunction style(node, _head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return createElement(node, utils);\n }\n}\nfunction script(node, _head, utils) {\n if (hasChildren(node) || hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nfunction base(node, _head, utils) {\n if (!hasChildren(node) && hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nconst template = createElement;\nconst noscript = createElement; // SSR only\nconst types = {\n title,\n meta,\n link,\n style,\n script,\n base,\n template,\n noscript,\n};\nexport default types;\n","import RenderTypes from './render';\nimport { shouldApplyToHead, applyToHead } from './dom';\nconst headExists = document && document.head;\nconst validTagNames = Object.keys(RenderTypes);\nconst isValidNode = (node) => validTagNames.indexOf(node.vtag) > -1;\nconst renderNode = (node, utils) => RenderTypes[node.vtag](node, document.head, utils);\nexport const Helmet = (_props, children, utils) => {\n if (!headExists) {\n return null;\n }\n const rendered = [];\n const validChildren = [];\n utils.forEach(children, (n) => {\n if (isValidNode(n)) {\n validChildren.push(n);\n rendered.push(renderNode(n, utils));\n }\n });\n // Build an HTMLElement for each provided virtual child\n rendered\n .filter(shouldApplyToHead)\n .forEach(applyToHead);\n return null;\n};\nexport default Helmet;\n",".pallete-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n","import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, Event, EventEmitter, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n @Prop() available_testers: string | null;\n @Prop() price: number | null;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n @Listen('addToBasket')\n addToBasketHandler(event: CustomEvent<{ id: number }>) {\n const { id } = event.detail;\n\n return id;\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [\n <my-backdrop></my-backdrop>,\n <my-modal\n shop={this.shop}\n product={this.product}\n baselink={this.baselink}\n selectedcolor={this.colorname}\n available_testers={this.available_testers ? JSON.parse(this.available_testers) : null}\n price={this.price}\n ></my-modal>,\n ];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"],"version":3}