watermark-js-plus 1.6.2 → 1.6.4

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 (50) hide show
  1. package/dist/es/src/core/watermark.js +8 -15
  2. package/dist/es/src/utils/index.js +3 -3
  3. package/dist/ie/es/node_modules/core-js/internals/array-from.js +11 -3
  4. package/dist/ie/es/node_modules/core-js/internals/array-set-length.js +39 -0
  5. package/dist/ie/es/node_modules/core-js/internals/check-correctness-of-iteration.js +2 -0
  6. package/dist/ie/es/node_modules/core-js/internals/environment-is-ios.js +1 -2
  7. package/dist/ie/es/node_modules/core-js/internals/function-bind-native.js +1 -1
  8. package/dist/ie/es/node_modules/core-js/internals/function-name.js +1 -1
  9. package/dist/ie/es/node_modules/core-js/internals/is-array.js +20 -0
  10. package/dist/ie/es/node_modules/core-js/internals/iterate.js +8 -3
  11. package/dist/ie/es/node_modules/core-js/internals/path.js +15 -0
  12. package/dist/ie/es/node_modules/core-js/internals/shared-store.js +3 -3
  13. package/dist/ie/es/node_modules/core-js/internals/to-string-tag-support.js +1 -1
  14. package/dist/ie/es/node_modules/core-js/internals/uid.js +1 -1
  15. package/dist/ie/es/node_modules/core-js/modules/es.array.fill.js +1 -1
  16. package/dist/ie/es/node_modules/core-js/modules/es.array.from.js +1 -1
  17. package/dist/ie/es/node_modules/core-js/modules/es.array.includes.js +8 -2
  18. package/dist/ie/es/node_modules/core-js/modules/es.promise.constructor.js +4 -0
  19. package/dist/ie/es/node_modules/core-js/modules/es.promise.js +1 -1
  20. package/dist/ie/es/src/core/watermark.js +8 -15
  21. package/dist/ie/es/src/utils/index.js +3 -3
  22. package/dist/ie/index.cjs.js +113 -35
  23. package/dist/ie/index.cjs.js.map +1 -1
  24. package/dist/ie/index.cjs.min.js +1 -1
  25. package/dist/ie/index.esm.js +113 -35
  26. package/dist/ie/index.esm.js.map +1 -1
  27. package/dist/ie/index.esm.min.js +1 -1
  28. package/dist/ie/index.iife.js +113 -35
  29. package/dist/ie/index.iife.js.map +1 -1
  30. package/dist/ie/index.iife.min.js +1 -1
  31. package/dist/ie/index.umd.js +113 -35
  32. package/dist/ie/index.umd.js.map +1 -1
  33. package/dist/ie/index.umd.min.js +1 -1
  34. package/dist/index.cjs.js +12 -19
  35. package/dist/index.cjs.js.map +1 -1
  36. package/dist/index.cjs.min.js +1 -1
  37. package/dist/index.esm.js +12 -19
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.esm.min.js +1 -1
  40. package/dist/index.iife.js +12 -19
  41. package/dist/index.iife.js.map +1 -1
  42. package/dist/index.iife.min.js +1 -1
  43. package/dist/index.umd.js +12 -19
  44. package/dist/index.umd.js.map +1 -1
  45. package/dist/index.umd.min.js +1 -1
  46. package/package.json +57 -51
  47. /package/dist/ie/es/_virtual/{es.array.fill2.js → es2.array.fill.js} +0 -0
  48. /package/dist/ie/es/_virtual/{es.array.from2.js → es2.array.from.js} +0 -0
  49. /package/dist/ie/es/_virtual/{es.array.includes2.js → es2.array.includes.js} +0 -0
  50. /package/dist/ie/es/_virtual/{es.promise2.js → es2.promise.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * watermark-js-plus v1.6.2
2
+ * watermark-js-plus v1.6.4
3
3
  * (c) 2022-2024 Michael Sun
4
4
  * Released under the MIT License.
5
5
  */
@@ -78,7 +78,7 @@ var WatermarkPlus = (function (exports) {
78
78
 
79
79
  functionBindNative = !fails(function () {
80
80
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
81
- var test = (function () { /* empty */ }).bind();
81
+ var test = function () { /* empty */ }.bind();
82
82
  // eslint-disable-next-line no-prototype-builtins -- safe
83
83
  return typeof test != 'function' || test.hasOwnProperty('prototype');
84
84
  });
@@ -557,10 +557,10 @@ var WatermarkPlus = (function (exports) {
557
557
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
558
558
 
559
559
  (store.versions || (store.versions = [])).push({
560
- version: '3.42.0',
560
+ version: '3.49.0',
561
561
  mode: IS_PURE ? 'pure' : 'global',
562
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
563
- license: 'https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE',
562
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
563
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
564
564
  source: 'https://github.com/zloirock/core-js'
565
565
  });
566
566
  return sharedStore.exports;
@@ -628,7 +628,7 @@ var WatermarkPlus = (function (exports) {
628
628
 
629
629
  var id = 0;
630
630
  var postfix = Math.random();
631
- var toString = uncurryThis(1.0.toString);
631
+ var toString = uncurryThis(1.1.toString);
632
632
 
633
633
  uid = function (key) {
634
634
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
@@ -913,7 +913,7 @@ var WatermarkPlus = (function (exports) {
913
913
 
914
914
  var EXISTS = hasOwn(FunctionPrototype, 'name');
915
915
  // additional protection from minified / mangled / dropped function names
916
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
916
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
917
917
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
918
918
 
919
919
  functionName = {
@@ -1655,7 +1655,7 @@ var WatermarkPlus = (function (exports) {
1655
1655
 
1656
1656
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1657
1657
  var test = {};
1658
-
1658
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1659
1659
  test[TO_STRING_TAG] = 'z';
1660
1660
 
1661
1661
  toStringTagSupport = String(test) === '[object z]';
@@ -1777,6 +1777,58 @@ var WatermarkPlus = (function (exports) {
1777
1777
  return createProperty;
1778
1778
  }
1779
1779
 
1780
+ var isArray;
1781
+ var hasRequiredIsArray;
1782
+
1783
+ function requireIsArray () {
1784
+ if (hasRequiredIsArray) return isArray;
1785
+ hasRequiredIsArray = 1;
1786
+ var classof = requireClassofRaw();
1787
+
1788
+ // `IsArray` abstract operation
1789
+ // https://tc39.es/ecma262/#sec-isarray
1790
+ // eslint-disable-next-line es/no-array-isarray -- safe
1791
+ isArray = Array.isArray || function isArray(argument) {
1792
+ return classof(argument) === 'Array';
1793
+ };
1794
+ return isArray;
1795
+ }
1796
+
1797
+ var arraySetLength;
1798
+ var hasRequiredArraySetLength;
1799
+
1800
+ function requireArraySetLength () {
1801
+ if (hasRequiredArraySetLength) return arraySetLength;
1802
+ hasRequiredArraySetLength = 1;
1803
+ var DESCRIPTORS = requireDescriptors();
1804
+ var isArray = requireIsArray();
1805
+
1806
+ var $TypeError = TypeError;
1807
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1808
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1809
+
1810
+ // Safari < 13 does not throw an error in this case
1811
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
1812
+ // makes no sense without proper strict mode support
1813
+ if (this !== undefined) return true;
1814
+ try {
1815
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1816
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
1817
+ } catch (error) {
1818
+ return error instanceof TypeError;
1819
+ }
1820
+ }();
1821
+
1822
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1823
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1824
+ throw new $TypeError('Cannot set read only .length');
1825
+ } return O.length = length;
1826
+ } : function (O, length) {
1827
+ return O.length = length;
1828
+ };
1829
+ return arraySetLength;
1830
+ }
1831
+
1780
1832
  var getIteratorMethod;
1781
1833
  var hasRequiredGetIteratorMethod;
1782
1834
 
@@ -1835,20 +1887,22 @@ var WatermarkPlus = (function (exports) {
1835
1887
  var isConstructor = requireIsConstructor();
1836
1888
  var lengthOfArrayLike = requireLengthOfArrayLike();
1837
1889
  var createProperty = requireCreateProperty();
1890
+ var setArrayLength = requireArraySetLength();
1838
1891
  var getIterator = requireGetIterator();
1839
1892
  var getIteratorMethod = requireGetIteratorMethod();
1893
+ var iteratorClose = requireIteratorClose();
1840
1894
 
1841
1895
  var $Array = Array;
1842
1896
 
1843
1897
  // `Array.from` method implementation
1844
1898
  // https://tc39.es/ecma262/#sec-array.from
1845
1899
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
1846
- var O = toObject(arrayLike);
1847
1900
  var IS_CONSTRUCTOR = isConstructor(this);
1848
1901
  var argumentsLength = arguments.length;
1849
1902
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1850
1903
  var mapping = mapfn !== undefined;
1851
1904
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1905
+ var O = toObject(arrayLike);
1852
1906
  var iteratorMethod = getIteratorMethod(O);
1853
1907
  var index = 0;
1854
1908
  var length, result, step, iterator, next, value;
@@ -1859,7 +1913,11 @@ var WatermarkPlus = (function (exports) {
1859
1913
  next = iterator.next;
1860
1914
  for (;!(step = call(next, iterator)).done; index++) {
1861
1915
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1862
- createProperty(result, index, value);
1916
+ try {
1917
+ createProperty(result, index, value);
1918
+ } catch (error) {
1919
+ iteratorClose(iterator, 'throw', error);
1920
+ }
1863
1921
  }
1864
1922
  } else {
1865
1923
  length = lengthOfArrayLike(O);
@@ -1869,7 +1927,7 @@ var WatermarkPlus = (function (exports) {
1869
1927
  createProperty(result, index, value);
1870
1928
  }
1871
1929
  }
1872
- result.length = index;
1930
+ setArrayLength(result, index);
1873
1931
  return result;
1874
1932
  };
1875
1933
  return arrayFrom;
@@ -1896,6 +1954,7 @@ var WatermarkPlus = (function (exports) {
1896
1954
  SAFE_CLOSING = true;
1897
1955
  }
1898
1956
  };
1957
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1899
1958
  iteratorWithReturn[ITERATOR] = function () {
1900
1959
  return this;
1901
1960
  };
@@ -1910,6 +1969,7 @@ var WatermarkPlus = (function (exports) {
1910
1969
  var ITERATION_SUPPORT = false;
1911
1970
  try {
1912
1971
  var object = {};
1972
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1913
1973
  object[ITERATOR] = function () {
1914
1974
  return {
1915
1975
  next: function () {
@@ -1993,6 +2053,18 @@ var WatermarkPlus = (function (exports) {
1993
2053
  return environmentIsNode;
1994
2054
  }
1995
2055
 
2056
+ var path;
2057
+ var hasRequiredPath;
2058
+
2059
+ function requirePath () {
2060
+ if (hasRequiredPath) return path;
2061
+ hasRequiredPath = 1;
2062
+ var globalThis = requireGlobalThis();
2063
+
2064
+ path = globalThis;
2065
+ return path;
2066
+ }
2067
+
1996
2068
  var functionUncurryThisAccessor;
1997
2069
  var hasRequiredFunctionUncurryThisAccessor;
1998
2070
 
@@ -2269,8 +2341,7 @@ var WatermarkPlus = (function (exports) {
2269
2341
  hasRequiredEnvironmentIsIos = 1;
2270
2342
  var userAgent = requireEnvironmentUserAgent();
2271
2343
 
2272
- // eslint-disable-next-line redos/no-vulnerable -- safe
2273
- environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
2344
+ environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
2274
2345
  return environmentIsIos;
2275
2346
  }
2276
2347
 
@@ -2701,6 +2772,7 @@ var WatermarkPlus = (function (exports) {
2701
2772
  var IS_PURE = requireIsPure();
2702
2773
  var IS_NODE = requireEnvironmentIsNode();
2703
2774
  var globalThis = requireGlobalThis();
2775
+ var path = requirePath();
2704
2776
  var call = requireFunctionCall();
2705
2777
  var defineBuiltIn = requireDefineBuiltIn();
2706
2778
  var setPrototypeOf = requireObjectSetPrototypeOf();
@@ -2984,6 +3056,8 @@ var WatermarkPlus = (function (exports) {
2984
3056
  Promise: PromiseConstructor
2985
3057
  });
2986
3058
 
3059
+ PromiseWrapper = path.Promise;
3060
+
2987
3061
  setToStringTag(PromiseConstructor, PROMISE, false, true);
2988
3062
  setSpecies(PROMISE);
2989
3063
  return es_promise_constructor;
@@ -3027,7 +3101,9 @@ var WatermarkPlus = (function (exports) {
3027
3101
  var iterator, iterFn, index, length, result, next, step;
3028
3102
 
3029
3103
  var stop = function (condition) {
3030
- if (iterator) iteratorClose(iterator, 'normal', condition);
3104
+ var $iterator = iterator;
3105
+ iterator = undefined;
3106
+ if ($iterator) iteratorClose($iterator, 'normal');
3031
3107
  return new Result(true, condition);
3032
3108
  };
3033
3109
 
@@ -3057,10 +3133,13 @@ var WatermarkPlus = (function (exports) {
3057
3133
 
3058
3134
  next = IS_RECORD ? iterable.next : iterator.next;
3059
3135
  while (!(step = call(next, iterator)).done) {
3136
+ // `IteratorValue` errors should propagate without closing the iterator
3137
+ var value = step.value;
3060
3138
  try {
3061
- result = callFn(step.value);
3139
+ result = callFn(value);
3062
3140
  } catch (error) {
3063
- iteratorClose(iterator, 'throw', error);
3141
+ if (iterator) iteratorClose(iterator, 'throw', error);
3142
+ else throw error;
3064
3143
  }
3065
3144
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3066
3145
  } return new Result(false);
@@ -3477,9 +3556,15 @@ var WatermarkPlus = (function (exports) {
3477
3556
  return !Array(1).includes();
3478
3557
  });
3479
3558
 
3559
+ // Safari 26.4- bug
3560
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
3561
+ // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
3562
+ return [, 1].includes(undefined, 1);
3563
+ });
3564
+
3480
3565
  // `Array.prototype.includes` method
3481
3566
  // https://tc39.es/ecma262/#sec-array.prototype.includes
3482
- $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3567
+ $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
3483
3568
  includes: function includes(el /* , fromIndex = 0 */) {
3484
3569
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3485
3570
  }
@@ -4490,11 +4575,11 @@ var WatermarkPlus = (function (exports) {
4490
4575
  case 'repeat':
4491
4576
  return 'animation: 200s linear 0s infinite alternate watermark !important;';
4492
4577
  case 'repeat-x':
4493
- return "animation: ".concat(horizontalDuration, "s ease-in 0s infinite alternate watermark-vertical !important;'");
4578
+ return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-vertical !important;'");
4494
4579
  case 'repeat-y':
4495
- return "animation: ".concat(verticalDuration, "s ease-out 0s infinite alternate watermark-horizontal !important;'");
4580
+ return "animation: ".concat(verticalDuration, "s linear 0s infinite alternate watermark-horizontal !important;'");
4496
4581
  case 'no-repeat':
4497
- return "animation: ".concat(horizontalDuration, "s ease-in 0s infinite alternate watermark-horizontal, ").concat(verticalDuration, "s ease-out 0s infinite alternate watermark-vertical !important;");
4582
+ return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-horizontal, ").concat(verticalDuration, "s linear 0s infinite alternate watermark-vertical !important;");
4498
4583
  default:
4499
4584
  return '';
4500
4585
  }
@@ -5337,26 +5422,22 @@ var WatermarkPlus = (function (exports) {
5337
5422
  characterData: true, // 节点内容或节点文本的变动。
5338
5423
  });
5339
5424
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
5340
- var _i, mutationsList_1, item;
5341
- var _a;
5342
- return __generator(this, function (_b) {
5343
- switch (_b.label) {
5425
+ var _i, mutationsList_1, item, watermarkRemoved;
5426
+ return __generator(this, function (_a) {
5427
+ switch (_a.label) {
5344
5428
  case 0:
5345
5429
  _i = 0, mutationsList_1 = mutationsList;
5346
- _b.label = 1;
5430
+ _a.label = 1;
5347
5431
  case 1:
5348
5432
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
5349
5433
  item = mutationsList_1[_i];
5350
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
5351
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
5352
- (item.type === 'childList' &&
5353
- item.target === this.parentElement &&
5354
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
5434
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
5435
+ if (!watermarkRemoved) return [3 /*break*/, 3];
5355
5436
  this.remove();
5356
5437
  return [4 /*yield*/, this.create()];
5357
5438
  case 2:
5358
- _b.sent();
5359
- _b.label = 3;
5439
+ _a.sent();
5440
+ _a.label = 3;
5360
5441
  case 3:
5361
5442
  _i++;
5362
5443
  return [3 /*break*/, 1];
@@ -5365,10 +5446,7 @@ var WatermarkPlus = (function (exports) {
5365
5446
  });
5366
5447
  }); });
5367
5448
  this.parentObserve.observe(this.parentElement, {
5368
- attributes: true, // 属性的变动
5369
5449
  childList: true, // 子节点的变动(指新增,删除或者更改)
5370
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
5371
- characterData: true, // 节点内容或节点文本的变动。
5372
5450
  });
5373
5451
  };
5374
5452
  return Watermark;