lightgallery 2.5.0 → 2.6.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 (82) hide show
  1. package/README.md +1 -1
  2. package/css/lg-rotate.css +7 -0
  3. package/css/lg-zoom.css +37 -5
  4. package/css/lightgallery-bundle.css +45 -6
  5. package/css/lightgallery-bundle.min.css +1 -1
  6. package/css/lightgallery.css +1 -1
  7. package/lib/lightgallery.js +21 -16
  8. package/lib/lightgallery.js.map +1 -1
  9. package/lib/plugins/rotate/lg-rotate.js +15 -8
  10. package/lib/plugins/rotate/lg-rotate.js.map +1 -1
  11. package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +1 -1
  12. package/lib/plugins/zoom/lg-zoom.js +281 -293
  13. package/lib/plugins/zoom/lg-zoom.js.map +1 -1
  14. package/lightgallery.d.ts +1 -0
  15. package/lightgallery.es5.js +22 -17
  16. package/lightgallery.es5.js.map +1 -1
  17. package/lightgallery.min.js +2 -2
  18. package/lightgallery.umd.js +22 -17
  19. package/lightgallery.umd.js.map +1 -1
  20. package/lit/lightgallery.esm.js +2 -2
  21. package/lit/lightgallery.umd.js +2 -2
  22. package/package.json +1 -1
  23. package/plugins/autoplay/lg-autoplay.es5.js +1 -1
  24. package/plugins/autoplay/lg-autoplay.min.js +1 -1
  25. package/plugins/autoplay/lg-autoplay.umd.js +1 -1
  26. package/plugins/comment/lg-comment.es5.js +1 -1
  27. package/plugins/comment/lg-comment.min.js +1 -1
  28. package/plugins/comment/lg-comment.umd.js +1 -1
  29. package/plugins/fullscreen/lg-fullscreen.es5.js +1 -1
  30. package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
  31. package/plugins/fullscreen/lg-fullscreen.umd.js +1 -1
  32. package/plugins/hash/lg-hash.es5.js +1 -1
  33. package/plugins/hash/lg-hash.min.js +1 -1
  34. package/plugins/hash/lg-hash.umd.js +1 -1
  35. package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
  36. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  37. package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
  38. package/plugins/pager/lg-pager.es5.js +1 -1
  39. package/plugins/pager/lg-pager.min.js +1 -1
  40. package/plugins/pager/lg-pager.umd.js +1 -1
  41. package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
  42. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  43. package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
  44. package/plugins/rotate/lg-rotate.es5.js +16 -9
  45. package/plugins/rotate/lg-rotate.es5.js.map +1 -1
  46. package/plugins/rotate/lg-rotate.min.js +2 -2
  47. package/plugins/rotate/lg-rotate.umd.js +16 -9
  48. package/plugins/rotate/lg-rotate.umd.js.map +1 -1
  49. package/plugins/share/lg-share.es5.js +1 -1
  50. package/plugins/share/lg-share.min.js +1 -1
  51. package/plugins/share/lg-share.umd.js +1 -1
  52. package/plugins/thumbnail/lg-thumbnail-settings.d.ts +2 -1
  53. package/plugins/thumbnail/lg-thumbnail.es5.js +1 -1
  54. package/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -1
  55. package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
  56. package/plugins/thumbnail/lg-thumbnail.umd.js +1 -1
  57. package/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -1
  58. package/plugins/video/lg-video.es5.js +1 -1
  59. package/plugins/video/lg-video.min.js +1 -1
  60. package/plugins/video/lg-video.umd.js +1 -1
  61. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +1 -1
  62. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +1 -1
  63. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +1 -1
  64. package/plugins/zoom/lg-zoom.d.ts +12 -23
  65. package/plugins/zoom/lg-zoom.es5.js +282 -294
  66. package/plugins/zoom/lg-zoom.es5.js.map +1 -1
  67. package/plugins/zoom/lg-zoom.min.js +2 -2
  68. package/plugins/zoom/lg-zoom.umd.js +282 -294
  69. package/plugins/zoom/lg-zoom.umd.js.map +1 -1
  70. package/react/Lightgallery.es5.js +23 -18
  71. package/react/Lightgallery.es5.js.map +1 -1
  72. package/react/Lightgallery.umd.js +23 -18
  73. package/react/Lightgallery.umd.js.map +1 -1
  74. package/scss/_lg-variables.scss +1 -1
  75. package/scss/lg-rotate.scss +8 -0
  76. package/scss/lg-zoom.scss +29 -2
  77. package/vue/LightGalleryVue.common.js +24 -19
  78. package/vue/LightGalleryVue.common.js.map +1 -1
  79. package/vue/LightGalleryVue.umd.js +24 -19
  80. package/vue/LightGalleryVue.umd.js.map +1 -1
  81. package/vue/LightGalleryVue.umd.min.js +1 -1
  82. package/vue/LightGalleryVue.umd.min.js.map +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -115,17 +115,24 @@ var Rotate = /** @class */ (function () {
115
115
  // even after navigating to diferent slides
116
116
  this.rotateValuesList = {};
117
117
  // event triggered after appending slide content
118
- this.core.LGel.on(lGEvents.afterAppendSlide + ".rotate", function (event) {
118
+ this.core.LGel.on(lGEvents.slideItemLoad + ".rotate", function (event) {
119
119
  var index = event.detail.index;
120
- var imageWrap = _this.core
120
+ var rotateEl = _this.core
121
121
  .getSlideItem(index)
122
- .find('.lg-img-wrap')
123
- .first();
124
- imageWrap.wrap('lg-img-rotate');
125
- _this.core
126
- .getSlideItem(_this.core.index)
127
122
  .find('.lg-img-rotate')
128
- .css('transition-duration', _this.settings.rotateSpeed + 'ms');
123
+ .get();
124
+ if (!rotateEl) {
125
+ var imageWrap = _this.core
126
+ .getSlideItem(index)
127
+ .find('.lg-object')
128
+ .first();
129
+ imageWrap.wrap('lg-img-rotate');
130
+ //this.rotateValuesList[this.core.index]
131
+ _this.core
132
+ .getSlideItem(_this.core.index)
133
+ .find('.lg-img-rotate')
134
+ .css('transition-duration', _this.settings.rotateSpeed + 'ms');
135
+ }
129
136
  });
130
137
  this.core.outer
131
138
  .find('#lg-rotate-left')
@@ -1 +1 @@
1
- {"version":3,"file":"lg-rotate.es5.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,kBAAkB,EAAE,sBAAsB;IAC1C,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,iBAAiB;IAChC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;IACpB,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,gBAAgB;IAC9B,QAAQ,EAAE,YAAY;IACtB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;CACjC;;ACMM,IAAM,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I,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;SAC7D;QACD,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;KAC9B;IAED,wBAAO,GAAP;;QAEI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACjC;IACL,aAAC;AAAD,CAAC;;"}
1
+ {"version":3,"file":"lg-rotate.es5.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 = {\n ...rotateSettings,\n ...this.core.settings,\n };\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.slideItemLoad}.rotate`, (event) => {\n const { index } = event.detail;\n\n const rotateEl = this.core\n .getSlideItem(index)\n .find('.lg-img-rotate')\n .get();\n if (!rotateEl) {\n const imageWrap = this.core\n .getSlideItem(index)\n .find('.lg-object')\n .first();\n\n imageWrap.wrap('lg-img-rotate');\n //this.rotateValuesList[this.core.index]\n this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .css(\n 'transition-duration',\n this.settings.rotateSpeed + 'ms',\n );\n }\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;AAKO,IAAM,QAAQ,GAEjB;IACA,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,kBAAkB,EAAE,sBAAsB;IAC1C,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,iBAAiB;IAChC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;IACpB,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,gBAAgB;IAC9B,QAAQ,EAAE,YAAY;IACtB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;CACjC;;ACMM,IAAM,cAAc,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,IAAI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AAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;SAC7D;QACD,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;KAC9B;IAED,wBAAO,GAAP;;QAEI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACjC;IACL,aAAC;AAAD,CAAC;;"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 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,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}()}));
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="lgSlideItemLoad",i="lgBeforeSlide",o="lgRotateLeft",r="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-rotate").get()||(t.core.getSlideItem(i).find(".lg-object").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}()}));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -121,17 +121,24 @@
121
121
  // even after navigating to diferent slides
122
122
  this.rotateValuesList = {};
123
123
  // event triggered after appending slide content
124
- this.core.LGel.on(lGEvents.afterAppendSlide + ".rotate", function (event) {
124
+ this.core.LGel.on(lGEvents.slideItemLoad + ".rotate", function (event) {
125
125
  var index = event.detail.index;
126
- var imageWrap = _this.core
126
+ var rotateEl = _this.core
127
127
  .getSlideItem(index)
128
- .find('.lg-img-wrap')
129
- .first();
130
- imageWrap.wrap('lg-img-rotate');
131
- _this.core
132
- .getSlideItem(_this.core.index)
133
128
  .find('.lg-img-rotate')
134
- .css('transition-duration', _this.settings.rotateSpeed + 'ms');
129
+ .get();
130
+ if (!rotateEl) {
131
+ var imageWrap = _this.core
132
+ .getSlideItem(index)
133
+ .find('.lg-object')
134
+ .first();
135
+ imageWrap.wrap('lg-img-rotate');
136
+ //this.rotateValuesList[this.core.index]
137
+ _this.core
138
+ .getSlideItem(_this.core.index)
139
+ .find('.lg-img-rotate')
140
+ .css('transition-duration', _this.settings.rotateSpeed + 'ms');
141
+ }
135
142
  });
136
143
  this.core.outer
137
144
  .find('#lg-rotate-left')
@@ -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 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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AO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aACzC,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC;SACtC;QAED,0CAAyB,GAAzB;YACI,IAAM,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 = {\n ...rotateSettings,\n ...this.core.settings,\n };\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.slideItemLoad}.rotate`, (event) => {\n const { index } = event.detail;\n\n const rotateEl = this.core\n .getSlideItem(index)\n .find('.lg-img-rotate')\n .get();\n if (!rotateEl) {\n const imageWrap = this.core\n .getSlideItem(index)\n .find('.lg-object')\n .first();\n\n imageWrap.wrap('lg-img-rotate');\n //this.rotateValuesList[this.core.index]\n this.core\n .getSlideItem(this.core.index)\n .find('.lg-img-rotate')\n .css(\n 'transition-duration',\n this.settings.rotateSpeed + 'ms',\n );\n }\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;QAC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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -12,7 +12,8 @@ export interface ThumbnailsSettings {
12
12
  */
13
13
  currentPagerPosition: 'left' | 'middle' | 'right';
14
14
  /**
15
- * Position of thumbnails.
15
+ * Position of thumbnails when the width of all thumbnails combined is less than the gallery's width.
16
+ *
16
17
  */
17
18
  alignThumbnails: 'left' | 'middle' | 'right';
18
19
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.5.0 | June 13th 2022
2
+ * lightgallery | 2.6.0 | August 29th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3