lightgallery 2.3.0-beta.3 → 2.4.0

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 (172) 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 +30 -2
  44. package/lg-utils.d.ts +16 -4
  45. package/lib/lg-events.js +3 -0
  46. package/lib/lg-events.js.map +1 -1
  47. package/lib/lg-settings.js +12 -1
  48. package/lib/lg-settings.js.map +1 -1
  49. package/lib/lg-utils.js +4 -4
  50. package/lib/lg-utils.js.map +1 -1
  51. package/lib/lgQuery.js +29 -20
  52. package/lib/lgQuery.js.map +1 -1
  53. package/lib/lightgallery.js +30 -16
  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/zoom/lg-zoom-settings.js +5 -0
  80. package/lib/plugins/zoom/lg-zoom-settings.js.map +1 -1
  81. package/lib/plugins/zoom/lg-zoom.js +2 -2
  82. package/lib/plugins/zoom/lg-zoom.js.map +1 -1
  83. package/lightgallery.d.ts +1 -1
  84. package/lightgallery.es5.js +172 -135
  85. package/lightgallery.es5.js.map +1 -1
  86. package/lightgallery.min.js +2 -2
  87. package/lightgallery.umd.js +172 -135
  88. package/lightgallery.umd.js.map +1 -1
  89. package/lit/lightgallery.esm.js +7 -7
  90. package/lit/lightgallery.umd.js +3 -3
  91. package/package.json +1 -1
  92. package/plugins/autoplay/lg-autoplay-settings.d.ts +7 -0
  93. package/plugins/autoplay/lg-autoplay.d.ts +2 -2
  94. package/plugins/autoplay/lg-autoplay.es5.js +27 -12
  95. package/plugins/autoplay/lg-autoplay.es5.js.map +1 -1
  96. package/plugins/autoplay/lg-autoplay.min.js +2 -2
  97. package/plugins/autoplay/lg-autoplay.umd.js +27 -12
  98. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  99. package/plugins/comment/lg-comment-settings.d.ts +7 -0
  100. package/plugins/comment/lg-comment.es5.js +8 -2
  101. package/plugins/comment/lg-comment.es5.js.map +1 -1
  102. package/plugins/comment/lg-comment.min.js +2 -2
  103. package/plugins/comment/lg-comment.umd.js +8 -2
  104. package/plugins/comment/lg-comment.umd.js.map +1 -1
  105. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +7 -0
  106. package/plugins/fullscreen/lg-fullscreen.es5.js +5 -3
  107. package/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -1
  108. package/plugins/fullscreen/lg-fullscreen.min.js +2 -2
  109. package/plugins/fullscreen/lg-fullscreen.umd.js +5 -3
  110. package/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -1
  111. package/plugins/hash/lg-hash.es5.js +4 -1
  112. package/plugins/hash/lg-hash.es5.js.map +1 -1
  113. package/plugins/hash/lg-hash.min.js +1 -1
  114. package/plugins/hash/lg-hash.umd.js +4 -1
  115. package/plugins/hash/lg-hash.umd.js.map +1 -1
  116. package/plugins/mediumZoom/lg-medium-zoom.es5.js +4 -1
  117. package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -1
  118. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  119. package/plugins/mediumZoom/lg-medium-zoom.umd.js +4 -1
  120. package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -1
  121. package/plugins/pager/lg-pager.es5.js +4 -1
  122. package/plugins/pager/lg-pager.es5.js.map +1 -1
  123. package/plugins/pager/lg-pager.min.js +1 -1
  124. package/plugins/pager/lg-pager.umd.js +4 -1
  125. package/plugins/pager/lg-pager.umd.js.map +1 -1
  126. package/plugins/relativeCaption/lg-relative-caption.es5.js +4 -1
  127. package/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -1
  128. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  129. package/plugins/relativeCaption/lg-relative-caption.umd.js +4 -1
  130. package/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -1
  131. package/plugins/rotate/lg-rotate-settings.d.ts +11 -0
  132. package/plugins/rotate/lg-rotate.es5.js +14 -9
  133. package/plugins/rotate/lg-rotate.es5.js.map +1 -1
  134. package/plugins/rotate/lg-rotate.min.js +2 -2
  135. package/plugins/rotate/lg-rotate.umd.js +14 -9
  136. package/plugins/rotate/lg-rotate.umd.js.map +1 -1
  137. package/plugins/share/lg-share-settings.d.ts +8 -0
  138. package/plugins/share/lg-share.es5.js +6 -2
  139. package/plugins/share/lg-share.es5.js.map +1 -1
  140. package/plugins/share/lg-share.min.js +2 -2
  141. package/plugins/share/lg-share.umd.js +6 -2
  142. package/plugins/share/lg-share.umd.js.map +1 -1
  143. package/plugins/thumbnail/lg-thumbnail-settings.d.ts +8 -0
  144. package/plugins/thumbnail/lg-thumbnail.es5.js +10 -2
  145. package/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -1
  146. package/plugins/thumbnail/lg-thumbnail.min.js +2 -2
  147. package/plugins/thumbnail/lg-thumbnail.umd.js +10 -2
  148. package/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -1
  149. package/plugins/video/lg-video.es5.js +4 -1
  150. package/plugins/video/lg-video.es5.js.map +1 -1
  151. package/plugins/video/lg-video.min.js +1 -1
  152. package/plugins/video/lg-video.umd.js +4 -1
  153. package/plugins/video/lg-video.umd.js.map +1 -1
  154. package/plugins/zoom/lg-zoom-settings.d.ts +9 -0
  155. package/plugins/zoom/lg-zoom.es5.js +11 -3
  156. package/plugins/zoom/lg-zoom.es5.js.map +1 -1
  157. package/plugins/zoom/lg-zoom.min.js +2 -2
  158. package/plugins/zoom/lg-zoom.umd.js +11 -3
  159. package/plugins/zoom/lg-zoom.umd.js.map +1 -1
  160. package/react/Lightgallery.d.ts +5 -1
  161. package/react/Lightgallery.es5.js +201 -136
  162. package/react/Lightgallery.es5.js.map +1 -1
  163. package/react/Lightgallery.umd.js +201 -136
  164. package/react/Lightgallery.umd.js.map +1 -1
  165. package/scss/lightgallery-core.scss +0 -1
  166. package/vue/LightGallery.vue.d.ts +5 -1
  167. package/vue/LightGalleryVue.common.js +314 -264
  168. package/vue/LightGalleryVue.common.js.map +1 -1
  169. package/vue/LightGalleryVue.umd.js +314 -264
  170. package/vue/LightGalleryVue.umd.js.map +1 -1
  171. package/vue/LightGalleryVue.umd.min.js +2 -2
  172. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -28,7 +28,7 @@ function __rest(s, e) {
28
28
  }
29
29
 
30
30
  /*!
31
- * lightgallery | 2.3.0-beta.3 | October 9th 2021
31
+ * lightgallery | 2.4.0 | January 29th 2022
32
32
  * http://www.lightgalleryjs.com/
33
33
  * Copyright (c) 2020 Sachin Neravath;
34
34
  * @license GPLv3
@@ -68,24 +68,140 @@ function __spreadArrays() {
68
68
  return r;
69
69
  }
70
70
 
71
- (function () {
72
- if (typeof window.CustomEvent === 'function')
73
- return false;
74
- function CustomEvent(event, params) {
75
- params = params || { bubbles: false, cancelable: false, detail: null };
76
- var evt = document.createEvent('CustomEvent');
77
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
78
- return evt;
79
- }
80
- window.CustomEvent = CustomEvent;
81
- })();
82
- (function () {
83
- if (!Element.prototype.matches) {
84
- Element.prototype.matches =
85
- Element.prototype.msMatchesSelector ||
86
- Element.prototype.webkitMatchesSelector;
87
- }
88
- })();
71
+ /**
72
+ * List of lightGallery events
73
+ * All events should be documented here
74
+ * Below interfaces are used to build the website documentations
75
+ * */
76
+ var lGEvents = {
77
+ afterAppendSlide: 'lgAfterAppendSlide',
78
+ init: 'lgInit',
79
+ hasVideo: 'lgHasVideo',
80
+ containerResize: 'lgContainerResize',
81
+ updateSlides: 'lgUpdateSlides',
82
+ afterAppendSubHtml: 'lgAfterAppendSubHtml',
83
+ beforeOpen: 'lgBeforeOpen',
84
+ afterOpen: 'lgAfterOpen',
85
+ slideItemLoad: 'lgSlideItemLoad',
86
+ beforeSlide: 'lgBeforeSlide',
87
+ afterSlide: 'lgAfterSlide',
88
+ posterClick: 'lgPosterClick',
89
+ dragStart: 'lgDragStart',
90
+ dragMove: 'lgDragMove',
91
+ dragEnd: 'lgDragEnd',
92
+ beforeNextSlide: 'lgBeforeNextSlide',
93
+ beforePrevSlide: 'lgBeforePrevSlide',
94
+ beforeClose: 'lgBeforeClose',
95
+ afterClose: 'lgAfterClose',
96
+ rotateLeft: 'lgRotateLeft',
97
+ rotateRight: 'lgRotateRight',
98
+ flipHorizontal: 'lgFlipHorizontal',
99
+ flipVertical: 'lgFlipVertical',
100
+ autoplay: 'lgAutoplay',
101
+ autoplayStart: 'lgAutoplayStart',
102
+ autoplayStop: 'lgAutoplayStop',
103
+ };
104
+
105
+ var lightGalleryCoreSettings = {
106
+ mode: 'lg-slide',
107
+ easing: 'ease',
108
+ speed: 400,
109
+ licenseKey: '0000-0000-000-0000',
110
+ height: '100%',
111
+ width: '100%',
112
+ addClass: '',
113
+ startClass: 'lg-start-zoom',
114
+ backdropDuration: 300,
115
+ container: '',
116
+ startAnimationDuration: 400,
117
+ zoomFromOrigin: true,
118
+ hideBarsDelay: 0,
119
+ showBarsAfter: 10000,
120
+ slideDelay: 0,
121
+ supportLegacyBrowser: true,
122
+ allowMediaOverlap: false,
123
+ videoMaxSize: '1280-720',
124
+ loadYouTubePoster: true,
125
+ defaultCaptionHeight: 0,
126
+ ariaLabelledby: '',
127
+ ariaDescribedby: '',
128
+ closable: true,
129
+ swipeToClose: true,
130
+ closeOnTap: true,
131
+ showCloseIcon: true,
132
+ showMaximizeIcon: false,
133
+ loop: true,
134
+ escKey: true,
135
+ keyPress: true,
136
+ controls: true,
137
+ slideEndAnimation: true,
138
+ hideControlOnEnd: false,
139
+ mousewheel: false,
140
+ getCaptionFromTitleOrAlt: true,
141
+ appendSubHtmlTo: '.lg-sub-html',
142
+ subHtmlSelectorRelative: false,
143
+ preload: 2,
144
+ numberOfSlideItemsInDom: 10,
145
+ selector: '',
146
+ selectWithin: '',
147
+ nextHtml: '',
148
+ prevHtml: '',
149
+ index: 0,
150
+ iframeWidth: '100%',
151
+ iframeHeight: '100%',
152
+ iframeMaxWidth: '100%',
153
+ iframeMaxHeight: '100%',
154
+ download: true,
155
+ counter: true,
156
+ appendCounterTo: '.lg-toolbar',
157
+ swipeThreshold: 50,
158
+ enableSwipe: true,
159
+ enableDrag: true,
160
+ dynamic: false,
161
+ dynamicEl: [],
162
+ extraProps: [],
163
+ exThumbImage: '',
164
+ isMobile: undefined,
165
+ mobileSettings: {
166
+ controls: false,
167
+ showCloseIcon: false,
168
+ download: false,
169
+ },
170
+ plugins: [],
171
+ strings: {
172
+ closeGallery: 'Close gallery',
173
+ toggleMaximize: 'Toggle maximize',
174
+ previousSlide: 'Previous slide',
175
+ nextSlide: 'Next slide',
176
+ download: 'Download',
177
+ playVideo: 'Play video',
178
+ },
179
+ };
180
+
181
+ function initLgPolyfills() {
182
+ (function () {
183
+ if (typeof window.CustomEvent === 'function')
184
+ return false;
185
+ function CustomEvent(event, params) {
186
+ params = params || {
187
+ bubbles: false,
188
+ cancelable: false,
189
+ detail: null,
190
+ };
191
+ var evt = document.createEvent('CustomEvent');
192
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
193
+ return evt;
194
+ }
195
+ window.CustomEvent = CustomEvent;
196
+ })();
197
+ (function () {
198
+ if (!Element.prototype.matches) {
199
+ Element.prototype.matches =
200
+ Element.prototype.msMatchesSelector ||
201
+ Element.prototype.webkitMatchesSelector;
202
+ }
203
+ })();
204
+ }
89
205
  var lgQuery = /** @class */ (function () {
90
206
  function lgQuery(selector) {
91
207
  this.cssVenderPrefixes = [
@@ -319,8 +435,10 @@ var lgQuery = /** @class */ (function () {
319
435
  // Does not support IE
320
436
  lgQuery.prototype.load = function (url) {
321
437
  var _this = this;
322
- fetch(url).then(function (res) {
323
- _this.selector.innerHTML = res;
438
+ fetch(url)
439
+ .then(function (res) { return res.text(); })
440
+ .then(function (html) {
441
+ _this.selector.innerHTML = html;
324
442
  });
325
443
  return this;
326
444
  };
@@ -431,6 +549,7 @@ var lgQuery = /** @class */ (function () {
431
549
  return lgQuery;
432
550
  }());
433
551
  function $LG(selector) {
552
+ initLgPolyfills();
434
553
  return new lgQuery(selector);
435
554
  }
436
555
 
@@ -554,9 +673,9 @@ var utils = {
554
673
  ', 1)';
555
674
  return transform;
556
675
  },
557
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
676
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
558
677
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
559
- return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:" + iframeWidth + "; height: " + iframeHeight + "\">\n <iframe class=\"lg-object\" frameborder=\"0\" " + title + " src=\"" + src + "\" allowfullscreen=\"true\"></iframe>\n </div>";
678
+ return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:" + iframeWidth + "; max-width:" + iframeMaxWidth + "; height: " + iframeHeight + "; max-height:" + iframeMaxHeight + "\">\n <iframe class=\"lg-object\" frameborder=\"0\" " + title + " src=\"" + src + "\" allowfullscreen=\"true\"></iframe>\n </div>";
560
679
  },
561
680
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
562
681
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -617,7 +736,7 @@ var utils = {
617
736
  // No other way of checking: assume it’s ok.
618
737
  return true;
619
738
  },
620
- getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, _isVideo) {
739
+ getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {
621
740
  var videoClass = '';
622
741
  if (_isVideo && _isVideo.youtube) {
623
742
  videoClass = 'lg-has-youtube';
@@ -628,7 +747,7 @@ var utils = {
628
747
  else {
629
748
  videoClass = 'lg-has-html5';
630
749
  }
631
- return "<div class=\"lg-video-cont " + videoClass + "\" style=\"" + videoContStyle + "\">\n <div class=\"lg-video-play-button\">\n <svg\n viewBox=\"0 0 20 20\"\n preserveAspectRatio=\"xMidYMid\"\n focusable=\"false\"\n aria-labelledby=\"Play video\"\n role=\"img\"\n class=\"lg-video-play-icon\"\n >\n <title>Play video</title>\n <polygon class=\"lg-video-play-icon-inner\" points=\"1,0 20,10 1,20\"></polygon>\n </svg>\n <svg class=\"lg-video-play-icon-bg\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle></svg>\n <svg class=\"lg-video-play-icon-circle\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle>\n </svg>\n </div>\n " + (dummyImg || '') + "\n <img class=\"lg-object lg-video-poster\" src=\"" + _poster + "\" />\n </div>";
750
+ return "<div class=\"lg-video-cont " + videoClass + "\" style=\"" + videoContStyle + "\">\n <div class=\"lg-video-play-button\">\n <svg\n viewBox=\"0 0 20 20\"\n preserveAspectRatio=\"xMidYMid\"\n focusable=\"false\"\n aria-labelledby=\"" + playVideoString + "\"\n role=\"img\"\n class=\"lg-video-play-icon\"\n >\n <title>" + playVideoString + "</title>\n <polygon class=\"lg-video-play-icon-inner\" points=\"1,0 20,10 1,20\"></polygon>\n </svg>\n <svg class=\"lg-video-play-icon-bg\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle></svg>\n <svg class=\"lg-video-play-icon-circle\" viewBox=\"0 0 50 50\" focusable=\"false\">\n <circle cx=\"50%\" cy=\"50%\" r=\"20\"></circle>\n </svg>\n </div>\n " + (dummyImg || '') + "\n <img class=\"lg-object lg-video-poster\" src=\"" + _poster + "\" />\n </div>";
632
751
  },
633
752
  /**
634
753
  * @desc Create dynamic elements array from gallery items when dynamic option is false
@@ -716,102 +835,6 @@ var utils = {
716
835
  },
717
836
  };
718
837
 
719
- var lightGalleryCoreSettings = {
720
- mode: 'lg-slide',
721
- easing: 'ease',
722
- speed: 400,
723
- licenseKey: '0000-0000-000-0000',
724
- height: '100%',
725
- width: '100%',
726
- addClass: '',
727
- startClass: 'lg-start-zoom',
728
- backdropDuration: 300,
729
- container: document.body,
730
- startAnimationDuration: 400,
731
- zoomFromOrigin: true,
732
- hideBarsDelay: 0,
733
- showBarsAfter: 10000,
734
- slideDelay: 0,
735
- supportLegacyBrowser: true,
736
- allowMediaOverlap: false,
737
- videoMaxSize: '1280-720',
738
- defaultCaptionHeight: 0,
739
- ariaLabelledby: '',
740
- ariaDescribedby: '',
741
- closable: true,
742
- swipeToClose: true,
743
- closeOnTap: true,
744
- showCloseIcon: true,
745
- showMaximizeIcon: false,
746
- loop: true,
747
- escKey: true,
748
- keyPress: true,
749
- controls: true,
750
- slideEndAnimation: true,
751
- hideControlOnEnd: false,
752
- mousewheel: false,
753
- getCaptionFromTitleOrAlt: true,
754
- appendSubHtmlTo: '.lg-sub-html',
755
- subHtmlSelectorRelative: false,
756
- preload: 2,
757
- numberOfSlideItemsInDom: 10,
758
- selector: '',
759
- selectWithin: '',
760
- nextHtml: '',
761
- prevHtml: '',
762
- index: 0,
763
- iframeWidth: '100%',
764
- iframeHeight: '100%',
765
- download: true,
766
- counter: true,
767
- appendCounterTo: '.lg-toolbar',
768
- swipeThreshold: 50,
769
- enableSwipe: true,
770
- enableDrag: true,
771
- dynamic: false,
772
- dynamicEl: [],
773
- extraProps: [],
774
- exThumbImage: '',
775
- isMobile: undefined,
776
- mobileSettings: {
777
- controls: false,
778
- showCloseIcon: false,
779
- download: false,
780
- },
781
- plugins: [],
782
- };
783
-
784
- /**
785
- * List of lightGallery events
786
- * All events should be documented here
787
- * Below interfaces are used to build the website documentations
788
- * */
789
- var lGEvents = {
790
- afterAppendSlide: 'lgAfterAppendSlide',
791
- init: 'lgInit',
792
- hasVideo: 'lgHasVideo',
793
- containerResize: 'lgContainerResize',
794
- updateSlides: 'lgUpdateSlides',
795
- afterAppendSubHtml: 'lgAfterAppendSubHtml',
796
- beforeOpen: 'lgBeforeOpen',
797
- afterOpen: 'lgAfterOpen',
798
- slideItemLoad: 'lgSlideItemLoad',
799
- beforeSlide: 'lgBeforeSlide',
800
- afterSlide: 'lgAfterSlide',
801
- posterClick: 'lgPosterClick',
802
- dragStart: 'lgDragStart',
803
- dragMove: 'lgDragMove',
804
- dragEnd: 'lgDragEnd',
805
- beforeNextSlide: 'lgBeforeNextSlide',
806
- beforePrevSlide: 'lgBeforePrevSlide',
807
- beforeClose: 'lgBeforeClose',
808
- afterClose: 'lgAfterClose',
809
- rotateLeft: 'lgRotateLeft',
810
- rotateRight: 'lgRotateRight',
811
- flipHorizontal: 'lgFlipHorizontal',
812
- flipVertical: 'lgFlipVertical',
813
- };
814
-
815
838
  // @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio
816
839
  // @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html
817
840
  // Unique id for each gallery
@@ -983,7 +1006,7 @@ var LightGallery = /** @class */ (function () {
983
1006
  var subHtmlCont = '';
984
1007
  // Create controls
985
1008
  if (this.settings.controls) {
986
- controls = "<button type=\"button\" id=\"" + this.getIdName('lg-prev') + "\" aria-label=\"Previous slide\" class=\"lg-prev lg-icon\"> " + this.settings.prevHtml + " </button>\n <button type=\"button\" id=\"" + this.getIdName('lg-next') + "\" aria-label=\"Next slide\" class=\"lg-next lg-icon\"> " + this.settings.nextHtml + " </button>";
1009
+ controls = "<button type=\"button\" id=\"" + this.getIdName('lg-prev') + "\" aria-label=\"" + this.settings.strings['previousSlide'] + "\" class=\"lg-prev lg-icon\"> " + this.settings.prevHtml + " </button>\n <button type=\"button\" id=\"" + this.getIdName('lg-next') + "\" aria-label=\"" + this.settings.strings['nextSlide'] + "\" class=\"lg-next lg-icon\"> " + this.settings.nextHtml + " </button>";
987
1010
  }
988
1011
  if (this.settings.appendSubHtmlTo !== '.lg-item') {
989
1012
  subHtmlCont =
@@ -1002,19 +1025,20 @@ var LightGallery = /** @class */ (function () {
1002
1025
  : '';
1003
1026
  var containerClassName = "lg-container " + this.settings.addClass + " " + (document.body !== this.settings.container ? 'lg-inline' : '');
1004
1027
  var closeIcon = this.settings.closable && this.settings.showCloseIcon
1005
- ? "<button type=\"button\" aria-label=\"Close gallery\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1028
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['closeGallery'] + "\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1006
1029
  : '';
1007
1030
  var maximizeIcon = this.settings.showMaximizeIcon
1008
- ? "<button type=\"button\" aria-label=\"Toggle maximize\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1031
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['toggleMaximize'] + "\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1009
1032
  : '';
1010
1033
  var template = "\n <div class=\"" + containerClassName + "\" id=\"" + this.getIdName('lg-container') + "\" tabindex=\"-1\" aria-modal=\"true\" " + ariaLabelledby + " " + ariaDescribedby + " role=\"dialog\"\n >\n <div id=\"" + this.getIdName('lg-backdrop') + "\" class=\"lg-backdrop\"></div>\n\n <div id=\"" + this.getIdName('lg-outer') + "\" class=\"lg-outer lg-use-css3 lg-css3 lg-hide-items " + addClasses + " \">\n\n <div id=\"" + this.getIdName('lg-content') + "\" class=\"lg-content\">\n <div id=\"" + this.getIdName('lg-inner') + "\" class=\"lg-inner\">\n </div>\n " + controls + "\n </div>\n <div id=\"" + this.getIdName('lg-toolbar') + "\" class=\"lg-toolbar lg-group\">\n " + maximizeIcon + "\n " + closeIcon + "\n </div>\n " + (this.settings.appendSubHtmlTo === '.lg-outer'
1011
1034
  ? subHtmlCont
1012
1035
  : '') + "\n <div id=\"" + this.getIdName('lg-components') + "\" class=\"lg-components\">\n " + (this.settings.appendSubHtmlTo === '.lg-sub-html'
1013
1036
  ? subHtmlCont
1014
1037
  : '') + "\n </div>\n </div>\n </div>\n ";
1015
- $LG(this.settings.container)
1016
- .css('position', 'relative')
1017
- .append(template);
1038
+ $LG(this.settings.container).append(template);
1039
+ if (document.body !== this.settings.container) {
1040
+ $LG(this.settings.container).css('position', 'relative');
1041
+ }
1018
1042
  this.outer = this.getElementById('lg-outer');
1019
1043
  this.$lgComponents = this.getElementById('lg-components');
1020
1044
  this.$backdrop = this.getElementById('lg-backdrop');
@@ -1032,7 +1056,7 @@ var LightGallery = /** @class */ (function () {
1032
1056
  this.$inner.css('transition-timing-function', this.settings.easing);
1033
1057
  this.$inner.css('transition-duration', this.settings.speed + 'ms');
1034
1058
  if (this.settings.download) {
1035
- this.$toolbar.append("<a id=\"" + this.getIdName('lg-download') + "\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download\" download class=\"lg-download lg-icon\"></a>");
1059
+ this.$toolbar.append("<a id=\"" + this.getIdName('lg-download') + "\" target=\"_blank\" rel=\"noopener\" aria-label=\"" + this.settings.strings['download'] + "\" download class=\"lg-download lg-icon\"></a>");
1036
1060
  }
1037
1061
  this.counter();
1038
1062
  $LG(window).on("resize.lg.global" + this.lgId + " orientationchange.lg.global" + this.lgId, function () {
@@ -1551,8 +1575,15 @@ var LightGallery = /** @class */ (function () {
1551
1575
  };
1552
1576
  // Add video slideInfo
1553
1577
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1578
+ var _this = this;
1554
1579
  items.forEach(function (element, index) {
1555
1580
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1581
+ if (element.__slideVideoInfo &&
1582
+ _this.settings.loadYouTubePoster &&
1583
+ !element.poster &&
1584
+ element.__slideVideoInfo.youtube) {
1585
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1586
+ }
1556
1587
  });
1557
1588
  };
1558
1589
  /**
@@ -1594,7 +1625,7 @@ var LightGallery = /** @class */ (function () {
1594
1625
  lgVideoStyle = this.getVideoContStyle(videoSize);
1595
1626
  }
1596
1627
  if (iframe) {
1597
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1628
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1598
1629
  $currentSlide.prepend(markup);
1599
1630
  }
1600
1631
  else if (poster) {
@@ -1605,7 +1636,7 @@ var LightGallery = /** @class */ (function () {
1605
1636
  if (hasStartAnimation) {
1606
1637
  dummyImg = this.getDummyImageContent($currentSlide, index, '');
1607
1638
  }
1608
- var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, videoInfo);
1639
+ var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);
1609
1640
  $currentSlide.prepend(markup);
1610
1641
  }
1611
1642
  else if (videoInfo) {
@@ -2388,17 +2419,23 @@ var LightGallery = /** @class */ (function () {
2388
2419
  };
2389
2420
  LightGallery.prototype.mousewheel = function () {
2390
2421
  var _this = this;
2391
- this.outer.on('mousewheel.lg', function (e) {
2422
+ var lastCall = 0;
2423
+ this.outer.on('wheel.lg', function (e) {
2392
2424
  if (!e.deltaY || _this.galleryItems.length < 2) {
2393
2425
  return;
2394
2426
  }
2395
- if (e.deltaY > 0) {
2396
- _this.goToPrevSlide();
2427
+ e.preventDefault();
2428
+ var now = new Date().getTime();
2429
+ if (now - lastCall < 1000) {
2430
+ return;
2397
2431
  }
2398
- else {
2432
+ lastCall = now;
2433
+ if (e.deltaY > 0) {
2399
2434
  _this.goToNextSlide();
2400
2435
  }
2401
- e.preventDefault();
2436
+ else if (e.deltaY < 0) {
2437
+ _this.goToPrevSlide();
2438
+ }
2402
2439
  });
2403
2440
  };
2404
2441
  LightGallery.prototype.isSlideElement = function (target) {
@@ -2658,9 +2695,13 @@ var LgMethods = {
2658
2695
  onBeforePrevSlide: 'lgBeforePrevSlide',
2659
2696
  onBeforeClose: 'lgBeforeClose',
2660
2697
  onAfterClose: 'lgAfterClose',
2698
+ onRotateLeft: 'lgRotateLeft',
2699
+ onRotateRight: 'lgRotateRight',
2700
+ onFlipHorizontal: 'lgFlipHorizontal',
2701
+ onFlipVertical: 'lgFlipVertical',
2661
2702
  };
2662
2703
  var LG = function (_a) {
2663
- var children = _a.children, elementClassNames = _a.elementClassNames, onAfterAppendSlide = _a.onAfterAppendSlide, onInit = _a.onInit, onHasVideo = _a.onHasVideo, onContainerResize = _a.onContainerResize, onAfterAppendSubHtml = _a.onAfterAppendSubHtml, onBeforeOpen = _a.onBeforeOpen, onAfterOpen = _a.onAfterOpen, onSlideItemLoad = _a.onSlideItemLoad, onBeforeSlide = _a.onBeforeSlide, onAfterSlide = _a.onAfterSlide, onPosterClick = _a.onPosterClick, onDragStart = _a.onDragStart, onDragMove = _a.onDragMove, onDragEnd = _a.onDragEnd, onBeforeNextSlide = _a.onBeforeNextSlide, onBeforePrevSlide = _a.onBeforePrevSlide, onBeforeClose = _a.onBeforeClose, onAfterClose = _a.onAfterClose, restProps = __rest(_a, ["children", "elementClassNames", "onAfterAppendSlide", "onInit", "onHasVideo", "onContainerResize", "onAfterAppendSubHtml", "onBeforeOpen", "onAfterOpen", "onSlideItemLoad", "onBeforeSlide", "onAfterSlide", "onPosterClick", "onDragStart", "onDragMove", "onDragEnd", "onBeforeNextSlide", "onBeforePrevSlide", "onBeforeClose", "onAfterClose"]);
2704
+ var children = _a.children, elementClassNames = _a.elementClassNames, onAfterAppendSlide = _a.onAfterAppendSlide, onInit = _a.onInit, onHasVideo = _a.onHasVideo, onContainerResize = _a.onContainerResize, onAfterAppendSubHtml = _a.onAfterAppendSubHtml, onBeforeOpen = _a.onBeforeOpen, onAfterOpen = _a.onAfterOpen, onSlideItemLoad = _a.onSlideItemLoad, onBeforeSlide = _a.onBeforeSlide, onAfterSlide = _a.onAfterSlide, onPosterClick = _a.onPosterClick, onDragStart = _a.onDragStart, onDragMove = _a.onDragMove, onDragEnd = _a.onDragEnd, onBeforeNextSlide = _a.onBeforeNextSlide, onBeforePrevSlide = _a.onBeforePrevSlide, onBeforeClose = _a.onBeforeClose, onAfterClose = _a.onAfterClose, onRotateLeft = _a.onRotateLeft, onRotateRight = _a.onRotateRight, onFlipHorizontal = _a.onFlipHorizontal, onFlipVertical = _a.onFlipVertical, restProps = __rest(_a, ["children", "elementClassNames", "onAfterAppendSlide", "onInit", "onHasVideo", "onContainerResize", "onAfterAppendSubHtml", "onBeforeOpen", "onAfterOpen", "onSlideItemLoad", "onBeforeSlide", "onAfterSlide", "onPosterClick", "onDragStart", "onDragMove", "onDragEnd", "onBeforeNextSlide", "onBeforePrevSlide", "onBeforeClose", "onAfterClose", "onRotateLeft", "onRotateRight", "onFlipHorizontal", "onFlipVertical"]);
2664
2705
  var $lg = useRef(null);
2665
2706
  var registerEvents = useCallback(function () {
2666
2707
  if (onAfterAppendSlide && $lg && $lg.current) {
@@ -2753,10 +2794,34 @@ var LG = function (_a) {
2753
2794
  onAfterClose(event.detail);
2754
2795
  }));
2755
2796
  }
2797
+ if (onRotateLeft && $lg && $lg.current) {
2798
+ $lg.current.addEventListener(LgMethods.onRotateLeft, (function (event) {
2799
+ onRotateLeft(event.detail);
2800
+ }));
2801
+ }
2802
+ if (onRotateRight && $lg && $lg.current) {
2803
+ $lg.current.addEventListener(LgMethods.onRotateRight, (function (event) {
2804
+ onRotateRight(event.detail);
2805
+ }));
2806
+ }
2807
+ if (onFlipHorizontal && $lg && $lg.current) {
2808
+ $lg.current.addEventListener(LgMethods.onFlipHorizontal, (function (event) {
2809
+ onFlipHorizontal(event.detail);
2810
+ }));
2811
+ }
2812
+ if (onFlipVertical && $lg && $lg.current) {
2813
+ $lg.current.addEventListener(LgMethods.onFlipVertical, (function (event) {
2814
+ onFlipVertical(event.detail);
2815
+ }));
2816
+ }
2756
2817
  }, [
2757
2818
  onAfterAppendSlide,
2758
2819
  onAfterAppendSubHtml,
2759
2820
  onAfterClose,
2821
+ onRotateLeft,
2822
+ onRotateRight,
2823
+ onFlipHorizontal,
2824
+ onFlipVertical,
2760
2825
  onAfterOpen,
2761
2826
  onAfterSlide,
2762
2827
  onBeforeClose,