lightgallery 2.3.0 → 2.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +4 -0
  2. package/angular/10/bundles/lightgallery-angular-10.umd.js +34 -1
  3. package/angular/10/bundles/lightgallery-angular-10.umd.js.map +1 -1
  4. package/angular/10/bundles/lightgallery-angular-10.umd.min.js +1 -1
  5. package/angular/10/bundles/lightgallery-angular-10.umd.min.js.map +1 -1
  6. package/angular/10/esm2015/lib/lightgallery-angular.component.js +35 -2
  7. package/angular/10/fesm2015/lightgallery-angular-10.js +34 -1
  8. package/angular/10/fesm2015/lightgallery-angular-10.js.map +1 -1
  9. package/angular/10/lib/lightgallery-angular.component.d.ts +6 -2
  10. package/angular/10/lib/lightgallery-angular.component.d.ts.map +1 -1
  11. package/angular/11/bundles/lightgallery-angular-11.umd.js +34 -1
  12. package/angular/11/bundles/lightgallery-angular-11.umd.js.map +1 -1
  13. package/angular/11/bundles/lightgallery-angular-11.umd.min.js +1 -1
  14. package/angular/11/bundles/lightgallery-angular-11.umd.min.js.map +1 -1
  15. package/angular/11/esm2015/lib/lightgallery-angular.component.js +35 -2
  16. package/angular/11/fesm2015/lightgallery-angular-11.js +34 -1
  17. package/angular/11/fesm2015/lightgallery-angular-11.js.map +1 -1
  18. package/angular/11/lib/lightgallery-angular.component.d.ts +6 -2
  19. package/angular/11/lib/lightgallery-angular.component.d.ts.map +1 -1
  20. package/angular/9/bundles/lightgallery-angular-9.umd.js +34 -1
  21. package/angular/9/bundles/lightgallery-angular-9.umd.js.map +1 -1
  22. package/angular/9/bundles/lightgallery-angular-9.umd.min.js +1 -1
  23. package/angular/9/bundles/lightgallery-angular-9.umd.min.js.map +1 -1
  24. package/angular/9/esm2015/lib/lightgallery-angular.component.js +35 -2
  25. package/angular/9/esm5/lib/lightgallery-angular.component.js +35 -2
  26. package/angular/9/fesm2015/lightgallery-angular-9.js +34 -1
  27. package/angular/9/fesm2015/lightgallery-angular-9.js.map +1 -1
  28. package/angular/9/fesm5/lightgallery-angular-9.js +34 -1
  29. package/angular/9/fesm5/lightgallery-angular-9.js.map +1 -1
  30. package/angular/9/lib/lightgallery-angular.component.d.ts +6 -2
  31. package/angular/bundles/lightgallery-angular.umd.js +34 -1
  32. package/angular/bundles/lightgallery-angular.umd.js.map +1 -1
  33. package/angular/esm2015/lib/lightgallery-angular.component.js +35 -2
  34. package/angular/fesm2015/lightgallery-angular.js +34 -1
  35. package/angular/fesm2015/lightgallery-angular.js.map +1 -1
  36. package/angular/lib/lightgallery-angular.component.d.ts +6 -2
  37. package/angular/lib/lightgallery-angular.component.d.ts.map +1 -1
  38. package/css/lightgallery-bundle.css +0 -1
  39. package/css/lightgallery-bundle.min.css +1 -1
  40. package/css/lightgallery-core.css +0 -1
  41. package/css/lightgallery.css +0 -1
  42. package/lg-events.d.ts +44 -0
  43. package/lg-settings.d.ts +15 -0
  44. package/lg-utils.d.ts +1 -1
  45. package/lib/lg-events.js +3 -0
  46. package/lib/lg-events.js.map +1 -1
  47. package/lib/lg-settings.js +8 -0
  48. package/lib/lg-settings.js.map +1 -1
  49. package/lib/lg-utils.js +2 -2
  50. package/lib/lg-utils.js.map +1 -1
  51. package/lib/lgQuery.js +4 -2
  52. package/lib/lgQuery.js.map +1 -1
  53. package/lib/lightgallery.js +11 -10
  54. package/lib/lightgallery.js.map +1 -1
  55. package/lib/plugins/autoplay/lg-autoplay-settings.js +3 -0
  56. package/lib/plugins/autoplay/lg-autoplay-settings.js.map +1 -1
  57. package/lib/plugins/autoplay/lg-autoplay.js +20 -11
  58. package/lib/plugins/autoplay/lg-autoplay.js.map +1 -1
  59. package/lib/plugins/comment/lg-comment-settings.js +3 -0
  60. package/lib/plugins/comment/lg-comment-settings.js.map +1 -1
  61. package/lib/plugins/comment/lg-comment.js +1 -1
  62. package/lib/plugins/comment/lg-comment.js.map +1 -1
  63. package/lib/plugins/fullscreen/lg-fullscreen-settings.js +3 -0
  64. package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +1 -1
  65. package/lib/plugins/fullscreen/lg-fullscreen.js +1 -2
  66. package/lib/plugins/fullscreen/lg-fullscreen.js.map +1 -1
  67. package/lib/plugins/rotate/lg-rotate-settings.js +6 -0
  68. package/lib/plugins/rotate/lg-rotate-settings.js.map +1 -1
  69. package/lib/plugins/rotate/lg-rotate.js +4 -8
  70. package/lib/plugins/rotate/lg-rotate.js.map +1 -1
  71. package/lib/plugins/share/lg-share-settings.js +1 -0
  72. package/lib/plugins/share/lg-share-settings.js.map +1 -1
  73. package/lib/plugins/share/lg-share.js +1 -1
  74. package/lib/plugins/share/lg-share.js.map +1 -1
  75. package/lib/plugins/thumbnail/lg-thumbnail-settings.js +3 -0
  76. package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +1 -1
  77. package/lib/plugins/thumbnail/lg-thumbnail.js +3 -1
  78. package/lib/plugins/thumbnail/lg-thumbnail.js.map +1 -1
  79. package/lib/plugins/video/lg-video-utils.js +13 -5
  80. package/lib/plugins/video/lg-video-utils.js.map +1 -1
  81. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +8 -0
  82. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +1 -0
  83. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +122 -0
  84. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +1 -0
  85. package/lib/plugins/zoom/lg-zoom-settings.js +5 -0
  86. package/lib/plugins/zoom/lg-zoom-settings.js.map +1 -1
  87. package/lib/plugins/zoom/lg-zoom.js +2 -2
  88. package/lib/plugins/zoom/lg-zoom.js.map +1 -1
  89. package/lightgallery.d.ts +1 -1
  90. package/lightgallery.es5.js +126 -112
  91. package/lightgallery.es5.js.map +1 -1
  92. package/lightgallery.min.js +2 -2
  93. package/lightgallery.umd.js +126 -112
  94. package/lightgallery.umd.js.map +1 -1
  95. package/lit/lightgallery.esm.js +6 -6
  96. package/lit/lightgallery.umd.js +3 -3
  97. package/package.json +1 -1
  98. package/plugins/autoplay/lg-autoplay-settings.d.ts +7 -0
  99. package/plugins/autoplay/lg-autoplay.d.ts +2 -2
  100. package/plugins/autoplay/lg-autoplay.es5.js +27 -12
  101. package/plugins/autoplay/lg-autoplay.es5.js.map +1 -1
  102. package/plugins/autoplay/lg-autoplay.min.js +2 -2
  103. package/plugins/autoplay/lg-autoplay.umd.js +27 -12
  104. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  105. package/plugins/comment/lg-comment-settings.d.ts +7 -0
  106. package/plugins/comment/lg-comment.es5.js +8 -2
  107. package/plugins/comment/lg-comment.es5.js.map +1 -1
  108. package/plugins/comment/lg-comment.min.js +2 -2
  109. package/plugins/comment/lg-comment.umd.js +8 -2
  110. package/plugins/comment/lg-comment.umd.js.map +1 -1
  111. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +7 -0
  112. package/plugins/fullscreen/lg-fullscreen.es5.js +5 -3
  113. package/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -1
  114. package/plugins/fullscreen/lg-fullscreen.min.js +2 -2
  115. package/plugins/fullscreen/lg-fullscreen.umd.js +5 -3
  116. package/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -1
  117. package/plugins/hash/lg-hash.es5.js +4 -1
  118. package/plugins/hash/lg-hash.es5.js.map +1 -1
  119. package/plugins/hash/lg-hash.min.js +1 -1
  120. package/plugins/hash/lg-hash.umd.js +4 -1
  121. package/plugins/hash/lg-hash.umd.js.map +1 -1
  122. package/plugins/mediumZoom/lg-medium-zoom.es5.js +4 -1
  123. package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -1
  124. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  125. package/plugins/mediumZoom/lg-medium-zoom.umd.js +4 -1
  126. package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -1
  127. package/plugins/pager/lg-pager.es5.js +4 -1
  128. package/plugins/pager/lg-pager.es5.js.map +1 -1
  129. package/plugins/pager/lg-pager.min.js +1 -1
  130. package/plugins/pager/lg-pager.umd.js +4 -1
  131. package/plugins/pager/lg-pager.umd.js.map +1 -1
  132. package/plugins/relativeCaption/lg-relative-caption.es5.js +4 -1
  133. package/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -1
  134. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  135. package/plugins/relativeCaption/lg-relative-caption.umd.js +4 -1
  136. package/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -1
  137. package/plugins/rotate/lg-rotate-settings.d.ts +11 -0
  138. package/plugins/rotate/lg-rotate.es5.js +14 -9
  139. package/plugins/rotate/lg-rotate.es5.js.map +1 -1
  140. package/plugins/rotate/lg-rotate.min.js +2 -2
  141. package/plugins/rotate/lg-rotate.umd.js +14 -9
  142. package/plugins/rotate/lg-rotate.umd.js.map +1 -1
  143. package/plugins/share/lg-share-settings.d.ts +8 -0
  144. package/plugins/share/lg-share.es5.js +6 -2
  145. package/plugins/share/lg-share.es5.js.map +1 -1
  146. package/plugins/share/lg-share.min.js +2 -2
  147. package/plugins/share/lg-share.umd.js +6 -2
  148. package/plugins/share/lg-share.umd.js.map +1 -1
  149. package/plugins/thumbnail/lg-thumbnail-settings.d.ts +8 -0
  150. package/plugins/thumbnail/lg-thumbnail.es5.js +10 -2
  151. package/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -1
  152. package/plugins/thumbnail/lg-thumbnail.min.js +2 -2
  153. package/plugins/thumbnail/lg-thumbnail.umd.js +10 -2
  154. package/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -1
  155. package/plugins/video/lg-video.es5.js +17 -6
  156. package/plugins/video/lg-video.es5.js.map +1 -1
  157. package/plugins/video/lg-video.min.js +2 -2
  158. package/plugins/video/lg-video.umd.js +17 -6
  159. package/plugins/video/lg-video.umd.js.map +1 -1
  160. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -0
  161. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -0
  162. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +182 -0
  163. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
  164. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +8 -0
  165. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +190 -0
  166. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
  167. package/plugins/vimeoThumbnail/package.json +7 -0
  168. package/plugins/zoom/lg-zoom-settings.d.ts +9 -0
  169. package/plugins/zoom/lg-zoom.es5.js +11 -3
  170. package/plugins/zoom/lg-zoom.es5.js.map +1 -1
  171. package/plugins/zoom/lg-zoom.min.js +2 -2
  172. package/plugins/zoom/lg-zoom.umd.js +11 -3
  173. package/plugins/zoom/lg-zoom.umd.js.map +1 -1
  174. package/react/Lightgallery.d.ts +5 -1
  175. package/react/Lightgallery.es5.js +155 -113
  176. package/react/Lightgallery.es5.js.map +1 -1
  177. package/react/Lightgallery.umd.js +155 -113
  178. package/react/Lightgallery.umd.js.map +1 -1
  179. package/scss/lightgallery-core.scss +0 -1
  180. package/vue/LightGallery.vue.d.ts +5 -1
  181. package/vue/LightGalleryVue.common.js +140 -110
  182. package/vue/LightGalleryVue.common.js.map +1 -1
  183. package/vue/LightGalleryVue.umd.js +140 -110
  184. package/vue/LightGalleryVue.umd.js.map +1 -1
  185. package/vue/LightGalleryVue.umd.min.js +1 -1
  186. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
- * lightgallery | 2.3.0 | October 28th 2021
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
6
6
  */
7
7
 
8
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRotate=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e="lgAfterAppendSlide",i="lgBeforeSlide",o="lgRotateLeft",r="lgRotateRight",s="lgFlipHorizontal",a="lgFlipVertical",l={rotate:!0,rotateSpeed:400,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0};return function(){function n(e,i){return this.core=e,this.$LG=i,this.settings=t(t({},l),this.core.settings),this}return n.prototype.buildTemplates=function(){var t="";this.settings.flipVertical&&(t+='<button type="button" id="lg-flip-ver" aria-label="flip vertical" class="lg-flip-ver lg-icon"></button>'),this.settings.flipHorizontal&&(t+='<button type="button" id="lg-flip-hor" aria-label="Flip horizontal" class="lg-flip-hor lg-icon"></button>'),this.settings.rotateLeft&&(t+='<button type="button" id="lg-rotate-left" aria-label="Rotate left" class="lg-rotate-left lg-icon"></button>'),this.settings.rotateRight&&(t+='<button type="button" id="lg-rotate-right" aria-label="Rotate right" class="lg-rotate-right lg-icon"></button>'),this.core.$toolbar.append(t)},n.prototype.init=function(){var t=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(e+".rotate",(function(e){var i=e.detail.index;t.core.getSlideItem(i).find(".lg-img-wrap").first().wrap("lg-img-rotate"),t.core.getSlideItem(t.core.index).find(".lg-img-rotate").css("transition-duration",t.settings.rotateSpeed+"ms")})),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(i+".rotate",(function(e){t.rotateValuesList[e.detail.index]||(t.rotateValuesList[e.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})})))},n.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},n.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles(),this.triggerEvents(o,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles(),this.triggerEvents(r,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.$LG(t).style(),i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";if("none"!==i){var o=i.split("(")[1].split(")")[0].split(",");if(o){var r=Math.round(Math.atan2(o[1],o[0])*(180/Math.PI));return r<0?r+360:r}}return 0},n.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipHorizontal";90!==e&&270!==e||(i="flipVertical"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(s,{flipHorizontal:this.rotateValuesList[this.core.index][i]})},n.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipVertical";90!==e&&270!==e||(i="flipHorizontal"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(a,{flipVertical:this.rotateValuesList[this.core.index][i]})},n.prototype.triggerEvents=function(t,e){var i=this;setTimeout((function(){i.core.LGel.trigger(t,e)}),this.settings.rotateSpeed+10)},n.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,o=t.flipVertical<0;return e||i||o},n.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},n.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},n}()}));
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRotate=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},e="lgAfterAppendSlide",i="lgBeforeSlide",r="lgRotateLeft",o="lgRotateRight",s="lgFlipHorizontal",a="lgFlipVertical",l={rotate:!0,rotateSpeed:400,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0,rotatePluginStrings:{flipVertical:"Flip vertical",flipHorizontal:"Flip horizontal",rotateLeft:"Rotate left",rotateRight:"Rotate right"}};return function(){function n(e,i){return this.core=e,this.$LG=i,this.settings=t(t({},l),this.core.settings),this}return n.prototype.buildTemplates=function(){var t="";this.settings.flipVertical&&(t+='<button type="button" id="lg-flip-ver" aria-label="'+this.settings.rotatePluginStrings.flipVertical+'" class="lg-flip-ver lg-icon"></button>'),this.settings.flipHorizontal&&(t+='<button type="button" id="lg-flip-hor" aria-label="'+this.settings.rotatePluginStrings.flipHorizontal+'" class="lg-flip-hor lg-icon"></button>'),this.settings.rotateLeft&&(t+='<button type="button" id="lg-rotate-left" aria-label="'+this.settings.rotatePluginStrings.rotateLeft+'" class="lg-rotate-left lg-icon"></button>'),this.settings.rotateRight&&(t+='<button type="button" id="lg-rotate-right" aria-label="'+this.settings.rotatePluginStrings.rotateRight+'" class="lg-rotate-right lg-icon"></button>'),this.core.$toolbar.append(t)},n.prototype.init=function(){var t=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(e+".rotate",(function(e){var i=e.detail.index;t.core.getSlideItem(i).find(".lg-img-wrap").first().wrap("lg-img-rotate"),t.core.getSlideItem(t.core.index).find(".lg-img-rotate").css("transition-duration",t.settings.rotateSpeed+"ms")})),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(i+".rotate",(function(e){t.rotateValuesList[e.detail.index]||(t.rotateValuesList[e.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})})))},n.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},n.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles(),this.triggerEvents(r,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles(),this.triggerEvents(o,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.$LG(t).style(),i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";if("none"!==i){var r=i.split("(")[1].split(")")[0].split(",");if(r){var o=Math.round(Math.atan2(r[1],r[0])*(180/Math.PI));return o<0?o+360:o}}return 0},n.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipHorizontal";90!==e&&270!==e||(i="flipVertical"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(s,{flipHorizontal:this.rotateValuesList[this.core.index][i]})},n.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipVertical";90!==e&&270!==e||(i="flipHorizontal"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(a,{flipVertical:this.rotateValuesList[this.core.index][i]})},n.prototype.triggerEvents=function(t,e){var i=this;setTimeout((function(){i.core.LGel.trigger(t,e)}),this.settings.rotateSpeed+10)},n.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,r=t.flipVertical<0;return e||i||r},n.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},n.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},n}()}));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.3.0 | October 28th 2021
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -66,6 +66,9 @@
66
66
  rotateRight: 'lgRotateRight',
67
67
  flipHorizontal: 'lgFlipHorizontal',
68
68
  flipVertical: 'lgFlipVertical',
69
+ autoplay: 'lgAutoplay',
70
+ autoplayStart: 'lgAutoplayStart',
71
+ autoplayStop: 'lgAutoplayStop',
69
72
  };
70
73
 
71
74
  var rotateSettings = {
@@ -75,6 +78,12 @@
75
78
  rotateRight: true,
76
79
  flipHorizontal: true,
77
80
  flipVertical: true,
81
+ rotatePluginStrings: {
82
+ flipVertical: 'Flip vertical',
83
+ flipHorizontal: 'Flip horizontal',
84
+ rotateLeft: 'Rotate left',
85
+ rotateRight: 'Rotate right',
86
+ },
78
87
  };
79
88
 
80
89
  var Rotate = /** @class */ (function () {
@@ -89,20 +98,16 @@
89
98
  Rotate.prototype.buildTemplates = function () {
90
99
  var rotateIcons = '';
91
100
  if (this.settings.flipVertical) {
92
- rotateIcons +=
93
- '<button type="button" id="lg-flip-ver" aria-label="flip vertical" class="lg-flip-ver lg-icon"></button>';
101
+ rotateIcons += "<button type=\"button\" id=\"lg-flip-ver\" aria-label=\"" + this.settings.rotatePluginStrings['flipVertical'] + "\" class=\"lg-flip-ver lg-icon\"></button>";
94
102
  }
95
103
  if (this.settings.flipHorizontal) {
96
- rotateIcons +=
97
- '<button type="button" id="lg-flip-hor" aria-label="Flip horizontal" class="lg-flip-hor lg-icon"></button>';
104
+ rotateIcons += "<button type=\"button\" id=\"lg-flip-hor\" aria-label=\"" + this.settings.rotatePluginStrings['flipHorizontal'] + "\" class=\"lg-flip-hor lg-icon\"></button>";
98
105
  }
99
106
  if (this.settings.rotateLeft) {
100
- rotateIcons +=
101
- '<button type="button" id="lg-rotate-left" aria-label="Rotate left" class="lg-rotate-left lg-icon"></button>';
107
+ rotateIcons += "<button type=\"button\" id=\"lg-rotate-left\" aria-label=\"" + this.settings.rotatePluginStrings['rotateLeft'] + "\" class=\"lg-rotate-left lg-icon\"></button>";
102
108
  }
103
109
  if (this.settings.rotateRight) {
104
- rotateIcons +=
105
- '<button type="button" id="lg-rotate-right" aria-label="Rotate right" class="lg-rotate-right lg-icon"></button>';
110
+ rotateIcons += "<button type=\"button\" id=\"lg-rotate-right\" aria-label=\"" + this.settings.rotatePluginStrings['rotateRight'] + "\" class=\"lg-rotate-right lg-icon\"></button>";
106
111
  }
107
112
  this.core.$toolbar.append(rotateIcons);
108
113
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lg-rotate.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/rotate/lg-rotate-settings.ts","../../../src/plugins/rotate/lg-rotate.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n};\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n","export interface RotateSettings {\n /**\n * Enable/Disable rotate option\n */\n rotate: boolean;\n\n /**\n * Rotate speed in milliseconds\n */\n rotateSpeed: number;\n\n /**\n * Enable rotate left.\n */\n rotateLeft: boolean;\n\n /**\n * Enable rotate right.\n */\n rotateRight: boolean;\n\n /**\n * Enable flip horizontal.\n */\n flipHorizontal: boolean;\n\n /**\n * Enable flip vertical.\n */\n flipVertical: boolean;\n}\nexport const rotateSettings = {\n rotate: true,\n rotateSpeed: 400,\n rotateLeft: true,\n rotateRight: true,\n flipHorizontal: true,\n flipVertical: true,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { rotateSettings, RotateSettings } from './lg-rotate-settings';\n\nexport default class Rotate {\n core: LightGallery;\n settings: RotateSettings;\n rotateValuesList!: {\n [key: string]: any;\n };\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n // extend module default settings with lightGallery core settings\n this.settings = { ...rotateSettings, ...this.core.settings };\n\n return this;\n }\n buildTemplates(): void {\n let rotateIcons = '';\n if (this.settings.flipVertical) {\n rotateIcons +=\n '<button type=\"button\" id=\"lg-flip-ver\" aria-label=\"flip vertical\" class=\"lg-flip-ver lg-icon\"></button>';\n }\n if (this.settings.flipHorizontal) {\n rotateIcons +=\n '<button type=\"button\" id=\"lg-flip-hor\" aria-label=\"Flip horizontal\" class=\"lg-flip-hor lg-icon\"></button>';\n }\n if (this.settings.rotateLeft) {\n rotateIcons +=\n '<button type=\"button\" id=\"lg-rotate-left\" aria-label=\"Rotate left\" class=\"lg-rotate-left lg-icon\"></button>';\n }\n if (this.settings.rotateRight) {\n rotateIcons +=\n '<button type=\"button\" id=\"lg-rotate-right\" aria-label=\"Rotate right\" class=\"lg-rotate-right lg-icon\"></button>';\n }\n this.core.$toolbar.append(rotateIcons);\n }\n\n init(): void {\n if (!this.settings.rotate) {\n return;\n }\n this.buildTemplates();\n\n // Save rotate config for each item to persist its rotate, flip values\n // even after navigating to diferent slides\n this.rotateValuesList = {};\n\n // event triggered after appending slide content\n this.core.LGel.on(`${lGEvents.afterAppendSlide}.rotate`, (event) => {\n const { index } = event.detail;\n const imageWrap = this.core\n .getSlideItem(index)\n .find('.lg-img-wrap')\n .first();\n\n imageWrap.wrap('lg-img-rotate');\n this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .css('transition-duration', this.settings.rotateSpeed + 'ms');\n });\n\n this.core.outer\n .find('#lg-rotate-left')\n .first()\n .on('click.lg', this.rotateLeft.bind(this));\n\n this.core.outer\n .find('#lg-rotate-right')\n .first()\n .on('click.lg', this.rotateRight.bind(this));\n\n this.core.outer\n .find('#lg-flip-hor')\n .first()\n .on('click.lg', this.flipHorizontal.bind(this));\n\n this.core.outer\n .find('#lg-flip-ver')\n .first()\n .on('click.lg', this.flipVertical.bind(this));\n\n // Reset rotate on slide change\n this.core.LGel.on(`${lGEvents.beforeSlide}.rotate`, (event) => {\n if (!this.rotateValuesList[event.detail.index]) {\n this.rotateValuesList[event.detail.index] = {\n rotate: 0,\n flipHorizontal: 1,\n flipVertical: 1,\n };\n }\n });\n }\n\n applyStyles(): void {\n const $image = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first();\n\n $image.css(\n 'transform',\n 'rotate(' +\n this.rotateValuesList[this.core.index].rotate +\n 'deg)' +\n ' scale3d(' +\n this.rotateValuesList[this.core.index].flipHorizontal +\n ', ' +\n this.rotateValuesList[this.core.index].flipVertical +\n ', 1)',\n );\n }\n\n rotateLeft(): void {\n this.rotateValuesList[this.core.index].rotate -= 90;\n this.applyStyles();\n this.triggerEvents(lGEvents.rotateLeft, {\n rotate: this.rotateValuesList[this.core.index].rotate,\n });\n }\n\n rotateRight(): void {\n this.rotateValuesList[this.core.index].rotate += 90;\n this.applyStyles();\n this.triggerEvents(lGEvents.rotateRight, {\n rotate: this.rotateValuesList[this.core.index].rotate,\n });\n }\n\n getCurrentRotation(el: HTMLElement): number {\n if (!el) {\n return 0;\n }\n const st = this.$LG(el).style();\n const tm =\n st.getPropertyValue('-webkit-transform') ||\n st.getPropertyValue('-moz-transform') ||\n st.getPropertyValue('-ms-transform') ||\n st.getPropertyValue('-o-transform') ||\n st.getPropertyValue('transform') ||\n 'none';\n if (tm !== 'none') {\n const values = tm.split('(')[1].split(')')[0].split(',') as any;\n if (values) {\n const angle = Math.round(\n Math.atan2(values[1], values[0]) * (180 / Math.PI),\n );\n return angle < 0 ? angle + 360 : angle;\n }\n }\n return 0;\n }\n\n flipHorizontal(): void {\n const rotateEl = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first()\n .get();\n const currentRotation = this.getCurrentRotation(rotateEl);\n let rotateAxis = 'flipHorizontal';\n if (currentRotation === 90 || currentRotation === 270) {\n rotateAxis = 'flipVertical';\n }\n this.rotateValuesList[this.core.index][rotateAxis] *= -1;\n this.applyStyles();\n this.triggerEvents(lGEvents.flipHorizontal, {\n flipHorizontal: this.rotateValuesList[this.core.index][rotateAxis],\n });\n }\n\n flipVertical(): void {\n const rotateEl = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first()\n .get();\n const currentRotation = this.getCurrentRotation(rotateEl);\n let rotateAxis = 'flipVertical';\n if (currentRotation === 90 || currentRotation === 270) {\n rotateAxis = 'flipHorizontal';\n }\n this.rotateValuesList[this.core.index][rotateAxis] *= -1;\n\n this.applyStyles();\n\n this.triggerEvents(lGEvents.flipVertical, {\n flipVertical: this.rotateValuesList[this.core.index][rotateAxis],\n });\n }\n\n triggerEvents(event: string, detail: any): void {\n setTimeout(() => {\n this.core.LGel.trigger(event, detail);\n }, this.settings.rotateSpeed + 10);\n }\n\n isImageOrientationChanged(): boolean {\n const rotateValue = this.rotateValuesList[this.core.index];\n const isRotated = Math.abs(rotateValue.rotate) % 360 !== 0;\n const ifFlippedHor = rotateValue.flipHorizontal < 0;\n const ifFlippedVer = rotateValue.flipVertical < 0;\n return isRotated || ifFlippedHor || ifFlippedVer;\n }\n\n closeGallery(): void {\n if (this.isImageOrientationChanged()) {\n this.core.getSlideItem(this.core.index).css('opacity', 0);\n }\n this.rotateValuesList = {};\n }\n\n destroy(): void {\n // Unbind all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,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;YAC3D,IAAM,YAAY,GAAG,WAAW,CAAC,cAAc,GAAG,CAAC,CAAC;YACpD,IAAM,YAAY,GAAG,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC;YAClD,OAAO,SAAS,IAAI,YAAY,IAAI,YAAY,CAAC;SACpD;QAED,6BAAY,GAAZ;YACI,IAAI,IAAI,CAAC,yBAAyB,EAAE,EAAE;gBAClC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aAC7D;YACD,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;SAC9B;QAED,wBAAO,GAAP;;YAEI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SACjC;QACL,aAAC;IAAD,CAAC;;;;"}
1
+ {"version":3,"file":"lg-rotate.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/rotate/lg-rotate-settings.ts","../../../src/plugins/rotate/lg-rotate.ts"],"sourcesContent":["import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","export interface RotateStrings {\n flipVertical: string;\n flipHorizontal: string;\n rotateLeft: string;\n rotateRight: string;\n}\n\nexport interface RotateSettings {\n /**\n * Enable/Disable rotate option\n */\n rotate: boolean;\n\n /**\n * Rotate speed in milliseconds\n */\n rotateSpeed: number;\n\n /**\n * Enable rotate left.\n */\n rotateLeft: boolean;\n\n /**\n * Enable rotate right.\n */\n rotateRight: boolean;\n\n /**\n * Enable flip horizontal.\n */\n flipHorizontal: boolean;\n\n /**\n * Enable flip vertical.\n */\n flipVertical: boolean;\n\n /**\n * Custom translation strings for aria-labels\n */\n rotatePluginStrings: RotateStrings;\n}\nexport const rotateSettings = {\n rotate: true,\n rotateSpeed: 400,\n rotateLeft: true,\n rotateRight: true,\n flipHorizontal: true,\n flipVertical: true,\n rotatePluginStrings: {\n flipVertical: 'Flip vertical',\n flipHorizontal: 'Flip horizontal',\n rotateLeft: 'Rotate left',\n rotateRight: 'Rotate right',\n } as RotateStrings,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { rotateSettings, RotateSettings } from './lg-rotate-settings';\n\nexport default class Rotate {\n core: LightGallery;\n settings: RotateSettings;\n rotateValuesList!: {\n [key: string]: any;\n };\n private $LG!: LgQuery;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...rotateSettings, ...this.core.settings };\n\n return this;\n }\n buildTemplates(): void {\n let rotateIcons = '';\n if (this.settings.flipVertical) {\n rotateIcons += `<button type=\"button\" id=\"lg-flip-ver\" aria-label=\"${this.settings.rotatePluginStrings['flipVertical']}\" class=\"lg-flip-ver lg-icon\"></button>`;\n }\n if (this.settings.flipHorizontal) {\n rotateIcons += `<button type=\"button\" id=\"lg-flip-hor\" aria-label=\"${this.settings.rotatePluginStrings['flipHorizontal']}\" class=\"lg-flip-hor lg-icon\"></button>`;\n }\n if (this.settings.rotateLeft) {\n rotateIcons += `<button type=\"button\" id=\"lg-rotate-left\" aria-label=\"${this.settings.rotatePluginStrings['rotateLeft']}\" class=\"lg-rotate-left lg-icon\"></button>`;\n }\n if (this.settings.rotateRight) {\n rotateIcons += `<button type=\"button\" id=\"lg-rotate-right\" aria-label=\"${this.settings.rotatePluginStrings['rotateRight']}\" class=\"lg-rotate-right lg-icon\"></button>`;\n }\n this.core.$toolbar.append(rotateIcons);\n }\n\n init(): void {\n if (!this.settings.rotate) {\n return;\n }\n this.buildTemplates();\n\n // Save rotate config for each item to persist its rotate, flip values\n // even after navigating to diferent slides\n this.rotateValuesList = {};\n\n // event triggered after appending slide content\n this.core.LGel.on(`${lGEvents.afterAppendSlide}.rotate`, (event) => {\n const { index } = event.detail;\n const imageWrap = this.core\n .getSlideItem(index)\n .find('.lg-img-wrap')\n .first();\n\n imageWrap.wrap('lg-img-rotate');\n this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .css('transition-duration', this.settings.rotateSpeed + 'ms');\n });\n\n this.core.outer\n .find('#lg-rotate-left')\n .first()\n .on('click.lg', this.rotateLeft.bind(this));\n\n this.core.outer\n .find('#lg-rotate-right')\n .first()\n .on('click.lg', this.rotateRight.bind(this));\n\n this.core.outer\n .find('#lg-flip-hor')\n .first()\n .on('click.lg', this.flipHorizontal.bind(this));\n\n this.core.outer\n .find('#lg-flip-ver')\n .first()\n .on('click.lg', this.flipVertical.bind(this));\n\n // Reset rotate on slide change\n this.core.LGel.on(`${lGEvents.beforeSlide}.rotate`, (event) => {\n if (!this.rotateValuesList[event.detail.index]) {\n this.rotateValuesList[event.detail.index] = {\n rotate: 0,\n flipHorizontal: 1,\n flipVertical: 1,\n };\n }\n });\n }\n\n applyStyles(): void {\n const $image = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first();\n\n $image.css(\n 'transform',\n 'rotate(' +\n this.rotateValuesList[this.core.index].rotate +\n 'deg)' +\n ' scale3d(' +\n this.rotateValuesList[this.core.index].flipHorizontal +\n ', ' +\n this.rotateValuesList[this.core.index].flipVertical +\n ', 1)',\n );\n }\n\n rotateLeft(): void {\n this.rotateValuesList[this.core.index].rotate -= 90;\n this.applyStyles();\n this.triggerEvents(lGEvents.rotateLeft, {\n rotate: this.rotateValuesList[this.core.index].rotate,\n });\n }\n\n rotateRight(): void {\n this.rotateValuesList[this.core.index].rotate += 90;\n this.applyStyles();\n this.triggerEvents(lGEvents.rotateRight, {\n rotate: this.rotateValuesList[this.core.index].rotate,\n });\n }\n\n getCurrentRotation(el: HTMLElement): number {\n if (!el) {\n return 0;\n }\n const st = this.$LG(el).style();\n const tm =\n st.getPropertyValue('-webkit-transform') ||\n st.getPropertyValue('-moz-transform') ||\n st.getPropertyValue('-ms-transform') ||\n st.getPropertyValue('-o-transform') ||\n st.getPropertyValue('transform') ||\n 'none';\n if (tm !== 'none') {\n const values = tm.split('(')[1].split(')')[0].split(',') as any;\n if (values) {\n const angle = Math.round(\n Math.atan2(values[1], values[0]) * (180 / Math.PI),\n );\n return angle < 0 ? angle + 360 : angle;\n }\n }\n return 0;\n }\n\n flipHorizontal(): void {\n const rotateEl = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first()\n .get();\n const currentRotation = this.getCurrentRotation(rotateEl);\n let rotateAxis = 'flipHorizontal';\n if (currentRotation === 90 || currentRotation === 270) {\n rotateAxis = 'flipVertical';\n }\n this.rotateValuesList[this.core.index][rotateAxis] *= -1;\n this.applyStyles();\n this.triggerEvents(lGEvents.flipHorizontal, {\n flipHorizontal: this.rotateValuesList[this.core.index][rotateAxis],\n });\n }\n\n flipVertical(): void {\n const rotateEl = this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .first()\n .get();\n const currentRotation = this.getCurrentRotation(rotateEl);\n let rotateAxis = 'flipVertical';\n if (currentRotation === 90 || currentRotation === 270) {\n rotateAxis = 'flipHorizontal';\n }\n this.rotateValuesList[this.core.index][rotateAxis] *= -1;\n\n this.applyStyles();\n\n this.triggerEvents(lGEvents.flipVertical, {\n flipVertical: this.rotateValuesList[this.core.index][rotateAxis],\n });\n }\n\n triggerEvents(event: string, detail: any): void {\n setTimeout(() => {\n this.core.LGel.trigger(event, detail);\n }, this.settings.rotateSpeed + 10);\n }\n\n isImageOrientationChanged(): boolean {\n const rotateValue = this.rotateValuesList[this.core.index];\n const isRotated = Math.abs(rotateValue.rotate) % 360 !== 0;\n const ifFlippedHor = rotateValue.flipHorizontal < 0;\n const ifFlippedVer = rotateValue.flipVertical < 0;\n return isRotated || ifFlippedHor || ifFlippedVer;\n }\n\n closeGallery(): void {\n if (this.isImageOrientationChanged()) {\n this.core.getSlideItem(this.core.index).css('opacity', 0);\n }\n this.rotateValuesList = {};\n }\n\n destroy(): void {\n // Unbind all events added by lightGallery rotate plugin\n this.core.LGel.off('.lg.rotate');\n this.core.LGel.off('.rotate');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGA;;;;;IAKO,IAAM,QAAQ,GAEjB;QACA,gBAAgB,EAAE,oBAAoB;QACtC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,mBAAmB;QACpC,YAAY,EAAE,gBAAgB;QAC9B,kBAAkB,EAAE,sBAAsB;QAC1C,UAAU,EAAE,cAAc;QAC1B,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,iBAAiB;QAChC,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,eAAe;QAC5B,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW;QACpB,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QAC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AAG,KAAK,CAAC,CAAC;YAC3D,IAAM,YAAY,GAAG,WAAW,CAAC,cAAc,GAAG,CAAC,CAAC;YACpD,IAAM,YAAY,GAAG,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC;YAClD,OAAO,SAAS,IAAI,YAAY,IAAI,YAAY,CAAC;SACpD;QAED,6BAAY,GAAZ;YACI,IAAI,IAAI,CAAC,yBAAyB,EAAE,EAAE;gBAClC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aAC7D;YACD,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;SAC9B;QAED,wBAAO,GAAP;;YAEI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SACjC;QACL,aAAC;IAAD,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
1
  import { ShareOption } from './types';
2
+ export interface ShareStrings {
3
+ share: string;
4
+ }
2
5
  export interface ShareSettings {
3
6
  /**
4
7
  * Enable/Disable share options
@@ -36,6 +39,10 @@ export interface ShareSettings {
36
39
  * <a href="/demos/share/">Demo</a>
37
40
  */
38
41
  additionalShareOptions: ShareOption[];
42
+ /**
43
+ * Custom translation strings for aria-labels
44
+ */
45
+ sharePluginStrings: ShareStrings;
39
46
  }
40
47
  export declare const shareSettings: {
41
48
  share: boolean;
@@ -46,4 +53,5 @@ export declare const shareSettings: {
46
53
  pinterest: boolean;
47
54
  pinterestDropdownText: string;
48
55
  additionalShareOptions: never[];
56
+ sharePluginStrings: ShareStrings;
49
57
  };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.3.0 | October 28th 2021
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -48,6 +48,7 @@ var shareSettings = {
48
48
  pinterest: true,
49
49
  pinterestDropdownText: 'Pinterest',
50
50
  additionalShareOptions: [],
51
+ sharePluginStrings: { share: 'Share' },
51
52
  };
52
53
 
53
54
  function getFacebookShareLink(galleryItem) {
@@ -105,6 +106,9 @@ var lGEvents = {
105
106
  rotateRight: 'lgRotateRight',
106
107
  flipHorizontal: 'lgFlipHorizontal',
107
108
  flipVertical: 'lgFlipVertical',
109
+ autoplay: 'lgAutoplay',
110
+ autoplayStart: 'lgAutoplayStart',
111
+ autoplayStop: 'lgAutoplayStop',
108
112
  };
109
113
 
110
114
  var Share = /** @class */ (function () {
@@ -136,7 +140,7 @@ var Share = /** @class */ (function () {
136
140
  };
137
141
  Share.prototype.setLgShareMarkup = function () {
138
142
  var _this = this;
139
- this.core.$toolbar.append("<button type=\"button\" aria-label=\"Share\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>");
143
+ this.core.$toolbar.append("<button type=\"button\" aria-label=\"" + this.settings.sharePluginStrings['share'] + "\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>");
140
144
  this.core.outer.append('<div class="lg-dropdown-overlay"></div>');
141
145
  var $shareButton = this.core.outer.find('.lg-share');
142
146
  $shareButton.first().on('click.lg', function () {
@@ -1 +1 @@
1
- {"version":3,"file":"lg-share.es5.js","sources":["../../../src/plugins/share/lg-share-settings.ts","../../../src/plugins/share/lg-fb-share-utils.ts","../../../src/plugins/share/lg-twitter-share-utils.ts","../../../src/plugins/share/lg-pinterest-share-utils.ts","../../../src/lg-events.ts","../../../src/plugins/share/lg-share.ts"],"sourcesContent":["import { ShareOption } from './types';\n\nexport interface ShareSettings {\n /**\n * Enable/Disable share options\n */\n share: boolean;\n\n /**\n * Enable Facebook share.\n */\n facebook: boolean;\n\n /**\n * Facebook dropdown text.\n */\n facebookDropdownText: string;\n\n /**\n * Enable twitter share.\n */\n twitter: boolean;\n\n /**\n * Twitter dropdown text\n */\n twitterDropdownText: string;\n\n /**\n * Enable pinterest share.\n */\n pinterest: boolean;\n\n /**\n * Pinterest dropdown text\n\n */\n pinterestDropdownText: string;\n\n /**\n * Array of additional share options\n *\n * This can be used to build additional share options.\n * <a href=\"/demos/share/\">Demo</a>\n */\n additionalShareOptions: ShareOption[];\n}\n\nexport const shareSettings = {\n share: true,\n facebook: true,\n facebookDropdownText: 'Facebook',\n twitter: true,\n twitterDropdownText: 'Twitter',\n pinterest: true,\n pinterestDropdownText: 'Pinterest',\n additionalShareOptions: [],\n};\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getFacebookShareLink(galleryItem: GalleryItem): string {\n const facebookBaseUrl = '//www.facebook.com/sharer/sharer.php?u=';\n return (\n facebookBaseUrl +\n encodeURIComponent(galleryItem.facebookShareUrl || window.location.href)\n );\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getTwitterShareLink(galleryItem: GalleryItem): string {\n const twitterBaseUrl = '//twitter.com/intent/tweet?text=';\n const url = encodeURIComponent(\n galleryItem.twitterShareUrl || window.location.href,\n );\n const text = galleryItem.tweetText;\n return twitterBaseUrl + text + '&url=' + url;\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getPinterestShareLink(galleryItem: GalleryItem): string {\n const pinterestBaseUrl = 'http://www.pinterest.com/pin/create/button/?url=';\n const description = galleryItem.pinterestText;\n const media = encodeURIComponent(galleryItem.src as string);\n const url = encodeURIComponent(\n galleryItem.pinterestShareUrl || window.location.href,\n );\n return (\n pinterestBaseUrl +\n url +\n '&media=' +\n media +\n '&description=' +\n description\n );\n}\n","import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n};\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n","import { ShareSettings, shareSettings } from './lg-share-settings';\n\nimport { getFacebookShareLink } from './lg-fb-share-utils';\nimport { getTwitterShareLink } from './lg-twitter-share-utils';\nimport { getPinterestShareLink } from './lg-pinterest-share-utils';\nimport { LightGallery } from '../../lightgallery';\nimport { lGEvents } from '../../lg-events';\nimport { ShareOption } from './types';\ninterface DefaultShareOptions extends ShareOption {\n type: string;\n}\nexport default class Share {\n core: LightGallery;\n settings: ShareSettings;\n private shareOptions: ShareOption[] = [];\n constructor(instance: LightGallery) {\n // get lightGallery core plugin instance\n this.core = instance;\n // extend module default settings with lightGallery core settings\n this.settings = { ...shareSettings, ...this.core.settings };\n return this;\n }\n\n public init(): void {\n if (!this.settings.share) {\n return;\n }\n this.shareOptions = [\n ...this.getDefaultShareOptions(),\n ...this.settings.additionalShareOptions,\n ];\n this.setLgShareMarkup();\n this.core.outer\n .find('.lg-share .lg-dropdown')\n .append(this.getShareListHtml());\n\n this.core.LGel.on(\n `${lGEvents.afterSlide}.share`,\n this.onAfterSlide.bind(this),\n );\n }\n\n private getShareListHtml() {\n let shareHtml = '';\n this.shareOptions.forEach((shareOption) => {\n shareHtml += shareOption.dropdownHTML;\n });\n\n return shareHtml;\n }\n\n setLgShareMarkup(): void {\n this.core.$toolbar.append(\n `<button type=\"button\" aria-label=\"Share\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>`,\n );\n\n this.core.outer.append('<div class=\"lg-dropdown-overlay\"></div>');\n const $shareButton = this.core.outer.find('.lg-share');\n $shareButton.first().on('click.lg', () => {\n this.core.outer.toggleClass('lg-dropdown-active');\n if (this.core.outer.hasClass('lg-dropdown-active')) {\n this.core.outer.attr('aria-expanded', true);\n } else {\n this.core.outer.attr('aria-expanded', false);\n }\n });\n\n this.core.outer\n .find('.lg-dropdown-overlay')\n .first()\n .on('click.lg', () => {\n this.core.outer.removeClass('lg-dropdown-active');\n this.core.outer.attr('aria-expanded', false);\n });\n }\n\n private onAfterSlide(event: CustomEvent) {\n const { index } = event.detail;\n const currentItem = this.core.galleryItems[index];\n setTimeout(() => {\n this.shareOptions.forEach((shareOption) => {\n const selector = shareOption.selector;\n this.core.outer\n .find(selector)\n .attr('href', shareOption.generateLink(currentItem));\n });\n }, 100);\n }\n\n private getShareListItemHTML(type: string, text: string): string {\n return `<li><a class=\"lg-share-${type}\" rel=\"noopener\" target=\"_blank\"><span class=\"lg-icon\"></span><span class=\"lg-dropdown-text\">${text}</span></a></li>`;\n }\n\n private getDefaultShareOptions(): DefaultShareOptions[] {\n return [\n ...(this.settings.facebook\n ? [\n {\n type: 'facebook',\n generateLink: getFacebookShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'facebook',\n this.settings.facebookDropdownText,\n ),\n selector: '.lg-share-facebook',\n },\n ]\n : []),\n ...(this.settings.twitter\n ? [\n {\n type: 'twitter',\n generateLink: getTwitterShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'twitter',\n this.settings.twitterDropdownText,\n ),\n selector: '.lg-share-twitter',\n },\n ]\n : []),\n ...(this.settings.pinterest\n ? [\n {\n type: 'pinterest',\n generateLink: getPinterestShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'pinterest',\n this.settings.pinterestDropdownText,\n ),\n selector: '.lg-share-pinterest',\n },\n ]\n : []),\n ];\n }\n\n public destroy(): void {\n this.core.outer.find('.lg-dropdown-overlay').remove();\n this.core.outer.find('.lg-share').remove();\n this.core.LGel.off('.lg.share');\n this.core.LGel.off('.share');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,IAAM,aAAa,GAAG;IACzB,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;IACd,oBAAoB,EAAE,UAAU;IAChC,OAAO,EAAE,IAAI;IACb,mBAAmB,EAAE,SAAS;IAC9B,SAAS,EAAE,IAAI;IACf,qBAAqB,EAAE,WAAW;IAClC,sBAAsB,EAAE,EAAE;CAC7B;;SCvDe,oBAAoB,CAAC,WAAwB;IACzD,IAAM,eAAe,GAAG,yCAAyC,CAAC;IAClE,QACI,eAAe;QACf,kBAAkB,CAAC,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1E;AACN;;SCNgB,mBAAmB,CAAC,WAAwB;IACxD,IAAM,cAAc,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C,QAAQ,CAAC,CAAC;KAChC;IACL,YAAC;AAAD,CAAC;;"}
1
+ {"version":3,"file":"lg-share.es5.js","sources":["../../../src/plugins/share/lg-share-settings.ts","../../../src/plugins/share/lg-fb-share-utils.ts","../../../src/plugins/share/lg-twitter-share-utils.ts","../../../src/plugins/share/lg-pinterest-share-utils.ts","../../../src/lg-events.ts","../../../src/plugins/share/lg-share.ts"],"sourcesContent":["import { ShareOption } from './types';\n\nexport interface ShareStrings {\n share: string;\n}\n\nexport interface ShareSettings {\n /**\n * Enable/Disable share options\n */\n share: boolean;\n\n /**\n * Enable Facebook share.\n */\n facebook: boolean;\n\n /**\n * Facebook dropdown text.\n */\n facebookDropdownText: string;\n\n /**\n * Enable twitter share.\n */\n twitter: boolean;\n\n /**\n * Twitter dropdown text\n */\n twitterDropdownText: string;\n\n /**\n * Enable pinterest share.\n */\n pinterest: boolean;\n\n /**\n * Pinterest dropdown text\n\n */\n pinterestDropdownText: string;\n\n /**\n * Array of additional share options\n *\n * This can be used to build additional share options.\n * <a href=\"/demos/share/\">Demo</a>\n */\n additionalShareOptions: ShareOption[];\n\n /**\n * Custom translation strings for aria-labels\n */\n sharePluginStrings: ShareStrings;\n}\n\nexport const shareSettings = {\n share: true,\n facebook: true,\n facebookDropdownText: 'Facebook',\n twitter: true,\n twitterDropdownText: 'Twitter',\n pinterest: true,\n pinterestDropdownText: 'Pinterest',\n additionalShareOptions: [],\n sharePluginStrings: { share: 'Share' } as ShareStrings,\n};\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getFacebookShareLink(galleryItem: GalleryItem): string {\n const facebookBaseUrl = '//www.facebook.com/sharer/sharer.php?u=';\n return (\n facebookBaseUrl +\n encodeURIComponent(galleryItem.facebookShareUrl || window.location.href)\n );\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getTwitterShareLink(galleryItem: GalleryItem): string {\n const twitterBaseUrl = '//twitter.com/intent/tweet?text=';\n const url = encodeURIComponent(\n galleryItem.twitterShareUrl || window.location.href,\n );\n const text = galleryItem.tweetText;\n return twitterBaseUrl + text + '&url=' + url;\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getPinterestShareLink(galleryItem: GalleryItem): string {\n const pinterestBaseUrl = 'http://www.pinterest.com/pin/create/button/?url=';\n const description = galleryItem.pinterestText;\n const media = encodeURIComponent(galleryItem.src as string);\n const url = encodeURIComponent(\n galleryItem.pinterestShareUrl || window.location.href,\n );\n return (\n pinterestBaseUrl +\n url +\n '&media=' +\n media +\n '&description=' +\n description\n );\n}\n","import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","import { ShareSettings, shareSettings } from './lg-share-settings';\n\nimport { getFacebookShareLink } from './lg-fb-share-utils';\nimport { getTwitterShareLink } from './lg-twitter-share-utils';\nimport { getPinterestShareLink } from './lg-pinterest-share-utils';\nimport { LightGallery } from '../../lightgallery';\nimport { lGEvents } from '../../lg-events';\nimport { ShareOption } from './types';\n\ninterface DefaultShareOptions extends ShareOption {\n type: string;\n}\nexport default class Share {\n core: LightGallery;\n settings: ShareSettings;\n private shareOptions: ShareOption[] = [];\n constructor(instance: LightGallery) {\n // get lightGallery core plugin instance\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...shareSettings, ...this.core.settings };\n return this;\n }\n\n public init(): void {\n if (!this.settings.share) {\n return;\n }\n this.shareOptions = [\n ...this.getDefaultShareOptions(),\n ...this.settings.additionalShareOptions,\n ];\n this.setLgShareMarkup();\n this.core.outer\n .find('.lg-share .lg-dropdown')\n .append(this.getShareListHtml());\n\n this.core.LGel.on(\n `${lGEvents.afterSlide}.share`,\n this.onAfterSlide.bind(this),\n );\n }\n\n private getShareListHtml() {\n let shareHtml = '';\n this.shareOptions.forEach((shareOption) => {\n shareHtml += shareOption.dropdownHTML;\n });\n\n return shareHtml;\n }\n\n setLgShareMarkup(): void {\n this.core.$toolbar.append(\n `<button type=\"button\" aria-label=\"${this.settings.sharePluginStrings['share']}\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>`,\n );\n\n this.core.outer.append('<div class=\"lg-dropdown-overlay\"></div>');\n const $shareButton = this.core.outer.find('.lg-share');\n $shareButton.first().on('click.lg', () => {\n this.core.outer.toggleClass('lg-dropdown-active');\n if (this.core.outer.hasClass('lg-dropdown-active')) {\n this.core.outer.attr('aria-expanded', true);\n } else {\n this.core.outer.attr('aria-expanded', false);\n }\n });\n\n this.core.outer\n .find('.lg-dropdown-overlay')\n .first()\n .on('click.lg', () => {\n this.core.outer.removeClass('lg-dropdown-active');\n this.core.outer.attr('aria-expanded', false);\n });\n }\n\n private onAfterSlide(event: CustomEvent) {\n const { index } = event.detail;\n const currentItem = this.core.galleryItems[index];\n setTimeout(() => {\n this.shareOptions.forEach((shareOption) => {\n const selector = shareOption.selector;\n this.core.outer\n .find(selector)\n .attr('href', shareOption.generateLink(currentItem));\n });\n }, 100);\n }\n\n private getShareListItemHTML(type: string, text: string): string {\n return `<li><a class=\"lg-share-${type}\" rel=\"noopener\" target=\"_blank\"><span class=\"lg-icon\"></span><span class=\"lg-dropdown-text\">${text}</span></a></li>`;\n }\n\n private getDefaultShareOptions(): DefaultShareOptions[] {\n return [\n ...(this.settings.facebook\n ? [\n {\n type: 'facebook',\n generateLink: getFacebookShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'facebook',\n this.settings.facebookDropdownText,\n ),\n selector: '.lg-share-facebook',\n },\n ]\n : []),\n ...(this.settings.twitter\n ? [\n {\n type: 'twitter',\n generateLink: getTwitterShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'twitter',\n this.settings.twitterDropdownText,\n ),\n selector: '.lg-share-twitter',\n },\n ]\n : []),\n ...(this.settings.pinterest\n ? [\n {\n type: 'pinterest',\n generateLink: getPinterestShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'pinterest',\n this.settings.pinterestDropdownText,\n ),\n selector: '.lg-share-pinterest',\n },\n ]\n : []),\n ];\n }\n\n public destroy(): void {\n this.core.outer.find('.lg-dropdown-overlay').remove();\n this.core.outer.find('.lg-share').remove();\n this.core.LGel.off('.lg.share');\n this.core.LGel.off('.share');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,IAAM,aAAa,GAAG;IACzB,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;IACd,oBAAoB,EAAE,UAAU;IAChC,OAAO,EAAE,IAAI;IACb,mBAAmB,EAAE,SAAS;IAC9B,SAAS,EAAE,IAAI;IACf,qBAAqB,EAAE,WAAW;IAClC,sBAAsB,EAAE,EAAE;IAC1B,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAkB;CACzD;;SCjEe,oBAAoB,CAAC,WAAwB;IACzD,IAAM,eAAe,GAAG,yCAAyC,CAAC;IAClE,QACI,eAAe;QACf,kBAAkB,CAAC,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1E;AACN;;SCNgB,mBAAmB,CAAC,WAAwB;IACxD,IAAM,cAAc,GAAG,kCAAkC,CAAC;IAC1D,IAAM,GAAG,GAAG,kBAAkB,CAC1B,WAAW,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CACtD,CAAC;IACF,IAAM,I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,QAAQ,CAAC,CAAC;KAChC;IACL,YAAC;AAAD,CAAC;;"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * lightgallery | 2.3.0 | October 28th 2021
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
6
6
  */
7
7
 
8
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgShare=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var r={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",pinterest:!0,pinterestDropdownText:"Pinterest",additionalShareOptions:[]};function o(t){return"//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t.facebookShareUrl||window.location.href)}function n(t){var e=encodeURIComponent(t.twitterShareUrl||window.location.href);return"//twitter.com/intent/tweet?text="+t.tweetText+"&url="+e}function i(t){var e=t.pinterestText,r=encodeURIComponent(t.src);return"http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(t.pinterestShareUrl||window.location.href)+"&media="+r+"&description="+e}var s="lgAfterSlide";return function(){function a(e){return this.shareOptions=[],this.core=e,this.settings=t(t({},r),this.core.settings),this}return a.prototype.init=function(){this.settings.share&&(this.shareOptions=e(this.getDefaultShareOptions(),this.settings.additionalShareOptions),this.setLgShareMarkup(),this.core.outer.find(".lg-share .lg-dropdown").append(this.getShareListHtml()),this.core.LGel.on(s+".share",this.onAfterSlide.bind(this)))},a.prototype.getShareListHtml=function(){var t="";return this.shareOptions.forEach((function(e){t+=e.dropdownHTML})),t},a.prototype.setLgShareMarkup=function(){var t=this;this.core.$toolbar.append('<button type="button" aria-label="Share" aria-haspopup="true" aria-expanded="false" class="lg-share lg-icon">\n <ul class="lg-dropdown" style="position: absolute;"></ul></button>'),this.core.outer.append('<div class="lg-dropdown-overlay"></div>'),this.core.outer.find(".lg-share").first().on("click.lg",(function(){t.core.outer.toggleClass("lg-dropdown-active"),t.core.outer.hasClass("lg-dropdown-active")?t.core.outer.attr("aria-expanded",!0):t.core.outer.attr("aria-expanded",!1)})),this.core.outer.find(".lg-dropdown-overlay").first().on("click.lg",(function(){t.core.outer.removeClass("lg-dropdown-active"),t.core.outer.attr("aria-expanded",!1)}))},a.prototype.onAfterSlide=function(t){var e=this,r=t.detail.index,o=this.core.galleryItems[r];setTimeout((function(){e.shareOptions.forEach((function(t){var r=t.selector;e.core.outer.find(r).attr("href",t.generateLink(o))}))}),100)},a.prototype.getShareListItemHTML=function(t,e){return'<li><a class="lg-share-'+t+'" rel="noopener" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+e+"</span></a></li>"},a.prototype.getDefaultShareOptions=function(){return e(this.settings.facebook?[{type:"facebook",generateLink:o,dropdownHTML:this.getShareListItemHTML("facebook",this.settings.facebookDropdownText),selector:".lg-share-facebook"}]:[],this.settings.twitter?[{type:"twitter",generateLink:n,dropdownHTML:this.getShareListItemHTML("twitter",this.settings.twitterDropdownText),selector:".lg-share-twitter"}]:[],this.settings.pinterest?[{type:"pinterest",generateLink:i,dropdownHTML:this.getShareListItemHTML("pinterest",this.settings.pinterestDropdownText),selector:".lg-share-pinterest"}]:[])},a.prototype.destroy=function(){this.core.outer.find(".lg-dropdown-overlay").remove(),this.core.outer.find(".lg-share").remove(),this.core.LGel.off(".lg.share"),this.core.LGel.off(".share")},a}()}));
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgShare=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var r={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",pinterest:!0,pinterestDropdownText:"Pinterest",additionalShareOptions:[],sharePluginStrings:{share:"Share"}};function o(t){return"//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t.facebookShareUrl||window.location.href)}function n(t){var e=encodeURIComponent(t.twitterShareUrl||window.location.href);return"//twitter.com/intent/tweet?text="+t.tweetText+"&url="+e}function i(t){var e=t.pinterestText,r=encodeURIComponent(t.src);return"http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(t.pinterestShareUrl||window.location.href)+"&media="+r+"&description="+e}var s="lgAfterSlide";return function(){function a(e){return this.shareOptions=[],this.core=e,this.settings=t(t({},r),this.core.settings),this}return a.prototype.init=function(){this.settings.share&&(this.shareOptions=e(this.getDefaultShareOptions(),this.settings.additionalShareOptions),this.setLgShareMarkup(),this.core.outer.find(".lg-share .lg-dropdown").append(this.getShareListHtml()),this.core.LGel.on(s+".share",this.onAfterSlide.bind(this)))},a.prototype.getShareListHtml=function(){var t="";return this.shareOptions.forEach((function(e){t+=e.dropdownHTML})),t},a.prototype.setLgShareMarkup=function(){var t=this;this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.sharePluginStrings.share+'" aria-haspopup="true" aria-expanded="false" class="lg-share lg-icon">\n <ul class="lg-dropdown" style="position: absolute;"></ul></button>'),this.core.outer.append('<div class="lg-dropdown-overlay"></div>'),this.core.outer.find(".lg-share").first().on("click.lg",(function(){t.core.outer.toggleClass("lg-dropdown-active"),t.core.outer.hasClass("lg-dropdown-active")?t.core.outer.attr("aria-expanded",!0):t.core.outer.attr("aria-expanded",!1)})),this.core.outer.find(".lg-dropdown-overlay").first().on("click.lg",(function(){t.core.outer.removeClass("lg-dropdown-active"),t.core.outer.attr("aria-expanded",!1)}))},a.prototype.onAfterSlide=function(t){var e=this,r=t.detail.index,o=this.core.galleryItems[r];setTimeout((function(){e.shareOptions.forEach((function(t){var r=t.selector;e.core.outer.find(r).attr("href",t.generateLink(o))}))}),100)},a.prototype.getShareListItemHTML=function(t,e){return'<li><a class="lg-share-'+t+'" rel="noopener" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+e+"</span></a></li>"},a.prototype.getDefaultShareOptions=function(){return e(this.settings.facebook?[{type:"facebook",generateLink:o,dropdownHTML:this.getShareListItemHTML("facebook",this.settings.facebookDropdownText),selector:".lg-share-facebook"}]:[],this.settings.twitter?[{type:"twitter",generateLink:n,dropdownHTML:this.getShareListItemHTML("twitter",this.settings.twitterDropdownText),selector:".lg-share-twitter"}]:[],this.settings.pinterest?[{type:"pinterest",generateLink:i,dropdownHTML:this.getShareListItemHTML("pinterest",this.settings.pinterestDropdownText),selector:".lg-share-pinterest"}]:[])},a.prototype.destroy=function(){this.core.outer.find(".lg-dropdown-overlay").remove(),this.core.outer.find(".lg-share").remove(),this.core.LGel.off(".lg.share"),this.core.LGel.off(".share")},a}()}));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.3.0 | October 28th 2021
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -54,6 +54,7 @@
54
54
  pinterest: true,
55
55
  pinterestDropdownText: 'Pinterest',
56
56
  additionalShareOptions: [],
57
+ sharePluginStrings: { share: 'Share' },
57
58
  };
58
59
 
59
60
  function getFacebookShareLink(galleryItem) {
@@ -111,6 +112,9 @@
111
112
  rotateRight: 'lgRotateRight',
112
113
  flipHorizontal: 'lgFlipHorizontal',
113
114
  flipVertical: 'lgFlipVertical',
115
+ autoplay: 'lgAutoplay',
116
+ autoplayStart: 'lgAutoplayStart',
117
+ autoplayStop: 'lgAutoplayStop',
114
118
  };
115
119
 
116
120
  var Share = /** @class */ (function () {
@@ -142,7 +146,7 @@
142
146
  };
143
147
  Share.prototype.setLgShareMarkup = function () {
144
148
  var _this = this;
145
- this.core.$toolbar.append("<button type=\"button\" aria-label=\"Share\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>");
149
+ this.core.$toolbar.append("<button type=\"button\" aria-label=\"" + this.settings.sharePluginStrings['share'] + "\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>");
146
150
  this.core.outer.append('<div class="lg-dropdown-overlay"></div>');
147
151
  var $shareButton = this.core.outer.find('.lg-share');
148
152
  $shareButton.first().on('click.lg', function () {
@@ -1 +1 @@
1
- {"version":3,"file":"lg-share.umd.js","sources":["../../../src/plugins/share/lg-share-settings.ts","../../../src/plugins/share/lg-fb-share-utils.ts","../../../src/plugins/share/lg-twitter-share-utils.ts","../../../src/plugins/share/lg-pinterest-share-utils.ts","../../../src/lg-events.ts","../../../src/plugins/share/lg-share.ts"],"sourcesContent":["import { ShareOption } from './types';\n\nexport interface ShareSettings {\n /**\n * Enable/Disable share options\n */\n share: boolean;\n\n /**\n * Enable Facebook share.\n */\n facebook: boolean;\n\n /**\n * Facebook dropdown text.\n */\n facebookDropdownText: string;\n\n /**\n * Enable twitter share.\n */\n twitter: boolean;\n\n /**\n * Twitter dropdown text\n */\n twitterDropdownText: string;\n\n /**\n * Enable pinterest share.\n */\n pinterest: boolean;\n\n /**\n * Pinterest dropdown text\n\n */\n pinterestDropdownText: string;\n\n /**\n * Array of additional share options\n *\n * This can be used to build additional share options.\n * <a href=\"/demos/share/\">Demo</a>\n */\n additionalShareOptions: ShareOption[];\n}\n\nexport const shareSettings = {\n share: true,\n facebook: true,\n facebookDropdownText: 'Facebook',\n twitter: true,\n twitterDropdownText: 'Twitter',\n pinterest: true,\n pinterestDropdownText: 'Pinterest',\n additionalShareOptions: [],\n};\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getFacebookShareLink(galleryItem: GalleryItem): string {\n const facebookBaseUrl = '//www.facebook.com/sharer/sharer.php?u=';\n return (\n facebookBaseUrl +\n encodeURIComponent(galleryItem.facebookShareUrl || window.location.href)\n );\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getTwitterShareLink(galleryItem: GalleryItem): string {\n const twitterBaseUrl = '//twitter.com/intent/tweet?text=';\n const url = encodeURIComponent(\n galleryItem.twitterShareUrl || window.location.href,\n );\n const text = galleryItem.tweetText;\n return twitterBaseUrl + text + '&url=' + url;\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getPinterestShareLink(galleryItem: GalleryItem): string {\n const pinterestBaseUrl = 'http://www.pinterest.com/pin/create/button/?url=';\n const description = galleryItem.pinterestText;\n const media = encodeURIComponent(galleryItem.src as string);\n const url = encodeURIComponent(\n galleryItem.pinterestShareUrl || window.location.href,\n );\n return (\n pinterestBaseUrl +\n url +\n '&media=' +\n media +\n '&description=' +\n description\n );\n}\n","import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n};\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n","import { ShareSettings, shareSettings } from './lg-share-settings';\n\nimport { getFacebookShareLink } from './lg-fb-share-utils';\nimport { getTwitterShareLink } from './lg-twitter-share-utils';\nimport { getPinterestShareLink } from './lg-pinterest-share-utils';\nimport { LightGallery } from '../../lightgallery';\nimport { lGEvents } from '../../lg-events';\nimport { ShareOption } from './types';\ninterface DefaultShareOptions extends ShareOption {\n type: string;\n}\nexport default class Share {\n core: LightGallery;\n settings: ShareSettings;\n private shareOptions: ShareOption[] = [];\n constructor(instance: LightGallery) {\n // get lightGallery core plugin instance\n this.core = instance;\n // extend module default settings with lightGallery core settings\n this.settings = { ...shareSettings, ...this.core.settings };\n return this;\n }\n\n public init(): void {\n if (!this.settings.share) {\n return;\n }\n this.shareOptions = [\n ...this.getDefaultShareOptions(),\n ...this.settings.additionalShareOptions,\n ];\n this.setLgShareMarkup();\n this.core.outer\n .find('.lg-share .lg-dropdown')\n .append(this.getShareListHtml());\n\n this.core.LGel.on(\n `${lGEvents.afterSlide}.share`,\n this.onAfterSlide.bind(this),\n );\n }\n\n private getShareListHtml() {\n let shareHtml = '';\n this.shareOptions.forEach((shareOption) => {\n shareHtml += shareOption.dropdownHTML;\n });\n\n return shareHtml;\n }\n\n setLgShareMarkup(): void {\n this.core.$toolbar.append(\n `<button type=\"button\" aria-label=\"Share\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>`,\n );\n\n this.core.outer.append('<div class=\"lg-dropdown-overlay\"></div>');\n const $shareButton = this.core.outer.find('.lg-share');\n $shareButton.first().on('click.lg', () => {\n this.core.outer.toggleClass('lg-dropdown-active');\n if (this.core.outer.hasClass('lg-dropdown-active')) {\n this.core.outer.attr('aria-expanded', true);\n } else {\n this.core.outer.attr('aria-expanded', false);\n }\n });\n\n this.core.outer\n .find('.lg-dropdown-overlay')\n .first()\n .on('click.lg', () => {\n this.core.outer.removeClass('lg-dropdown-active');\n this.core.outer.attr('aria-expanded', false);\n });\n }\n\n private onAfterSlide(event: CustomEvent) {\n const { index } = event.detail;\n const currentItem = this.core.galleryItems[index];\n setTimeout(() => {\n this.shareOptions.forEach((shareOption) => {\n const selector = shareOption.selector;\n this.core.outer\n .find(selector)\n .attr('href', shareOption.generateLink(currentItem));\n });\n }, 100);\n }\n\n private getShareListItemHTML(type: string, text: string): string {\n return `<li><a class=\"lg-share-${type}\" rel=\"noopener\" target=\"_blank\"><span class=\"lg-icon\"></span><span class=\"lg-dropdown-text\">${text}</span></a></li>`;\n }\n\n private getDefaultShareOptions(): DefaultShareOptions[] {\n return [\n ...(this.settings.facebook\n ? [\n {\n type: 'facebook',\n generateLink: getFacebookShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'facebook',\n this.settings.facebookDropdownText,\n ),\n selector: '.lg-share-facebook',\n },\n ]\n : []),\n ...(this.settings.twitter\n ? [\n {\n type: 'twitter',\n generateLink: getTwitterShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'twitter',\n this.settings.twitterDropdownText,\n ),\n selector: '.lg-share-twitter',\n },\n ]\n : []),\n ...(this.settings.pinterest\n ? [\n {\n type: 'pinterest',\n generateLink: getPinterestShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'pinterest',\n this.settings.pinterestDropdownText,\n ),\n selector: '.lg-share-pinterest',\n },\n ]\n : []),\n ];\n }\n\n public destroy(): void {\n this.core.outer.find('.lg-dropdown-overlay').remove();\n this.core.outer.find('.lg-share').remove();\n this.core.LGel.off('.lg.share');\n this.core.LGel.off('.share');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDO,IAAM,aAAa,GAAG;QACzB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,UAAU;QAChC,OAAO,EAAE,IAAI;QACb,mBAAmB,EAAE,SAAS;QAC9B,SAAS,EAAE,IAAI;QACf,qBAAqB,EAAE,WAAW;QAClC,sBAAsB,EAAE,EAAE;KAC7B;;aCvDe,oBAAoB,CAAC,WAAwB;QACzD,IAAM,eAAe,GAAG,yCAAyC,CAAC;QAClE,QACI,eAAe;YACf,kBAAkB,CAAC,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1E;IACN;;aCNgB,mBAAmB,CAAC,WAAwB;QACxD,IAAM,cAAc,GAAG,kCAAkC,CAAC;QAC1D,IAAM,GAAG,GAAG,kBAAkB,CAC1B,WAAW,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CACtD,CAAC;QACF,IAAM,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC;QACnC,OAAO,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,GA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AAI,EAAE,UAAU;wBAChB,YAAY,EAAE,oBAAoB;wBAClC,YAAY,EAAE,IAAI,CAAC,oBAAoB,CACnC,UAAU,EACV,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CACrC;wBACD,QAAQ,EAAE,oBAAoB;qBACjC;iBACJ;kBACD,EAAE,IACJ,IAAI,CAAC,QAAQ,CAAC,OAAO;kBACnB;oBACI;wBACI,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,mBAAmB;wBACjC,YAAY,EAAE,IAAI,CAAC,oBAAoB,CACnC,SAAS,EACT,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CACpC;wBACD,QAAQ,EAAE,mBAAmB;qBAChC;iBACJ;kBACD,EAAE,IACJ,IAAI,CAAC,QAAQ,CAAC,SAAS;kBACrB;oBACI;wBACI,IAAI,EAAE,WAAW;wBACjB,YAAY,EAAE,qBAAqB;wBACnC,YAAY,EAAE,IAAI,CAAC,oBAAoB,CACnC,WAAW,EACX,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CACtC;wBACD,QAAQ,EAAE,qBAAqB;qBAClC;iBACJ;kBACD,EAAE,GACV;SACL;QAEM,uBAAO,GAAd;YACI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,EAAE,CAAC;YACtD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SAChC;QACL,YAAC;IAAD,CAAC;;;;"}
1
+ {"version":3,"file":"lg-share.umd.js","sources":["../../../src/plugins/share/lg-share-settings.ts","../../../src/plugins/share/lg-fb-share-utils.ts","../../../src/plugins/share/lg-twitter-share-utils.ts","../../../src/plugins/share/lg-pinterest-share-utils.ts","../../../src/lg-events.ts","../../../src/plugins/share/lg-share.ts"],"sourcesContent":["import { ShareOption } from './types';\n\nexport interface ShareStrings {\n share: string;\n}\n\nexport interface ShareSettings {\n /**\n * Enable/Disable share options\n */\n share: boolean;\n\n /**\n * Enable Facebook share.\n */\n facebook: boolean;\n\n /**\n * Facebook dropdown text.\n */\n facebookDropdownText: string;\n\n /**\n * Enable twitter share.\n */\n twitter: boolean;\n\n /**\n * Twitter dropdown text\n */\n twitterDropdownText: string;\n\n /**\n * Enable pinterest share.\n */\n pinterest: boolean;\n\n /**\n * Pinterest dropdown text\n\n */\n pinterestDropdownText: string;\n\n /**\n * Array of additional share options\n *\n * This can be used to build additional share options.\n * <a href=\"/demos/share/\">Demo</a>\n */\n additionalShareOptions: ShareOption[];\n\n /**\n * Custom translation strings for aria-labels\n */\n sharePluginStrings: ShareStrings;\n}\n\nexport const shareSettings = {\n share: true,\n facebook: true,\n facebookDropdownText: 'Facebook',\n twitter: true,\n twitterDropdownText: 'Twitter',\n pinterest: true,\n pinterestDropdownText: 'Pinterest',\n additionalShareOptions: [],\n sharePluginStrings: { share: 'Share' } as ShareStrings,\n};\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getFacebookShareLink(galleryItem: GalleryItem): string {\n const facebookBaseUrl = '//www.facebook.com/sharer/sharer.php?u=';\n return (\n facebookBaseUrl +\n encodeURIComponent(galleryItem.facebookShareUrl || window.location.href)\n );\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getTwitterShareLink(galleryItem: GalleryItem): string {\n const twitterBaseUrl = '//twitter.com/intent/tweet?text=';\n const url = encodeURIComponent(\n galleryItem.twitterShareUrl || window.location.href,\n );\n const text = galleryItem.tweetText;\n return twitterBaseUrl + text + '&url=' + url;\n}\n","import { GalleryItem } from '../../lg-utils';\n\nexport function getPinterestShareLink(galleryItem: GalleryItem): string {\n const pinterestBaseUrl = 'http://www.pinterest.com/pin/create/button/?url=';\n const description = galleryItem.pinterestText;\n const media = encodeURIComponent(galleryItem.src as string);\n const url = encodeURIComponent(\n galleryItem.pinterestShareUrl || window.location.href,\n );\n return (\n pinterestBaseUrl +\n url +\n '&media=' +\n media +\n '&description=' +\n description\n );\n}\n","import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods\">Methods<a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","import { ShareSettings, shareSettings } from './lg-share-settings';\n\nimport { getFacebookShareLink } from './lg-fb-share-utils';\nimport { getTwitterShareLink } from './lg-twitter-share-utils';\nimport { getPinterestShareLink } from './lg-pinterest-share-utils';\nimport { LightGallery } from '../../lightgallery';\nimport { lGEvents } from '../../lg-events';\nimport { ShareOption } from './types';\n\ninterface DefaultShareOptions extends ShareOption {\n type: string;\n}\nexport default class Share {\n core: LightGallery;\n settings: ShareSettings;\n private shareOptions: ShareOption[] = [];\n constructor(instance: LightGallery) {\n // get lightGallery core plugin instance\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...shareSettings, ...this.core.settings };\n return this;\n }\n\n public init(): void {\n if (!this.settings.share) {\n return;\n }\n this.shareOptions = [\n ...this.getDefaultShareOptions(),\n ...this.settings.additionalShareOptions,\n ];\n this.setLgShareMarkup();\n this.core.outer\n .find('.lg-share .lg-dropdown')\n .append(this.getShareListHtml());\n\n this.core.LGel.on(\n `${lGEvents.afterSlide}.share`,\n this.onAfterSlide.bind(this),\n );\n }\n\n private getShareListHtml() {\n let shareHtml = '';\n this.shareOptions.forEach((shareOption) => {\n shareHtml += shareOption.dropdownHTML;\n });\n\n return shareHtml;\n }\n\n setLgShareMarkup(): void {\n this.core.$toolbar.append(\n `<button type=\"button\" aria-label=\"${this.settings.sharePluginStrings['share']}\" aria-haspopup=\"true\" aria-expanded=\"false\" class=\"lg-share lg-icon\">\n <ul class=\"lg-dropdown\" style=\"position: absolute;\"></ul></button>`,\n );\n\n this.core.outer.append('<div class=\"lg-dropdown-overlay\"></div>');\n const $shareButton = this.core.outer.find('.lg-share');\n $shareButton.first().on('click.lg', () => {\n this.core.outer.toggleClass('lg-dropdown-active');\n if (this.core.outer.hasClass('lg-dropdown-active')) {\n this.core.outer.attr('aria-expanded', true);\n } else {\n this.core.outer.attr('aria-expanded', false);\n }\n });\n\n this.core.outer\n .find('.lg-dropdown-overlay')\n .first()\n .on('click.lg', () => {\n this.core.outer.removeClass('lg-dropdown-active');\n this.core.outer.attr('aria-expanded', false);\n });\n }\n\n private onAfterSlide(event: CustomEvent) {\n const { index } = event.detail;\n const currentItem = this.core.galleryItems[index];\n setTimeout(() => {\n this.shareOptions.forEach((shareOption) => {\n const selector = shareOption.selector;\n this.core.outer\n .find(selector)\n .attr('href', shareOption.generateLink(currentItem));\n });\n }, 100);\n }\n\n private getShareListItemHTML(type: string, text: string): string {\n return `<li><a class=\"lg-share-${type}\" rel=\"noopener\" target=\"_blank\"><span class=\"lg-icon\"></span><span class=\"lg-dropdown-text\">${text}</span></a></li>`;\n }\n\n private getDefaultShareOptions(): DefaultShareOptions[] {\n return [\n ...(this.settings.facebook\n ? [\n {\n type: 'facebook',\n generateLink: getFacebookShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'facebook',\n this.settings.facebookDropdownText,\n ),\n selector: '.lg-share-facebook',\n },\n ]\n : []),\n ...(this.settings.twitter\n ? [\n {\n type: 'twitter',\n generateLink: getTwitterShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'twitter',\n this.settings.twitterDropdownText,\n ),\n selector: '.lg-share-twitter',\n },\n ]\n : []),\n ...(this.settings.pinterest\n ? [\n {\n type: 'pinterest',\n generateLink: getPinterestShareLink,\n dropdownHTML: this.getShareListItemHTML(\n 'pinterest',\n this.settings.pinterestDropdownText,\n ),\n selector: '.lg-share-pinterest',\n },\n ]\n : []),\n ];\n }\n\n public destroy(): void {\n this.core.outer.find('.lg-dropdown-overlay').remove();\n this.core.outer.find('.lg-share').remove();\n this.core.LGel.off('.lg.share');\n this.core.LGel.off('.share');\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyDO,IAAM,aAAa,GAAG;QACzB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,UAAU;QAChC,OAAO,EAAE,IAAI;QACb,mBAAmB,EAAE,SAAS;QAC9B,SAAS,EAAE,IAAI;QACf,qBAAqB,EAAE,WAAW;QAClC,sBAAsB,EAAE,EAAE;QAC1B,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAkB;KACzD;;aCjEe,oBAAoB,CAAC,WAAwB;QACzD,IAAM,eAAe,GAAG,yCAAyC,CAAC;QAClE,QACI,eAAe;YACf,kBAAkB,CAAC,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1E;IACN;;aCNgB,mBAAmB,CAAC,WAAwB;QACxD,IAAM,cAAc,GAAG,kCAAkC,CAAC;QAC1D,IAAM,GAAG,GAAG,kBAAkB,CAC1B,WAAW,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CACtD,CAAC;QACF,IAAM,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC;QACnC,OAAO,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,GAAG,CAAC;IACjD;;aCPgB,qBAAqB,CAAC,WAAwB;QAC1D,IAAM,gBAAgB,GAAG,kDAAkD,CAAC;QAC5E,IAAM,W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6
  * Enable thumbnails for the gallery
@@ -57,5 +60,10 @@ export interface ThumbnailsSettings {
57
60
  * You can specify the thumbnail size by setting respective number.
58
61
  */
59
62
  youTubeThumbSize: number;
63
+ /**
64
+ * Custom translation strings for aria-labels
65
+ */
66
+ thumbnailPluginStrings: ThumbnailStrings;
60
67
  }
61
68
  export declare const thumbnailsSettings: ThumbnailsSettings;
69
+ export {};