lightgallery 2.4.0 → 2.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/plugins/video/lg-video-utils.js +13 -5
  2. package/lib/plugins/video/lg-video-utils.js.map +1 -1
  3. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +8 -0
  4. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +1 -0
  5. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +122 -0
  6. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +1 -0
  7. package/lightgallery.es5.js +1 -1
  8. package/lightgallery.min.js +1 -1
  9. package/lightgallery.umd.js +1 -1
  10. package/lit/lightgallery.esm.js +1 -1
  11. package/lit/lightgallery.umd.js +1 -1
  12. package/package.json +1 -1
  13. package/plugins/autoplay/lg-autoplay.es5.js +1 -1
  14. package/plugins/autoplay/lg-autoplay.min.js +1 -1
  15. package/plugins/autoplay/lg-autoplay.umd.js +1 -1
  16. package/plugins/comment/lg-comment.es5.js +1 -1
  17. package/plugins/comment/lg-comment.min.js +1 -1
  18. package/plugins/comment/lg-comment.umd.js +1 -1
  19. package/plugins/fullscreen/lg-fullscreen.es5.js +1 -1
  20. package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
  21. package/plugins/fullscreen/lg-fullscreen.umd.js +1 -1
  22. package/plugins/hash/lg-hash.es5.js +1 -1
  23. package/plugins/hash/lg-hash.min.js +1 -1
  24. package/plugins/hash/lg-hash.umd.js +1 -1
  25. package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
  26. package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
  27. package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
  28. package/plugins/pager/lg-pager.es5.js +1 -1
  29. package/plugins/pager/lg-pager.min.js +1 -1
  30. package/plugins/pager/lg-pager.umd.js +1 -1
  31. package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
  32. package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
  33. package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
  34. package/plugins/rotate/lg-rotate.es5.js +1 -1
  35. package/plugins/rotate/lg-rotate.min.js +1 -1
  36. package/plugins/rotate/lg-rotate.umd.js +1 -1
  37. package/plugins/share/lg-share.es5.js +1 -1
  38. package/plugins/share/lg-share.min.js +1 -1
  39. package/plugins/share/lg-share.umd.js +1 -1
  40. package/plugins/thumbnail/lg-thumbnail.es5.js +1 -1
  41. package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
  42. package/plugins/thumbnail/lg-thumbnail.umd.js +1 -1
  43. package/plugins/video/lg-video.es5.js +14 -6
  44. package/plugins/video/lg-video.es5.js.map +1 -1
  45. package/plugins/video/lg-video.min.js +2 -2
  46. package/plugins/video/lg-video.umd.js +14 -6
  47. package/plugins/video/lg-video.umd.js.map +1 -1
  48. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -0
  49. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -0
  50. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +182 -0
  51. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
  52. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +8 -0
  53. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +190 -0
  54. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
  55. package/plugins/vimeoThumbnail/package.json +7 -0
  56. package/plugins/zoom/lg-zoom.es5.js +1 -1
  57. package/plugins/zoom/lg-zoom.min.js +1 -1
  58. package/plugins/zoom/lg-zoom.umd.js +1 -1
  59. package/react/Lightgallery.es5.js +1 -1
  60. package/react/Lightgallery.es5.js.map +1 -1
  61. package/react/Lightgallery.umd.js +1 -1
  62. package/react/Lightgallery.umd.js.map +1 -1
@@ -0,0 +1,182 @@
1
+ /*!
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
+ * http://www.lightgalleryjs.com/
4
+ * Copyright (c) 2020 Sachin Neravath;
5
+ * @license GPLv3
6
+ */
7
+
8
+ /*! *****************************************************************************
9
+ Copyright (c) Microsoft Corporation.
10
+
11
+ Permission to use, copy, modify, and/or distribute this software for any
12
+ purpose with or without fee is hereby granted.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ PERFORMANCE OF THIS SOFTWARE.
21
+ ***************************************************************************** */
22
+
23
+ var __assign = function() {
24
+ __assign = Object.assign || function __assign(t) {
25
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26
+ s = arguments[i];
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28
+ }
29
+ return t;
30
+ };
31
+ return __assign.apply(this, arguments);
32
+ };
33
+
34
+ function __awaiter(thisArg, _arguments, P, generator) {
35
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36
+ return new (P || (P = Promise))(function (resolve, reject) {
37
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
38
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
40
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
41
+ });
42
+ }
43
+
44
+ function __generator(thisArg, body) {
45
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
46
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47
+ function verb(n) { return function (v) { return step([n, v]); }; }
48
+ function step(op) {
49
+ if (f) throw new TypeError("Generator is already executing.");
50
+ while (_) try {
51
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
52
+ if (y = 0, t) op = [op[0] & 2, t.value];
53
+ switch (op[0]) {
54
+ case 0: case 1: t = op; break;
55
+ case 4: _.label++; return { value: op[1], done: false };
56
+ case 5: _.label++; y = op[1]; op = [0]; continue;
57
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
58
+ default:
59
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63
+ if (t[2]) _.ops.pop();
64
+ _.trys.pop(); continue;
65
+ }
66
+ op = body.call(thisArg, _);
67
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69
+ }
70
+ }
71
+
72
+ /**
73
+ * List of lightGallery events
74
+ * All events should be documented here
75
+ * Below interfaces are used to build the website documentations
76
+ * */
77
+ var lGEvents = {
78
+ afterAppendSlide: 'lgAfterAppendSlide',
79
+ init: 'lgInit',
80
+ hasVideo: 'lgHasVideo',
81
+ containerResize: 'lgContainerResize',
82
+ updateSlides: 'lgUpdateSlides',
83
+ afterAppendSubHtml: 'lgAfterAppendSubHtml',
84
+ beforeOpen: 'lgBeforeOpen',
85
+ afterOpen: 'lgAfterOpen',
86
+ slideItemLoad: 'lgSlideItemLoad',
87
+ beforeSlide: 'lgBeforeSlide',
88
+ afterSlide: 'lgAfterSlide',
89
+ posterClick: 'lgPosterClick',
90
+ dragStart: 'lgDragStart',
91
+ dragMove: 'lgDragMove',
92
+ dragEnd: 'lgDragEnd',
93
+ beforeNextSlide: 'lgBeforeNextSlide',
94
+ beforePrevSlide: 'lgBeforePrevSlide',
95
+ beforeClose: 'lgBeforeClose',
96
+ afterClose: 'lgAfterClose',
97
+ rotateLeft: 'lgRotateLeft',
98
+ rotateRight: 'lgRotateRight',
99
+ flipHorizontal: 'lgFlipHorizontal',
100
+ flipVertical: 'lgFlipVertical',
101
+ autoplay: 'lgAutoplay',
102
+ autoplayStart: 'lgAutoplayStart',
103
+ autoplayStop: 'lgAutoplayStop',
104
+ };
105
+
106
+ var vimeoSettings = {
107
+ showVimeoThumbnails: true,
108
+ showThumbnailWithPlayButton: false,
109
+ };
110
+
111
+ /**
112
+ * Creates the vimeo thumbnails plugin.
113
+ * @param {object} element - lightGallery element
114
+ */
115
+ var VimeoThumbnail = /** @class */ (function () {
116
+ function VimeoThumbnail(instance) {
117
+ this.core = instance;
118
+ // extend module default settings with lightGallery core settings
119
+ this.settings = __assign(__assign({}, vimeoSettings), this.core.settings);
120
+ return this;
121
+ }
122
+ VimeoThumbnail.prototype.init = function () {
123
+ var _this = this;
124
+ if (!this.settings.showVimeoThumbnails) {
125
+ return;
126
+ }
127
+ this.core.LGel.on(lGEvents.init + ".vimeothumbnails", function (event) {
128
+ var pluginInstance = event.detail.instance;
129
+ var thumbCont = pluginInstance.$container
130
+ .find('.lg-thumb-outer')
131
+ .get();
132
+ if (thumbCont) {
133
+ _this.setVimeoThumbnails(pluginInstance);
134
+ }
135
+ });
136
+ };
137
+ VimeoThumbnail.prototype.setVimeoThumbnails = function (dynamicGallery) {
138
+ return __awaiter(this, void 0, void 0, function () {
139
+ var i, item, slideVideoInfo, response, vimeoInfo;
140
+ return __generator(this, function (_a) {
141
+ switch (_a.label) {
142
+ case 0:
143
+ i = 0;
144
+ _a.label = 1;
145
+ case 1:
146
+ if (!(i < dynamicGallery.galleryItems.length)) return [3 /*break*/, 5];
147
+ item = dynamicGallery.galleryItems[i];
148
+ slideVideoInfo = item.__slideVideoInfo || {};
149
+ if (!slideVideoInfo.vimeo) return [3 /*break*/, 4];
150
+ return [4 /*yield*/, fetch('https://vimeo.com/api/oembed.json?url=' +
151
+ encodeURIComponent(item.src))];
152
+ case 2:
153
+ response = _a.sent();
154
+ return [4 /*yield*/, response.json()];
155
+ case 3:
156
+ vimeoInfo = _a.sent();
157
+ dynamicGallery.$container
158
+ .find('.lg-thumb-item')
159
+ .eq(i)
160
+ .find('img')
161
+ .attr('src', this.settings.showThumbnailWithPlayButton
162
+ ? vimeoInfo.thumbnail_url_with_play_button
163
+ : vimeoInfo.thumbnail_url);
164
+ _a.label = 4;
165
+ case 4:
166
+ i++;
167
+ return [3 /*break*/, 1];
168
+ case 5: return [2 /*return*/];
169
+ }
170
+ });
171
+ });
172
+ };
173
+ VimeoThumbnail.prototype.destroy = function () {
174
+ // Remove all event listeners added by vimeothumbnails plugin
175
+ this.core.LGel.off('.lg.vimeothumbnails');
176
+ this.core.LGel.off('.vimeothumbnails');
177
+ };
178
+ return VimeoThumbnail;
179
+ }());
180
+
181
+ export default VimeoThumbnail;
182
+ //# sourceMappingURL=lg-vimeo-thumbnail.es5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lg-vimeo-thumbnail.es5.js","sources":["../../../src/lg-events.ts","../../../src/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.ts","../../../src/plugins/vimeoThumbnail/lg-vimeo-thumbnail.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 VimeoThumbnailSettings {\n /**\n * Auto load thumbnails for Vimeo videos\n */\n showVimeoThumbnails: boolean;\n\n /**\n * Show thumbnails with play button\n */\n showThumbnailWithPlayButton: boolean;\n}\nexport const vimeoSettings: VimeoThumbnailSettings = {\n showVimeoThumbnails: true,\n showThumbnailWithPlayButton: false,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport {\n vimeoSettings,\n VimeoThumbnailSettings,\n} from './lg-vimeo-thumbnail-settings';\n\n/**\n * Creates the vimeo thumbnails plugin.\n * @param {object} element - lightGallery element\n */\nexport default class VimeoThumbnail {\n core: LightGallery;\n settings: VimeoThumbnailSettings;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...vimeoSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.showVimeoThumbnails) {\n return;\n }\n\n this.core.LGel.on(`${lGEvents.init}.vimeothumbnails`, (event) => {\n const pluginInstance = event.detail.instance;\n const thumbCont = pluginInstance.$container\n .find('.lg-thumb-outer')\n .get();\n if (thumbCont) {\n this.setVimeoThumbnails(pluginInstance);\n }\n });\n }\n\n async setVimeoThumbnails(dynamicGallery: LightGallery): Promise<void> {\n for (let i = 0; i < dynamicGallery.galleryItems.length; i++) {\n const item = dynamicGallery.galleryItems[i];\n const slideVideoInfo = item.__slideVideoInfo || {};\n if (slideVideoInfo.vimeo) {\n const response = await fetch(\n 'https://vimeo.com/api/oembed.json?url=' +\n encodeURIComponent(item.src as string),\n );\n const vimeoInfo = await response.json();\n dynamicGallery.$container\n .find('.lg-thumb-item')\n .eq(i)\n .find('img')\n .attr(\n 'src',\n this.settings.showThumbnailWithPlayButton\n ? vimeoInfo.thumbnail_url_with_play_button\n : vimeoInfo.thumbnail_url,\n );\n }\n }\n }\n\n public destroy(): void {\n // Remove all event listeners added by vimeothumbnails plugin\n this.core.LGel.off('.lg.vimeothumbnails');\n this.core.LGel.off('.vimeothumbnails');\n }\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
+ * http://www.lightgalleryjs.com/
4
+ * Copyright (c) 2020 Sachin Neravath;
5
+ * @license GPLv3
6
+ */
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).lgVimeoThumbnail=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,l)}a((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){u.label=r[1];break}if(6===r[0]&&u.label<i[1]){u.label=i[1],i=r;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(r);break}i[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}}var o="lgInit",i={showVimeoThumbnails:!0,showThumbnailWithPlayButton:!1};return function(){function r(e){return this.core=e,this.settings=t(t({},i),this.core.settings),this}return r.prototype.init=function(){var t=this;this.settings.showVimeoThumbnails&&this.core.LGel.on(o+".vimeothumbnails",(function(e){var n=e.detail.instance;n.$container.find(".lg-thumb-outer").get()&&t.setVimeoThumbnails(n)}))},r.prototype.setVimeoThumbnails=function(t){return e(this,void 0,void 0,(function(){var e,o,i;return n(this,(function(n){switch(n.label){case 0:e=0,n.label=1;case 1:return e<t.galleryItems.length?(o=t.galleryItems[e],(o.__slideVideoInfo||{}).vimeo?[4,fetch("https://vimeo.com/api/oembed.json?url="+encodeURIComponent(o.src))]:[3,4]):[3,5];case 2:return[4,n.sent().json()];case 3:i=n.sent(),t.$container.find(".lg-thumb-item").eq(e).find("img").attr("src",this.settings.showThumbnailWithPlayButton?i.thumbnail_url_with_play_button:i.thumbnail_url),n.label=4;case 4:return e++,[3,1];case 5:return[2]}}))}))},r.prototype.destroy=function(){this.core.LGel.off(".lg.vimeothumbnails"),this.core.LGel.off(".vimeothumbnails")},r}()}));
@@ -0,0 +1,190 @@
1
+ /*!
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
+ * http://www.lightgalleryjs.com/
4
+ * Copyright (c) 2020 Sachin Neravath;
5
+ * @license GPLv3
6
+ */
7
+
8
+ (function (global, factory) {
9
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
10
+ typeof define === 'function' && define.amd ? define(factory) :
11
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgVimeoThumbnail = factory());
12
+ }(this, (function () { 'use strict';
13
+
14
+ /*! *****************************************************************************
15
+ Copyright (c) Microsoft Corporation.
16
+
17
+ Permission to use, copy, modify, and/or distribute this software for any
18
+ purpose with or without fee is hereby granted.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
+ PERFORMANCE OF THIS SOFTWARE.
27
+ ***************************************************************************** */
28
+
29
+ var __assign = function() {
30
+ __assign = Object.assign || function __assign(t) {
31
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
32
+ s = arguments[i];
33
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
34
+ }
35
+ return t;
36
+ };
37
+ return __assign.apply(this, arguments);
38
+ };
39
+
40
+ function __awaiter(thisArg, _arguments, P, generator) {
41
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
42
+ return new (P || (P = Promise))(function (resolve, reject) {
43
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
44
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
45
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
46
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
47
+ });
48
+ }
49
+
50
+ function __generator(thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (_) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ }
77
+
78
+ /**
79
+ * List of lightGallery events
80
+ * All events should be documented here
81
+ * Below interfaces are used to build the website documentations
82
+ * */
83
+ var lGEvents = {
84
+ afterAppendSlide: 'lgAfterAppendSlide',
85
+ init: 'lgInit',
86
+ hasVideo: 'lgHasVideo',
87
+ containerResize: 'lgContainerResize',
88
+ updateSlides: 'lgUpdateSlides',
89
+ afterAppendSubHtml: 'lgAfterAppendSubHtml',
90
+ beforeOpen: 'lgBeforeOpen',
91
+ afterOpen: 'lgAfterOpen',
92
+ slideItemLoad: 'lgSlideItemLoad',
93
+ beforeSlide: 'lgBeforeSlide',
94
+ afterSlide: 'lgAfterSlide',
95
+ posterClick: 'lgPosterClick',
96
+ dragStart: 'lgDragStart',
97
+ dragMove: 'lgDragMove',
98
+ dragEnd: 'lgDragEnd',
99
+ beforeNextSlide: 'lgBeforeNextSlide',
100
+ beforePrevSlide: 'lgBeforePrevSlide',
101
+ beforeClose: 'lgBeforeClose',
102
+ afterClose: 'lgAfterClose',
103
+ rotateLeft: 'lgRotateLeft',
104
+ rotateRight: 'lgRotateRight',
105
+ flipHorizontal: 'lgFlipHorizontal',
106
+ flipVertical: 'lgFlipVertical',
107
+ autoplay: 'lgAutoplay',
108
+ autoplayStart: 'lgAutoplayStart',
109
+ autoplayStop: 'lgAutoplayStop',
110
+ };
111
+
112
+ var vimeoSettings = {
113
+ showVimeoThumbnails: true,
114
+ showThumbnailWithPlayButton: false,
115
+ };
116
+
117
+ /**
118
+ * Creates the vimeo thumbnails plugin.
119
+ * @param {object} element - lightGallery element
120
+ */
121
+ var VimeoThumbnail = /** @class */ (function () {
122
+ function VimeoThumbnail(instance) {
123
+ this.core = instance;
124
+ // extend module default settings with lightGallery core settings
125
+ this.settings = __assign(__assign({}, vimeoSettings), this.core.settings);
126
+ return this;
127
+ }
128
+ VimeoThumbnail.prototype.init = function () {
129
+ var _this = this;
130
+ if (!this.settings.showVimeoThumbnails) {
131
+ return;
132
+ }
133
+ this.core.LGel.on(lGEvents.init + ".vimeothumbnails", function (event) {
134
+ var pluginInstance = event.detail.instance;
135
+ var thumbCont = pluginInstance.$container
136
+ .find('.lg-thumb-outer')
137
+ .get();
138
+ if (thumbCont) {
139
+ _this.setVimeoThumbnails(pluginInstance);
140
+ }
141
+ });
142
+ };
143
+ VimeoThumbnail.prototype.setVimeoThumbnails = function (dynamicGallery) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var i, item, slideVideoInfo, response, vimeoInfo;
146
+ return __generator(this, function (_a) {
147
+ switch (_a.label) {
148
+ case 0:
149
+ i = 0;
150
+ _a.label = 1;
151
+ case 1:
152
+ if (!(i < dynamicGallery.galleryItems.length)) return [3 /*break*/, 5];
153
+ item = dynamicGallery.galleryItems[i];
154
+ slideVideoInfo = item.__slideVideoInfo || {};
155
+ if (!slideVideoInfo.vimeo) return [3 /*break*/, 4];
156
+ return [4 /*yield*/, fetch('https://vimeo.com/api/oembed.json?url=' +
157
+ encodeURIComponent(item.src))];
158
+ case 2:
159
+ response = _a.sent();
160
+ return [4 /*yield*/, response.json()];
161
+ case 3:
162
+ vimeoInfo = _a.sent();
163
+ dynamicGallery.$container
164
+ .find('.lg-thumb-item')
165
+ .eq(i)
166
+ .find('img')
167
+ .attr('src', this.settings.showThumbnailWithPlayButton
168
+ ? vimeoInfo.thumbnail_url_with_play_button
169
+ : vimeoInfo.thumbnail_url);
170
+ _a.label = 4;
171
+ case 4:
172
+ i++;
173
+ return [3 /*break*/, 1];
174
+ case 5: return [2 /*return*/];
175
+ }
176
+ });
177
+ });
178
+ };
179
+ VimeoThumbnail.prototype.destroy = function () {
180
+ // Remove all event listeners added by vimeothumbnails plugin
181
+ this.core.LGel.off('.lg.vimeothumbnails');
182
+ this.core.LGel.off('.vimeothumbnails');
183
+ };
184
+ return VimeoThumbnail;
185
+ }());
186
+
187
+ return VimeoThumbnail;
188
+
189
+ })));
190
+ //# sourceMappingURL=lg-vimeo-thumbnail.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lg-vimeo-thumbnail.umd.js","sources":["../../../src/lg-events.ts","../../../src/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.ts","../../../src/plugins/vimeoThumbnail/lg-vimeo-thumbnail.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 VimeoThumbnailSettings {\n /**\n * Auto load thumbnails for Vimeo videos\n */\n showVimeoThumbnails: boolean;\n\n /**\n * Show thumbnails with play button\n */\n showThumbnailWithPlayButton: boolean;\n}\nexport const vimeoSettings: VimeoThumbnailSettings = {\n showVimeoThumbnails: true,\n showThumbnailWithPlayButton: false,\n};\n","import { lGEvents } from '../../lg-events';\nimport { LightGallery } from '../../lightgallery';\nimport {\n vimeoSettings,\n VimeoThumbnailSettings,\n} from './lg-vimeo-thumbnail-settings';\n\n/**\n * Creates the vimeo thumbnails plugin.\n * @param {object} element - lightGallery element\n */\nexport default class VimeoThumbnail {\n core: LightGallery;\n settings: VimeoThumbnailSettings;\n\n constructor(instance: LightGallery) {\n this.core = instance;\n\n // extend module default settings with lightGallery core settings\n this.settings = { ...vimeoSettings, ...this.core.settings };\n\n return this;\n }\n\n public init(): void {\n if (!this.settings.showVimeoThumbnails) {\n return;\n }\n\n this.core.LGel.on(`${lGEvents.init}.vimeothumbnails`, (event) => {\n const pluginInstance = event.detail.instance;\n const thumbCont = pluginInstance.$container\n .find('.lg-thumb-outer')\n .get();\n if (thumbCont) {\n this.setVimeoThumbnails(pluginInstance);\n }\n });\n }\n\n async setVimeoThumbnails(dynamicGallery: LightGallery): Promise<void> {\n for (let i = 0; i < dynamicGallery.galleryItems.length; i++) {\n const item = dynamicGallery.galleryItems[i];\n const slideVideoInfo = item.__slideVideoInfo || {};\n if (slideVideoInfo.vimeo) {\n const response = await fetch(\n 'https://vimeo.com/api/oembed.json?url=' +\n encodeURIComponent(item.src as string),\n );\n const vimeoInfo = await response.json();\n dynamicGallery.$container\n .find('.lg-thumb-item')\n .eq(i)\n .find('img')\n .attr(\n 'src',\n this.settings.showThumbnailWithPlayButton\n ? vimeoInfo.thumbnail_url_with_play_button\n : vimeoInfo.thumbnail_url,\n );\n }\n }\n }\n\n public destroy(): void {\n // Remove all event listeners added by vimeothumbnails plugin\n this.core.LGel.off('.lg.vimeothumbnails');\n this.core.LGel.off('.vimeothumbnails');\n }\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "lightgallery/plugins/vimeoThumbnail",
3
+ "private": true,
4
+ "main": "lg-vimeo-thumbnail.umd.js",
5
+ "module": "lg-vimeo-thumbnail.es5.js",
6
+ "typings": "lg-vimeo-thumbnail.d.ts"
7
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0 | January 29th 2022
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * lightgallery | 2.4.0 | January 29th 2022
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * lightgallery | 2.4.0 | January 29th 2022
2
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
5
5
  * @license GPLv3
@@ -28,7 +28,7 @@ function __rest(s, e) {
28
28
  }
29
29
 
30
30
  /*!
31
- * lightgallery | 2.4.0 | January 29th 2022
31
+ * lightgallery | 2.5.0-beta.1 | February 24th 2022
32
32
  * http://www.lightgalleryjs.com/
33
33
  * Copyright (c) 2020 Sachin Neravath;
34
34
  * @license GPLv3