viewerjs 1.11.7 → 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,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.11.7
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: 2024-11-24T04:32:19.116Z
8
+ * Date: 2026-07-18T13:41:00.752Z
9
9
  */
10
10
 
11
11
  'use strict';
@@ -414,9 +414,9 @@ function isPlainObject(value) {
414
414
  return false;
415
415
  }
416
416
  try {
417
- var _constructor = value.constructor;
418
- var prototype = _constructor.prototype;
419
- 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');
420
420
  } catch (error) {
421
421
  return false;
422
422
  }
@@ -1074,9 +1074,11 @@ var render = {
1074
1074
  var list = this.list;
1075
1075
  list.innerHTML = '';
1076
1076
  removeClass(list, CLASS_TRANSITION);
1077
- setStyle(list, getTransforms({
1077
+ setStyle(list, assign({
1078
+ width: 0
1079
+ }, getTransforms({
1078
1080
  translateX: 0
1079
- }));
1081
+ })));
1080
1082
  },
1081
1083
  initImage: function initImage(done) {
1082
1084
  var _this2 = this;
@@ -2465,7 +2467,7 @@ var methods = {
2465
2467
  },
2466
2468
  // Exit modal mode (only available in inline mode)
2467
2469
  exit: function exit() {
2468
- var _this10 = this;
2470
+ var _this0 = this;
2469
2471
  var options = this.options,
2470
2472
  viewer = this.viewer,
2471
2473
  image = this.image,
@@ -2497,7 +2499,7 @@ var methods = {
2497
2499
  this.renderList();
2498
2500
  if (this.viewed) {
2499
2501
  this.initImage(function () {
2500
- _this10.renderImage(function () {
2502
+ _this0.renderImage(function () {
2501
2503
  if (options.transition) {
2502
2504
  setTimeout(function () {
2503
2505
  addClass(image, CLASS_TRANSITION);
@@ -2511,7 +2513,7 @@ var methods = {
2511
2513
  },
2512
2514
  // Show the current ratio of the image with percentage
2513
2515
  tooltip: function tooltip() {
2514
- var _this11 = this;
2516
+ var _this1 = this;
2515
2517
  var options = this.options,
2516
2518
  tooltipBox = this.tooltipBox,
2517
2519
  imageData = this.imageData;
@@ -2546,17 +2548,17 @@ var methods = {
2546
2548
  removeClass(tooltipBox, CLASS_FADE);
2547
2549
  removeClass(tooltipBox, CLASS_TRANSITION);
2548
2550
  tooltipBox.setAttribute('aria-hidden', true);
2549
- _this11.fading = false;
2551
+ _this1.fading = false;
2550
2552
  }, {
2551
2553
  once: true
2552
2554
  });
2553
2555
  removeClass(tooltipBox, CLASS_IN);
2554
- _this11.fading = true;
2556
+ _this1.fading = true;
2555
2557
  } else {
2556
2558
  removeClass(tooltipBox, CLASS_SHOW);
2557
2559
  tooltipBox.setAttribute('aria-hidden', true);
2558
2560
  }
2559
- _this11.tooltipping = false;
2561
+ _this1.tooltipping = false;
2560
2562
  }, 1000);
2561
2563
  return this;
2562
2564
  },
@@ -2584,7 +2586,7 @@ var methods = {
2584
2586
  },
2585
2587
  // Update viewer when images changed
2586
2588
  update: function update() {
2587
- var _this12 = this;
2589
+ var _this10 = this;
2588
2590
  var element = this.element,
2589
2591
  options = this.options,
2590
2592
  isImg = this.isImg;
@@ -2596,10 +2598,10 @@ var methods = {
2596
2598
  var images = [];
2597
2599
  forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
2598
2600
  if (isFunction(options.filter)) {
2599
- if (options.filter.call(_this12, image)) {
2601
+ if (options.filter.call(_this10, image)) {
2600
2602
  images.push(image);
2601
2603
  }
2602
- } else if (_this12.getImageURL(image)) {
2604
+ } else if (_this10.getImageURL(image)) {
2603
2605
  images.push(image);
2604
2606
  }
2605
2607
  });
@@ -2787,7 +2789,7 @@ var others = {
2787
2789
  var element = this.element,
2788
2790
  options = this.options,
2789
2791
  viewer = this.viewer;
2790
- if (options.fucus) {
2792
+ if (options.focus) {
2791
2793
  this.clearEnforceFocus();
2792
2794
  }
2793
2795
  this.close();
package/dist/viewer.css CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.11.7
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: 2024-11-24T04:32:14.526Z
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 {
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.11.7
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: 2024-11-24T04:32:19.116Z
8
+ * Date: 2026-07-18T13:41:00.752Z
9
9
  */
10
10
 
11
11
  function _classCallCheck(a, n) {
@@ -412,9 +412,9 @@ function isPlainObject(value) {
412
412
  return false;
413
413
  }
414
414
  try {
415
- var _constructor = value.constructor;
416
- var prototype = _constructor.prototype;
417
- 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');
418
418
  } catch (error) {
419
419
  return false;
420
420
  }
@@ -1072,9 +1072,11 @@ var render = {
1072
1072
  var list = this.list;
1073
1073
  list.innerHTML = '';
1074
1074
  removeClass(list, CLASS_TRANSITION);
1075
- setStyle(list, getTransforms({
1075
+ setStyle(list, assign({
1076
+ width: 0
1077
+ }, getTransforms({
1076
1078
  translateX: 0
1077
- }));
1079
+ })));
1078
1080
  },
1079
1081
  initImage: function initImage(done) {
1080
1082
  var _this2 = this;
@@ -2463,7 +2465,7 @@ var methods = {
2463
2465
  },
2464
2466
  // Exit modal mode (only available in inline mode)
2465
2467
  exit: function exit() {
2466
- var _this10 = this;
2468
+ var _this0 = this;
2467
2469
  var options = this.options,
2468
2470
  viewer = this.viewer,
2469
2471
  image = this.image,
@@ -2495,7 +2497,7 @@ var methods = {
2495
2497
  this.renderList();
2496
2498
  if (this.viewed) {
2497
2499
  this.initImage(function () {
2498
- _this10.renderImage(function () {
2500
+ _this0.renderImage(function () {
2499
2501
  if (options.transition) {
2500
2502
  setTimeout(function () {
2501
2503
  addClass(image, CLASS_TRANSITION);
@@ -2509,7 +2511,7 @@ var methods = {
2509
2511
  },
2510
2512
  // Show the current ratio of the image with percentage
2511
2513
  tooltip: function tooltip() {
2512
- var _this11 = this;
2514
+ var _this1 = this;
2513
2515
  var options = this.options,
2514
2516
  tooltipBox = this.tooltipBox,
2515
2517
  imageData = this.imageData;
@@ -2544,17 +2546,17 @@ var methods = {
2544
2546
  removeClass(tooltipBox, CLASS_FADE);
2545
2547
  removeClass(tooltipBox, CLASS_TRANSITION);
2546
2548
  tooltipBox.setAttribute('aria-hidden', true);
2547
- _this11.fading = false;
2549
+ _this1.fading = false;
2548
2550
  }, {
2549
2551
  once: true
2550
2552
  });
2551
2553
  removeClass(tooltipBox, CLASS_IN);
2552
- _this11.fading = true;
2554
+ _this1.fading = true;
2553
2555
  } else {
2554
2556
  removeClass(tooltipBox, CLASS_SHOW);
2555
2557
  tooltipBox.setAttribute('aria-hidden', true);
2556
2558
  }
2557
- _this11.tooltipping = false;
2559
+ _this1.tooltipping = false;
2558
2560
  }, 1000);
2559
2561
  return this;
2560
2562
  },
@@ -2582,7 +2584,7 @@ var methods = {
2582
2584
  },
2583
2585
  // Update viewer when images changed
2584
2586
  update: function update() {
2585
- var _this12 = this;
2587
+ var _this10 = this;
2586
2588
  var element = this.element,
2587
2589
  options = this.options,
2588
2590
  isImg = this.isImg;
@@ -2594,10 +2596,10 @@ var methods = {
2594
2596
  var images = [];
2595
2597
  forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
2596
2598
  if (isFunction(options.filter)) {
2597
- if (options.filter.call(_this12, image)) {
2599
+ if (options.filter.call(_this10, image)) {
2598
2600
  images.push(image);
2599
2601
  }
2600
- } else if (_this12.getImageURL(image)) {
2602
+ } else if (_this10.getImageURL(image)) {
2601
2603
  images.push(image);
2602
2604
  }
2603
2605
  });
@@ -2785,7 +2787,7 @@ var others = {
2785
2787
  var element = this.element,
2786
2788
  options = this.options,
2787
2789
  viewer = this.viewer;
2788
- if (options.fucus) {
2790
+ if (options.focus) {
2789
2791
  this.clearEnforceFocus();
2790
2792
  }
2791
2793
  this.close();
package/dist/viewer.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.11.7
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: 2024-11-24T04:32:19.116Z
8
+ * Date: 2026-07-18T13:41:00.752Z
9
9
  */
10
10
 
11
11
  (function (global, factory) {
@@ -418,9 +418,9 @@
418
418
  return false;
419
419
  }
420
420
  try {
421
- var _constructor = value.constructor;
422
- var prototype = _constructor.prototype;
423
- return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
421
+ var constructor = value.constructor;
422
+ var prototype = constructor.prototype;
423
+ return constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
424
424
  } catch (error) {
425
425
  return false;
426
426
  }
@@ -1078,9 +1078,11 @@
1078
1078
  var list = this.list;
1079
1079
  list.innerHTML = '';
1080
1080
  removeClass(list, CLASS_TRANSITION);
1081
- setStyle(list, getTransforms({
1081
+ setStyle(list, assign({
1082
+ width: 0
1083
+ }, getTransforms({
1082
1084
  translateX: 0
1083
- }));
1085
+ })));
1084
1086
  },
1085
1087
  initImage: function initImage(done) {
1086
1088
  var _this2 = this;
@@ -2469,7 +2471,7 @@
2469
2471
  },
2470
2472
  // Exit modal mode (only available in inline mode)
2471
2473
  exit: function exit() {
2472
- var _this10 = this;
2474
+ var _this0 = this;
2473
2475
  var options = this.options,
2474
2476
  viewer = this.viewer,
2475
2477
  image = this.image,
@@ -2501,7 +2503,7 @@
2501
2503
  this.renderList();
2502
2504
  if (this.viewed) {
2503
2505
  this.initImage(function () {
2504
- _this10.renderImage(function () {
2506
+ _this0.renderImage(function () {
2505
2507
  if (options.transition) {
2506
2508
  setTimeout(function () {
2507
2509
  addClass(image, CLASS_TRANSITION);
@@ -2515,7 +2517,7 @@
2515
2517
  },
2516
2518
  // Show the current ratio of the image with percentage
2517
2519
  tooltip: function tooltip() {
2518
- var _this11 = this;
2520
+ var _this1 = this;
2519
2521
  var options = this.options,
2520
2522
  tooltipBox = this.tooltipBox,
2521
2523
  imageData = this.imageData;
@@ -2550,17 +2552,17 @@
2550
2552
  removeClass(tooltipBox, CLASS_FADE);
2551
2553
  removeClass(tooltipBox, CLASS_TRANSITION);
2552
2554
  tooltipBox.setAttribute('aria-hidden', true);
2553
- _this11.fading = false;
2555
+ _this1.fading = false;
2554
2556
  }, {
2555
2557
  once: true
2556
2558
  });
2557
2559
  removeClass(tooltipBox, CLASS_IN);
2558
- _this11.fading = true;
2560
+ _this1.fading = true;
2559
2561
  } else {
2560
2562
  removeClass(tooltipBox, CLASS_SHOW);
2561
2563
  tooltipBox.setAttribute('aria-hidden', true);
2562
2564
  }
2563
- _this11.tooltipping = false;
2565
+ _this1.tooltipping = false;
2564
2566
  }, 1000);
2565
2567
  return this;
2566
2568
  },
@@ -2588,7 +2590,7 @@
2588
2590
  },
2589
2591
  // Update viewer when images changed
2590
2592
  update: function update() {
2591
- var _this12 = this;
2593
+ var _this10 = this;
2592
2594
  var element = this.element,
2593
2595
  options = this.options,
2594
2596
  isImg = this.isImg;
@@ -2600,10 +2602,10 @@
2600
2602
  var images = [];
2601
2603
  forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
2602
2604
  if (isFunction(options.filter)) {
2603
- if (options.filter.call(_this12, image)) {
2605
+ if (options.filter.call(_this10, image)) {
2604
2606
  images.push(image);
2605
2607
  }
2606
- } else if (_this12.getImageURL(image)) {
2608
+ } else if (_this10.getImageURL(image)) {
2607
2609
  images.push(image);
2608
2610
  }
2609
2611
  });
@@ -2791,7 +2793,7 @@
2791
2793
  var element = this.element,
2792
2794
  options = this.options,
2793
2795
  viewer = this.viewer;
2794
- if (options.fucus) {
2796
+ if (options.focus) {
2795
2797
  this.clearEnforceFocus();
2796
2798
  }
2797
2799
  this.close();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viewerjs",
3
3
  "description": "JavaScript image viewer.",
4
- "version": "1.11.7",
4
+ "version": "1.11.8",
5
5
  "main": "dist/viewer.common.js",
6
6
  "module": "dist/viewer.esm.js",
7
7
  "browser": "dist/viewer.js",
@@ -56,8 +56,8 @@
56
56
  },
57
57
  "homepage": "https://fengyuanchen.github.io/viewerjs",
58
58
  "devDependencies": {
59
- "@babel/core": "^7.26.0",
60
- "@babel/preset-env": "^7.26.0",
59
+ "@babel/core": "^7.29.7",
60
+ "@babel/preset-env": "^7.29.7",
61
61
  "@commitlint/cli": "^17.8.1",
62
62
  "@commitlint/config-conventional": "^17.8.1",
63
63
  "@rollup/plugin-babel": "^5.3.1",
@@ -71,7 +71,7 @@
71
71
  "del-cli": "^5.1.0",
72
72
  "eslint": "^8.49.0",
73
73
  "eslint-config-airbnb-base": "^15.0.0",
74
- "eslint-plugin-import": "^2.31.0",
74
+ "eslint-plugin-import": "^2.32.0",
75
75
  "husky": "^8.0.3",
76
76
  "karma": "^6.4.4",
77
77
  "karma-chai": "^0.1.0",
@@ -83,14 +83,14 @@
83
83
  "lint-staged": "^13.3.0",
84
84
  "mocha": "^9.2.2",
85
85
  "npm-run-all": "^4.1.5",
86
- "postcss": "^8.4.49",
86
+ "postcss": "^8.5.19",
87
87
  "postcss-cli": "^10.1.0",
88
88
  "postcss-header": "^3.0.3",
89
89
  "postcss-import": "^15.1.0",
90
90
  "postcss-preset-env": "^7.8.3",
91
- "postcss-url": "^10.1.3",
91
+ "postcss-url": "^10.1.4",
92
92
  "puppeteer": "^19.11.1",
93
- "rollup": "^2.79.2",
93
+ "rollup": "^2.80.0",
94
94
  "stylelint": "^13.13.1",
95
95
  "stylelint-config-standard": "^22.0.0",
96
96
  "stylelint-order": "^4.1.0",
package/src/js/others.js CHANGED
@@ -118,7 +118,7 @@ export default {
118
118
  hidden() {
119
119
  const { element, options, viewer } = this;
120
120
 
121
- if (options.fucus) {
121
+ if (options.focus) {
122
122
  this.clearEnforceFocus();
123
123
  }
124
124
 
package/src/js/render.js CHANGED
@@ -187,9 +187,11 @@ export default {
187
187
 
188
188
  list.innerHTML = '';
189
189
  removeClass(list, CLASS_TRANSITION);
190
- setStyle(list, getTransforms({
190
+ setStyle(list, assign({
191
+ width: 0,
192
+ }, getTransforms({
191
193
  translateX: 0,
192
- }));
194
+ })));
193
195
  },
194
196
 
195
197
  initImage(done) {