lightgallery 2.3.0-beta.2 → 2.4.0-beta.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 (173) 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 +19 -27
  39. package/css/lightgallery-bundle.min.css +1 -1
  40. package/css/lightgallery-core.css +0 -20
  41. package/css/lightgallery.css +19 -27
  42. package/lg-events.d.ts +44 -0
  43. package/lg-settings.d.ts +20 -8
  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 -2
  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 +31 -20
  52. package/lib/lgQuery.js.map +1 -1
  53. package/lib/lightgallery.js +30 -19
  54. package/lib/lightgallery.js.map +1 -1
  55. package/lib/plugins/autoplay/lg-autoplay-settings.js +1 -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 +1 -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 +1 -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 +1 -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 +174 -139
  85. package/lightgallery.es5.js.map +1 -1
  86. package/lightgallery.min.js +2 -2
  87. package/lightgallery.umd.js +174 -139
  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 +6 -0
  93. package/plugins/autoplay/lg-autoplay.d.ts +2 -2
  94. package/plugins/autoplay/lg-autoplay.es5.js +25 -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 +25 -12
  98. package/plugins/autoplay/lg-autoplay.umd.js.map +1 -1
  99. package/plugins/comment/lg-comment-settings.d.ts +6 -0
  100. package/plugins/comment/lg-comment.es5.js +6 -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 +6 -2
  104. package/plugins/comment/lg-comment.umd.js.map +1 -1
  105. package/plugins/fullscreen/lg-fullscreen-settings.d.ts +6 -0
  106. package/plugins/fullscreen/lg-fullscreen.es5.js +3 -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 +3 -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 +12 -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 +9 -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 +6 -0
  144. package/plugins/thumbnail/lg-thumbnail.es5.js +8 -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 +8 -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 +6 -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 +203 -140
  162. package/react/Lightgallery.es5.js.map +1 -1
  163. package/react/Lightgallery.umd.js +203 -140
  164. package/react/Lightgallery.umd.js.map +1 -1
  165. package/scss/_lg-theme-default.scss +17 -10
  166. package/scss/lightgallery-core.scss +0 -25
  167. package/vue/LightGallery.vue.d.ts +5 -1
  168. package/vue/LightGalleryVue.common.js +317 -270
  169. package/vue/LightGalleryVue.common.js.map +1 -1
  170. package/vue/LightGalleryVue.umd.js +317 -270
  171. package/vue/LightGalleryVue.umd.js.map +1 -1
  172. package/vue/LightGalleryVue.umd.min.js +2 -2
  173. 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.2 | September 28th 2021
31
+ * lightgallery | 2.4.0-beta.0 | December 12th 2021
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 = [
@@ -218,7 +334,9 @@ var lgQuery = /** @class */ (function () {
218
334
  this._each(function (el) {
219
335
  // IE doesn't support multiple arguments
220
336
  classNames.split(' ').forEach(function (className) {
221
- el.classList.add(className);
337
+ if (className) {
338
+ el.classList.add(className);
339
+ }
222
340
  });
223
341
  });
224
342
  return this;
@@ -227,7 +345,9 @@ var lgQuery = /** @class */ (function () {
227
345
  this._each(function (el) {
228
346
  // IE doesn't support multiple arguments
229
347
  classNames.split(' ').forEach(function (className) {
230
- el.classList.remove(className);
348
+ if (className) {
349
+ el.classList.remove(className);
350
+ }
231
351
  });
232
352
  });
233
353
  return this;
@@ -427,6 +547,7 @@ var lgQuery = /** @class */ (function () {
427
547
  return lgQuery;
428
548
  }());
429
549
  function $LG(selector) {
550
+ initLgPolyfills();
430
551
  return new lgQuery(selector);
431
552
  }
432
553
 
@@ -550,9 +671,9 @@ var utils = {
550
671
  ', 1)';
551
672
  return transform;
552
673
  },
553
- getIframeMarkup: function (iframeWidth, iframeHeight, src, iframeTitle) {
674
+ getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
554
675
  var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
555
- 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>";
676
+ 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>";
556
677
  },
557
678
  getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {
558
679
  var srcsetAttr = srcset ? "srcset=\"" + srcset + "\"" : '';
@@ -613,7 +734,7 @@ var utils = {
613
734
  // No other way of checking: assume it’s ok.
614
735
  return true;
615
736
  },
616
- getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, _isVideo) {
737
+ getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {
617
738
  var videoClass = '';
618
739
  if (_isVideo && _isVideo.youtube) {
619
740
  videoClass = 'lg-has-youtube';
@@ -624,7 +745,7 @@ var utils = {
624
745
  else {
625
746
  videoClass = 'lg-has-html5';
626
747
  }
627
- 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>";
748
+ 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>";
628
749
  },
629
750
  /**
630
751
  * @desc Create dynamic elements array from gallery items when dynamic option is false
@@ -712,103 +833,6 @@ var utils = {
712
833
  },
713
834
  };
714
835
 
715
- var lightGalleryCoreSettings = {
716
- mode: 'lg-slide',
717
- easing: 'ease',
718
- speed: 400,
719
- licenseKey: '0000-0000-000-0000',
720
- height: '100%',
721
- width: '100%',
722
- addClass: '',
723
- startClass: 'lg-start-zoom',
724
- backdropDuration: 300,
725
- container: document.body,
726
- startAnimationDuration: 400,
727
- zoomFromOrigin: true,
728
- hideBarsDelay: 0,
729
- showBarsAfter: 10000,
730
- slideDelay: 0,
731
- supportLegacyBrowser: true,
732
- allowMediaOverlap: false,
733
- videoMaxSize: '1280-720',
734
- defaultCaptionHeight: 0,
735
- ariaLabelledby: '',
736
- ariaDescribedby: '',
737
- closable: true,
738
- swipeToClose: true,
739
- closeOnTap: true,
740
- showCloseIcon: true,
741
- showMaximizeIcon: false,
742
- loop: true,
743
- escKey: true,
744
- keyPress: true,
745
- controls: true,
746
- slideEndAnimation: true,
747
- hideControlOnEnd: false,
748
- mousewheel: false,
749
- getCaptionFromTitleOrAlt: true,
750
- appendSubHtmlTo: '.lg-sub-html',
751
- subHtmlSelectorRelative: false,
752
- preload: 2,
753
- numberOfSlideItemsInDom: 10,
754
- showAfterLoad: true,
755
- selector: '',
756
- selectWithin: '',
757
- nextHtml: '',
758
- prevHtml: '',
759
- index: 0,
760
- iframeWidth: '100%',
761
- iframeHeight: '100%',
762
- download: true,
763
- counter: true,
764
- appendCounterTo: '.lg-toolbar',
765
- swipeThreshold: 50,
766
- enableSwipe: true,
767
- enableDrag: true,
768
- dynamic: false,
769
- dynamicEl: [],
770
- extraProps: [],
771
- exThumbImage: '',
772
- isMobile: undefined,
773
- mobileSettings: {
774
- controls: false,
775
- showCloseIcon: false,
776
- download: false,
777
- },
778
- plugins: [],
779
- };
780
-
781
- /**
782
- * List of lightGallery events
783
- * All events should be documented here
784
- * Below interfaces are used to build the website documentations
785
- * */
786
- var lGEvents = {
787
- afterAppendSlide: 'lgAfterAppendSlide',
788
- init: 'lgInit',
789
- hasVideo: 'lgHasVideo',
790
- containerResize: 'lgContainerResize',
791
- updateSlides: 'lgUpdateSlides',
792
- afterAppendSubHtml: 'lgAfterAppendSubHtml',
793
- beforeOpen: 'lgBeforeOpen',
794
- afterOpen: 'lgAfterOpen',
795
- slideItemLoad: 'lgSlideItemLoad',
796
- beforeSlide: 'lgBeforeSlide',
797
- afterSlide: 'lgAfterSlide',
798
- posterClick: 'lgPosterClick',
799
- dragStart: 'lgDragStart',
800
- dragMove: 'lgDragMove',
801
- dragEnd: 'lgDragEnd',
802
- beforeNextSlide: 'lgBeforeNextSlide',
803
- beforePrevSlide: 'lgBeforePrevSlide',
804
- beforeClose: 'lgBeforeClose',
805
- afterClose: 'lgAfterClose',
806
- rotateLeft: 'lgRotateLeft',
807
- rotateRight: 'lgRotateRight',
808
- flipHorizontal: 'lgFlipHorizontal',
809
- flipVertical: 'lgFlipVertical',
810
- };
811
-
812
836
  // @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio
813
837
  // @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html
814
838
  // Unique id for each gallery
@@ -980,7 +1004,7 @@ var LightGallery = /** @class */ (function () {
980
1004
  var subHtmlCont = '';
981
1005
  // Create controls
982
1006
  if (this.settings.controls) {
983
- 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>";
1007
+ 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>";
984
1008
  }
985
1009
  if (this.settings.appendSubHtmlTo !== '.lg-item') {
986
1010
  subHtmlCont =
@@ -999,19 +1023,20 @@ var LightGallery = /** @class */ (function () {
999
1023
  : '';
1000
1024
  var containerClassName = "lg-container " + this.settings.addClass + " " + (document.body !== this.settings.container ? 'lg-inline' : '');
1001
1025
  var closeIcon = this.settings.closable && this.settings.showCloseIcon
1002
- ? "<button type=\"button\" aria-label=\"Close gallery\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1026
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['closeGallery'] + "\" id=\"" + this.getIdName('lg-close') + "\" class=\"lg-close lg-icon\"></button>"
1003
1027
  : '';
1004
1028
  var maximizeIcon = this.settings.showMaximizeIcon
1005
- ? "<button type=\"button\" aria-label=\"Toggle maximize\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1029
+ ? "<button type=\"button\" aria-label=\"" + this.settings.strings['toggleMaximize'] + "\" id=\"" + this.getIdName('lg-maximize') + "\" class=\"lg-maximize lg-icon\"></button>"
1006
1030
  : '';
1007
1031
  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'
1008
1032
  ? subHtmlCont
1009
1033
  : '') + "\n <div id=\"" + this.getIdName('lg-components') + "\" class=\"lg-components\">\n " + (this.settings.appendSubHtmlTo === '.lg-sub-html'
1010
1034
  ? subHtmlCont
1011
1035
  : '') + "\n </div>\n </div>\n </div>\n ";
1012
- $LG(this.settings.container)
1013
- .css('position', 'relative')
1014
- .append(template);
1036
+ $LG(this.settings.container).append(template);
1037
+ if (document.body !== this.settings.container) {
1038
+ $LG(this.settings.container).css('position', 'relative');
1039
+ }
1015
1040
  this.outer = this.getElementById('lg-outer');
1016
1041
  this.$lgComponents = this.getElementById('lg-components');
1017
1042
  this.$backdrop = this.getElementById('lg-backdrop');
@@ -1025,14 +1050,11 @@ var LightGallery = /** @class */ (function () {
1025
1050
  if (this.settings.enableDrag) {
1026
1051
  outerClassNames += 'lg-grab ';
1027
1052
  }
1028
- if (this.settings.showAfterLoad) {
1029
- outerClassNames += 'lg-show-after-load';
1030
- }
1031
1053
  this.outer.addClass(outerClassNames);
1032
1054
  this.$inner.css('transition-timing-function', this.settings.easing);
1033
1055
  this.$inner.css('transition-duration', this.settings.speed + 'ms');
1034
1056
  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>");
1057
+ 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
1058
  }
1037
1059
  this.counter();
1038
1060
  $LG(window).on("resize.lg.global" + this.lgId + " orientationchange.lg.global" + this.lgId, function () {
@@ -1551,8 +1573,15 @@ var LightGallery = /** @class */ (function () {
1551
1573
  };
1552
1574
  // Add video slideInfo
1553
1575
  LightGallery.prototype.addSlideVideoInfo = function (items) {
1576
+ var _this = this;
1554
1577
  items.forEach(function (element, index) {
1555
1578
  element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);
1579
+ if (element.__slideVideoInfo &&
1580
+ _this.settings.loadYouTubePoster &&
1581
+ !element.poster &&
1582
+ element.__slideVideoInfo.youtube) {
1583
+ element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/maxresdefault.jpg";
1584
+ }
1556
1585
  });
1557
1586
  };
1558
1587
  /**
@@ -1594,7 +1623,7 @@ var LightGallery = /** @class */ (function () {
1594
1623
  lgVideoStyle = this.getVideoContStyle(videoSize);
1595
1624
  }
1596
1625
  if (iframe) {
1597
- var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
1626
+ var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
1598
1627
  $currentSlide.prepend(markup);
1599
1628
  }
1600
1629
  else if (poster) {
@@ -1605,7 +1634,7 @@ var LightGallery = /** @class */ (function () {
1605
1634
  if (hasStartAnimation) {
1606
1635
  dummyImg = this.getDummyImageContent($currentSlide, index, '');
1607
1636
  }
1608
- var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, videoInfo);
1637
+ var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);
1609
1638
  $currentSlide.prepend(markup);
1610
1639
  }
1611
1640
  else if (videoInfo) {
@@ -2388,17 +2417,23 @@ var LightGallery = /** @class */ (function () {
2388
2417
  };
2389
2418
  LightGallery.prototype.mousewheel = function () {
2390
2419
  var _this = this;
2391
- this.outer.on('mousewheel.lg', function (e) {
2420
+ var lastCall = 0;
2421
+ this.outer.on('wheel.lg', function (e) {
2392
2422
  if (!e.deltaY || _this.galleryItems.length < 2) {
2393
2423
  return;
2394
2424
  }
2395
- if (e.deltaY > 0) {
2396
- _this.goToPrevSlide();
2425
+ e.preventDefault();
2426
+ var now = new Date().getTime();
2427
+ if (now - lastCall < 1000) {
2428
+ return;
2397
2429
  }
2398
- else {
2430
+ lastCall = now;
2431
+ if (e.deltaY > 0) {
2399
2432
  _this.goToNextSlide();
2400
2433
  }
2401
- e.preventDefault();
2434
+ else if (e.deltaY < 0) {
2435
+ _this.goToPrevSlide();
2436
+ }
2402
2437
  });
2403
2438
  };
2404
2439
  LightGallery.prototype.isSlideElement = function (target) {
@@ -2658,9 +2693,13 @@ var LgMethods = {
2658
2693
  onBeforePrevSlide: 'lgBeforePrevSlide',
2659
2694
  onBeforeClose: 'lgBeforeClose',
2660
2695
  onAfterClose: 'lgAfterClose',
2696
+ onRotateLeft: 'lgRotateLeft',
2697
+ onRotateRight: 'lgRotateRight',
2698
+ onFlipHorizontal: 'lgFlipHorizontal',
2699
+ onFlipVertical: 'lgFlipVertical',
2661
2700
  };
2662
2701
  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"]);
2702
+ 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
2703
  var $lg = useRef(null);
2665
2704
  var registerEvents = useCallback(function () {
2666
2705
  if (onAfterAppendSlide && $lg && $lg.current) {
@@ -2753,10 +2792,34 @@ var LG = function (_a) {
2753
2792
  onAfterClose(event.detail);
2754
2793
  }));
2755
2794
  }
2795
+ if (onRotateLeft && $lg && $lg.current) {
2796
+ $lg.current.addEventListener(LgMethods.onRotateLeft, (function (event) {
2797
+ onRotateLeft(event.detail);
2798
+ }));
2799
+ }
2800
+ if (onRotateRight && $lg && $lg.current) {
2801
+ $lg.current.addEventListener(LgMethods.onRotateRight, (function (event) {
2802
+ onRotateRight(event.detail);
2803
+ }));
2804
+ }
2805
+ if (onFlipHorizontal && $lg && $lg.current) {
2806
+ $lg.current.addEventListener(LgMethods.onFlipHorizontal, (function (event) {
2807
+ onFlipHorizontal(event.detail);
2808
+ }));
2809
+ }
2810
+ if (onFlipVertical && $lg && $lg.current) {
2811
+ $lg.current.addEventListener(LgMethods.onFlipVertical, (function (event) {
2812
+ onFlipVertical(event.detail);
2813
+ }));
2814
+ }
2756
2815
  }, [
2757
2816
  onAfterAppendSlide,
2758
2817
  onAfterAppendSubHtml,
2759
2818
  onAfterClose,
2819
+ onRotateLeft,
2820
+ onRotateRight,
2821
+ onFlipHorizontal,
2822
+ onFlipVertical,
2760
2823
  onAfterOpen,
2761
2824
  onAfterSlide,
2762
2825
  onBeforeClose,