pro-gallery 4.0.15-beta.21 → 4.0.15-beta.210
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/README.md +6 -4
- package/dist/cjs/components/gallery/index.js +22 -25
- package/dist/cjs/components/gallery/index.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/galleryContainer.js +102 -66
- package/dist/cjs/components/gallery/proGallery/galleryContainer.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/galleryDebugMessage.js +1 -2
- package/dist/cjs/components/gallery/proGallery/galleryDebugMessage.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/galleryScrollIndicator.js +19 -24
- package/dist/cjs/components/gallery/proGallery/galleryScrollIndicator.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/galleryView.js +25 -23
- package/dist/cjs/components/gallery/proGallery/galleryView.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/proGallery.js +2 -3
- package/dist/cjs/components/gallery/proGallery/proGallery.js.map +1 -1
- package/dist/cjs/components/gallery/proGallery/propTypes.js +1 -1
- package/dist/cjs/components/gallery/proGallery/slideshowView.js +362 -402
- package/dist/cjs/components/gallery/proGallery/slideshowView.js.map +1 -1
- package/dist/cjs/components/gallery/rendererIndex.js +18 -26
- package/dist/cjs/components/gallery/rendererIndex.js.map +1 -1
- package/dist/cjs/components/gallery/typeValidator/typeErrorsUI.js +42 -8
- package/dist/cjs/components/gallery/typeValidator/typeErrorsUI.js.map +1 -1
- package/dist/cjs/components/gallery/typeValidator/validateTypes.js +2 -8
- package/dist/cjs/components/gallery/typeValidator/validateTypes.js.map +1 -1
- package/dist/cjs/components/group/groupView.js +2 -3
- package/dist/cjs/components/group/groupView.js.map +1 -1
- package/dist/cjs/components/helpers/cssScrollHelper.js +17 -17
- package/dist/cjs/components/helpers/cssScrollHelper.js.map +1 -1
- package/dist/cjs/components/helpers/navigationArrowUtils.js +153 -0
- package/dist/cjs/components/helpers/navigationArrowUtils.js.map +1 -0
- package/dist/cjs/components/helpers/scrollHelper.js +17 -28
- package/dist/cjs/components/helpers/scrollHelper.js.map +1 -1
- package/dist/cjs/components/helpers/videoScrollHelper.js +10 -2
- package/dist/cjs/components/helpers/videoScrollHelper.js.map +1 -1
- package/dist/cjs/components/hoc/withMagnified.js +185 -0
- package/dist/cjs/components/hoc/withMagnified.js.map +1 -0
- package/dist/cjs/components/item/imageItem.js +17 -17
- package/dist/cjs/components/item/imageItem.js.map +1 -1
- package/dist/cjs/components/item/imageRenderer.js +4 -1
- package/dist/cjs/components/item/imageRenderer.js.map +1 -1
- package/dist/cjs/components/item/imageWithMagnified.js +7 -0
- package/dist/cjs/components/item/imageWithMagnified.js.map +1 -0
- package/dist/cjs/components/item/itemHelper.js +11 -10
- package/dist/cjs/components/item/itemHelper.js.map +1 -1
- package/dist/cjs/components/item/itemHover.js +91 -11
- package/dist/cjs/components/item/itemHover.js.map +1 -1
- package/dist/cjs/components/item/itemView.js +108 -175
- package/dist/cjs/components/item/itemView.js.map +1 -1
- package/dist/cjs/components/item/itemViewStyleProvider.js +37 -35
- package/dist/cjs/components/item/itemViewStyleProvider.js.map +1 -1
- package/dist/cjs/components/item/printOnlySource.js +30 -0
- package/dist/cjs/components/item/printOnlySource.js.map +1 -0
- package/dist/cjs/components/item/pure.js +64 -0
- package/dist/cjs/components/item/pure.js.map +1 -0
- package/dist/cjs/components/item/textItem.js +7 -8
- package/dist/cjs/components/item/textItem.js.map +1 -1
- package/dist/cjs/components/item/videos/videoItem.js +11 -14
- package/dist/cjs/components/item/videos/videoItem.js.map +1 -1
- package/dist/cjs/components/item/videos/videoItemPlaceholder.js +3 -6
- package/dist/cjs/components/item/videos/videoItemPlaceholder.js.map +1 -1
- package/dist/cjs/components/item/videos/videoItemWrapper.js +18 -13
- package/dist/cjs/components/item/videos/videoItemWrapper.js.map +1 -1
- package/dist/cjs/components/svgs/arrowsIconsData.js +25 -0
- package/dist/cjs/components/svgs/arrowsIconsData.js.map +1 -0
- package/dist/cjs/components/svgs/components/arrow2.js +16 -0
- package/dist/cjs/components/svgs/components/arrow2.js.map +1 -0
- package/dist/cjs/components/svgs/components/arrow3.js +16 -0
- package/dist/cjs/components/svgs/components/arrow3.js.map +1 -0
- package/dist/cjs/components/svgs/components/defaultArrow.js +14 -0
- package/dist/cjs/components/svgs/components/defaultArrow.js.map +1 -0
- package/dist/cjs/components/svgs/index.js +3 -1
- package/dist/cjs/components/svgs/index.js.map +1 -1
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/gallery/index.js +22 -25
- package/dist/esm/components/gallery/index.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/galleryContainer.js +102 -66
- package/dist/esm/components/gallery/proGallery/galleryContainer.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/galleryDebugMessage.js +1 -2
- package/dist/esm/components/gallery/proGallery/galleryDebugMessage.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/galleryScrollIndicator.js +19 -24
- package/dist/esm/components/gallery/proGallery/galleryScrollIndicator.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/galleryView.js +25 -23
- package/dist/esm/components/gallery/proGallery/galleryView.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/proGallery.js +2 -3
- package/dist/esm/components/gallery/proGallery/proGallery.js.map +1 -1
- package/dist/esm/components/gallery/proGallery/propTypes.js +1 -1
- package/dist/esm/components/gallery/proGallery/slideshowView.js +362 -402
- package/dist/esm/components/gallery/proGallery/slideshowView.js.map +1 -1
- package/dist/esm/components/gallery/rendererIndex.js +19 -27
- package/dist/esm/components/gallery/rendererIndex.js.map +1 -1
- package/dist/esm/components/gallery/typeValidator/typeErrorsUI.js +43 -8
- package/dist/esm/components/gallery/typeValidator/typeErrorsUI.js.map +1 -1
- package/dist/esm/components/gallery/typeValidator/validateTypes.js +2 -8
- package/dist/esm/components/gallery/typeValidator/validateTypes.js.map +1 -1
- package/dist/esm/components/group/groupView.js +2 -3
- package/dist/esm/components/group/groupView.js.map +1 -1
- package/dist/esm/components/helpers/cssScrollHelper.js +17 -17
- package/dist/esm/components/helpers/cssScrollHelper.js.map +1 -1
- package/dist/esm/components/helpers/navigationArrowUtils.js +146 -0
- package/dist/esm/components/helpers/navigationArrowUtils.js.map +1 -0
- package/dist/esm/components/helpers/scrollHelper.js +17 -28
- package/dist/esm/components/helpers/scrollHelper.js.map +1 -1
- package/dist/esm/components/helpers/videoScrollHelper.js +11 -3
- package/dist/esm/components/helpers/videoScrollHelper.js.map +1 -1
- package/dist/esm/components/hoc/withMagnified.js +183 -0
- package/dist/esm/components/hoc/withMagnified.js.map +1 -0
- package/dist/esm/components/item/imageItem.js +18 -18
- package/dist/esm/components/item/imageItem.js.map +1 -1
- package/dist/esm/components/item/imageRenderer.js +4 -1
- package/dist/esm/components/item/imageRenderer.js.map +1 -1
- package/dist/esm/components/item/imageWithMagnified.js +4 -0
- package/dist/esm/components/item/imageWithMagnified.js.map +1 -0
- package/dist/esm/components/item/itemHelper.js +11 -10
- package/dist/esm/components/item/itemHelper.js.map +1 -1
- package/dist/esm/components/item/itemHover.js +91 -11
- package/dist/esm/components/item/itemHover.js.map +1 -1
- package/dist/esm/components/item/itemView.js +109 -176
- package/dist/esm/components/item/itemView.js.map +1 -1
- package/dist/esm/components/item/itemViewStyleProvider.js +37 -35
- package/dist/esm/components/item/itemViewStyleProvider.js.map +1 -1
- package/dist/esm/components/item/printOnlySource.js +27 -0
- package/dist/esm/components/item/printOnlySource.js.map +1 -0
- package/dist/esm/components/item/pure.js +59 -0
- package/dist/esm/components/item/pure.js.map +1 -0
- package/dist/esm/components/item/textItem.js +7 -8
- package/dist/esm/components/item/textItem.js.map +1 -1
- package/dist/esm/components/item/videos/videoItem.js +11 -14
- package/dist/esm/components/item/videos/videoItem.js.map +1 -1
- package/dist/esm/components/item/videos/videoItemPlaceholder.js +4 -7
- package/dist/esm/components/item/videos/videoItemPlaceholder.js.map +1 -1
- package/dist/esm/components/item/videos/videoItemWrapper.js +18 -13
- package/dist/esm/components/item/videos/videoItemWrapper.js.map +1 -1
- package/dist/esm/components/svgs/arrowsIconsData.js +22 -0
- package/dist/esm/components/svgs/arrowsIconsData.js.map +1 -0
- package/dist/esm/components/svgs/components/arrow2.js +13 -0
- package/dist/esm/components/svgs/components/arrow2.js.map +1 -0
- package/dist/esm/components/svgs/components/arrow3.js +13 -0
- package/dist/esm/components/svgs/components/arrow3.js.map +1 -0
- package/dist/esm/components/svgs/components/defaultArrow.js +11 -0
- package/dist/esm/components/svgs/components/defaultArrow.js.map +1 -0
- package/dist/esm/components/svgs/index.js +1 -0
- package/dist/esm/components/svgs/index.js.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm-types/components/gallery/index.d.ts +2 -2
- package/dist/esm-types/components/gallery/index.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/galleryContainer.d.ts +65 -17
- package/dist/esm-types/components/gallery/proGallery/galleryContainer.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/galleryDebugMessage.d.ts +3 -2
- package/dist/esm-types/components/gallery/proGallery/galleryDebugMessage.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/galleryScrollIndicator.d.ts +2 -2
- package/dist/esm-types/components/gallery/proGallery/galleryScrollIndicator.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/galleryView.d.ts +3 -6
- package/dist/esm-types/components/gallery/proGallery/galleryView.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/proGallery.d.ts +1 -4
- package/dist/esm-types/components/gallery/proGallery/proGallery.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/proGallery/propTypes.d.ts +1 -1
- package/dist/esm-types/components/gallery/proGallery/slideshowView.d.ts +60 -23
- package/dist/esm-types/components/gallery/proGallery/slideshowView.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/rendererIndex.d.ts +4 -14
- package/dist/esm-types/components/gallery/rendererIndex.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/typeValidator/typeErrorsUI.d.ts.map +1 -1
- package/dist/esm-types/components/gallery/typeValidator/validateTypes.d.ts +2 -2
- package/dist/esm-types/components/gallery/typeValidator/validateTypes.d.ts.map +1 -1
- package/dist/esm-types/components/group/groupView.d.ts +2 -2
- package/dist/esm-types/components/group/groupView.d.ts.map +1 -1
- package/dist/esm-types/components/helpers/cssScrollHelper.d.ts +8 -8
- package/dist/esm-types/components/helpers/navigationArrowUtils.d.ts +18 -0
- package/dist/esm-types/components/helpers/navigationArrowUtils.d.ts.map +1 -0
- package/dist/esm-types/components/helpers/scrollHelper.d.ts.map +1 -1
- package/dist/esm-types/components/helpers/videoScrollHelper.d.ts +2 -1
- package/dist/esm-types/components/helpers/videoScrollHelper.d.ts.map +1 -1
- package/dist/esm-types/components/hoc/withMagnified.d.ts +79 -0
- package/dist/esm-types/components/hoc/withMagnified.d.ts.map +1 -0
- package/dist/esm-types/components/item/imageItem.d.ts +3 -2
- package/dist/esm-types/components/item/imageItem.d.ts.map +1 -1
- package/dist/esm-types/components/item/imageRenderer.d.ts.map +1 -1
- package/dist/esm-types/components/item/imageWithMagnified.d.ts +78 -0
- package/dist/esm-types/components/item/imageWithMagnified.d.ts.map +1 -0
- package/dist/esm-types/components/item/itemHelper.d.ts +1 -1
- package/dist/esm-types/components/item/itemHelper.d.ts.map +1 -1
- package/dist/esm-types/components/item/itemHover.d.ts +24 -2
- package/dist/esm-types/components/item/itemHover.d.ts.map +1 -1
- package/dist/esm-types/components/item/itemView.d.ts +188 -20
- package/dist/esm-types/components/item/itemView.d.ts.map +1 -1
- package/dist/esm-types/components/item/itemViewStyleProvider.d.ts +20 -4
- package/dist/esm-types/components/item/itemViewStyleProvider.d.ts.map +1 -1
- package/dist/esm-types/components/item/printOnlySource.d.ts +11 -0
- package/dist/esm-types/components/item/printOnlySource.d.ts.map +1 -0
- package/dist/esm-types/components/item/pure.d.ts +14 -0
- package/dist/esm-types/components/item/pure.d.ts.map +1 -0
- package/dist/esm-types/components/item/textItem.d.ts +2 -2
- package/dist/esm-types/components/item/textItem.d.ts.map +1 -1
- package/dist/esm-types/components/item/videos/videoItem.d.ts +1 -2
- package/dist/esm-types/components/item/videos/videoItem.d.ts.map +1 -1
- package/dist/esm-types/components/item/videos/videoItemPlaceholder.d.ts +3 -2
- package/dist/esm-types/components/item/videos/videoItemPlaceholder.d.ts.map +1 -1
- package/dist/esm-types/components/item/videos/videoItemWrapper.d.ts +2 -2
- package/dist/esm-types/components/item/videos/videoItemWrapper.d.ts.map +1 -1
- package/dist/esm-types/components/svgs/arrowsIconsData.d.ts +26 -0
- package/dist/esm-types/components/svgs/arrowsIconsData.d.ts.map +1 -0
- package/dist/esm-types/components/svgs/components/arrow2.d.ts +5 -0
- package/dist/esm-types/components/svgs/components/arrow2.d.ts.map +1 -0
- package/dist/esm-types/components/svgs/components/arrow3.d.ts +5 -0
- package/dist/esm-types/components/svgs/components/arrow3.d.ts.map +1 -0
- package/dist/esm-types/components/svgs/components/defaultArrow.d.ts +5 -0
- package/dist/esm-types/components/svgs/components/defaultArrow.d.ts.map +1 -0
- package/dist/esm-types/components/svgs/index.d.ts +1 -0
- package/dist/esm-types/context/GalleryContext.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +11 -5
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/statics/main.css +77 -13
- package/dist/statics/main.css.map +1 -1
- package/dist/tsconfig-esm.tsbuildinfo +1854 -1262
- package/dist/tsconfig.tsbuildinfo +1854 -1262
- package/dist/types/components/gallery/index.d.ts +2 -2
- package/dist/types/components/gallery/index.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/galleryContainer.d.ts +65 -17
- package/dist/types/components/gallery/proGallery/galleryContainer.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/galleryDebugMessage.d.ts +3 -2
- package/dist/types/components/gallery/proGallery/galleryDebugMessage.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/galleryScrollIndicator.d.ts +2 -2
- package/dist/types/components/gallery/proGallery/galleryScrollIndicator.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/galleryView.d.ts +3 -6
- package/dist/types/components/gallery/proGallery/galleryView.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/proGallery.d.ts +1 -4
- package/dist/types/components/gallery/proGallery/proGallery.d.ts.map +1 -1
- package/dist/types/components/gallery/proGallery/propTypes.d.ts +1 -1
- package/dist/types/components/gallery/proGallery/slideshowView.d.ts +60 -23
- package/dist/types/components/gallery/proGallery/slideshowView.d.ts.map +1 -1
- package/dist/types/components/gallery/rendererIndex.d.ts +4 -14
- package/dist/types/components/gallery/rendererIndex.d.ts.map +1 -1
- package/dist/types/components/gallery/typeValidator/typeErrorsUI.d.ts.map +1 -1
- package/dist/types/components/gallery/typeValidator/validateTypes.d.ts +2 -2
- package/dist/types/components/gallery/typeValidator/validateTypes.d.ts.map +1 -1
- package/dist/types/components/group/groupView.d.ts +2 -2
- package/dist/types/components/group/groupView.d.ts.map +1 -1
- package/dist/types/components/helpers/cssScrollHelper.d.ts +8 -8
- package/dist/types/components/helpers/navigationArrowUtils.d.ts +18 -0
- package/dist/types/components/helpers/navigationArrowUtils.d.ts.map +1 -0
- package/dist/types/components/helpers/scrollHelper.d.ts.map +1 -1
- package/dist/types/components/helpers/videoScrollHelper.d.ts +2 -1
- package/dist/types/components/helpers/videoScrollHelper.d.ts.map +1 -1
- package/dist/types/components/hoc/withMagnified.d.ts +79 -0
- package/dist/types/components/hoc/withMagnified.d.ts.map +1 -0
- package/dist/types/components/item/imageItem.d.ts +3 -2
- package/dist/types/components/item/imageItem.d.ts.map +1 -1
- package/dist/types/components/item/imageRenderer.d.ts.map +1 -1
- package/dist/types/components/item/imageWithMagnified.d.ts +78 -0
- package/dist/types/components/item/imageWithMagnified.d.ts.map +1 -0
- package/dist/types/components/item/itemHelper.d.ts +1 -1
- package/dist/types/components/item/itemHelper.d.ts.map +1 -1
- package/dist/types/components/item/itemHover.d.ts +24 -2
- package/dist/types/components/item/itemHover.d.ts.map +1 -1
- package/dist/types/components/item/itemView.d.ts +188 -20
- package/dist/types/components/item/itemView.d.ts.map +1 -1
- package/dist/types/components/item/itemViewStyleProvider.d.ts +20 -4
- package/dist/types/components/item/itemViewStyleProvider.d.ts.map +1 -1
- package/dist/types/components/item/printOnlySource.d.ts +11 -0
- package/dist/types/components/item/printOnlySource.d.ts.map +1 -0
- package/dist/types/components/item/pure.d.ts +14 -0
- package/dist/types/components/item/pure.d.ts.map +1 -0
- package/dist/types/components/item/textItem.d.ts +2 -2
- package/dist/types/components/item/textItem.d.ts.map +1 -1
- package/dist/types/components/item/videos/videoItem.d.ts +1 -2
- package/dist/types/components/item/videos/videoItem.d.ts.map +1 -1
- package/dist/types/components/item/videos/videoItemPlaceholder.d.ts +3 -2
- package/dist/types/components/item/videos/videoItemPlaceholder.d.ts.map +1 -1
- package/dist/types/components/item/videos/videoItemWrapper.d.ts +2 -2
- package/dist/types/components/item/videos/videoItemWrapper.d.ts.map +1 -1
- package/dist/types/components/svgs/arrowsIconsData.d.ts +26 -0
- package/dist/types/components/svgs/arrowsIconsData.d.ts.map +1 -0
- package/dist/types/components/svgs/components/arrow2.d.ts +5 -0
- package/dist/types/components/svgs/components/arrow2.d.ts.map +1 -0
- package/dist/types/components/svgs/components/arrow3.d.ts +5 -0
- package/dist/types/components/svgs/components/arrow3.d.ts.map +1 -0
- package/dist/types/components/svgs/components/defaultArrow.d.ts +5 -0
- package/dist/types/components/svgs/components/defaultArrow.d.ts.map +1 -0
- package/dist/types/components/svgs/index.d.ts +1 -0
- package/dist/types/context/GalleryContext.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -5
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +15 -15
- package/dist/cjs/common/interfaces/Container.js +0 -3
- package/dist/cjs/common/interfaces/Container.js.map +0 -1
- package/dist/cjs/common/interfaces/EventsListener.js +0 -3
- package/dist/cjs/common/interfaces/EventsListener.js.map +0 -1
- package/dist/cjs/common/interfaces/Item.js +0 -3
- package/dist/cjs/common/interfaces/Item.js.map +0 -1
- package/dist/cjs/components/gallery/galleryTypes.js +0 -3
- package/dist/cjs/components/gallery/galleryTypes.js.map +0 -1
- package/dist/cjs/components/gallery/typeValidator/schema.js +0 -47
- package/dist/cjs/components/gallery/typeValidator/schema.js.map +0 -1
- package/dist/cjs/components/galleryComponent.js +0 -23
- package/dist/cjs/components/galleryComponent.js.map +0 -1
- package/dist/cjs/components/helpers/isNew.js +0 -207
- package/dist/cjs/components/helpers/isNew.js.map +0 -1
- package/dist/esm/common/interfaces/Container.js +0 -2
- package/dist/esm/common/interfaces/Container.js.map +0 -1
- package/dist/esm/common/interfaces/EventsListener.js +0 -2
- package/dist/esm/common/interfaces/EventsListener.js.map +0 -1
- package/dist/esm/common/interfaces/Item.js +0 -2
- package/dist/esm/common/interfaces/Item.js.map +0 -1
- package/dist/esm/components/gallery/galleryTypes.js +0 -2
- package/dist/esm/components/gallery/galleryTypes.js.map +0 -1
- package/dist/esm/components/gallery/typeValidator/schema.js +0 -45
- package/dist/esm/components/gallery/typeValidator/schema.js.map +0 -1
- package/dist/esm/components/galleryComponent.js +0 -20
- package/dist/esm/components/galleryComponent.js.map +0 -1
- package/dist/esm/components/helpers/isNew.js +0 -205
- package/dist/esm/components/helpers/isNew.js.map +0 -1
- package/dist/esm-types/common/interfaces/Container.d.ts +0 -6
- package/dist/esm-types/common/interfaces/Container.d.ts.map +0 -1
- package/dist/esm-types/common/interfaces/EventsListener.d.ts +0 -8
- package/dist/esm-types/common/interfaces/EventsListener.d.ts.map +0 -1
- package/dist/esm-types/common/interfaces/Item.d.ts +0 -10
- package/dist/esm-types/common/interfaces/Item.d.ts.map +0 -1
- package/dist/esm-types/components/gallery/galleryTypes.d.ts +0 -23
- package/dist/esm-types/components/gallery/galleryTypes.d.ts.map +0 -1
- package/dist/esm-types/components/gallery/typeValidator/schema.d.ts +0 -46
- package/dist/esm-types/components/gallery/typeValidator/schema.d.ts.map +0 -1
- package/dist/esm-types/components/galleryComponent.d.ts +0 -6
- package/dist/esm-types/components/galleryComponent.d.ts.map +0 -1
- package/dist/esm-types/components/helpers/isNew.d.ts +0 -17
- package/dist/esm-types/components/helpers/isNew.d.ts.map +0 -1
- package/dist/types/common/interfaces/Container.d.ts +0 -6
- package/dist/types/common/interfaces/Container.d.ts.map +0 -1
- package/dist/types/common/interfaces/EventsListener.d.ts +0 -8
- package/dist/types/common/interfaces/EventsListener.d.ts.map +0 -1
- package/dist/types/common/interfaces/Item.d.ts +0 -10
- package/dist/types/common/interfaces/Item.d.ts.map +0 -1
- package/dist/types/components/gallery/galleryTypes.d.ts +0 -23
- package/dist/types/components/gallery/galleryTypes.d.ts.map +0 -1
- package/dist/types/components/gallery/typeValidator/schema.d.ts +0 -46
- package/dist/types/components/gallery/typeValidator/schema.d.ts.map +0 -1
- package/dist/types/components/galleryComponent.d.ts +0 -6
- package/dist/types/components/galleryComponent.d.ts.map +0 -1
- package/dist/types/components/helpers/isNew.d.ts +0 -17
- package/dist/types/components/helpers/isNew.d.ts.map +0 -1
|
@@ -9,8 +9,8 @@ var galleryDebugMessage_js_1 = tslib_1.__importDefault(require("./galleryDebugMe
|
|
|
9
9
|
var galleryHelpers_js_1 = require("./galleryHelpers.js");
|
|
10
10
|
var play_1 = tslib_1.__importDefault(require("../../svgs/components/play"));
|
|
11
11
|
var pause_1 = tslib_1.__importDefault(require("../../svgs/components/pause"));
|
|
12
|
-
var galleryComponent_1 = require("../../galleryComponent");
|
|
13
12
|
var textItem_js_1 = tslib_1.__importDefault(require("../../item/textItem.js"));
|
|
13
|
+
var navigationArrowUtils_1 = require("../../helpers/navigationArrowUtils");
|
|
14
14
|
var SKIP_SLIDES_MULTIPLIER = 1.5;
|
|
15
15
|
function getDirection(code) {
|
|
16
16
|
var reverse = [33, 37, 38];
|
|
@@ -28,12 +28,26 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
28
28
|
_this.autoScrollToNextItem = function () {
|
|
29
29
|
if (!pro_gallery_lib_1.isEditMode() &&
|
|
30
30
|
(galleryHelpers_js_1.isGalleryInViewport(_this.props.container) || pro_gallery_lib_1.isPreviewMode())) {
|
|
31
|
-
var
|
|
32
|
-
|
|
31
|
+
var options = _this.props.options;
|
|
32
|
+
var direction = options.isRTL ? -1 : 1;
|
|
33
|
+
if (options.autoSlideshowType ===
|
|
34
|
+
pro_gallery_lib_1.GALLERY_CONSTS.autoSlideshowTypes.CONTINUOUS) {
|
|
35
|
+
_this._next({
|
|
36
|
+
direction: direction,
|
|
37
|
+
isAutoTrigger: true,
|
|
38
|
+
isContinuousScrolling: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else if (options.autoSlideshowType ===
|
|
42
|
+
pro_gallery_lib_1.GALLERY_CONSTS.autoSlideshowTypes.INTERVAL) {
|
|
43
|
+
_this._next({
|
|
44
|
+
direction: direction,
|
|
45
|
+
isAutoTrigger: true,
|
|
46
|
+
scrollDuration: 800,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
33
49
|
}
|
|
34
50
|
};
|
|
35
|
-
_this.navigationOutHandler = _this.navigationOutHandler.bind(_this);
|
|
36
|
-
_this.navigationInHandler = _this.navigationInHandler.bind(_this);
|
|
37
51
|
_this.scrollToThumbnail = _this.scrollToThumbnail.bind(_this);
|
|
38
52
|
_this.clearAutoSlideshowInterval = _this.clearAutoSlideshowInterval.bind(_this);
|
|
39
53
|
_this.onFocus = _this.onFocus.bind(_this);
|
|
@@ -42,8 +56,8 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
42
56
|
_this.onAutoSlideShowButtonClick.bind(_this);
|
|
43
57
|
_this.startAutoSlideshowIfNeeded =
|
|
44
58
|
_this.startAutoSlideshowIfNeeded.bind(_this);
|
|
45
|
-
_this.
|
|
46
|
-
_this.
|
|
59
|
+
_this.updateAutoSlideShowState =
|
|
60
|
+
_this.updateAutoSlideShowState.bind(_this);
|
|
47
61
|
_this.canStartAutoSlideshow = _this.canStartAutoSlideshow.bind(_this);
|
|
48
62
|
_this.handleSlideshowKeyPress = _this.handleSlideshowKeyPress.bind(_this);
|
|
49
63
|
_this.onAutoSlideshowAutoPlayKeyPress =
|
|
@@ -64,7 +78,6 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
64
78
|
};
|
|
65
79
|
_this.lastCurrentItem = undefined;
|
|
66
80
|
_this.shouldCreateSlideShowPlayButton = false;
|
|
67
|
-
_this.shouldCreateSlideShowNumbers = false;
|
|
68
81
|
_this.skipFromSlide = Math.round(_this.props.totalItemsCount * SKIP_SLIDES_MULTIPLIER); // Used in infinite loop
|
|
69
82
|
return _this;
|
|
70
83
|
}
|
|
@@ -72,41 +85,47 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
72
85
|
return this.state.activeIndex === 0;
|
|
73
86
|
};
|
|
74
87
|
SlideshowView.prototype.isScrollStart = function () {
|
|
75
|
-
var slideAnimation = this.props.
|
|
88
|
+
var slideAnimation = this.props.options.slideAnimation;
|
|
76
89
|
if (slideAnimation !== pro_gallery_lib_1.GALLERY_CONSTS.slideAnimations.SCROLL || !this.scrollElement) {
|
|
77
90
|
return false;
|
|
78
91
|
}
|
|
79
92
|
return this.scrollPosition() <= 1;
|
|
80
93
|
};
|
|
81
94
|
SlideshowView.prototype.isScrollEnd = function () {
|
|
82
|
-
var _a = this.props
|
|
83
|
-
var _b = this.props.styleParams, slideshowLoop = _b.slideshowLoop, slideAnimation = _b.slideAnimation, imageMargin = _b.imageMargin;
|
|
95
|
+
var _a = this.props.options, slideshowLoop = _a.slideshowLoop, slideAnimation = _a.slideAnimation;
|
|
84
96
|
if (slideshowLoop ||
|
|
85
97
|
slideAnimation === pro_gallery_lib_1.GALLERY_CONSTS.slideAnimations.FADE ||
|
|
86
98
|
slideAnimation === pro_gallery_lib_1.GALLERY_CONSTS.slideAnimations.DECK) {
|
|
87
99
|
return false;
|
|
88
100
|
}
|
|
89
|
-
|
|
101
|
+
return (this.isAllItemsLoaded() &&
|
|
102
|
+
this.scrollPositionAtTheAndOfTheGallery() >= Math.floor(this.getScrollElementWidth()));
|
|
103
|
+
};
|
|
104
|
+
SlideshowView.prototype.isAllItemsLoaded = function () {
|
|
105
|
+
var _a = this.props, totalItemsCount = _a.totalItemsCount, getVisibleItems = _a.getVisibleItems, galleryStructure = _a.galleryStructure, container = _a.container;
|
|
90
106
|
var visibleItemsCount = getVisibleItems(galleryStructure.galleryItems, container).length;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
return visibleItemsCount >= totalItemsCount;
|
|
108
|
+
};
|
|
109
|
+
SlideshowView.prototype.getScrollElementWidth = function () {
|
|
110
|
+
var galleryStructure = this.props.galleryStructure;
|
|
111
|
+
var imageMargin = this.props.options.imageMargin;
|
|
112
|
+
return galleryStructure.width - imageMargin / 2;
|
|
94
113
|
};
|
|
95
114
|
SlideshowView.prototype.isFirstItemFullyVisible = function () {
|
|
96
|
-
return !this.props.
|
|
115
|
+
return !this.props.options.slideshowLoop && this.isScrollStart();
|
|
97
116
|
};
|
|
98
117
|
SlideshowView.prototype.isLastItemFullyVisible = function () {
|
|
99
|
-
return !this.props.
|
|
118
|
+
return !this.props.options.slideshowLoop && this.isScrollEnd();
|
|
100
119
|
};
|
|
101
120
|
SlideshowView.prototype.isLastItem = function () {
|
|
102
|
-
return (!this.props.
|
|
121
|
+
return (!this.props.options.slideshowLoop &&
|
|
103
122
|
this.state.activeIndex >= this.props.totalItemsCount - 1);
|
|
104
123
|
};
|
|
105
124
|
//__________________________________Slide show loop functions_____________________________________________
|
|
106
125
|
SlideshowView.prototype.createNewItemsForSlideshowLoopThumbnails = function () {
|
|
107
126
|
var items = this.props.items;
|
|
108
127
|
var biasedItems = [];
|
|
109
|
-
var numOfThumbnails = Math.ceil(this.props.container.galleryWidth / this.props.
|
|
128
|
+
var numOfThumbnails = Math.ceil(this.props.container.galleryWidth / this.props.options.thumbnailSize);
|
|
110
129
|
// need to create new item ! not just to copy the last once - the react view refferce one of them
|
|
111
130
|
Object.keys(items).forEach(function (idx) {
|
|
112
131
|
var _idx = Number(idx);
|
|
@@ -132,33 +151,46 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
132
151
|
this.numOfThumbnails = numOfThumbnails;
|
|
133
152
|
};
|
|
134
153
|
//__________________________________end of slide show loop functions__________________________
|
|
154
|
+
SlideshowView.prototype.shouldBlockNext = function (_a) {
|
|
155
|
+
var scrollingUpTheGallery = _a.scrollingUpTheGallery;
|
|
156
|
+
return ((scrollingUpTheGallery && this.isLastItem()) ||
|
|
157
|
+
(!scrollingUpTheGallery && this.isFirstItem()));
|
|
158
|
+
};
|
|
159
|
+
SlideshowView.prototype.shouldNotAllowScroll = function (_a) {
|
|
160
|
+
var scrollingUpTheGallery = _a.scrollingUpTheGallery;
|
|
161
|
+
return ((scrollingUpTheGallery && this.isLastItemFullyVisible()) ||
|
|
162
|
+
(!scrollingUpTheGallery && this.isFirstItemFullyVisible()));
|
|
163
|
+
};
|
|
135
164
|
SlideshowView.prototype.next = function (_a) {
|
|
136
|
-
var
|
|
137
|
-
direction
|
|
138
|
-
|
|
139
|
-
|
|
165
|
+
var _b;
|
|
166
|
+
var direction = _a.direction, isAutoTrigger = _a.isAutoTrigger, scrollDuration = _a.scrollDuration, _c = _a.isKeyboardNavigation, isKeyboardNavigation = _c === void 0 ? false : _c, _d = _a.isContinuousScrolling, isContinuousScrolling = _d === void 0 ? false : _d;
|
|
167
|
+
var scrollingUpTheGallery = this.props.options.isRTL
|
|
168
|
+
? direction <= -1
|
|
169
|
+
: direction >= 1;
|
|
170
|
+
if (this.shouldBlockNext({ scrollingUpTheGallery: scrollingUpTheGallery })) {
|
|
140
171
|
this.clearAutoSlideshowInterval();
|
|
141
172
|
return;
|
|
142
173
|
}
|
|
174
|
+
direction *= this.props.options.isRTL ? -1 : 1;
|
|
143
175
|
var activeElement = document.activeElement;
|
|
144
176
|
var galleryItemIsFocused = activeElement.className &&
|
|
145
177
|
activeElement.className.includes('gallery-item-container');
|
|
146
178
|
var avoidIndividualNavigation = !isKeyboardNavigation ||
|
|
147
|
-
!(this.props.
|
|
179
|
+
!(((_b = this.props.settings) === null || _b === void 0 ? void 0 : _b.isAccessible) && galleryItemIsFocused);
|
|
148
180
|
var ignoreScrollPosition = false;
|
|
149
|
-
if (this.props.
|
|
181
|
+
if (this.props.options.slideAnimation !==
|
|
150
182
|
pro_gallery_lib_1.GALLERY_CONSTS.slideAnimations.SCROLL) {
|
|
151
183
|
scrollDuration = 0;
|
|
152
184
|
ignoreScrollPosition = true;
|
|
153
185
|
}
|
|
154
|
-
if (avoidIndividualNavigation && this.props.
|
|
155
|
-
this.nextGroup({ direction: direction,
|
|
186
|
+
if (avoidIndividualNavigation && this.props.options.groupSize > 1) {
|
|
187
|
+
this.nextGroup({ direction: direction, scrollDuration: scrollDuration, isContinuousScrolling: isContinuousScrolling, scrollingUpTheGallery: scrollingUpTheGallery }); //if its not in accessibility that requieres individual nav and we are in a horizontal(this file) collage(layout 0) - use group navigation
|
|
156
188
|
}
|
|
157
189
|
else {
|
|
158
190
|
if (avoidIndividualNavigation &&
|
|
159
|
-
this.props.
|
|
160
|
-
this.props.
|
|
161
|
-
direction *= this.props.
|
|
191
|
+
pro_gallery_lib_1.GALLERY_CONSTS.isLayout('GRID')(this.props.options) &&
|
|
192
|
+
this.props.options.numberOfImagesPerCol) {
|
|
193
|
+
direction *= this.props.options.numberOfImagesPerCol;
|
|
162
194
|
}
|
|
163
195
|
this.nextItem({
|
|
164
196
|
direction: direction,
|
|
@@ -166,168 +198,154 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
166
198
|
scrollDuration: scrollDuration,
|
|
167
199
|
avoidIndividualNavigation: avoidIndividualNavigation,
|
|
168
200
|
ignoreScrollPosition: ignoreScrollPosition,
|
|
201
|
+
isContinuousScrolling: isContinuousScrolling,
|
|
202
|
+
scrollingUpTheGallery: scrollingUpTheGallery,
|
|
169
203
|
});
|
|
170
204
|
}
|
|
171
205
|
this.removeArrowsIfNeeded();
|
|
172
206
|
};
|
|
207
|
+
SlideshowView.prototype.getNextItemOrGroupToScrollTo = function (initiator, direction, ignoreScrollPosition, avoidIndividualNavigation, isAutoTrigger) {
|
|
208
|
+
this.isSliding = true;
|
|
209
|
+
var nextIndex;
|
|
210
|
+
if (initiator === 'nextGroup' ||
|
|
211
|
+
(initiator === 'nextItem' &&
|
|
212
|
+
!ignoreScrollPosition &&
|
|
213
|
+
avoidIndividualNavigation &&
|
|
214
|
+
!(this.props.options.groupSize > 1))) {
|
|
215
|
+
var key = initiator === 'nextGroup' ? 'groups' : 'galleryItems';
|
|
216
|
+
nextIndex =
|
|
217
|
+
this.getCenteredItemOrGroupIdxByScroll(key) + direction;
|
|
218
|
+
}
|
|
219
|
+
else if (initiator === 'nextItem') {
|
|
220
|
+
if (ignoreScrollPosition || !isAutoTrigger) {
|
|
221
|
+
nextIndex = this.state.activeIndex;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
nextIndex = this.setCurrentItemByScroll();
|
|
225
|
+
}
|
|
226
|
+
nextIndex += direction;
|
|
227
|
+
if (!this.props.options.slideshowLoop) {
|
|
228
|
+
nextIndex = Math.min(this.props.galleryStructure.items.length - 1, nextIndex);
|
|
229
|
+
nextIndex = Math.max(0, nextIndex);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
this.isAutoScrolling = true;
|
|
233
|
+
return nextIndex;
|
|
234
|
+
};
|
|
173
235
|
SlideshowView.prototype.nextItem = function (_a) {
|
|
174
|
-
var direction = _a.direction, isAutoTrigger = _a.isAutoTrigger, scrollDuration = _a.scrollDuration, avoidIndividualNavigation = _a.avoidIndividualNavigation, ignoreScrollPosition = _a.ignoreScrollPosition;
|
|
236
|
+
var direction = _a.direction, isAutoTrigger = _a.isAutoTrigger, scrollDuration = _a.scrollDuration, avoidIndividualNavigation = _a.avoidIndividualNavigation, ignoreScrollPosition = _a.ignoreScrollPosition, isContinuousScrolling = _a.isContinuousScrolling, scrollingUpTheGallery = _a.scrollingUpTheGallery;
|
|
175
237
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
switch (_c.label) {
|
|
238
|
+
var nextItem, itemToScroll, skipToSlide, e_1;
|
|
239
|
+
return tslib_1.__generator(this, function (_b) {
|
|
240
|
+
switch (_b.label) {
|
|
180
241
|
case 0:
|
|
181
242
|
if (this.isSliding) {
|
|
182
243
|
return [2 /*return*/];
|
|
183
244
|
}
|
|
184
|
-
this.
|
|
185
|
-
|
|
186
|
-
activeIndex = this.state.activeIndex;
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
if (avoidIndividualNavigation &&
|
|
190
|
-
!(this.props.styleParams.groupSize > 1)) {
|
|
191
|
-
activeIndex = this.getCenteredItemIdxByScroll();
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
activeIndex = isAutoTrigger
|
|
195
|
-
? this.setCurrentItemByScroll()
|
|
196
|
-
: this.state.activeIndex;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
nextItem = activeIndex + direction;
|
|
200
|
-
if (!this.props.styleParams.slideshowLoop) {
|
|
201
|
-
nextItem = Math.min(this.props.galleryStructure.items.length - 1, nextItem);
|
|
202
|
-
nextItem = Math.max(0, nextItem);
|
|
203
|
-
}
|
|
204
|
-
scrollToItem = this.props.actions.scrollToItem;
|
|
205
|
-
this.isAutoScrolling = true;
|
|
206
|
-
if (isAutoTrigger) {
|
|
207
|
-
// ---- Called by the Auto Slideshow ---- //
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
// ---- Called by the user (arrows, keys etc.) ---- //
|
|
211
|
-
this.startAutoSlideshowIfNeeded(this.props.styleParams);
|
|
212
|
-
scrollingPastLastItem = (direction >= 1 && this.isLastItem()) ||
|
|
213
|
-
(direction <= -1 && this.isFirstItem());
|
|
214
|
-
if (scrollingPastLastItem) {
|
|
215
|
-
this.isSliding = false;
|
|
216
|
-
return [2 /*return*/];
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
_c.label = 1;
|
|
245
|
+
nextItem = this.getNextItemOrGroupToScrollTo('nextItem', direction, ignoreScrollPosition, avoidIndividualNavigation, isAutoTrigger);
|
|
246
|
+
_b.label = 1;
|
|
220
247
|
case 1:
|
|
221
|
-
|
|
222
|
-
isScrollingPastEdge = !isAutoTrigger &&
|
|
223
|
-
((direction >= 1 && this.isLastItemFullyVisible()) ||
|
|
224
|
-
(direction <= -1 && this.isFirstItemFullyVisible()));
|
|
225
|
-
scrollMarginCorrection = this.getStyles().margin || 0;
|
|
226
|
-
_scrollDuration = scrollDuration || this.props.styleParams.scrollDuration || 400;
|
|
248
|
+
_b.trys.push([1, 5, , 6]);
|
|
227
249
|
itemToScroll = ignoreScrollPosition ? 0 : nextItem;
|
|
228
|
-
|
|
229
|
-
if (!_b) return [3 /*break*/, 3];
|
|
230
|
-
return [4 /*yield*/, scrollToItem(itemToScroll, false, true, _scrollDuration, scrollMarginCorrection)];
|
|
250
|
+
return [4 /*yield*/, this.scrollToItemOrGroup(this.props.actions.scrollToItem, itemToScroll, isContinuousScrolling, scrollDuration, scrollingUpTheGallery)];
|
|
231
251
|
case 2:
|
|
232
|
-
_b
|
|
233
|
-
|
|
234
|
-
case 3:
|
|
235
|
-
_b;
|
|
236
|
-
if (!(this.props.styleParams.groupSize === 1)) return [3 /*break*/, 5];
|
|
252
|
+
_b.sent();
|
|
253
|
+
if (!(this.props.options.groupSize === 1)) return [3 /*break*/, 4];
|
|
237
254
|
skipToSlide = this.skipFromSlide - this.props.totalItemsCount;
|
|
238
|
-
if (!(nextItem >= this.skipFromSlide)) return [3 /*break*/,
|
|
255
|
+
if (!(nextItem >= this.skipFromSlide)) return [3 /*break*/, 4];
|
|
239
256
|
nextItem = skipToSlide;
|
|
240
|
-
return [4 /*yield*/, scrollToItem(nextItem)];
|
|
257
|
+
return [4 /*yield*/, this.props.actions.scrollToItem(nextItem)];
|
|
258
|
+
case 3:
|
|
259
|
+
_b.sent();
|
|
260
|
+
_b.label = 4;
|
|
241
261
|
case 4:
|
|
242
|
-
|
|
243
|
-
_c.label = 5;
|
|
244
|
-
case 5:
|
|
245
|
-
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
246
|
-
activeIndex: nextItem,
|
|
247
|
-
}, function () {
|
|
248
|
-
_this.onCurrentItemChanged();
|
|
249
|
-
_this.isSliding = false;
|
|
250
|
-
});
|
|
262
|
+
this.onScrollToItemOrGroup(nextItem, isContinuousScrolling);
|
|
251
263
|
if (ignoreScrollPosition) {
|
|
252
264
|
this.props.getMoreItemsIfNeeded(this.props.galleryStructure.galleryItems[nextItem].offset.left);
|
|
253
265
|
this.props.setGotFirstScrollIfNeeded();
|
|
254
266
|
}
|
|
255
|
-
return [3 /*break*/,
|
|
256
|
-
case
|
|
257
|
-
e_1 =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
case 7: return [2 /*return*/];
|
|
267
|
+
return [3 /*break*/, 6];
|
|
268
|
+
case 5:
|
|
269
|
+
e_1 = _b.sent();
|
|
270
|
+
this.onThrowScrollError('Cannot proceed to the next Item', e_1);
|
|
271
|
+
return [3 /*break*/, 6];
|
|
272
|
+
case 6: return [2 /*return*/];
|
|
262
273
|
}
|
|
263
274
|
});
|
|
264
275
|
});
|
|
265
276
|
};
|
|
266
277
|
SlideshowView.prototype.nextGroup = function (_a) {
|
|
267
|
-
var direction = _a.direction,
|
|
278
|
+
var direction = _a.direction, scrollDuration = _a.scrollDuration, _b = _a.isContinuousScrolling, isContinuousScrolling = _b === void 0 ? false : _b, scrollingUpTheGallery = _a.scrollingUpTheGallery;
|
|
268
279
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
269
|
-
var
|
|
270
|
-
var _this = this;
|
|
280
|
+
var nextGroup, nextItem, e_2;
|
|
271
281
|
return tslib_1.__generator(this, function (_c) {
|
|
272
282
|
switch (_c.label) {
|
|
273
283
|
case 0:
|
|
274
284
|
if (this.isSliding) {
|
|
275
285
|
return [2 /*return*/];
|
|
276
286
|
}
|
|
277
|
-
this.
|
|
278
|
-
currentGroupIdx = this.getCenteredGroupIdxByScroll();
|
|
279
|
-
currentGroup = currentGroupIdx + direction;
|
|
280
|
-
scrollToGroup = this.props.actions.scrollToGroup;
|
|
281
|
-
this.isAutoScrolling = true;
|
|
282
|
-
if (isAutoTrigger) {
|
|
283
|
-
// ---- Called by the Auto Slideshow ---- //
|
|
284
|
-
if (this.isLastItem()) {
|
|
285
|
-
// maybe this should be isLastItemFullyVisible now that we have both. product- do we allow autoSlideshow in other layouts ( those that could have more than one item displayed in the galleryWidth)
|
|
286
|
-
currentGroup = 0;
|
|
287
|
-
scrollDuration = 0;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
scrollingPastLastItem = (direction >= 1 && this.isLastItem()) ||
|
|
292
|
-
(direction <= -1 && this.isFirstItem());
|
|
293
|
-
if (scrollingPastLastItem) {
|
|
294
|
-
this.isSliding = false;
|
|
295
|
-
return [2 /*return*/];
|
|
296
|
-
}
|
|
297
|
-
}
|
|
287
|
+
nextGroup = this.getNextItemOrGroupToScrollTo('nextGroup', direction);
|
|
298
288
|
_c.label = 1;
|
|
299
289
|
case 1:
|
|
300
|
-
_c.trys.push([1,
|
|
301
|
-
|
|
302
|
-
((direction >= 1 && this.isLastItemFullyVisible()) ||
|
|
303
|
-
(direction <= -1 && this.isFirstItemFullyVisible()));
|
|
304
|
-
scrollMarginCorrection = this.getStyles().margin || 0;
|
|
305
|
-
_scrollDuration = scrollDuration || this.props.styleParams.scrollDuration || 400;
|
|
306
|
-
_b = !isScrollingPastEdge;
|
|
307
|
-
if (!_b) return [3 /*break*/, 3];
|
|
308
|
-
return [4 /*yield*/, scrollToGroup(currentGroup, false, true, _scrollDuration, scrollMarginCorrection)];
|
|
290
|
+
_c.trys.push([1, 3, , 4]);
|
|
291
|
+
return [4 /*yield*/, this.scrollToItemOrGroup(this.props.actions.scrollToGroup, nextGroup, isContinuousScrolling, scrollDuration, scrollingUpTheGallery)];
|
|
309
292
|
case 2:
|
|
310
|
-
|
|
311
|
-
|
|
293
|
+
_c.sent();
|
|
294
|
+
nextItem = this.getCenteredItemOrGroupIdxByScroll('galleryItems') + direction;
|
|
295
|
+
this.onScrollToItemOrGroup(nextItem, isContinuousScrolling);
|
|
296
|
+
return [3 /*break*/, 4];
|
|
312
297
|
case 3:
|
|
313
|
-
_b;
|
|
314
|
-
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
315
|
-
activeIndex: this.getCenteredItemIdxByScroll() + direction,
|
|
316
|
-
}, function () {
|
|
317
|
-
_this.onCurrentItemChanged();
|
|
318
|
-
_this.isSliding = false;
|
|
319
|
-
});
|
|
320
|
-
return [3 /*break*/, 5];
|
|
321
|
-
case 4:
|
|
322
298
|
e_2 = _c.sent();
|
|
323
|
-
|
|
324
|
-
|
|
299
|
+
this.onThrowScrollError('Cannot proceed to the next Group', e_2);
|
|
300
|
+
return [3 /*break*/, 4];
|
|
301
|
+
case 4: return [2 /*return*/];
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
SlideshowView.prototype.scrollToItemOrGroup = function (func, indexToScroll, isContinuousScrolling, scrollDuration, scrollingUpTheGallery) {
|
|
307
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
308
|
+
var shouldAllowScroll, _a, scrollMarginCorrection, _scrollDuration, _b;
|
|
309
|
+
return tslib_1.__generator(this, function (_c) {
|
|
310
|
+
switch (_c.label) {
|
|
311
|
+
case 0:
|
|
312
|
+
shouldAllowScroll = !this.shouldNotAllowScroll({ scrollingUpTheGallery: scrollingUpTheGallery });
|
|
313
|
+
_a = this.getScrollParameters(scrollDuration), scrollMarginCorrection = _a.scrollMarginCorrection, _scrollDuration = _a._scrollDuration;
|
|
314
|
+
_b = shouldAllowScroll;
|
|
315
|
+
if (!_b) return [3 /*break*/, 2];
|
|
316
|
+
return [4 /*yield*/, func(indexToScroll, false, true, _scrollDuration, scrollMarginCorrection, isContinuousScrolling)];
|
|
317
|
+
case 1:
|
|
318
|
+
_b = (_c.sent());
|
|
319
|
+
_c.label = 2;
|
|
320
|
+
case 2:
|
|
321
|
+
_b;
|
|
325
322
|
return [2 /*return*/];
|
|
326
|
-
case 5: return [2 /*return*/];
|
|
327
323
|
}
|
|
328
324
|
});
|
|
329
325
|
});
|
|
330
326
|
};
|
|
327
|
+
SlideshowView.prototype.onThrowScrollError = function (massage, e) {
|
|
328
|
+
console.error(massage, e);
|
|
329
|
+
this.clearAutoSlideshowInterval();
|
|
330
|
+
};
|
|
331
|
+
SlideshowView.prototype.onScrollToItemOrGroup = function (nextItem, isContinuousScrolling) {
|
|
332
|
+
var _this = this;
|
|
333
|
+
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
334
|
+
activeIndex: nextItem,
|
|
335
|
+
}, function () {
|
|
336
|
+
_this.onCurrentItemChanged();
|
|
337
|
+
_this.isSliding = false;
|
|
338
|
+
if (isContinuousScrolling) {
|
|
339
|
+
_this.startAutoSlideshowIfNeeded(_this.props.options);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
SlideshowView.prototype.getScrollParameters = function (scrollDuration) {
|
|
344
|
+
return {
|
|
345
|
+
scrollMarginCorrection: this.getStyles().margin || 0,
|
|
346
|
+
_scrollDuration: scrollDuration || this.props.options.scrollDuration || 400,
|
|
347
|
+
};
|
|
348
|
+
};
|
|
331
349
|
SlideshowView.prototype.onCurrentItemChanged = function () {
|
|
332
350
|
if (this.lastCurrentItem !== this.state.activeIndex) {
|
|
333
351
|
this.lastCurrentItem = this.state.activeIndex;
|
|
@@ -345,16 +363,23 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
345
363
|
SlideshowView.prototype.clearAutoSlideshowInterval = function () {
|
|
346
364
|
clearInterval(this.autoSlideshowInterval);
|
|
347
365
|
};
|
|
348
|
-
SlideshowView.prototype.canStartAutoSlideshow = function (
|
|
349
|
-
|
|
350
|
-
return (isAutoSlideshow &&
|
|
351
|
-
autoSlideshowInterval > 0 &&
|
|
366
|
+
SlideshowView.prototype.canStartAutoSlideshow = function (options) {
|
|
367
|
+
return (options.isAutoSlideshow &&
|
|
352
368
|
!this.state.shouldBlockAutoSlideshow);
|
|
353
369
|
};
|
|
354
|
-
SlideshowView.prototype.startAutoSlideshowIfNeeded = function (
|
|
370
|
+
SlideshowView.prototype.startAutoSlideshowIfNeeded = function (options) {
|
|
355
371
|
this.clearAutoSlideshowInterval();
|
|
356
|
-
if (this.canStartAutoSlideshow(
|
|
357
|
-
|
|
372
|
+
if (this.canStartAutoSlideshow(options)) {
|
|
373
|
+
if (options.autoSlideshowType ===
|
|
374
|
+
pro_gallery_lib_1.GALLERY_CONSTS.autoSlideshowTypes.CONTINUOUS &&
|
|
375
|
+
options.autoSlideshowContinuousSpeed > 0) {
|
|
376
|
+
this.autoScrollToNextItem();
|
|
377
|
+
}
|
|
378
|
+
else if (options.autoSlideshowType ===
|
|
379
|
+
pro_gallery_lib_1.GALLERY_CONSTS.autoSlideshowTypes.INTERVAL &&
|
|
380
|
+
options.autoSlideshowInterval > 0) {
|
|
381
|
+
this.autoSlideshowInterval = setInterval(this.autoScrollToNextItem, options.autoSlideshowInterval * 1000);
|
|
382
|
+
}
|
|
358
383
|
}
|
|
359
384
|
};
|
|
360
385
|
SlideshowView.prototype.scrollToThumbnail = function (itemIdx, scrollDuration) {
|
|
@@ -395,9 +420,10 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
395
420
|
};
|
|
396
421
|
SlideshowView.prototype.createThumbnails = function (thumbnailPosition) {
|
|
397
422
|
var _this = this;
|
|
423
|
+
var _a;
|
|
398
424
|
var items = this.props.items;
|
|
399
425
|
var activeIndex = this.state.activeIndex;
|
|
400
|
-
if (this.props.
|
|
426
|
+
if (this.props.options.slideshowLoop) {
|
|
401
427
|
if (!this.ItemsForSlideshowLoopThumbnails) {
|
|
402
428
|
this.createNewItemsForSlideshowLoopThumbnails();
|
|
403
429
|
}
|
|
@@ -407,8 +433,8 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
407
433
|
if (pro_gallery_lib_1.utils.isVerbose()) {
|
|
408
434
|
console.log('creating thumbnails for idx', activeIndex);
|
|
409
435
|
}
|
|
410
|
-
var width = this.props.
|
|
411
|
-
var height = this.props.
|
|
436
|
+
var width = this.props.options.thumbnailSize;
|
|
437
|
+
var height = this.props.options.thumbnailSize;
|
|
412
438
|
var horizontalThumbnails;
|
|
413
439
|
var numOfThumbnails;
|
|
414
440
|
var numOfWholeThumbnails;
|
|
@@ -417,29 +443,29 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
417
443
|
case 'bottom':
|
|
418
444
|
width =
|
|
419
445
|
this.props.container.galleryWidth +
|
|
420
|
-
this.props.
|
|
446
|
+
this.props.options.thumbnailSpacings;
|
|
421
447
|
height =
|
|
422
|
-
this.props.
|
|
423
|
-
this.props.
|
|
448
|
+
this.props.options.thumbnailSize +
|
|
449
|
+
this.props.options.thumbnailSpacings;
|
|
424
450
|
horizontalThumbnails = true;
|
|
425
|
-
numOfThumbnails = Math.ceil(width / this.props.
|
|
426
|
-
numOfWholeThumbnails = Math.floor((width + this.props.
|
|
427
|
-
(this.props.
|
|
428
|
-
this.props.
|
|
451
|
+
numOfThumbnails = Math.ceil(width / this.props.options.thumbnailSize);
|
|
452
|
+
numOfWholeThumbnails = Math.floor((width + this.props.options.thumbnailSpacings) /
|
|
453
|
+
(this.props.options.thumbnailSize +
|
|
454
|
+
this.props.options.thumbnailSpacings * 2));
|
|
429
455
|
break;
|
|
430
456
|
case 'left':
|
|
431
457
|
case 'right':
|
|
432
458
|
height =
|
|
433
459
|
this.props.container.galleryHeight +
|
|
434
|
-
2 * this.props.
|
|
460
|
+
2 * this.props.options.thumbnailSpacings;
|
|
435
461
|
width =
|
|
436
|
-
this.props.
|
|
437
|
-
2 * this.props.
|
|
462
|
+
this.props.options.thumbnailSize +
|
|
463
|
+
2 * this.props.options.thumbnailSpacings;
|
|
438
464
|
horizontalThumbnails = false;
|
|
439
|
-
numOfThumbnails = Math.ceil(height / this.props.
|
|
465
|
+
numOfThumbnails = Math.ceil(height / this.props.options.thumbnailSize);
|
|
440
466
|
numOfWholeThumbnails = Math.floor(height /
|
|
441
|
-
(this.props.
|
|
442
|
-
this.props.
|
|
467
|
+
(this.props.options.thumbnailSize +
|
|
468
|
+
this.props.options.thumbnailSpacings * 2));
|
|
443
469
|
break;
|
|
444
470
|
}
|
|
445
471
|
this.firstItemIdx = activeIndex - Math.floor(numOfThumbnails / 2) - 1;
|
|
@@ -463,9 +489,9 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
463
489
|
numOfThumbnails += 1;
|
|
464
490
|
this.lastItemIdx += 1;
|
|
465
491
|
}
|
|
466
|
-
var thumbnailsContainerSize = numOfThumbnails * this.props.
|
|
492
|
+
var thumbnailsContainerSize = numOfThumbnails * this.props.options.thumbnailSize +
|
|
467
493
|
((numOfThumbnails - 1) * 2 + 1) *
|
|
468
|
-
this.props.
|
|
494
|
+
this.props.options.thumbnailSpacings;
|
|
469
495
|
var thumbnailsStyle = { width: width, height: height };
|
|
470
496
|
if (items.length <= numOfWholeThumbnails ||
|
|
471
497
|
activeIndex < numOfThumbnails / 2 - 1) {
|
|
@@ -515,13 +541,13 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
515
541
|
break;
|
|
516
542
|
}
|
|
517
543
|
}
|
|
518
|
-
if (this.props.
|
|
544
|
+
if (this.props.options.isRTL) {
|
|
519
545
|
thumbnailsStyle.right = thumbnailsStyle.left;
|
|
520
546
|
delete thumbnailsStyle.left;
|
|
521
547
|
}
|
|
522
548
|
var thumbnailsMargin;
|
|
523
|
-
var thumbnailSpacings = this.props.
|
|
524
|
-
switch (this.props.
|
|
549
|
+
var thumbnailSpacings = this.props.options.thumbnailSpacings;
|
|
550
|
+
switch (this.props.options.galleryThumbnailsAlignment) {
|
|
525
551
|
case 'bottom':
|
|
526
552
|
thumbnailsMargin = thumbnailSpacings + "px -" + thumbnailSpacings + "px 0 -" + thumbnailSpacings + "px";
|
|
527
553
|
break;
|
|
@@ -540,27 +566,27 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
540
566
|
};
|
|
541
567
|
var highlighledIdxForSlideshowLoop = Math.floor(numOfThumbnails / 2);
|
|
542
568
|
var thumbnailItems;
|
|
543
|
-
if (this.props.
|
|
569
|
+
if (this.props.options.slideshowLoop) {
|
|
544
570
|
thumbnailItems = items.slice(this.firstItemIdx, this.lastItemIdx + 1);
|
|
545
571
|
}
|
|
546
572
|
else {
|
|
547
573
|
thumbnailItems = this.props.galleryStructure.galleryItems.slice(this.firstItemIdx, this.lastItemIdx + 1);
|
|
548
574
|
}
|
|
549
|
-
var thumbnailSize = this.props.
|
|
575
|
+
var thumbnailSize = this.props.options.thumbnailSize;
|
|
550
576
|
return (react_1.default.createElement("div", { className: 'pro-gallery inline-styles thumbnails-gallery ' +
|
|
551
577
|
(horizontalThumbnails ? ' one-row hide-scrollbars ' : '') +
|
|
552
|
-
(this.props.
|
|
553
|
-
(this.props.
|
|
578
|
+
(this.props.options.isRTL ? ' rtl ' : ' ltr ') +
|
|
579
|
+
(((_a = this.props.settings) === null || _a === void 0 ? void 0 : _a.isAccessible) ? ' accessible ' : ''), style: {
|
|
554
580
|
width: width,
|
|
555
581
|
height: height,
|
|
556
582
|
margin: thumbnailsMargin,
|
|
557
583
|
}, "data-hook": "gallery-thumbnails" },
|
|
558
584
|
react_1.default.createElement("div", { "data-hook": "gallery-thumbnails-column", className: 'galleryColumn', key: 'thumbnails-column', style: Object.assign(thumbnailsStyle, { width: width, height: height }) }, thumbnailItems.map(function (item, idx) {
|
|
559
585
|
var _a;
|
|
560
|
-
var thumbnailItem = _this.props.
|
|
586
|
+
var thumbnailItem = _this.props.options.slideshowLoop
|
|
561
587
|
? getThumbnailItemForSlideshowLoop(item.itemId || item.photoId)
|
|
562
588
|
: item;
|
|
563
|
-
var highlighted = _this.props.
|
|
589
|
+
var highlighted = _this.props.options.slideshowLoop
|
|
564
590
|
? idx === highlighledIdxForSlideshowLoop
|
|
565
591
|
: thumbnailItem.idx === activeIndex;
|
|
566
592
|
var itemStyle = {
|
|
@@ -573,61 +599,39 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
573
599
|
};
|
|
574
600
|
var thumbnailOffset = horizontalThumbnails
|
|
575
601
|
? (_a = {},
|
|
576
|
-
_a[_this.props.
|
|
602
|
+
_a[_this.props.options.isRTL ? 'right' : 'left'] = thumbnailSize * idx + 2 * idx * thumbnailSpacings,
|
|
577
603
|
_a) : { top: thumbnailSize * idx + 2 * idx * thumbnailSpacings };
|
|
578
604
|
Object.assign(itemStyle, thumbnailOffset);
|
|
579
605
|
return (react_1.default.createElement("div", { key: 'thumbnail-' +
|
|
580
606
|
thumbnailItem.id +
|
|
581
607
|
(Number.isInteger(item.loopIndex) ? '-' + item.loopIndex : ''), className: 'thumbnailItem' +
|
|
582
608
|
(highlighted
|
|
583
|
-
? ' pro-gallery-thumbnails-highlighted
|
|
609
|
+
? ' pro-gallery-thumbnails-highlighted highlight' +
|
|
584
610
|
(pro_gallery_lib_1.utils.isMobile() ? ' pro-gallery-mobile-indicator' : '')
|
|
585
|
-
: ''), "data-key": thumbnailItem.id, style: itemStyle, onClick: function () { return _this.scrollToThumbnail(thumbnailItem.idx); } }, item.type === 'text' ? (react_1.default.createElement(textItem_js_1.default, tslib_1.__assign({}, _this.props, thumbnailItem.renderProps(), {
|
|
611
|
+
: ''), "data-key": thumbnailItem.id, style: itemStyle, onClick: function () { return _this.scrollToThumbnail(thumbnailItem.idx); } }, item.type === 'text' ? (react_1.default.createElement(textItem_js_1.default, tslib_1.__assign({}, _this.props, thumbnailItem.renderProps(), { options: tslib_1.__assign(tslib_1.__assign({}, _this.props.options), { cubeType: 'fill', cubeImages: true }), actions: {}, imageDimensions: tslib_1.__assign(tslib_1.__assign({}, itemStyle), { marginTop: 0, marginLeft: 0 }), style: tslib_1.__assign(tslib_1.__assign({}, thumbnailItem.renderProps().style), itemStyle) }))) : null));
|
|
586
612
|
}))));
|
|
587
613
|
};
|
|
588
|
-
SlideshowView.prototype.
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
var centeredIdx;
|
|
592
|
-
// const scrollPos = this.props.styleParams.isRTL ?
|
|
593
|
-
// this.props.galleryStructure.width - scrollLeft - this.props.container.galleryWidth / 2 :
|
|
614
|
+
SlideshowView.prototype.getCenteredItemOrGroupIdxByScroll = function (key) {
|
|
615
|
+
var itemsOrGroups = this.props.galleryStructure[key];
|
|
616
|
+
var centeredItemOrGroupIdx;
|
|
594
617
|
var scrollPositionAtTheMiddleOfTheGallery = this.scrollPositionAtTheMiddleOfTheGallery();
|
|
595
618
|
if (scrollPositionAtTheMiddleOfTheGallery === 0) {
|
|
596
|
-
|
|
619
|
+
centeredItemOrGroupIdx = 0;
|
|
597
620
|
}
|
|
598
621
|
else {
|
|
599
|
-
for (var
|
|
600
|
-
|
|
601
|
-
|
|
622
|
+
for (var itemOrGroup = void 0, i = 0; (itemOrGroup = itemsOrGroups[i]); i++) {
|
|
623
|
+
var itemOrGroupLeft = key === 'galleryItems' ?
|
|
624
|
+
itemOrGroup.offset.left : itemOrGroup.left;
|
|
625
|
+
if (itemOrGroupLeft > scrollPositionAtTheMiddleOfTheGallery) {
|
|
626
|
+
centeredItemOrGroupIdx = i - 1;
|
|
602
627
|
break;
|
|
603
628
|
}
|
|
604
629
|
}
|
|
605
630
|
}
|
|
606
|
-
if (!(
|
|
607
|
-
|
|
631
|
+
if (!(centeredItemOrGroupIdx >= 0)) {
|
|
632
|
+
centeredItemOrGroupIdx = itemsOrGroups.length - 1;
|
|
608
633
|
}
|
|
609
|
-
return
|
|
610
|
-
};
|
|
611
|
-
SlideshowView.prototype.getCenteredGroupIdxByScroll = function () {
|
|
612
|
-
// console.log('[RTL SCROLL] setCurrentItemByScroll: ', scrollLeft);
|
|
613
|
-
var groups = this.props.galleryStructure.groups;
|
|
614
|
-
var centeredGroupIdx;
|
|
615
|
-
var scrollPositionAtTheMiddleOfTheGallery = this.scrollPositionAtTheMiddleOfTheGallery();
|
|
616
|
-
if (scrollPositionAtTheMiddleOfTheGallery === 0) {
|
|
617
|
-
centeredGroupIdx = 0;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
for (var group = void 0, i = 0; (group = groups[i]); i++) {
|
|
621
|
-
if (group.left > scrollPositionAtTheMiddleOfTheGallery) {
|
|
622
|
-
centeredGroupIdx = i - 1;
|
|
623
|
-
break;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
if (!(centeredGroupIdx >= 0)) {
|
|
628
|
-
centeredGroupIdx = groups.length - 1;
|
|
629
|
-
}
|
|
630
|
-
return centeredGroupIdx;
|
|
634
|
+
return centeredItemOrGroupIdx;
|
|
631
635
|
};
|
|
632
636
|
SlideshowView.prototype.setCurrentItemByScroll = function () {
|
|
633
637
|
var _this = this;
|
|
@@ -646,8 +650,8 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
646
650
|
//while the scroll is animating, prevent the reaction to this event
|
|
647
651
|
return;
|
|
648
652
|
}
|
|
649
|
-
this.startAutoSlideshowIfNeeded(this.props.
|
|
650
|
-
var activeIndex = this.
|
|
653
|
+
this.startAutoSlideshowIfNeeded(this.props.options);
|
|
654
|
+
var activeIndex = this.getCenteredItemOrGroupIdxByScroll('galleryItems');
|
|
651
655
|
if (!pro_gallery_lib_1.utils.isUndefined(activeIndex)) {
|
|
652
656
|
pro_gallery_lib_1.utils.setStateAndLog(this, 'Set Current Item', {
|
|
653
657
|
activeIndex: activeIndex,
|
|
@@ -660,77 +664,48 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
660
664
|
SlideshowView.prototype.createDebugMsg = function () {
|
|
661
665
|
return react_1.default.createElement(galleryDebugMessage_js_1.default, tslib_1.__assign({}, this.props.debug));
|
|
662
666
|
};
|
|
663
|
-
SlideshowView.prototype.getArrowsRenderData = function () {
|
|
664
|
-
var customNavArrowsRenderer = this.props.customNavArrowsRenderer;
|
|
665
|
-
var arrowsSize = this.props.styleParams.arrowsSize;
|
|
666
|
-
if (customNavArrowsRenderer) {
|
|
667
|
-
return {
|
|
668
|
-
arrowRenderer: customNavArrowsRenderer,
|
|
669
|
-
navArrowsContainerWidth: arrowsSize,
|
|
670
|
-
navArrowsContainerHeight: arrowsSize
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
var arrowOrigWidth = 23; //arrow-right svg and arrow-left svg width
|
|
674
|
-
var arrowOrigHeight = 39; //arrow-right svg and arrow-left svg height
|
|
675
|
-
var scalePercentage = arrowsSize / arrowOrigWidth;
|
|
676
|
-
var svgStyle = { transform: "scale(" + scalePercentage + ")" };
|
|
677
|
-
var navArrowsContainerWidth = arrowsSize; // === arrowOrigWidth * scalePercentage
|
|
678
|
-
var navArrowsContainerHeight = arrowOrigHeight * scalePercentage;
|
|
679
|
-
var arrowsColor = this.props.styleParams.arrowsColor;
|
|
680
|
-
var svgInternalStyle = pro_gallery_lib_1.utils.isMobile() && (arrowsColor === null || arrowsColor === void 0 ? void 0 : arrowsColor.value) ? { fill: arrowsColor.value } : {};
|
|
681
|
-
var arrowRenderer = function (position) {
|
|
682
|
-
var _a = position === 'right' ?
|
|
683
|
-
{
|
|
684
|
-
d: "M857.005,231.479L858.5,230l18.124,18-18.127,18-1.49-1.48L873.638,248Z",
|
|
685
|
-
transform: "translate(-855 -230)"
|
|
686
|
-
}
|
|
687
|
-
:
|
|
688
|
-
{
|
|
689
|
-
d: "M154.994,259.522L153.477,261l-18.471-18,18.473-18,1.519,1.48L138.044,243Z",
|
|
690
|
-
transform: "translate(-133 -225)"
|
|
691
|
-
}, d = _a.d, transform = _a.transform;
|
|
692
|
-
return (react_1.default.createElement("svg", { width: arrowOrigWidth, height: arrowOrigHeight, viewBox: "0 0 " + arrowOrigWidth + " " + arrowOrigHeight, style: svgStyle },
|
|
693
|
-
react_1.default.createElement("path", { className: "slideshow-arrow", style: svgInternalStyle, d: d, transform: transform })));
|
|
694
|
-
};
|
|
695
|
-
return { arrowRenderer: arrowRenderer, navArrowsContainerWidth: navArrowsContainerWidth, navArrowsContainerHeight: navArrowsContainerHeight };
|
|
696
|
-
};
|
|
697
667
|
SlideshowView.prototype.createNavArrows = function () {
|
|
698
668
|
var _a;
|
|
699
669
|
var _this = this;
|
|
700
|
-
var _b = this.props.
|
|
701
|
-
var _c =
|
|
702
|
-
var
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
//remove navBars if no scroll is needed and is column layout
|
|
712
|
-
if (shouldNotRenderNavArrows) {
|
|
713
|
-
return null;
|
|
714
|
-
}
|
|
715
|
-
var _d = this.getArrowsRenderData(), arrowRenderer = _d.arrowRenderer, navArrowsContainerWidth = _d.navArrowsContainerWidth, navArrowsContainerHeight = _d.navArrowsContainerHeight;
|
|
670
|
+
var _b = this.props.options, isRTL = _b.isRTL, scrollDirection = _b.scrollDirection, slideshowInfoSize = _b.slideshowInfoSize, imageMargin = _b.imageMargin, arrowsPadding = _b.arrowsPadding, arrowsPosition = _b.arrowsPosition, arrowsVerticalPosition = _b.arrowsVerticalPosition, layoutParams = _b.layoutParams, titlePlacement = _b.titlePlacement, textBoxHeight = _b.textBoxHeight;
|
|
671
|
+
var _c = layoutParams.navigationArrows.container, type = _c.type, backgroundColor = _c.backgroundColor, borderRadius = _c.borderRadius;
|
|
672
|
+
var isSlideshow = pro_gallery_lib_1.GALLERY_CONSTS.isLayout('SLIDESHOW')(this.props.options);
|
|
673
|
+
var _d = this.state, hideLeftArrow = _d.hideLeftArrow, hideRightArrow = _d.hideRightArrow;
|
|
674
|
+
var _e = navigationArrowUtils_1.getArrowsRenderData({
|
|
675
|
+
customNavArrowsRenderer: this.props.customComponents.customNavArrowsRenderer,
|
|
676
|
+
arrowsColor: this.props.options.arrowsColor,
|
|
677
|
+
arrowsSize: this.props.options.arrowsSize,
|
|
678
|
+
arrowsType: layoutParams.navigationArrows.type,
|
|
679
|
+
containerStyleType: type
|
|
680
|
+
}), arrowRenderer = _e.arrowRenderer, navArrowsContainerWidth = _e.navArrowsContainerWidth, navArrowsContainerHeight = _e.navArrowsContainerHeight;
|
|
716
681
|
var galleryHeight = this.props.container.galleryHeight;
|
|
717
682
|
var infoHeight = isSlideshow ? slideshowInfoSize : textBoxHeight;
|
|
718
683
|
var imageHeight = isSlideshow
|
|
719
684
|
? galleryHeight
|
|
720
685
|
: galleryHeight - infoHeight;
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
686
|
+
// the nav arrows parent container top edge is imageMargin/2 ABOVE the actual view, that calculates the middle point of gallery
|
|
687
|
+
var galleryVerticalCenter = "50% + " + imageMargin / 4 + "px";
|
|
688
|
+
// Determines the direction fix, the direction in which we move the nav arrows 'vertical position fix' pixels
|
|
689
|
+
var directionFix;
|
|
690
|
+
if (pro_gallery_lib_1.GALLERY_CONSTS.hasExternalAbovePlacement(titlePlacement)) {
|
|
691
|
+
directionFix = -1;
|
|
692
|
+
}
|
|
693
|
+
else if (isSlideshow || pro_gallery_lib_1.GALLERY_CONSTS.hasExternalBelowPlacement(titlePlacement)) {
|
|
694
|
+
directionFix = 1;
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
// if we got here, we should be ITEM_CENTER, taken care of in layoutHelper.js
|
|
698
|
+
}
|
|
699
|
+
var verticalPositionFix = (_a = {},
|
|
700
|
+
_a[pro_gallery_lib_1.GALLERY_CONSTS.arrowsVerticalPosition.ITEM_CENTER] = 0,
|
|
701
|
+
_a[pro_gallery_lib_1.GALLERY_CONSTS.arrowsVerticalPosition.IMAGE_CENTER] = infoHeight * directionFix,
|
|
702
|
+
_a[pro_gallery_lib_1.GALLERY_CONSTS.arrowsVerticalPosition.INFO_CENTER] = -imageHeight * directionFix,
|
|
703
|
+
_a)[arrowsVerticalPosition];
|
|
704
|
+
var containerStyle = tslib_1.__assign({ width: navArrowsContainerWidth + "px", height: navArrowsContainerHeight + "px", padding: 0, top: "calc(" + galleryVerticalCenter + " - " + navArrowsContainerHeight / 2 + "px - \n " + verticalPositionFix / 2 + "px)" }, navigationArrowUtils_1.getArrowBoxStyle({
|
|
705
|
+
type: type,
|
|
706
|
+
backgroundColor: backgroundColor,
|
|
707
|
+
borderRadius: borderRadius,
|
|
708
|
+
}));
|
|
734
709
|
var arrowsPos = scrollDirection === pro_gallery_lib_1.GALLERY_CONSTS.scrollDirection.HORIZONTAL &&
|
|
735
710
|
arrowsPosition === pro_gallery_lib_1.GALLERY_CONSTS.arrowsPosition.OUTSIDE_GALLERY
|
|
736
711
|
? "-" + (20 + navArrowsContainerWidth) + "px"
|
|
@@ -743,27 +718,29 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
743
718
|
var nextContainerStyle = {
|
|
744
719
|
right: arrowsPos,
|
|
745
720
|
};
|
|
721
|
+
var useDropShadow = type === pro_gallery_lib_1.GALLERY_CONSTS.arrowsContainerStyleType.SHADOW;
|
|
722
|
+
var arrowsBaseClasses = [
|
|
723
|
+
'nav-arrows-container',
|
|
724
|
+
useDropShadow ? 'drop-shadow' : ''
|
|
725
|
+
];
|
|
746
726
|
return [
|
|
747
|
-
hideLeftArrow ? null : (react_1.default.createElement("button", { className: '
|
|
727
|
+
hideLeftArrow ? null : (react_1.default.createElement("button", { className: arrowsBaseClasses.join(' ') +
|
|
748
728
|
(pro_gallery_lib_1.utils.isMobile() ? ' pro-gallery-mobile-indicator' : ''), onClick: function () { return _this._next({ direction: -1 }); }, "aria-label": (isRTL ? 'Next' : 'Previous') + " Item", tabIndex: pro_gallery_lib_1.utils.getTabIndex('slideshowPrev'), key: "nav-arrow-back", "data-hook": "nav-arrow-back", style: tslib_1.__assign(tslib_1.__assign({}, containerStyle), prevContainerStyle) }, arrowRenderer('left'))),
|
|
749
|
-
hideRightArrow ? null : (react_1.default.createElement("button", { className: '
|
|
729
|
+
hideRightArrow ? null : (react_1.default.createElement("button", { className: arrowsBaseClasses.join(' '), onClick: function () { return _this._next({ direction: 1 }); }, "aria-label": (!isRTL ? 'Next' : 'Previous') + " Item", tabIndex: pro_gallery_lib_1.utils.getTabIndex('slideshowNext'), key: "nav-arrow-next", "data-hook": "nav-arrow-next", style: tslib_1.__assign(tslib_1.__assign({}, containerStyle), nextContainerStyle) }, arrowRenderer('right'))),
|
|
750
730
|
];
|
|
751
731
|
};
|
|
752
732
|
SlideshowView.prototype.createLayout = function () {
|
|
753
733
|
var _this = this;
|
|
754
|
-
var _a = this.props,
|
|
734
|
+
var _a = this.props, getVisibleItems = _a.getVisibleItems, galleryStructure = _a.galleryStructure, container = _a.container;
|
|
755
735
|
var galleryConfig = {
|
|
756
736
|
scrollingElement: this.props.scrollingElement,
|
|
757
737
|
totalItemsCount: this.props.totalItemsCount,
|
|
758
738
|
scroll: this.props.scroll,
|
|
759
|
-
|
|
739
|
+
options: this.props.options,
|
|
760
740
|
container: this.props.container,
|
|
761
|
-
watermark: this.props.watermark,
|
|
762
741
|
settings: this.props.settings,
|
|
763
742
|
activeIndex: this.state.activeIndex,
|
|
764
|
-
|
|
765
|
-
customInfoRenderer: this.props.customInfoRenderer,
|
|
766
|
-
customSlideshowInfoRenderer: this.props.customSlideshowInfoRenderer,
|
|
743
|
+
customComponents: this.props.customComponents,
|
|
767
744
|
noFollowForSEO: this.props.noFollowForSEO,
|
|
768
745
|
galleryId: this.props.id,
|
|
769
746
|
gotFirstScrollEvent: this.props.gotFirstScrollEvent,
|
|
@@ -782,60 +759,63 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
782
759
|
return (layoutGroupView &&
|
|
783
760
|
layoutGroupView.map(function (group) {
|
|
784
761
|
return group.rendered
|
|
785
|
-
? react_1.default.createElement(groupView_js_1.default, tslib_1.__assign(tslib_1.__assign({ allowLoop: _this.props.
|
|
762
|
+
? react_1.default.createElement(groupView_js_1.default, tslib_1.__assign(tslib_1.__assign({ allowLoop: _this.props.options.slideshowLoop &&
|
|
786
763
|
_this.props.galleryStructure.width >
|
|
787
|
-
_this.props.container.width
|
|
764
|
+
_this.props.container.width }, group.renderProps(galleryConfig)), { ariaHidden: group.idx > _this.skipFromSlide }))
|
|
788
765
|
: false;
|
|
789
766
|
}));
|
|
790
767
|
};
|
|
791
768
|
return galleryStructure.columns.map(function (column, c) {
|
|
792
769
|
var columnStyle = {
|
|
793
770
|
width: _this.props.isPrerenderMode ? '100%' : column.width,
|
|
794
|
-
height:
|
|
771
|
+
height: _this.getDimensions().height
|
|
795
772
|
};
|
|
796
|
-
|
|
797
|
-
Object.assign(columnStyle, {
|
|
798
|
-
paddingBottom: _this.props.styleParams.slideshowInfoSize,
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
return (react_1.default.createElement("div", { "data-hook": "gallery-column", id: "gallery-horizontal-scroll", className: "gallery-horizontal-scroll gallery-column hide-scrollbars " + (_this.props.styleParams.isRTL ? ' rtl ' : ' ltr ') + " " + (_this.props.styleParams.scrollSnap ? ' scroll-snap ' : '') + " ", key: 'column' + c, style: columnStyle },
|
|
773
|
+
return (react_1.default.createElement("div", { "data-hook": "gallery-column", id: "gallery-horizontal-scroll", className: "gallery-horizontal-scroll gallery-column hide-scrollbars " + (_this.props.options.isRTL ? ' rtl ' : ' ltr ') + " " + (_this.props.options.scrollSnap ? ' scroll-snap ' : '') + " ", key: 'column' + c, style: columnStyle },
|
|
802
774
|
react_1.default.createElement("div", { className: "gallery-horizontal-scroll-inner" }, renderGroups(column))));
|
|
803
775
|
});
|
|
804
776
|
};
|
|
777
|
+
SlideshowView.prototype.getDimensions = function () {
|
|
778
|
+
var isSlideshow = pro_gallery_lib_1.GALLERY_CONSTS.isLayout('SLIDESHOW')(this.props.options);
|
|
779
|
+
var addition = isSlideshow ? this.props.options.slideshowInfoSize : 0;
|
|
780
|
+
var height = this.props.container.galleryHeight + addition;
|
|
781
|
+
return this.props.isPrerenderMode
|
|
782
|
+
? {
|
|
783
|
+
width: '100%',
|
|
784
|
+
height: height,
|
|
785
|
+
}
|
|
786
|
+
: {
|
|
787
|
+
height: height,
|
|
788
|
+
width: this.props.container.galleryWidth,
|
|
789
|
+
};
|
|
790
|
+
};
|
|
805
791
|
SlideshowView.prototype.createGallery = function () {
|
|
792
|
+
var _a;
|
|
806
793
|
// When arrows are set outside of the gallery, gallery is resized (in dimensionsHelper -> getGalleryWidth) and needs to be positioned accordingly
|
|
807
|
-
var galleryStyleForExternalArrows = this.props.
|
|
794
|
+
var galleryStyleForExternalArrows = this.props.options.scrollDirection ===
|
|
808
795
|
pro_gallery_lib_1.GALLERY_CONSTS.scrollDirection.HORIZONTAL &&
|
|
809
|
-
this.props.
|
|
796
|
+
this.props.options.arrowsPosition ===
|
|
810
797
|
pro_gallery_lib_1.GALLERY_CONSTS.arrowsPosition.OUTSIDE_GALLERY
|
|
811
798
|
? {
|
|
812
799
|
overflow: 'visible',
|
|
813
|
-
left: this.props.
|
|
800
|
+
left: this.props.options.arrowsSize +
|
|
814
801
|
40 +
|
|
815
|
-
this.props.
|
|
802
|
+
this.props.options.imageMargin / 2,
|
|
816
803
|
}
|
|
817
804
|
: {};
|
|
818
|
-
var galleryDimensions = this.
|
|
819
|
-
? {
|
|
820
|
-
width: '100%',
|
|
821
|
-
height: this.props.container.galleryHeight,
|
|
822
|
-
}
|
|
823
|
-
: {
|
|
824
|
-
height: this.props.container.galleryHeight,
|
|
825
|
-
width: this.props.container.galleryWidth,
|
|
826
|
-
};
|
|
805
|
+
var galleryDimensions = this.getDimensions();
|
|
827
806
|
var galleryStyle = tslib_1.__assign(tslib_1.__assign({}, galleryDimensions), galleryStyleForExternalArrows);
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
return (react_1.default.createElement("div", { id: "pro-gallery-container", className: 'pro-gallery inline-styles one-row hide-scrollbars ' +
|
|
834
|
-
(this.props.styleParams.enableScroll ? ' slider ' : '') +
|
|
835
|
-
(this.props.styleParams.isAccessible ? ' accessible ' : '') +
|
|
836
|
-
(this.props.styleParams.isRTL ? ' rtl ' : ' ltr '), style: galleryStyle },
|
|
807
|
+
return (react_1.default.createElement("div", { id: this.props.galleryContainerId, className: 'pro-gallery inline-styles one-row hide-scrollbars ' +
|
|
808
|
+
(this.props.options.enableScroll ? ' slider ' : '') +
|
|
809
|
+
(((_a = this.props.settings) === null || _a === void 0 ? void 0 : _a.isAccessible) ? ' accessible ' : '') +
|
|
810
|
+
(this.props.options.isRTL ? ' rtl ' : ' ltr '), style: galleryStyle },
|
|
837
811
|
this.createDebugMsg(),
|
|
838
|
-
|
|
812
|
+
navigationArrowUtils_1.shouldRenderNavArrows({
|
|
813
|
+
options: this.props.options,
|
|
814
|
+
container: this.props.container,
|
|
815
|
+
isPrerenderMode: this.props.isPrerenderMode,
|
|
816
|
+
galleryStructure: this.props.galleryStructure,
|
|
817
|
+
customNavArrowsRenderer: this.props.customComponents.customNavArrowsRenderer,
|
|
818
|
+
}) && this.createNavArrows(),
|
|
839
819
|
this.createLayout(),
|
|
840
820
|
this.createAutoSlideShowPlayButton(),
|
|
841
821
|
this.createSlideShowNumbers()));
|
|
@@ -843,7 +823,7 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
843
823
|
SlideshowView.prototype.onAutoSlideShowButtonClick = function () {
|
|
844
824
|
var _this = this;
|
|
845
825
|
this.setState({ pauseAutoSlideshowClicked: !this.state.pauseAutoSlideshowClicked }, function () {
|
|
846
|
-
_this.
|
|
826
|
+
_this.updateAutoSlideShowState(_this.props);
|
|
847
827
|
});
|
|
848
828
|
};
|
|
849
829
|
SlideshowView.prototype.isFullWidthGallery = function () {
|
|
@@ -885,14 +865,14 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
885
865
|
if (!this.shouldCreateSlideShowPlayButton) {
|
|
886
866
|
return false;
|
|
887
867
|
}
|
|
888
|
-
var _a = this.props.
|
|
889
|
-
var imageMargin = this.props.
|
|
868
|
+
var _a = this.props.options, galleryTextAlign = _a.galleryTextAlign, slideshowInfoSize = _a.slideshowInfoSize;
|
|
869
|
+
var imageMargin = this.props.options.imageMargin / 2 +
|
|
890
870
|
(this.isFullWidthGallery() ? 50 : 0);
|
|
891
871
|
var side = galleryTextAlign === 'right'
|
|
892
872
|
? { left: imageMargin / 2 + "px" }
|
|
893
873
|
: {
|
|
894
874
|
right: imageMargin / 2 +
|
|
895
|
-
(this.
|
|
875
|
+
(this.props.options.allowSlideshowCounter
|
|
896
876
|
? this.calcSlideshowCounterWidth()
|
|
897
877
|
: 0) + "px",
|
|
898
878
|
};
|
|
@@ -901,11 +881,11 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
901
881
|
}, onKeyDown: this.onAutoSlideshowAutoPlayKeyPress, "data-hook": "auto-slideshow-button", title: 'slideshow auto play', "aria-pressed": this.state.pauseAutoSlideshowClicked, tabIndex: 0, style: tslib_1.__assign({ top: "calc(100% - " + slideshowInfoSize + "px + 3px)" }, side) }, this.state.pauseAutoSlideshowClicked ? (react_1.default.createElement(play_1.default, { width: "10px", height: "100%" })) : (react_1.default.createElement(pause_1.default, { width: "10px", height: "100%" }))));
|
|
902
882
|
};
|
|
903
883
|
SlideshowView.prototype.createSlideShowNumbers = function () {
|
|
904
|
-
if (!this.
|
|
884
|
+
if (!this.props.options.allowSlideshowCounter) {
|
|
905
885
|
return false;
|
|
906
886
|
}
|
|
907
|
-
var _a = this.props, totalItemsCount = _a.totalItemsCount, _b = _a.
|
|
908
|
-
var imageMargin = this.props.
|
|
887
|
+
var _a = this.props, totalItemsCount = _a.totalItemsCount, _b = _a.options, galleryTextAlign = _b.galleryTextAlign, slideshowInfoSize = _b.slideshowInfoSize;
|
|
888
|
+
var imageMargin = this.props.options.imageMargin / 2 +
|
|
909
889
|
(this.isFullWidthGallery() ? 50 : 0);
|
|
910
890
|
var leftMargin = this.shouldCreateSlideShowPlayButton
|
|
911
891
|
? imageMargin / 2 + 25
|
|
@@ -920,8 +900,8 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
920
900
|
totalItemsCount)));
|
|
921
901
|
};
|
|
922
902
|
SlideshowView.prototype.getThumbnails = function () {
|
|
923
|
-
var hasThumbnails = this.props.
|
|
924
|
-
var thumbnailsPosition = this.props.
|
|
903
|
+
var hasThumbnails = this.props.options.hasThumbnails;
|
|
904
|
+
var thumbnailsPosition = this.props.options.galleryThumbnailsAlignment;
|
|
925
905
|
var thumbnailsGallery = hasThumbnails
|
|
926
906
|
? this.createThumbnails(thumbnailsPosition)
|
|
927
907
|
: false;
|
|
@@ -941,17 +921,18 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
941
921
|
return thumbnails;
|
|
942
922
|
};
|
|
943
923
|
SlideshowView.prototype.getClassNames = function () {
|
|
924
|
+
pro_gallery_lib_1.GALLERY_CONSTS.isLayout('SLIDESHOW')(this.props.options);
|
|
944
925
|
var classNames = 'pro-gallery-parent-container';
|
|
945
|
-
if (this.props.
|
|
926
|
+
if (pro_gallery_lib_1.GALLERY_CONSTS.isLayout('SLIDESHOW')(this.props.options)) {
|
|
946
927
|
classNames += ' gallery-slideshow';
|
|
947
928
|
}
|
|
948
|
-
else if (this.props.
|
|
929
|
+
else if (pro_gallery_lib_1.GALLERY_CONSTS.isLayout('SLIDER')(this.props.options)) {
|
|
949
930
|
classNames += ' gallery-slider';
|
|
950
931
|
}
|
|
951
|
-
else if (this.props.
|
|
932
|
+
else if (this.props.options.hasThumbnails) {
|
|
952
933
|
classNames += ' gallery-thumbnails';
|
|
953
934
|
}
|
|
954
|
-
else if (this.props.
|
|
935
|
+
else if (pro_gallery_lib_1.GALLERY_CONSTS.isLayout('COLUMN')(this.props.options)) {
|
|
955
936
|
classNames += ' gallery-columns';
|
|
956
937
|
}
|
|
957
938
|
if (this.isFullWidthGallery()) {
|
|
@@ -962,8 +943,8 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
962
943
|
SlideshowView.prototype.getStyles = function () {
|
|
963
944
|
return {
|
|
964
945
|
margin: -1 *
|
|
965
|
-
(this.props.
|
|
966
|
-
this.props.
|
|
946
|
+
(this.props.options.imageMargin / 2 -
|
|
947
|
+
this.props.options.layoutParams.gallerySpacing),
|
|
967
948
|
};
|
|
968
949
|
};
|
|
969
950
|
SlideshowView.prototype.getScrollPosition = function () {
|
|
@@ -978,59 +959,58 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
978
959
|
return this.getScrollPosition() + this.props.container.galleryWidth;
|
|
979
960
|
};
|
|
980
961
|
SlideshowView.prototype.scrollPosition = function () {
|
|
981
|
-
return (this.props.
|
|
962
|
+
return (this.props.options.isRTL ? -1 : 1) * this.scrollElement.scrollLeft;
|
|
982
963
|
};
|
|
983
964
|
//-----------------------------------------| REACT |--------------------------------------------//
|
|
984
|
-
SlideshowView.prototype.
|
|
965
|
+
SlideshowView.prototype.updateAutoSlideShowState = function (props) {
|
|
985
966
|
var _this = this;
|
|
986
967
|
if (props === void 0) { props = this.props; }
|
|
987
|
-
var isGalleryInHover = props.isGalleryInHover,
|
|
968
|
+
var isGalleryInHover = props.isGalleryInHover, options = props.options, settings = props.settings;
|
|
988
969
|
var _a = this.state, pauseAutoSlideshowClicked = _a.pauseAutoSlideshowClicked, shouldBlockAutoSlideshow = _a.shouldBlockAutoSlideshow, isInView = _a.isInView, isInFocus = _a.isInFocus;
|
|
989
|
-
var
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
styleParams.isAccessible) {
|
|
999
|
-
should = true;
|
|
1000
|
-
}
|
|
1001
|
-
if (shouldBlockAutoSlideshow !== should) {
|
|
1002
|
-
this.setState({ shouldBlockAutoSlideshow: should }, function () {
|
|
1003
|
-
_this.startAutoSlideshowIfNeeded(styleParams);
|
|
970
|
+
var shouldPauseDueToHover = isGalleryInHover && options.pauseAutoSlideshowOnHover;
|
|
971
|
+
var shouldPauseDueToFocus = isInFocus && (settings === null || settings === void 0 ? void 0 : settings.isAccessible);
|
|
972
|
+
var shouldBlock = !isInView ||
|
|
973
|
+
pauseAutoSlideshowClicked ||
|
|
974
|
+
shouldPauseDueToFocus ||
|
|
975
|
+
shouldPauseDueToHover;
|
|
976
|
+
if (shouldBlockAutoSlideshow !== shouldBlock) {
|
|
977
|
+
this.setState({ shouldBlockAutoSlideshow: shouldBlock }, function () {
|
|
978
|
+
_this.startAutoSlideshowIfNeeded(options);
|
|
1004
979
|
});
|
|
1005
980
|
}
|
|
1006
|
-
else {
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
981
|
};
|
|
1010
982
|
SlideshowView.prototype.onFocus = function () {
|
|
1011
983
|
var _this = this;
|
|
1012
984
|
this.setState({ isInFocus: true }, function () {
|
|
1013
|
-
_this.
|
|
985
|
+
_this.updateAutoSlideShowState(_this.props);
|
|
1014
986
|
});
|
|
1015
987
|
};
|
|
1016
988
|
SlideshowView.prototype.onBlur = function () {
|
|
1017
989
|
var _this = this;
|
|
1018
990
|
this.setState({ isInFocus: false }, function () {
|
|
1019
|
-
_this.
|
|
991
|
+
_this.updateAutoSlideShowState(_this.props);
|
|
1020
992
|
});
|
|
1021
993
|
};
|
|
1022
994
|
SlideshowView.prototype.UNSAFE_componentWillReceiveProps = function (props) {
|
|
1023
995
|
var _this = this;
|
|
996
|
+
var _a, _b;
|
|
1024
997
|
if (props.items) {
|
|
1025
998
|
this.ItemsForSlideshowLoopThumbnails = false;
|
|
1026
999
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1000
|
+
var isInView = props.isInViewport && ((_a = props.isInDisplay) !== null && _a !== void 0 ? _a : true);
|
|
1001
|
+
var oldIsInView = this.props.isInViewport && ((_b = this.props.isInDisplay) !== null && _b !== void 0 ? _b : true);
|
|
1002
|
+
if (isInView !== oldIsInView) {
|
|
1003
|
+
this.setState({ isInView: isInView }, function () {
|
|
1004
|
+
_this.updateAutoSlideShowState(props);
|
|
1030
1005
|
});
|
|
1031
1006
|
}
|
|
1032
|
-
if (this.props.isGalleryInHover !== props.isGalleryInHover) {
|
|
1033
|
-
this.
|
|
1007
|
+
else if (this.props.isGalleryInHover !== props.isGalleryInHover) {
|
|
1008
|
+
this.updateAutoSlideShowState(props);
|
|
1009
|
+
}
|
|
1010
|
+
else if (this.props.container.scrollBase != props.container.scrollBase) {
|
|
1011
|
+
this.forceUpdate(function () {
|
|
1012
|
+
_this.startAutoSlideshowIfNeeded(props.options);
|
|
1013
|
+
});
|
|
1034
1014
|
}
|
|
1035
1015
|
if (this.props.activeIndex !== props.activeIndex) {
|
|
1036
1016
|
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
@@ -1045,23 +1025,18 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
1045
1025
|
if (pro_gallery_lib_1.isEditMode() || pro_gallery_lib_1.isPreviewMode()) {
|
|
1046
1026
|
if (
|
|
1047
1027
|
//check that the change is related to the slideshow settings
|
|
1048
|
-
this.props.
|
|
1049
|
-
props.
|
|
1050
|
-
this.props.
|
|
1051
|
-
props.
|
|
1052
|
-
this.startAutoSlideshowIfNeeded(props.
|
|
1028
|
+
this.props.options.isAutoSlideshow !==
|
|
1029
|
+
props.options.isAutoSlideshow ||
|
|
1030
|
+
this.props.options.autoSlideshowInterval !==
|
|
1031
|
+
props.options.autoSlideshowInterval) {
|
|
1032
|
+
this.startAutoSlideshowIfNeeded(props.options);
|
|
1053
1033
|
}
|
|
1054
1034
|
}
|
|
1055
|
-
var isAutoSlideShow = props.styleParams.galleryLayout === 5 &&
|
|
1056
|
-
props.styleParams.isSlideshow &&
|
|
1057
|
-
props.styleParams.isAutoSlideshow;
|
|
1058
1035
|
this.shouldCreateSlideShowPlayButton =
|
|
1059
|
-
|
|
1060
|
-
this.shouldCreateSlideShowNumbers =
|
|
1061
|
-
isAutoSlideShow && props.styleParams.allowSlideshowCounter;
|
|
1036
|
+
props.options.isAutoSlideshow && props.options.playButtonForAutoSlideShow;
|
|
1062
1037
|
};
|
|
1063
1038
|
SlideshowView.prototype.removeArrowsIfNeeded = function () {
|
|
1064
|
-
var isRTL = this.props.
|
|
1039
|
+
var isRTL = this.props.options.isRTL;
|
|
1065
1040
|
var _a = this.state, hideLeftArrow = _a.hideLeftArrow, hideRightArrow = _a.hideRightArrow;
|
|
1066
1041
|
var isScrollStart = this.isScrollStart();
|
|
1067
1042
|
var isFirstItem = this.isFirstItem();
|
|
@@ -1080,23 +1055,7 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
1080
1055
|
});
|
|
1081
1056
|
}
|
|
1082
1057
|
};
|
|
1083
|
-
SlideshowView.prototype.navigationOutHandler = function () {
|
|
1084
|
-
//TODO remove after full refactor release
|
|
1085
|
-
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
1086
|
-
isInView: false,
|
|
1087
|
-
});
|
|
1088
|
-
this.clearAutoSlideshowInterval();
|
|
1089
|
-
};
|
|
1090
|
-
SlideshowView.prototype.navigationInHandler = function () {
|
|
1091
|
-
//TODO remove after full refactor release
|
|
1092
|
-
pro_gallery_lib_1.utils.setStateAndLog(this, 'Next Item', {
|
|
1093
|
-
isInView: true,
|
|
1094
|
-
});
|
|
1095
|
-
this.startAutoSlideshowIfNeeded(this.props.styleParams);
|
|
1096
|
-
};
|
|
1097
1058
|
SlideshowView.prototype.componentDidMount = function () {
|
|
1098
|
-
pro_gallery_lib_1.window.addEventListener('gallery_navigation_out', this.navigationOutHandler);
|
|
1099
|
-
pro_gallery_lib_1.window.addEventListener('gallery_navigation_in', this.navigationInHandler);
|
|
1100
1059
|
this.scrollElement = pro_gallery_lib_1.window.document.querySelector("#pro-gallery-" + this.props.id + " #gallery-horizontal-scroll");
|
|
1101
1060
|
if (this.scrollElement) {
|
|
1102
1061
|
this.scrollElement.addEventListener('scroll', this._setCurrentItemByScroll);
|
|
@@ -1108,11 +1067,9 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
1108
1067
|
else {
|
|
1109
1068
|
this.setCurrentItemByScroll();
|
|
1110
1069
|
}
|
|
1111
|
-
this.startAutoSlideshowIfNeeded(this.props.
|
|
1070
|
+
this.startAutoSlideshowIfNeeded(this.props.options);
|
|
1112
1071
|
};
|
|
1113
1072
|
SlideshowView.prototype.componentWillUnmount = function () {
|
|
1114
|
-
pro_gallery_lib_1.window.removeEventListener('gallery_navigation_out', this.navigationOutHandler);
|
|
1115
|
-
pro_gallery_lib_1.window.removeEventListener('gallery_navigation_in', this.navigationInHandler);
|
|
1116
1073
|
if (this.scrollElement) {
|
|
1117
1074
|
this.scrollElement.removeEventListener('scroll', this._setCurrentItemByScroll);
|
|
1118
1075
|
}
|
|
@@ -1129,13 +1086,16 @@ var SlideshowView = /** @class */ (function (_super) {
|
|
|
1129
1086
|
if (pro_gallery_lib_1.utils.isVerbose()) {
|
|
1130
1087
|
console.timeEnd('Rendering Gallery took ');
|
|
1131
1088
|
}
|
|
1132
|
-
return (react_1.default.createElement("div", tslib_1.__assign({ className: this.getClassNames(), style: this.getStyles(), onKeyDown: this.handleSlideshowKeyPress }, pro_gallery_lib_1.utils.getAriaAttributes(
|
|
1089
|
+
return (react_1.default.createElement("div", tslib_1.__assign({ className: this.getClassNames(), style: this.getStyles(), onKeyDown: this.handleSlideshowKeyPress }, pro_gallery_lib_1.utils.getAriaAttributes({
|
|
1090
|
+
proGalleryRole: this.props.proGalleryRole,
|
|
1091
|
+
proGalleryRegionLabel: this.props.proGalleryRegionLabel
|
|
1092
|
+
}), { onFocus: this.onFocus, onBlur: this.onBlur }),
|
|
1133
1093
|
thumbnails[0],
|
|
1134
1094
|
gallery,
|
|
1135
1095
|
thumbnails[1]));
|
|
1136
1096
|
};
|
|
1137
1097
|
return SlideshowView;
|
|
1138
|
-
}(
|
|
1098
|
+
}(react_1.default.Component));
|
|
1139
1099
|
exports.default = SlideshowView;
|
|
1140
1100
|
/* eslint-enable prettier/prettier */
|
|
1141
1101
|
//# sourceMappingURL=slideshowView.js.map
|