@covet-pics/covet-pics-widget 0.134.3 → 0.134.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.
- package/dist/cjs/covet-pics-direct-buy_8.cjs.entry.js +1 -1
- package/dist/cjs/covet-pics-gallery-grid_3.cjs.entry.js +27 -31
- package/dist/cjs/covet-pics-gallery-grid_3.cjs.entry.js.map +1 -1
- package/dist/cjs/covet-pics-gallery-header_3.cjs.entry.js +45 -58
- package/dist/cjs/covet-pics-gallery-header_3.cjs.entry.js.map +1 -1
- package/dist/cjs/covet-pics-gallery-item-caption.cjs.entry.js +1 -1
- package/dist/cjs/covet-pics-highlighted-hotspots_2.cjs.entry.js +1 -1
- package/dist/cjs/covet-pics-star-rating.cjs.entry.js +1 -1
- package/dist/cjs/covet-pics-widget.cjs.entry.js +33 -6
- package/dist/cjs/covet-pics-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/covet-pics-widget.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-07dcda6f.js → utils-5dd2e2e5.js} +1 -34
- package/dist/cjs/utils-5dd2e2e5.js.map +1 -0
- package/dist/collection/components/covet-pics-gallery-grid/covet-pics-gallery-grid.js +14 -20
- package/dist/collection/components/covet-pics-gallery-grid/covet-pics-gallery-grid.js.map +1 -1
- package/dist/collection/components/covet-pics-gallery-item/covet-pics-gallery-item.js +35 -331
- package/dist/collection/components/covet-pics-gallery-item/covet-pics-gallery-item.js.map +1 -1
- package/dist/collection/components/covet-pics-gallery-item-detail/covet-pics-gallery-item-detail.js +9 -139
- package/dist/collection/components/covet-pics-gallery-item-detail/covet-pics-gallery-item-detail.js.map +1 -1
- package/dist/collection/components/covet-pics-gallery-slider/covet-pics-gallery-slider.js +12 -10
- package/dist/collection/components/covet-pics-gallery-slider/covet-pics-gallery-slider.js.map +1 -1
- package/dist/collection/components/covet-pics-widget/covet-pics-widget.js +8 -4
- package/dist/collection/components/covet-pics-widget/covet-pics-widget.js.map +1 -1
- package/dist/collection/store/preview.js +1 -1
- package/dist/collection/store/preview.js.map +1 -1
- package/dist/collection/store/settings.js +24 -1
- package/dist/collection/store/settings.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/collection/utils/utils.js +0 -32
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/covet-pics-widget/covet-pics-widget.esm.js +1 -1
- package/dist/covet-pics-widget/covet-pics-widget.esm.js.map +1 -1
- package/dist/covet-pics-widget/{p-07929539.entry.js → p-144f49bd.entry.js} +2 -2
- package/dist/covet-pics-widget/{p-07929539.entry.js.map → p-144f49bd.entry.js.map} +1 -1
- package/dist/covet-pics-widget/{p-5631a10e.system.entry.js → p-17a720ec.system.entry.js} +2 -2
- package/dist/covet-pics-widget/{p-adbf9b20.entry.js → p-260e173f.entry.js} +2 -2
- package/dist/covet-pics-widget/p-2696bccb.system.entry.js +41 -0
- package/dist/covet-pics-widget/p-2696bccb.system.entry.js.map +1 -0
- package/dist/covet-pics-widget/p-681cf9fd.system.entry.js +5 -0
- package/dist/covet-pics-widget/p-681cf9fd.system.entry.js.map +1 -0
- package/dist/covet-pics-widget/p-6ed108f2.system.js +5 -0
- package/dist/covet-pics-widget/p-6ed108f2.system.js.map +1 -0
- package/dist/covet-pics-widget/p-73de8ce6.entry.js +41 -0
- package/dist/covet-pics-widget/p-73de8ce6.entry.js.map +1 -0
- package/dist/covet-pics-widget/p-7a3c0bde.system.entry.js +5 -0
- package/dist/covet-pics-widget/p-7a3c0bde.system.entry.js.map +1 -0
- package/dist/covet-pics-widget/p-80431ccc.js +5 -0
- package/dist/covet-pics-widget/p-80431ccc.js.map +1 -0
- package/dist/covet-pics-widget/{p-ef7fe5c8.entry.js → p-89f0c6a8.entry.js} +2 -2
- package/dist/covet-pics-widget/p-8e2f5a57.system.js +1 -1
- package/dist/covet-pics-widget/p-8e2f5a57.system.js.map +1 -1
- package/dist/covet-pics-widget/{p-f9ee3cd6.system.entry.js → p-a5b86ca8.system.entry.js} +2 -2
- package/dist/covet-pics-widget/{p-74a2a735.entry.js → p-b971dd19.entry.js} +2 -2
- package/dist/covet-pics-widget/p-bed6092b.entry.js +5 -0
- package/dist/covet-pics-widget/p-bed6092b.entry.js.map +1 -0
- package/dist/covet-pics-widget/{p-2b1a4414.system.entry.js → p-cbd8ab1e.system.entry.js} +2 -2
- package/dist/covet-pics-widget/{p-075502b8.system.entry.js → p-ce62fb9f.system.entry.js} +2 -2
- package/dist/covet-pics-widget/p-f80c6434.entry.js +5 -0
- package/dist/covet-pics-widget/p-f80c6434.entry.js.map +1 -0
- package/dist/esm/covet-pics-direct-buy_8.entry.js +1 -1
- package/dist/esm/covet-pics-gallery-grid_3.entry.js +27 -31
- package/dist/esm/covet-pics-gallery-grid_3.entry.js.map +1 -1
- package/dist/esm/covet-pics-gallery-header_3.entry.js +45 -58
- package/dist/esm/covet-pics-gallery-header_3.entry.js.map +1 -1
- package/dist/esm/covet-pics-gallery-item-caption.entry.js +1 -1
- package/dist/esm/covet-pics-highlighted-hotspots_2.entry.js +1 -1
- package/dist/esm/covet-pics-star-rating.entry.js +1 -1
- package/dist/esm/covet-pics-widget.entry.js +33 -6
- package/dist/esm/covet-pics-widget.entry.js.map +1 -1
- package/dist/esm/covet-pics-widget.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-15c56a4b.js → utils-cb078757.js} +2 -34
- package/dist/esm/utils-cb078757.js.map +1 -0
- package/dist/esm-es5/covet-pics-direct-buy_8.entry.js +1 -1
- package/dist/esm-es5/covet-pics-gallery-grid_3.entry.js +3 -3
- package/dist/esm-es5/covet-pics-gallery-grid_3.entry.js.map +1 -1
- package/dist/esm-es5/covet-pics-gallery-header_3.entry.js +1 -1
- package/dist/esm-es5/covet-pics-gallery-header_3.entry.js.map +1 -1
- package/dist/esm-es5/covet-pics-gallery-item-caption.entry.js +1 -1
- package/dist/esm-es5/covet-pics-highlighted-hotspots_2.entry.js +1 -1
- package/dist/esm-es5/covet-pics-star-rating.entry.js +1 -1
- package/dist/esm-es5/covet-pics-widget.entry.js +1 -1
- package/dist/esm-es5/covet-pics-widget.entry.js.map +1 -1
- package/dist/esm-es5/covet-pics-widget.js +1 -1
- package/dist/esm-es5/covet-pics-widget.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/utils-cb078757.js +5 -0
- package/dist/esm-es5/utils-cb078757.js.map +1 -0
- package/dist/types/components/covet-pics-gallery-item/covet-pics-gallery-item.d.ts +3 -65
- package/dist/types/components/covet-pics-gallery-item-detail/covet-pics-gallery-item-detail.d.ts +1 -28
- package/dist/types/components.d.ts +0 -184
- package/dist/types/store/preview.d.ts +0 -1
- package/dist/types/utils/types.d.ts +23 -0
- package/dist/types/utils/utils.d.ts +0 -4
- package/package.json +1 -1
- package/dist/cjs/utils-07dcda6f.js.map +0 -1
- package/dist/covet-pics-widget/p-0ccc3016.entry.js +0 -5
- package/dist/covet-pics-widget/p-0ccc3016.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-1cf7bea5.system.entry.js +0 -41
- package/dist/covet-pics-widget/p-1cf7bea5.system.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-6bcbcb0d.entry.js +0 -5
- package/dist/covet-pics-widget/p-6bcbcb0d.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-6eee4403.js +0 -5
- package/dist/covet-pics-widget/p-6eee4403.js.map +0 -1
- package/dist/covet-pics-widget/p-7b102580.system.js +0 -5
- package/dist/covet-pics-widget/p-7b102580.system.js.map +0 -1
- package/dist/covet-pics-widget/p-823e1b45.system.entry.js +0 -5
- package/dist/covet-pics-widget/p-823e1b45.system.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-d6b3befd.entry.js +0 -41
- package/dist/covet-pics-widget/p-d6b3befd.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-fe9f2e45.system.entry.js +0 -5
- package/dist/covet-pics-widget/p-fe9f2e45.system.entry.js.map +0 -1
- package/dist/esm/utils-15c56a4b.js.map +0 -1
- package/dist/esm-es5/utils-15c56a4b.js +0 -5
- package/dist/esm-es5/utils-15c56a4b.js.map +0 -1
- /package/dist/covet-pics-widget/{p-5631a10e.system.entry.js.map → p-17a720ec.system.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-adbf9b20.entry.js.map → p-260e173f.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-ef7fe5c8.entry.js.map → p-89f0c6a8.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-f9ee3cd6.system.entry.js.map → p-a5b86ca8.system.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-74a2a735.entry.js.map → p-b971dd19.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-2b1a4414.system.entry.js.map → p-cbd8ab1e.system.entry.js.map} +0 -0
- /package/dist/covet-pics-widget/{p-075502b8.system.entry.js.map → p-ce62fb9f.system.entry.js.map} +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-5415b8fd.js');
|
|
9
|
-
const utils = require('./utils-
|
|
9
|
+
const utils = require('./utils-5dd2e2e5.js');
|
|
10
10
|
const a11y = require('./a11y-c38c0cb2.js');
|
|
11
11
|
const slider = require('./slider-c7104397.js');
|
|
12
12
|
const popup = require('./popup-73ac7fd8.js');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-5415b8fd.js');
|
|
9
|
-
const utils$1 = require('./utils-
|
|
9
|
+
const utils$1 = require('./utils-5dd2e2e5.js');
|
|
10
10
|
const _commonjsHelpers = require('./_commonjsHelpers-0cd0785e.js');
|
|
11
11
|
const getters = require('./getters-c3c47af0.js');
|
|
12
12
|
const popup = require('./popup-73ac7fd8.js');
|
|
@@ -3452,12 +3452,12 @@ const CovetPicsGalleryGrid = class {
|
|
|
3452
3452
|
this.appStore.dispatch(popup.setPopupItems(newValue));
|
|
3453
3453
|
}
|
|
3454
3454
|
componentWillLoad() {
|
|
3455
|
-
this.initFilters();
|
|
3456
|
-
this.initPopup();
|
|
3457
|
-
this.initUploadWidget();
|
|
3458
3455
|
if (this.appStore !== undefined) {
|
|
3459
3456
|
this.initStore();
|
|
3460
3457
|
} // TODO temp check for pass spec.test, issue props function in stencil tests
|
|
3458
|
+
this.initPopup();
|
|
3459
|
+
this.initFilters();
|
|
3460
|
+
this.initUploadWidget();
|
|
3461
3461
|
}
|
|
3462
3462
|
componentDidLoad() {
|
|
3463
3463
|
if (this.layout === "collage")
|
|
@@ -3510,7 +3510,7 @@ const CovetPicsGalleryGrid = class {
|
|
|
3510
3510
|
return (highlightOffset % every) === 0;
|
|
3511
3511
|
}
|
|
3512
3512
|
bindCustomUploadWidgetButtons() {
|
|
3513
|
-
const selector = this.
|
|
3513
|
+
const selector = this.appState.settings.customer_photo_upload_button_selector;
|
|
3514
3514
|
if (selector !== "") {
|
|
3515
3515
|
const nodes = document.querySelectorAll(selector);
|
|
3516
3516
|
nodes.forEach(node => {
|
|
@@ -3519,7 +3519,7 @@ const CovetPicsGalleryGrid = class {
|
|
|
3519
3519
|
}
|
|
3520
3520
|
}
|
|
3521
3521
|
initPopup() {
|
|
3522
|
-
if (this.
|
|
3522
|
+
if (this.appState.preview.mode) {
|
|
3523
3523
|
document.body.querySelectorAll("covet-pics-popup").forEach(node => node.remove());
|
|
3524
3524
|
}
|
|
3525
3525
|
this.appStore.dispatch(popup.setPopupItems(this.items)); // TODO move this to main component (double init in grid and slider)
|
|
@@ -3527,10 +3527,10 @@ const CovetPicsGalleryGrid = class {
|
|
|
3527
3527
|
document.body.appendChild(this.popup);
|
|
3528
3528
|
}
|
|
3529
3529
|
initUploadWidget() {
|
|
3530
|
-
if (this.
|
|
3530
|
+
if (this.appState.preview.mode) {
|
|
3531
3531
|
document.querySelectorAll("covet-pics-upload").forEach(uploadWidget => uploadWidget.remove());
|
|
3532
3532
|
}
|
|
3533
|
-
if (this.
|
|
3533
|
+
if (this.appState.settings.customer_photo_item_position !== null || this.appState.settings.customer_photo_upload_button_selector !== "" || this.showHeader) {
|
|
3534
3534
|
this.upload = utils$1.createUploadPopup(this.loader, this.appStore);
|
|
3535
3535
|
document.body.appendChild(this.upload);
|
|
3536
3536
|
}
|
|
@@ -3564,7 +3564,7 @@ const CovetPicsGalleryGrid = class {
|
|
|
3564
3564
|
}
|
|
3565
3565
|
}
|
|
3566
3566
|
emitGalleryReadyEvent() {
|
|
3567
|
-
const galleryReadyEvent = utils$1.buildEvent("galleryReady:covetPics", { galleryId: this.
|
|
3567
|
+
const galleryReadyEvent = utils$1.buildEvent("galleryReady:covetPics", { galleryId: this.appState.widgetId.galleryId, itemsCount: this.items.length, el: this.el });
|
|
3568
3568
|
document.dispatchEvent(galleryReadyEvent);
|
|
3569
3569
|
}
|
|
3570
3570
|
setLoadMoreButtonVariables() {
|
|
@@ -3604,14 +3604,14 @@ const CovetPicsGalleryGrid = class {
|
|
|
3604
3604
|
const previewFilters = this.loader.previewSettings["filters"];
|
|
3605
3605
|
this.loader.data.filters.list.forEach(f => this.filters[f] = false);
|
|
3606
3606
|
// restore selected filters between preview reloads
|
|
3607
|
-
if (this.
|
|
3607
|
+
if (this.appState.preview.mode && typeof previewFilters !== "undefined") {
|
|
3608
3608
|
previewFilters.forEach(activeFilter => this.filters[activeFilter] = true);
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
3611
|
resetFilters() {
|
|
3612
3612
|
Object.keys(this.filters).forEach(f => this.filters[f] = false);
|
|
3613
3613
|
this.loader.setSelectedFilters([]);
|
|
3614
|
-
if (this.
|
|
3614
|
+
if (this.appState.preview.mode) {
|
|
3615
3615
|
delete this.loader.previewSettings["filters"];
|
|
3616
3616
|
}
|
|
3617
3617
|
}
|
|
@@ -3642,25 +3642,19 @@ const CovetPicsGalleryGrid = class {
|
|
|
3642
3642
|
const itemWidth = this.isDesktopScreen
|
|
3643
3643
|
? (100 - (this.desktopItemPadding * (this.desktopPhotosPerRow - 1))) / this.desktopPhotosPerRow
|
|
3644
3644
|
: (100 - (this.mobileItemPadding * (this.mobilePhotosPerRow - 1))) / this.mobilePhotosPerRow;
|
|
3645
|
-
|
|
3646
|
-
if (item.links.length === 0) {
|
|
3647
|
-
caption = this.loader.data.settings.item_without_product_label_text;
|
|
3648
|
-
}
|
|
3649
|
-
return (index.h("covet-pics-gallery-item", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, "animation-duration": this.loader.data.settings.item_animation_duration, highlighted: this.isHighlighted(idx), "hover-animation-style": this.loader.data.settings.item_animation_type, "hover-background-opacity": this.loader.data.settings.item_hover_background_opacity, "hover-border-color": this.loader.data.settings.item_hover_border_color, "hover-color-from": this.loader.data.settings.item_hover_color_from, "hover-color-to": this.loader.data.settings.item_hover_color_to, "hover-disabled": this.loader.data.settings.item_hover_disabled, "hover-preview": this.loader.previewHoverMode, "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow, this.isHighlighted(idx)), "item-id": item.id, "item-source": item.source, "item-index": idx, caption: item.caption, "item-type": item.data_type, "label-caption": caption, "label-caption-with-links": this.loader.data.settings.item_label_text, "label-color": this.loader.data.settings.item_label_color, "label-font-size": this.loader.data.settings.item_label_font_size, "label-font-style": this.loader.data.settings.item_label_font_style, links: item.links, layout: this.layout, "popup-disabled": this.loader.data.settings.popup_disable_modal, "popup-redirect-mode": this.loader.data.settings.item_open_link, "show-hover-icon": this.loader.data.settings.item_hover_icon, url: item.url, rating: item.rating !== null ? item.rating : 0, "user-name": item.username, "item-width": itemWidth, "created-time": item.created_time, role: "listitem", "aria-label": `${this.layout}-item ${idx + 1}/${itemsLength}, post created ${utils$1.getDateFromTimestamp(item.created_time)}`, "alt-tag": this.itemImgAltTag(item.caption, idx, itemsLength, item.created_time, this.layout), appStore: this.appStore }));
|
|
3645
|
+
return (index.h("covet-pics-gallery-item", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, highlighted: this.isHighlighted(idx), "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow, this.isHighlighted(idx)), "item-id": item.id, "item-source": item.source, "item-index": idx, caption: item.caption, "item-type": item.data_type, links: item.links, layout: this.layout, url: item.url, rating: item.rating !== null ? item.rating : 0, "user-name": item.username, "item-width": itemWidth, "created-time": item.created_time, role: "listitem", "aria-label": `${this.layout}-item ${idx + 1}/${itemsLength}, post created ${utils$1.getDateFromTimestamp(item.created_time)}`, "alt-tag": this.itemImgAltTag(item.caption, idx, itemsLength, item.created_time, this.layout), appStore: this.appStore }));
|
|
3650
3646
|
}
|
|
3651
3647
|
renderStandardUploadItem(item, idx, itemsLength) {
|
|
3652
|
-
return index.h("covet-pics-gallery-item", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, "
|
|
3653
|
-
// TODO check do we use for upload widget END
|
|
3654
|
-
appStore: this.appStore, "aria-label": `click on for upload image in gallery, ${this.layout}-item ${idx + 1}/${itemsLength},`, role: "listitem" });
|
|
3648
|
+
return index.h("covet-pics-gallery-item", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, "image-url": item.imageUrl, "item-source": item.source, "item-index": idx, appStore: this.appStore, "aria-label": `click on for upload image in gallery, ${this.layout}-item ${idx + 1}/${itemsLength},`, role: "listitem" });
|
|
3655
3649
|
}
|
|
3656
3650
|
renderDetailUploadItem(item, idx, itemsLength) {
|
|
3657
|
-
return index.h("covet-pics-gallery-item-detail", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, "image-url": item.imageUrl, "item-source": item.source, "item-index": idx,
|
|
3651
|
+
return index.h("covet-pics-gallery-item-detail", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage" }, "image-url": item.imageUrl, "item-source": item.source, "item-index": idx, appStore: this.appStore, "aria-label": `click on for upload image in gallery, ${this.layout}-item ${idx + 1}/${itemsLength},`, role: "listitem" });
|
|
3658
3652
|
}
|
|
3659
3653
|
renderDetailItem(item, idx, itemsLength) {
|
|
3660
3654
|
const itemWidth = this.isDesktopScreen
|
|
3661
3655
|
? (100 - (this.desktopItemPadding * (this.desktopPhotosPerRow - 1))) / this.desktopPhotosPerRow
|
|
3662
3656
|
: (100 - (this.mobileItemPadding * (this.mobilePhotosPerRow - 1))) / this.mobilePhotosPerRow;
|
|
3663
|
-
return index.h("covet-pics-gallery-item-detail", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage", "highlighted": this.isHighlighted(idx) }, highlighted: this.isHighlighted(idx), "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow), "item-id": item.id, "item-index": idx, "item-source": item.source, "item-
|
|
3657
|
+
return index.h("covet-pics-gallery-item-detail", { class: { "grid-item": this.layout === "grid", "collage-item": this.layout === "collage", "highlighted": this.isHighlighted(idx) }, highlighted: this.isHighlighted(idx), "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow), "item-id": item.id, "item-index": idx, "item-source": item.source, "item-type": item.data_type, "item-width": itemWidth, links: item.links, url: item.url, layout: this.layout, "user-name": item.username, caption: item.caption, "created-time": item.created_time, verified: item.verified, rating: item.rating !== null ? item.rating : 0, role: "listitem", "aria-label": `${this.layout}-item ${idx + 1}/${itemsLength}, post created ${utils$1.getDateFromTimestamp(item.created_time)}`, "alt-tag": this.itemImgAltTag(item.caption, idx, itemsLength, item.created_time, this.layout), appStore: this.appStore });
|
|
3664
3658
|
}
|
|
3665
3659
|
renderHeader() {
|
|
3666
3660
|
return (index.h("covet-pics-gallery-header", { "product-title": this.productTitle, rating: this.rating, "rating-count": this.ratingCount, breakdown: this.breakdown, "header-type": this.headerType, "show-sort": this.headerShowSort.toString(), "show-average-star-rating": this.headerShowAverageRating.toString(), "show-breakdown": this.showBreakdown.toString(), appStore: this.appStore, "aria-hidden": `${this.isGridDisabled}` }));
|
|
@@ -4027,9 +4021,9 @@ const CovetPicsGallerySlider = class {
|
|
|
4027
4021
|
}
|
|
4028
4022
|
}
|
|
4029
4023
|
componentWillLoad() {
|
|
4024
|
+
this.initStore();
|
|
4030
4025
|
this.initPopup();
|
|
4031
4026
|
this.initUploadWidget();
|
|
4032
|
-
this.initStore();
|
|
4033
4027
|
}
|
|
4034
4028
|
componentDidLoad() {
|
|
4035
4029
|
this.initSwiper();
|
|
@@ -4056,7 +4050,7 @@ const CovetPicsGallerySlider = class {
|
|
|
4056
4050
|
});
|
|
4057
4051
|
}
|
|
4058
4052
|
bindCustomUploadWidgetButtons() {
|
|
4059
|
-
const selector = this.
|
|
4053
|
+
const selector = this.appState.settings.customer_photo_upload_button_selector;
|
|
4060
4054
|
if (selector !== "") {
|
|
4061
4055
|
const nodes = document.querySelectorAll(selector);
|
|
4062
4056
|
nodes.forEach(node => {
|
|
@@ -4065,7 +4059,7 @@ const CovetPicsGallerySlider = class {
|
|
|
4065
4059
|
}
|
|
4066
4060
|
}
|
|
4067
4061
|
initPopup() {
|
|
4068
|
-
if (this.
|
|
4062
|
+
if (this.appState.preview.mode) {
|
|
4069
4063
|
document.body.querySelectorAll("covet-pics-popup").forEach(node => node.remove());
|
|
4070
4064
|
}
|
|
4071
4065
|
this.appStore.dispatch(popup.setPopupItems(this.items));
|
|
@@ -4073,10 +4067,10 @@ const CovetPicsGallerySlider = class {
|
|
|
4073
4067
|
document.body.appendChild(this.popup);
|
|
4074
4068
|
}
|
|
4075
4069
|
initUploadWidget() {
|
|
4076
|
-
if (this.
|
|
4070
|
+
if (this.appState.preview.mode) {
|
|
4077
4071
|
document.querySelectorAll("covet-pics-upload").forEach(uploadWidget => uploadWidget.remove());
|
|
4078
4072
|
}
|
|
4079
|
-
if (this.
|
|
4073
|
+
if (this.appState.settings.customer_photo_item_position !== null || this.appState.settings.customer_photo_upload_button_selector !== "") {
|
|
4080
4074
|
this.upload = utils$1.createUploadPopup(this.loader, this.appStore);
|
|
4081
4075
|
document.body.appendChild(this.upload);
|
|
4082
4076
|
}
|
|
@@ -4163,7 +4157,7 @@ const CovetPicsGallerySlider = class {
|
|
|
4163
4157
|
swiperWrapper.style.removeProperty("height");
|
|
4164
4158
|
}
|
|
4165
4159
|
emitGalleryReadyEvent() {
|
|
4166
|
-
const galleryReadyEvent = utils$1.buildEvent("galleryReady:covetPics", { galleryId: this.
|
|
4160
|
+
const galleryReadyEvent = utils$1.buildEvent("galleryReady:covetPics", { galleryId: this.appState.widgetId.galleryId, itemsCount: this.items.length, el: this.el });
|
|
4167
4161
|
document.dispatchEvent(galleryReadyEvent);
|
|
4168
4162
|
}
|
|
4169
4163
|
openPopup(itemId) {
|
|
@@ -4176,6 +4170,8 @@ const CovetPicsGallerySlider = class {
|
|
|
4176
4170
|
setEnableControls(disabled) {
|
|
4177
4171
|
const nextEl = this.el.querySelector(".gallery .swiper-button-next");
|
|
4178
4172
|
const prevEl = this.el.querySelector(".gallery .swiper-button-prev");
|
|
4173
|
+
if (nextEl === null || prevEl === null)
|
|
4174
|
+
return false;
|
|
4179
4175
|
prevEl.tabIndex = disabled ? -1 : 0;
|
|
4180
4176
|
nextEl.tabIndex = disabled ? -1 : 0;
|
|
4181
4177
|
return true;
|
|
@@ -4193,22 +4189,22 @@ const CovetPicsGallerySlider = class {
|
|
|
4193
4189
|
: `slide ${idx + 1}/${itemsLength}, post created ${utils$1.getDateFromTimestamp(createdTime)}`;
|
|
4194
4190
|
}
|
|
4195
4191
|
renderStandardUploadItem(item, idx, itemsLength) {
|
|
4196
|
-
return (index.h("covet-pics-gallery-item", { class: "swiper-slide slide", layout: "slider", "item-source": item.source, "
|
|
4192
|
+
return (index.h("covet-pics-gallery-item", { class: "swiper-slide slide", layout: "slider", "item-source": item.source, "image-url": item.imageUrl, "item-index": idx, "aria-label": `click on for upload image in slider, slide ${idx + 1}/${itemsLength},`, appStore: this.appStore }));
|
|
4197
4193
|
}
|
|
4198
4194
|
renderDetailUploadItem(item, idx, itemsLength) {
|
|
4199
|
-
return (index.h("covet-pics-gallery-item", { class: "swiper-slide slide", layout: "slider", "item-source": item.source, "image-url": item.imageUrl, "item-
|
|
4195
|
+
return (index.h("covet-pics-gallery-item", { class: "swiper-slide slide", layout: "slider", "item-source": item.source, "image-url": item.imageUrl, "item-index": idx, "aria-label": `click on for upload image in slider, slide ${idx + 1}/${itemsLength},`, appStore: this.appStore }));
|
|
4200
4196
|
}
|
|
4201
4197
|
renderStandardItem(item, idx, itemsLength) {
|
|
4202
4198
|
const itemWidth = this.isDesktopScreen
|
|
4203
4199
|
? (100 - (this.desktopItemPadding * (this.desktopPhotosPerRow - 1))) / this.desktopPhotosPerRow
|
|
4204
4200
|
: (100 - (this.mobileItemPadding * (this.mobilePhotosPerRow - 1))) / this.mobilePhotosPerRow;
|
|
4205
|
-
return (index.h("covet-pics-gallery-item", { class: "swiper-slide", layout: "slider", "
|
|
4201
|
+
return (index.h("covet-pics-gallery-item", { class: "swiper-slide", layout: "slider", "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow), "item-id": item.id, "item-source": item.source, links: item.links, url: item.url, "aria-label": this.itemImgAltTag(item.caption, idx, itemsLength, item.created_time), rating: item.rating !== null ? item.rating : 0, "user-name": item.username, "created-time": item.created_time, "item-type": item.data_type, caption: item.caption, "item-width": itemWidth, "item-index": idx, appStore: this.appStore }));
|
|
4206
4202
|
}
|
|
4207
4203
|
renderDetailItem(item, idx, itemsLength) {
|
|
4208
4204
|
const itemWidth = this.isDesktopScreen
|
|
4209
4205
|
? (100 - (this.desktopItemPadding * (this.desktopPhotosPerRow - 1))) / this.desktopPhotosPerRow
|
|
4210
4206
|
: (100 - (this.mobileItemPadding * (this.mobilePhotosPerRow - 1))) / this.mobilePhotosPerRow;
|
|
4211
|
-
return (index.h("covet-pics-gallery-item-detail", { class: "swiper-slide", layout: "slider", "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow), "item-id": item.id, "item-source": item.source, "item-style": this.itemStyle, "item-type": item.data_type, "item-width": itemWidth, "lazy-load": true, links: item.links,
|
|
4207
|
+
return (index.h("covet-pics-gallery-item-detail", { class: "swiper-slide", layout: "slider", "image-url": utils$1.getCoverImage(item.cover_images.medium_resolution, item.images.medium_resolution), "image-high-resolution-url": utils$1.getCoverImage(item.cover_images.high_resolution, item.images.high_resolution), "image-responsive-sizes": utils$1.getSizesForResponsiveImage(this.desktopPhotosPerRow, this.mobilePhotosPerRow), "item-id": item.id, "item-source": item.source, "item-style": this.itemStyle, "item-type": item.data_type, "item-width": itemWidth, "lazy-load": true, links: item.links, url: item.url, "user-name": item.username, caption: item.caption, "created-time": item.created_time, rating: item.rating !== null ? item.rating : 0, verified: item.verified, altTag: this.itemImgAltTag(item.caption, idx, itemsLength, item.created_time), "aria-label": `slide ${idx + 1} of ${itemsLength} in main slider`, appStore: this.appStore, "item-index": idx }));
|
|
4212
4208
|
}
|
|
4213
4209
|
render() {
|
|
4214
4210
|
if (this.items !== undefined) {
|