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
  */
@@ -81,7 +81,7 @@
81
81
 
82
82
  functionBindNative = !fails(function () {
83
83
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
84
- var test = (function () { /* empty */ }).bind();
84
+ var test = function () { /* empty */ }.bind();
85
85
  // eslint-disable-next-line no-prototype-builtins -- safe
86
86
  return typeof test != 'function' || test.hasOwnProperty('prototype');
87
87
  });
@@ -560,10 +560,10 @@
560
560
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
561
561
 
562
562
  (store.versions || (store.versions = [])).push({
563
- version: '3.42.0',
563
+ version: '3.49.0',
564
564
  mode: IS_PURE ? 'pure' : 'global',
565
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
566
- license: 'https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE',
565
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
566
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
567
567
  source: 'https://github.com/zloirock/core-js'
568
568
  });
569
569
  return sharedStore.exports;
@@ -631,7 +631,7 @@
631
631
 
632
632
  var id = 0;
633
633
  var postfix = Math.random();
634
- var toString = uncurryThis(1.0.toString);
634
+ var toString = uncurryThis(1.1.toString);
635
635
 
636
636
  uid = function (key) {
637
637
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
@@ -916,7 +916,7 @@
916
916
 
917
917
  var EXISTS = hasOwn(FunctionPrototype, 'name');
918
918
  // additional protection from minified / mangled / dropped function names
919
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
919
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
920
920
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
921
921
 
922
922
  functionName = {
@@ -1658,7 +1658,7 @@
1658
1658
 
1659
1659
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1660
1660
  var test = {};
1661
-
1661
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1662
1662
  test[TO_STRING_TAG] = 'z';
1663
1663
 
1664
1664
  toStringTagSupport = String(test) === '[object z]';
@@ -1780,6 +1780,58 @@
1780
1780
  return createProperty;
1781
1781
  }
1782
1782
 
1783
+ var isArray;
1784
+ var hasRequiredIsArray;
1785
+
1786
+ function requireIsArray () {
1787
+ if (hasRequiredIsArray) return isArray;
1788
+ hasRequiredIsArray = 1;
1789
+ var classof = requireClassofRaw();
1790
+
1791
+ // `IsArray` abstract operation
1792
+ // https://tc39.es/ecma262/#sec-isarray
1793
+ // eslint-disable-next-line es/no-array-isarray -- safe
1794
+ isArray = Array.isArray || function isArray(argument) {
1795
+ return classof(argument) === 'Array';
1796
+ };
1797
+ return isArray;
1798
+ }
1799
+
1800
+ var arraySetLength;
1801
+ var hasRequiredArraySetLength;
1802
+
1803
+ function requireArraySetLength () {
1804
+ if (hasRequiredArraySetLength) return arraySetLength;
1805
+ hasRequiredArraySetLength = 1;
1806
+ var DESCRIPTORS = requireDescriptors();
1807
+ var isArray = requireIsArray();
1808
+
1809
+ var $TypeError = TypeError;
1810
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1811
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1812
+
1813
+ // Safari < 13 does not throw an error in this case
1814
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
1815
+ // makes no sense without proper strict mode support
1816
+ if (this !== undefined) return true;
1817
+ try {
1818
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1819
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
1820
+ } catch (error) {
1821
+ return error instanceof TypeError;
1822
+ }
1823
+ }();
1824
+
1825
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1826
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1827
+ throw new $TypeError('Cannot set read only .length');
1828
+ } return O.length = length;
1829
+ } : function (O, length) {
1830
+ return O.length = length;
1831
+ };
1832
+ return arraySetLength;
1833
+ }
1834
+
1783
1835
  var getIteratorMethod;
1784
1836
  var hasRequiredGetIteratorMethod;
1785
1837
 
@@ -1838,20 +1890,22 @@
1838
1890
  var isConstructor = requireIsConstructor();
1839
1891
  var lengthOfArrayLike = requireLengthOfArrayLike();
1840
1892
  var createProperty = requireCreateProperty();
1893
+ var setArrayLength = requireArraySetLength();
1841
1894
  var getIterator = requireGetIterator();
1842
1895
  var getIteratorMethod = requireGetIteratorMethod();
1896
+ var iteratorClose = requireIteratorClose();
1843
1897
 
1844
1898
  var $Array = Array;
1845
1899
 
1846
1900
  // `Array.from` method implementation
1847
1901
  // https://tc39.es/ecma262/#sec-array.from
1848
1902
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
1849
- var O = toObject(arrayLike);
1850
1903
  var IS_CONSTRUCTOR = isConstructor(this);
1851
1904
  var argumentsLength = arguments.length;
1852
1905
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1853
1906
  var mapping = mapfn !== undefined;
1854
1907
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1908
+ var O = toObject(arrayLike);
1855
1909
  var iteratorMethod = getIteratorMethod(O);
1856
1910
  var index = 0;
1857
1911
  var length, result, step, iterator, next, value;
@@ -1862,7 +1916,11 @@
1862
1916
  next = iterator.next;
1863
1917
  for (;!(step = call(next, iterator)).done; index++) {
1864
1918
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1865
- createProperty(result, index, value);
1919
+ try {
1920
+ createProperty(result, index, value);
1921
+ } catch (error) {
1922
+ iteratorClose(iterator, 'throw', error);
1923
+ }
1866
1924
  }
1867
1925
  } else {
1868
1926
  length = lengthOfArrayLike(O);
@@ -1872,7 +1930,7 @@
1872
1930
  createProperty(result, index, value);
1873
1931
  }
1874
1932
  }
1875
- result.length = index;
1933
+ setArrayLength(result, index);
1876
1934
  return result;
1877
1935
  };
1878
1936
  return arrayFrom;
@@ -1899,6 +1957,7 @@
1899
1957
  SAFE_CLOSING = true;
1900
1958
  }
1901
1959
  };
1960
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1902
1961
  iteratorWithReturn[ITERATOR] = function () {
1903
1962
  return this;
1904
1963
  };
@@ -1913,6 +1972,7 @@
1913
1972
  var ITERATION_SUPPORT = false;
1914
1973
  try {
1915
1974
  var object = {};
1975
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1916
1976
  object[ITERATOR] = function () {
1917
1977
  return {
1918
1978
  next: function () {
@@ -1996,6 +2056,18 @@
1996
2056
  return environmentIsNode;
1997
2057
  }
1998
2058
 
2059
+ var path;
2060
+ var hasRequiredPath;
2061
+
2062
+ function requirePath () {
2063
+ if (hasRequiredPath) return path;
2064
+ hasRequiredPath = 1;
2065
+ var globalThis = requireGlobalThis();
2066
+
2067
+ path = globalThis;
2068
+ return path;
2069
+ }
2070
+
1999
2071
  var functionUncurryThisAccessor;
2000
2072
  var hasRequiredFunctionUncurryThisAccessor;
2001
2073
 
@@ -2272,8 +2344,7 @@
2272
2344
  hasRequiredEnvironmentIsIos = 1;
2273
2345
  var userAgent = requireEnvironmentUserAgent();
2274
2346
 
2275
- // eslint-disable-next-line redos/no-vulnerable -- safe
2276
- environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
2347
+ environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
2277
2348
  return environmentIsIos;
2278
2349
  }
2279
2350
 
@@ -2704,6 +2775,7 @@
2704
2775
  var IS_PURE = requireIsPure();
2705
2776
  var IS_NODE = requireEnvironmentIsNode();
2706
2777
  var globalThis = requireGlobalThis();
2778
+ var path = requirePath();
2707
2779
  var call = requireFunctionCall();
2708
2780
  var defineBuiltIn = requireDefineBuiltIn();
2709
2781
  var setPrototypeOf = requireObjectSetPrototypeOf();
@@ -2987,6 +3059,8 @@
2987
3059
  Promise: PromiseConstructor
2988
3060
  });
2989
3061
 
3062
+ PromiseWrapper = path.Promise;
3063
+
2990
3064
  setToStringTag(PromiseConstructor, PROMISE, false, true);
2991
3065
  setSpecies(PROMISE);
2992
3066
  return es_promise_constructor;
@@ -3030,7 +3104,9 @@
3030
3104
  var iterator, iterFn, index, length, result, next, step;
3031
3105
 
3032
3106
  var stop = function (condition) {
3033
- if (iterator) iteratorClose(iterator, 'normal', condition);
3107
+ var $iterator = iterator;
3108
+ iterator = undefined;
3109
+ if ($iterator) iteratorClose($iterator, 'normal');
3034
3110
  return new Result(true, condition);
3035
3111
  };
3036
3112
 
@@ -3060,10 +3136,13 @@
3060
3136
 
3061
3137
  next = IS_RECORD ? iterable.next : iterator.next;
3062
3138
  while (!(step = call(next, iterator)).done) {
3139
+ // `IteratorValue` errors should propagate without closing the iterator
3140
+ var value = step.value;
3063
3141
  try {
3064
- result = callFn(step.value);
3142
+ result = callFn(value);
3065
3143
  } catch (error) {
3066
- iteratorClose(iterator, 'throw', error);
3144
+ if (iterator) iteratorClose(iterator, 'throw', error);
3145
+ else throw error;
3067
3146
  }
3068
3147
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3069
3148
  } return new Result(false);
@@ -3480,9 +3559,15 @@
3480
3559
  return !Array(1).includes();
3481
3560
  });
3482
3561
 
3562
+ // Safari 26.4- bug
3563
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
3564
+ // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
3565
+ return [, 1].includes(undefined, 1);
3566
+ });
3567
+
3483
3568
  // `Array.prototype.includes` method
3484
3569
  // https://tc39.es/ecma262/#sec-array.prototype.includes
3485
- $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3570
+ $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
3486
3571
  includes: function includes(el /* , fromIndex = 0 */) {
3487
3572
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3488
3573
  }
@@ -4493,11 +4578,11 @@
4493
4578
  case 'repeat':
4494
4579
  return 'animation: 200s linear 0s infinite alternate watermark !important;';
4495
4580
  case 'repeat-x':
4496
- return "animation: ".concat(horizontalDuration, "s ease-in 0s infinite alternate watermark-vertical !important;'");
4581
+ return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-vertical !important;'");
4497
4582
  case 'repeat-y':
4498
- return "animation: ".concat(verticalDuration, "s ease-out 0s infinite alternate watermark-horizontal !important;'");
4583
+ return "animation: ".concat(verticalDuration, "s linear 0s infinite alternate watermark-horizontal !important;'");
4499
4584
  case 'no-repeat':
4500
- return "animation: ".concat(horizontalDuration, "s ease-in 0s infinite alternate watermark-horizontal, ").concat(verticalDuration, "s ease-out 0s infinite alternate watermark-vertical !important;");
4585
+ return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-horizontal, ").concat(verticalDuration, "s linear 0s infinite alternate watermark-vertical !important;");
4501
4586
  default:
4502
4587
  return '';
4503
4588
  }
@@ -5340,26 +5425,22 @@
5340
5425
  characterData: true, // 节点内容或节点文本的变动。
5341
5426
  });
5342
5427
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
5343
- var _i, mutationsList_1, item;
5344
- var _a;
5345
- return __generator(this, function (_b) {
5346
- switch (_b.label) {
5428
+ var _i, mutationsList_1, item, watermarkRemoved;
5429
+ return __generator(this, function (_a) {
5430
+ switch (_a.label) {
5347
5431
  case 0:
5348
5432
  _i = 0, mutationsList_1 = mutationsList;
5349
- _b.label = 1;
5433
+ _a.label = 1;
5350
5434
  case 1:
5351
5435
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
5352
5436
  item = mutationsList_1[_i];
5353
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
5354
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
5355
- (item.type === 'childList' &&
5356
- item.target === this.parentElement &&
5357
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
5437
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
5438
+ if (!watermarkRemoved) return [3 /*break*/, 3];
5358
5439
  this.remove();
5359
5440
  return [4 /*yield*/, this.create()];
5360
5441
  case 2:
5361
- _b.sent();
5362
- _b.label = 3;
5442
+ _a.sent();
5443
+ _a.label = 3;
5363
5444
  case 3:
5364
5445
  _i++;
5365
5446
  return [3 /*break*/, 1];
@@ -5368,10 +5449,7 @@
5368
5449
  });
5369
5450
  }); });
5370
5451
  this.parentObserve.observe(this.parentElement, {
5371
- attributes: true, // 属性的变动
5372
5452
  childList: true, // 子节点的变动(指新增,删除或者更改)
5373
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
5374
- characterData: true, // 节点内容或节点文本的变动。
5375
5453
  });
5376
5454
  };
5377
5455
  return Watermark;