@ppg_pl/pallete 2.0.4 → 2.0.5

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 (47) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/my-backdrop_8.cjs.entry.js +40 -29
  3. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  4. package/dist/cjs/pallete.cjs.js +1 -1
  5. package/dist/collection/components/my-colorbox/my-colorbox.js +27 -1
  6. package/dist/collection/components/my-colorbox/my-colorbox.js.map +1 -1
  7. package/dist/collection/components/my-modal/my-modal.js +8 -2
  8. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  9. package/dist/collection/types.js.map +1 -1
  10. package/dist/components/index2.js +4 -5302
  11. package/dist/components/index2.js.map +1 -1
  12. package/dist/components/index3.js +5305 -0
  13. package/dist/components/index3.js.map +1 -0
  14. package/dist/components/my-colorbox2.js +9 -3
  15. package/dist/components/my-colorbox2.js.map +1 -1
  16. package/dist/components/my-colorinfo2.js +2 -2
  17. package/dist/components/my-component.js +1 -1
  18. package/dist/components/my-modal2.js +10 -4
  19. package/dist/components/my-modal2.js.map +1 -1
  20. package/dist/components/my-slider.js +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/my-backdrop_8.entry.js +40 -29
  23. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  24. package/dist/esm/pallete.js +1 -1
  25. package/dist/pallete/p-39f2a8e0.entry.js +2 -0
  26. package/dist/pallete/p-39f2a8e0.entry.js.map +1 -0
  27. package/dist/pallete/pallete.esm.js +1 -1
  28. package/dist/pallete/pallete.esm.js.map +1 -1
  29. package/dist/types/components/my-colorbox/my-colorbox.d.ts +2 -0
  30. package/dist/types/components.d.ts +4 -2
  31. package/dist/types/types.d.ts +6 -0
  32. package/package.json +1 -1
  33. package/www/build/p-39f2a8e0.entry.js +2 -0
  34. package/www/build/p-39f2a8e0.entry.js.map +1 -0
  35. package/www/build/p-90c0eb8a.js +163 -0
  36. package/www/build/p-fd390eef.css +3 -0
  37. package/www/build/pallete.esm.js +1 -1
  38. package/www/build/pallete.esm.js.map +1 -1
  39. package/www/index.html +1 -1
  40. package/dist/components/gtmUtils.js +0 -7
  41. package/dist/components/gtmUtils.js.map +0 -1
  42. package/dist/pallete/p-ee5f61e8.entry.js +0 -2
  43. package/dist/pallete/p-ee5f61e8.entry.js.map +0 -1
  44. package/www/build/p-7c1b28aa.css +0 -1
  45. package/www/build/p-e8e99831.js +0 -2
  46. package/www/build/p-ee5f61e8.entry.js +0 -2
  47. package/www/build/p-ee5f61e8.entry.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { J as JcSwiper, d as defineCustomElement$1 } from './index2.js';
1
+ import { J as JcSwiper, d as defineCustomElement$1 } from './index3.js';
2
2
 
3
3
  const MySlider = JcSwiper;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"show":[32],"readyToClose":[32],"open":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"]}],[2,"my-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
14
+ return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"show":[32],"readyToClose":[32],"open":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"],"isImageInsteadHex":[16]}],[2,"my-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -16,6 +16,32 @@ const setDataLayer = (obj) => {
16
16
  return window.dataLayer.push(obj);
17
17
  };
18
18
 
19
+ // DEV/
20
+ // export const APIURL = 'http://57.128.200.45:8055';
21
+ // export const accessToken = '_baZ127gfvFIFmZ5umrrTBUUm6D7ve6p';
22
+ // PROD
23
+ const APIURL = 'http://147.135.211.144:8055'; //'https://pallete-colors-backend.herokuapp.com';
24
+ const accessToken = 'uBKzhiNM4rkdZSe_PQvKJp9pE-DSTmtu';
25
+ class API {
26
+ async getData(ep) {
27
+ try {
28
+ const request = await fetch(`${APIURL}/${ep}`, {
29
+ method: 'GET',
30
+ headers: {
31
+ 'Authorization': `Bearer ${accessToken}`,
32
+ 'Content-Type': 'application/json',
33
+ },
34
+ });
35
+ const response = await request.json();
36
+ return response;
37
+ }
38
+ catch (error) {
39
+ console.error(error);
40
+ }
41
+ }
42
+ }
43
+ const ApiService = new API();
44
+
19
45
  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:80px;height:80px}}.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}";
20
46
 
21
47
  const MyColorBox = class {
@@ -48,42 +74,21 @@ const MyColorBox = class {
48
74
  this.product = undefined;
49
75
  this.isActive = undefined;
50
76
  this.isCategoryActive = undefined;
77
+ this.isImageInsteadHex = undefined;
51
78
  }
52
79
  render() {
80
+ var _a, _b, _c;
81
+ console.log(this.color);
53
82
  return (h("div", { onMouseEnter: () => this.colorCheck(), onMouseLeave: () => this.colorUnCheck(), class: `my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`, style: {
54
- background: this.color,
83
+ backgroundSize: ((_a = this.isImageInsteadHex) === null || _a === void 0 ? void 0 : _a.isImageInsteadHex) ? 'cover' : '',
84
+ backgroundImage: ((_b = this.isImageInsteadHex) === null || _b === void 0 ? void 0 : _b.isImageInsteadHex) ? `url(${APIURL}/assets/${this.isImageInsteadHex.bigImage}?access_token=${accessToken})` : '',
85
+ background: ((_c = this.isImageInsteadHex) === null || _c === void 0 ? void 0 : _c.isImageInsteadHex) ? this.isImageInsteadHex.bigImage : this.color,
55
86
  border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',
56
87
  } }, h("div", { class: "color-name" }, this.name)));
57
88
  }
58
89
  };
59
90
  MyColorBox.style = myColorboxCss;
60
91
 
61
- // DEV/
62
- // export const APIURL = 'http://57.128.200.45:8055';
63
- // export const accessToken = '_baZ127gfvFIFmZ5umrrTBUUm6D7ve6p';
64
- // PROD
65
- const APIURL = 'http://147.135.211.144:8055'; //'https://pallete-colors-backend.herokuapp.com';
66
- const accessToken = 'uBKzhiNM4rkdZSe_PQvKJp9pE-DSTmtu';
67
- class API {
68
- async getData(ep) {
69
- try {
70
- const request = await fetch(`${APIURL}/${ep}`, {
71
- method: 'GET',
72
- headers: {
73
- 'Authorization': `Bearer ${accessToken}`,
74
- 'Content-Type': 'application/json',
75
- },
76
- });
77
- const response = await request.json();
78
- return response;
79
- }
80
- catch (error) {
81
- console.error(error);
82
- }
83
- }
84
- }
85
- const ApiService = new API();
86
-
87
92
  const MyColorInfo = class {
88
93
  constructor(hostRef) {
89
94
  registerInstance(this, hostRef);
@@ -2894,7 +2899,10 @@ const MyModal = class {
2894
2899
  }
2895
2900
  render() {
2896
2901
  var _a, _b, _c, _d;
2897
- return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (h("div", { class: 'categories' }, this.data && h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id })))), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
2902
+ return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (h("div", { class: 'categories' }, this.data && h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id, isImageInsteadHex: {
2903
+ isImageInsteadHex: (c === null || c === void 0 ? void 0 : c.imageInsteadHex) || false,
2904
+ bigImage: (c === null || c === void 0 ? void 0 : c.bigImage) || '',
2905
+ } })))), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
2898
2906
  var _a;
2899
2907
  return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
2900
2908
  var _a;
@@ -2911,7 +2919,10 @@ const MyModal = class {
2911
2919
  }),
2912
2920
  ((_c = this.currentColor) === null || _c === void 0 ? void 0 : _c.id) && this.clearInterval(),
2913
2921
  ];
2914
- }, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
2922
+ }, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product, isImageInsteadHex: {
2923
+ isImageInsteadHex: c.imageInsteadHex,
2924
+ bigImage: c.bigImage,
2925
+ } }));
2915
2926
  })), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
2916
2927
  })) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
2917
2928
  e.preventDefault();