viewerjs 1.11.6 → 1.11.8

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.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  ## Table of contents
11
11
 
12
12
  - [Features](#features)
13
- - [Main](#main)
13
+ - [Main Files](#main-files)
14
14
  - [Getting started](#getting-started)
15
15
  - [Keyboard support](#keyboard-support)
16
16
  - [Options](#options)
@@ -1,15 +1,37 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.8
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2026-07-18T13:41:00.752Z
9
9
  */
10
10
 
11
11
  'use strict';
12
12
 
13
+ function _classCallCheck(a, n) {
14
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
15
+ }
16
+ function _defineProperties(e, r) {
17
+ for (var t = 0; t < r.length; t++) {
18
+ var o = r[t];
19
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
20
+ }
21
+ }
22
+ function _createClass(e, r, t) {
23
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
24
+ writable: !1
25
+ }), e;
26
+ }
27
+ function _defineProperty(e, r, t) {
28
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
29
+ value: t,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }) : e[r] = t, e;
34
+ }
13
35
  function ownKeys(e, r) {
14
36
  var t = Object.keys(e);
15
37
  if (Object.getOwnPropertySymbols) {
@@ -31,6 +53,20 @@ function _objectSpread2(e) {
31
53
  }
32
54
  return e;
33
55
  }
56
+ function _toPrimitive(t, r) {
57
+ if ("object" != typeof t || !t) return t;
58
+ var e = t[Symbol.toPrimitive];
59
+ if (void 0 !== e) {
60
+ var i = e.call(t, r || "default");
61
+ if ("object" != typeof i) return i;
62
+ throw new TypeError("@@toPrimitive must return a primitive value.");
63
+ }
64
+ return ("string" === r ? String : Number)(t);
65
+ }
66
+ function _toPropertyKey(t) {
67
+ var i = _toPrimitive(t, "string");
68
+ return "symbol" == typeof i ? i : i + "";
69
+ }
34
70
  function _typeof(o) {
35
71
  "@babel/helpers - typeof";
36
72
 
@@ -40,56 +76,6 @@ function _typeof(o) {
40
76
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
41
77
  }, _typeof(o);
42
78
  }
43
- function _classCallCheck(instance, Constructor) {
44
- if (!(instance instanceof Constructor)) {
45
- throw new TypeError("Cannot call a class as a function");
46
- }
47
- }
48
- function _defineProperties(target, props) {
49
- for (var i = 0; i < props.length; i++) {
50
- var descriptor = props[i];
51
- descriptor.enumerable = descriptor.enumerable || false;
52
- descriptor.configurable = true;
53
- if ("value" in descriptor) descriptor.writable = true;
54
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
55
- }
56
- }
57
- function _createClass(Constructor, protoProps, staticProps) {
58
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
59
- if (staticProps) _defineProperties(Constructor, staticProps);
60
- Object.defineProperty(Constructor, "prototype", {
61
- writable: false
62
- });
63
- return Constructor;
64
- }
65
- function _defineProperty(obj, key, value) {
66
- key = _toPropertyKey(key);
67
- if (key in obj) {
68
- Object.defineProperty(obj, key, {
69
- value: value,
70
- enumerable: true,
71
- configurable: true,
72
- writable: true
73
- });
74
- } else {
75
- obj[key] = value;
76
- }
77
- return obj;
78
- }
79
- function _toPrimitive(input, hint) {
80
- if (typeof input !== "object" || input === null) return input;
81
- var prim = input[Symbol.toPrimitive];
82
- if (prim !== undefined) {
83
- var res = prim.call(input, hint || "default");
84
- if (typeof res !== "object") return res;
85
- throw new TypeError("@@toPrimitive must return a primitive value.");
86
- }
87
- return (hint === "string" ? String : Number)(input);
88
- }
89
- function _toPropertyKey(arg) {
90
- var key = _toPrimitive(arg, "string");
91
- return typeof key === "symbol" ? key : String(key);
92
- }
93
79
 
94
80
  var DEFAULTS = {
95
81
  /**
@@ -428,9 +414,9 @@ function isPlainObject(value) {
428
414
  return false;
429
415
  }
430
416
  try {
431
- var _constructor = value.constructor;
432
- var prototype = _constructor.prototype;
433
- return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
417
+ var constructor = value.constructor;
418
+ var prototype = constructor.prototype;
419
+ return constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
434
420
  } catch (error) {
435
421
  return false;
436
422
  }
@@ -1088,9 +1074,11 @@ var render = {
1088
1074
  var list = this.list;
1089
1075
  list.innerHTML = '';
1090
1076
  removeClass(list, CLASS_TRANSITION);
1091
- setStyle(list, getTransforms({
1077
+ setStyle(list, assign({
1078
+ width: 0
1079
+ }, getTransforms({
1092
1080
  translateX: 0
1093
- }));
1081
+ })));
1094
1082
  },
1095
1083
  initImage: function initImage(done) {
1096
1084
  var _this2 = this;
@@ -1762,17 +1750,17 @@ var methods = {
1762
1750
  _this.hidden();
1763
1751
  };
1764
1752
  if (options.transition && !immediate) {
1765
- var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1753
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1766
1754
  // Ignore all propagating `transitionend` events (#275).
1767
1755
  if (event && event.target === viewer) {
1768
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1756
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1769
1757
  _this.hidden();
1770
1758
  }
1771
1759
  };
1772
1760
  var onImageTransitionEnd = function onImageTransitionEnd() {
1773
1761
  // In case of show the viewer by `viewer.show(true)` previously (#407).
1774
1762
  if (hasClass(viewer, CLASS_TRANSITION)) {
1775
- addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1763
+ addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1776
1764
  removeClass(viewer, CLASS_IN);
1777
1765
  } else {
1778
1766
  hideImmediately();
@@ -1783,7 +1771,7 @@ var methods = {
1783
1771
  if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
1784
1772
  removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
1785
1773
  } else if (hasClass(viewer, CLASS_TRANSITION)) {
1786
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1774
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1787
1775
  }
1788
1776
  }
1789
1777
  };
@@ -2376,27 +2364,27 @@ var methods = {
2376
2364
  player.appendChild(image);
2377
2365
  });
2378
2366
  if (isNumber(options.interval) && options.interval > 0) {
2379
- var prev = function prev() {
2367
+ var _prev = function prev() {
2380
2368
  clearTimeout(_this7.playing.timeout);
2381
2369
  removeClass(list[index], CLASS_IN);
2382
2370
  index -= 1;
2383
2371
  index = index >= 0 ? index : total - 1;
2384
2372
  addClass(list[index], CLASS_IN);
2385
- _this7.playing.timeout = setTimeout(prev, options.interval);
2373
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
2386
2374
  };
2387
- var next = function next() {
2375
+ var _next = function next() {
2388
2376
  clearTimeout(_this7.playing.timeout);
2389
2377
  removeClass(list[index], CLASS_IN);
2390
2378
  index += 1;
2391
2379
  index = index < total ? index : 0;
2392
2380
  addClass(list[index], CLASS_IN);
2393
- _this7.playing.timeout = setTimeout(next, options.interval);
2381
+ _this7.playing.timeout = setTimeout(_next, options.interval);
2394
2382
  };
2395
2383
  if (total > 1) {
2396
2384
  this.playing = {
2397
- prev: prev,
2398
- next: next,
2399
- timeout: setTimeout(next, options.interval)
2385
+ prev: _prev,
2386
+ next: _next,
2387
+ timeout: setTimeout(_next, options.interval)
2400
2388
  };
2401
2389
  }
2402
2390
  }
@@ -2479,7 +2467,7 @@ var methods = {
2479
2467
  },
2480
2468
  // Exit modal mode (only available in inline mode)
2481
2469
  exit: function exit() {
2482
- var _this10 = this;
2470
+ var _this0 = this;
2483
2471
  var options = this.options,
2484
2472
  viewer = this.viewer,
2485
2473
  image = this.image,
@@ -2511,7 +2499,7 @@ var methods = {
2511
2499
  this.renderList();
2512
2500
  if (this.viewed) {
2513
2501
  this.initImage(function () {
2514
- _this10.renderImage(function () {
2502
+ _this0.renderImage(function () {
2515
2503
  if (options.transition) {
2516
2504
  setTimeout(function () {
2517
2505
  addClass(image, CLASS_TRANSITION);
@@ -2525,7 +2513,7 @@ var methods = {
2525
2513
  },
2526
2514
  // Show the current ratio of the image with percentage
2527
2515
  tooltip: function tooltip() {
2528
- var _this11 = this;
2516
+ var _this1 = this;
2529
2517
  var options = this.options,
2530
2518
  tooltipBox = this.tooltipBox,
2531
2519
  imageData = this.imageData;
@@ -2560,17 +2548,17 @@ var methods = {
2560
2548
  removeClass(tooltipBox, CLASS_FADE);
2561
2549
  removeClass(tooltipBox, CLASS_TRANSITION);
2562
2550
  tooltipBox.setAttribute('aria-hidden', true);
2563
- _this11.fading = false;
2551
+ _this1.fading = false;
2564
2552
  }, {
2565
2553
  once: true
2566
2554
  });
2567
2555
  removeClass(tooltipBox, CLASS_IN);
2568
- _this11.fading = true;
2556
+ _this1.fading = true;
2569
2557
  } else {
2570
2558
  removeClass(tooltipBox, CLASS_SHOW);
2571
2559
  tooltipBox.setAttribute('aria-hidden', true);
2572
2560
  }
2573
- _this11.tooltipping = false;
2561
+ _this1.tooltipping = false;
2574
2562
  }, 1000);
2575
2563
  return this;
2576
2564
  },
@@ -2598,7 +2586,7 @@ var methods = {
2598
2586
  },
2599
2587
  // Update viewer when images changed
2600
2588
  update: function update() {
2601
- var _this12 = this;
2589
+ var _this10 = this;
2602
2590
  var element = this.element,
2603
2591
  options = this.options,
2604
2592
  isImg = this.isImg;
@@ -2610,10 +2598,10 @@ var methods = {
2610
2598
  var images = [];
2611
2599
  forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
2612
2600
  if (isFunction(options.filter)) {
2613
- if (options.filter.call(_this12, image)) {
2601
+ if (options.filter.call(_this10, image)) {
2614
2602
  images.push(image);
2615
2603
  }
2616
- } else if (_this12.getImageURL(image)) {
2604
+ } else if (_this10.getImageURL(image)) {
2617
2605
  images.push(image);
2618
2606
  }
2619
2607
  });
@@ -2801,7 +2789,7 @@ var others = {
2801
2789
  var element = this.element,
2802
2790
  options = this.options,
2803
2791
  viewer = this.viewer;
2804
- if (options.fucus) {
2792
+ if (options.focus) {
2805
2793
  this.clearEnforceFocus();
2806
2794
  }
2807
2795
  this.close();
@@ -2968,7 +2956,7 @@ var Viewer = /*#__PURE__*/function () {
2968
2956
  this.id = getUniqueID();
2969
2957
  this.init();
2970
2958
  }
2971
- _createClass(Viewer, [{
2959
+ return _createClass(Viewer, [{
2972
2960
  key: "init",
2973
2961
  value: function init() {
2974
2962
  var _this = this;
@@ -3230,7 +3218,6 @@ var Viewer = /*#__PURE__*/function () {
3230
3218
  assign(DEFAULTS, isPlainObject(options) && options);
3231
3219
  }
3232
3220
  }]);
3233
- return Viewer;
3234
3221
  }();
3235
3222
  assign(Viewer.prototype, render, events, handlers, methods, others);
3236
3223
 
package/dist/viewer.css CHANGED
@@ -1,15 +1,15 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.8
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:35.830Z
8
+ * Date: 2026-07-18T13:40:58.328Z
9
9
  */
10
10
 
11
11
  .viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {
12
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC');
12
+ background-image: url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 560 40%22%3E%3Cpath fill%3D%22%23fff%22 d%3D%22M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z%22%2F%3E%3C%2Fsvg%3E");
13
13
  background-repeat: no-repeat;
14
14
  background-size: 280px;
15
15
  color: transparent;
@@ -1,13 +1,35 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.8
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2026-07-18T13:41:00.752Z
9
9
  */
10
10
 
11
+ function _classCallCheck(a, n) {
12
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
13
+ }
14
+ function _defineProperties(e, r) {
15
+ for (var t = 0; t < r.length; t++) {
16
+ var o = r[t];
17
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
18
+ }
19
+ }
20
+ function _createClass(e, r, t) {
21
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
22
+ writable: !1
23
+ }), e;
24
+ }
25
+ function _defineProperty(e, r, t) {
26
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
27
+ value: t,
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0
31
+ }) : e[r] = t, e;
32
+ }
11
33
  function ownKeys(e, r) {
12
34
  var t = Object.keys(e);
13
35
  if (Object.getOwnPropertySymbols) {
@@ -29,6 +51,20 @@ function _objectSpread2(e) {
29
51
  }
30
52
  return e;
31
53
  }
54
+ function _toPrimitive(t, r) {
55
+ if ("object" != typeof t || !t) return t;
56
+ var e = t[Symbol.toPrimitive];
57
+ if (void 0 !== e) {
58
+ var i = e.call(t, r || "default");
59
+ if ("object" != typeof i) return i;
60
+ throw new TypeError("@@toPrimitive must return a primitive value.");
61
+ }
62
+ return ("string" === r ? String : Number)(t);
63
+ }
64
+ function _toPropertyKey(t) {
65
+ var i = _toPrimitive(t, "string");
66
+ return "symbol" == typeof i ? i : i + "";
67
+ }
32
68
  function _typeof(o) {
33
69
  "@babel/helpers - typeof";
34
70
 
@@ -38,56 +74,6 @@ function _typeof(o) {
38
74
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
39
75
  }, _typeof(o);
40
76
  }
41
- function _classCallCheck(instance, Constructor) {
42
- if (!(instance instanceof Constructor)) {
43
- throw new TypeError("Cannot call a class as a function");
44
- }
45
- }
46
- function _defineProperties(target, props) {
47
- for (var i = 0; i < props.length; i++) {
48
- var descriptor = props[i];
49
- descriptor.enumerable = descriptor.enumerable || false;
50
- descriptor.configurable = true;
51
- if ("value" in descriptor) descriptor.writable = true;
52
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
53
- }
54
- }
55
- function _createClass(Constructor, protoProps, staticProps) {
56
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
57
- if (staticProps) _defineProperties(Constructor, staticProps);
58
- Object.defineProperty(Constructor, "prototype", {
59
- writable: false
60
- });
61
- return Constructor;
62
- }
63
- function _defineProperty(obj, key, value) {
64
- key = _toPropertyKey(key);
65
- if (key in obj) {
66
- Object.defineProperty(obj, key, {
67
- value: value,
68
- enumerable: true,
69
- configurable: true,
70
- writable: true
71
- });
72
- } else {
73
- obj[key] = value;
74
- }
75
- return obj;
76
- }
77
- function _toPrimitive(input, hint) {
78
- if (typeof input !== "object" || input === null) return input;
79
- var prim = input[Symbol.toPrimitive];
80
- if (prim !== undefined) {
81
- var res = prim.call(input, hint || "default");
82
- if (typeof res !== "object") return res;
83
- throw new TypeError("@@toPrimitive must return a primitive value.");
84
- }
85
- return (hint === "string" ? String : Number)(input);
86
- }
87
- function _toPropertyKey(arg) {
88
- var key = _toPrimitive(arg, "string");
89
- return typeof key === "symbol" ? key : String(key);
90
- }
91
77
 
92
78
  var DEFAULTS = {
93
79
  /**
@@ -426,9 +412,9 @@ function isPlainObject(value) {
426
412
  return false;
427
413
  }
428
414
  try {
429
- var _constructor = value.constructor;
430
- var prototype = _constructor.prototype;
431
- return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
415
+ var constructor = value.constructor;
416
+ var prototype = constructor.prototype;
417
+ return constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
432
418
  } catch (error) {
433
419
  return false;
434
420
  }
@@ -1086,9 +1072,11 @@ var render = {
1086
1072
  var list = this.list;
1087
1073
  list.innerHTML = '';
1088
1074
  removeClass(list, CLASS_TRANSITION);
1089
- setStyle(list, getTransforms({
1075
+ setStyle(list, assign({
1076
+ width: 0
1077
+ }, getTransforms({
1090
1078
  translateX: 0
1091
- }));
1079
+ })));
1092
1080
  },
1093
1081
  initImage: function initImage(done) {
1094
1082
  var _this2 = this;
@@ -1760,17 +1748,17 @@ var methods = {
1760
1748
  _this.hidden();
1761
1749
  };
1762
1750
  if (options.transition && !immediate) {
1763
- var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1751
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1764
1752
  // Ignore all propagating `transitionend` events (#275).
1765
1753
  if (event && event.target === viewer) {
1766
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1754
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1767
1755
  _this.hidden();
1768
1756
  }
1769
1757
  };
1770
1758
  var onImageTransitionEnd = function onImageTransitionEnd() {
1771
1759
  // In case of show the viewer by `viewer.show(true)` previously (#407).
1772
1760
  if (hasClass(viewer, CLASS_TRANSITION)) {
1773
- addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1761
+ addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1774
1762
  removeClass(viewer, CLASS_IN);
1775
1763
  } else {
1776
1764
  hideImmediately();
@@ -1781,7 +1769,7 @@ var methods = {
1781
1769
  if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
1782
1770
  removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
1783
1771
  } else if (hasClass(viewer, CLASS_TRANSITION)) {
1784
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1772
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1785
1773
  }
1786
1774
  }
1787
1775
  };
@@ -2374,27 +2362,27 @@ var methods = {
2374
2362
  player.appendChild(image);
2375
2363
  });
2376
2364
  if (isNumber(options.interval) && options.interval > 0) {
2377
- var prev = function prev() {
2365
+ var _prev = function prev() {
2378
2366
  clearTimeout(_this7.playing.timeout);
2379
2367
  removeClass(list[index], CLASS_IN);
2380
2368
  index -= 1;
2381
2369
  index = index >= 0 ? index : total - 1;
2382
2370
  addClass(list[index], CLASS_IN);
2383
- _this7.playing.timeout = setTimeout(prev, options.interval);
2371
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
2384
2372
  };
2385
- var next = function next() {
2373
+ var _next = function next() {
2386
2374
  clearTimeout(_this7.playing.timeout);
2387
2375
  removeClass(list[index], CLASS_IN);
2388
2376
  index += 1;
2389
2377
  index = index < total ? index : 0;
2390
2378
  addClass(list[index], CLASS_IN);
2391
- _this7.playing.timeout = setTimeout(next, options.interval);
2379
+ _this7.playing.timeout = setTimeout(_next, options.interval);
2392
2380
  };
2393
2381
  if (total > 1) {
2394
2382
  this.playing = {
2395
- prev: prev,
2396
- next: next,
2397
- timeout: setTimeout(next, options.interval)
2383
+ prev: _prev,
2384
+ next: _next,
2385
+ timeout: setTimeout(_next, options.interval)
2398
2386
  };
2399
2387
  }
2400
2388
  }
@@ -2477,7 +2465,7 @@ var methods = {
2477
2465
  },
2478
2466
  // Exit modal mode (only available in inline mode)
2479
2467
  exit: function exit() {
2480
- var _this10 = this;
2468
+ var _this0 = this;
2481
2469
  var options = this.options,
2482
2470
  viewer = this.viewer,
2483
2471
  image = this.image,
@@ -2509,7 +2497,7 @@ var methods = {
2509
2497
  this.renderList();
2510
2498
  if (this.viewed) {
2511
2499
  this.initImage(function () {
2512
- _this10.renderImage(function () {
2500
+ _this0.renderImage(function () {
2513
2501
  if (options.transition) {
2514
2502
  setTimeout(function () {
2515
2503
  addClass(image, CLASS_TRANSITION);
@@ -2523,7 +2511,7 @@ var methods = {
2523
2511
  },
2524
2512
  // Show the current ratio of the image with percentage
2525
2513
  tooltip: function tooltip() {
2526
- var _this11 = this;
2514
+ var _this1 = this;
2527
2515
  var options = this.options,
2528
2516
  tooltipBox = this.tooltipBox,
2529
2517
  imageData = this.imageData;
@@ -2558,17 +2546,17 @@ var methods = {
2558
2546
  removeClass(tooltipBox, CLASS_FADE);
2559
2547
  removeClass(tooltipBox, CLASS_TRANSITION);
2560
2548
  tooltipBox.setAttribute('aria-hidden', true);
2561
- _this11.fading = false;
2549
+ _this1.fading = false;
2562
2550
  }, {
2563
2551
  once: true
2564
2552
  });
2565
2553
  removeClass(tooltipBox, CLASS_IN);
2566
- _this11.fading = true;
2554
+ _this1.fading = true;
2567
2555
  } else {
2568
2556
  removeClass(tooltipBox, CLASS_SHOW);
2569
2557
  tooltipBox.setAttribute('aria-hidden', true);
2570
2558
  }
2571
- _this11.tooltipping = false;
2559
+ _this1.tooltipping = false;
2572
2560
  }, 1000);
2573
2561
  return this;
2574
2562
  },
@@ -2596,7 +2584,7 @@ var methods = {
2596
2584
  },
2597
2585
  // Update viewer when images changed
2598
2586
  update: function update() {
2599
- var _this12 = this;
2587
+ var _this10 = this;
2600
2588
  var element = this.element,
2601
2589
  options = this.options,
2602
2590
  isImg = this.isImg;
@@ -2608,10 +2596,10 @@ var methods = {
2608
2596
  var images = [];
2609
2597
  forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
2610
2598
  if (isFunction(options.filter)) {
2611
- if (options.filter.call(_this12, image)) {
2599
+ if (options.filter.call(_this10, image)) {
2612
2600
  images.push(image);
2613
2601
  }
2614
- } else if (_this12.getImageURL(image)) {
2602
+ } else if (_this10.getImageURL(image)) {
2615
2603
  images.push(image);
2616
2604
  }
2617
2605
  });
@@ -2799,7 +2787,7 @@ var others = {
2799
2787
  var element = this.element,
2800
2788
  options = this.options,
2801
2789
  viewer = this.viewer;
2802
- if (options.fucus) {
2790
+ if (options.focus) {
2803
2791
  this.clearEnforceFocus();
2804
2792
  }
2805
2793
  this.close();
@@ -2966,7 +2954,7 @@ var Viewer = /*#__PURE__*/function () {
2966
2954
  this.id = getUniqueID();
2967
2955
  this.init();
2968
2956
  }
2969
- _createClass(Viewer, [{
2957
+ return _createClass(Viewer, [{
2970
2958
  key: "init",
2971
2959
  value: function init() {
2972
2960
  var _this = this;
@@ -3228,7 +3216,6 @@ var Viewer = /*#__PURE__*/function () {
3228
3216
  assign(DEFAULTS, isPlainObject(options) && options);
3229
3217
  }
3230
3218
  }]);
3231
- return Viewer;
3232
3219
  }();
3233
3220
  assign(Viewer.prototype, render, events, handlers, methods, others);
3234
3221