watermark-js-plus 1.6.3 → 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 (45) hide show
  1. package/dist/es/src/core/watermark.js +8 -15
  2. package/dist/ie/es/node_modules/core-js/internals/array-from.js +11 -3
  3. package/dist/ie/es/node_modules/core-js/internals/array-set-length.js +39 -0
  4. package/dist/ie/es/node_modules/core-js/internals/check-correctness-of-iteration.js +2 -0
  5. package/dist/ie/es/node_modules/core-js/internals/environment-is-ios.js +1 -2
  6. package/dist/ie/es/node_modules/core-js/internals/function-bind-native.js +1 -1
  7. package/dist/ie/es/node_modules/core-js/internals/function-name.js +1 -1
  8. package/dist/ie/es/node_modules/core-js/internals/is-array.js +20 -0
  9. package/dist/ie/es/node_modules/core-js/internals/iterate.js +8 -3
  10. package/dist/ie/es/node_modules/core-js/internals/shared-store.js +3 -3
  11. package/dist/ie/es/node_modules/core-js/internals/to-string-tag-support.js +1 -1
  12. package/dist/ie/es/node_modules/core-js/modules/es.array.fill.js +1 -1
  13. package/dist/ie/es/node_modules/core-js/modules/es.array.from.js +1 -1
  14. package/dist/ie/es/node_modules/core-js/modules/es.array.includes.js +8 -2
  15. package/dist/ie/es/node_modules/core-js/modules/es.promise.js +1 -1
  16. package/dist/ie/es/src/core/watermark.js +8 -15
  17. package/dist/ie/index.cjs.js +94 -31
  18. package/dist/ie/index.cjs.js.map +1 -1
  19. package/dist/ie/index.cjs.min.js +1 -1
  20. package/dist/ie/index.esm.js +94 -31
  21. package/dist/ie/index.esm.js.map +1 -1
  22. package/dist/ie/index.esm.min.js +1 -1
  23. package/dist/ie/index.iife.js +94 -31
  24. package/dist/ie/index.iife.js.map +1 -1
  25. package/dist/ie/index.iife.min.js +1 -1
  26. package/dist/ie/index.umd.js +94 -31
  27. package/dist/ie/index.umd.js.map +1 -1
  28. package/dist/ie/index.umd.min.js +1 -1
  29. package/dist/index.cjs.js +9 -16
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.cjs.min.js +1 -1
  32. package/dist/index.esm.js +9 -16
  33. package/dist/index.esm.js.map +1 -1
  34. package/dist/index.esm.min.js +1 -1
  35. package/dist/index.iife.js +9 -16
  36. package/dist/index.iife.js.map +1 -1
  37. package/dist/index.iife.min.js +1 -1
  38. package/dist/index.umd.js +9 -16
  39. package/dist/index.umd.js.map +1 -1
  40. package/dist/index.umd.min.js +1 -1
  41. package/package.json +57 -51
  42. /package/dist/ie/es/_virtual/{es.array.fill2.js → es2.array.fill.js} +0 -0
  43. /package/dist/ie/es/_virtual/{es.array.from2.js → es2.array.from.js} +0 -0
  44. /package/dist/ie/es/_virtual/{es.array.includes2.js → es2.array.includes.js} +0 -0
  45. /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.3
2
+ * watermark-js-plus v1.6.4
3
3
  * (c) 2022-2024 Michael Sun
4
4
  * Released under the MIT License.
5
5
  */
@@ -75,7 +75,7 @@ function requireFunctionBindNative () {
75
75
 
76
76
  functionBindNative = !fails(function () {
77
77
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
78
- var test = (function () { /* empty */ }).bind();
78
+ var test = function () { /* empty */ }.bind();
79
79
  // eslint-disable-next-line no-prototype-builtins -- safe
80
80
  return typeof test != 'function' || test.hasOwnProperty('prototype');
81
81
  });
@@ -554,10 +554,10 @@ function requireSharedStore () {
554
554
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
555
555
 
556
556
  (store.versions || (store.versions = [])).push({
557
- version: '3.44.0',
557
+ version: '3.49.0',
558
558
  mode: IS_PURE ? 'pure' : 'global',
559
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
560
- license: 'https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE',
559
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
560
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
561
561
  source: 'https://github.com/zloirock/core-js'
562
562
  });
563
563
  return sharedStore.exports;
@@ -910,7 +910,7 @@ function requireFunctionName () {
910
910
 
911
911
  var EXISTS = hasOwn(FunctionPrototype, 'name');
912
912
  // additional protection from minified / mangled / dropped function names
913
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
913
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
914
914
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
915
915
 
916
916
  functionName = {
@@ -1652,7 +1652,7 @@ function requireToStringTagSupport () {
1652
1652
 
1653
1653
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1654
1654
  var test = {};
1655
-
1655
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1656
1656
  test[TO_STRING_TAG] = 'z';
1657
1657
 
1658
1658
  toStringTagSupport = String(test) === '[object z]';
@@ -1774,6 +1774,58 @@ function requireCreateProperty () {
1774
1774
  return createProperty;
1775
1775
  }
1776
1776
 
1777
+ var isArray;
1778
+ var hasRequiredIsArray;
1779
+
1780
+ function requireIsArray () {
1781
+ if (hasRequiredIsArray) return isArray;
1782
+ hasRequiredIsArray = 1;
1783
+ var classof = requireClassofRaw();
1784
+
1785
+ // `IsArray` abstract operation
1786
+ // https://tc39.es/ecma262/#sec-isarray
1787
+ // eslint-disable-next-line es/no-array-isarray -- safe
1788
+ isArray = Array.isArray || function isArray(argument) {
1789
+ return classof(argument) === 'Array';
1790
+ };
1791
+ return isArray;
1792
+ }
1793
+
1794
+ var arraySetLength;
1795
+ var hasRequiredArraySetLength;
1796
+
1797
+ function requireArraySetLength () {
1798
+ if (hasRequiredArraySetLength) return arraySetLength;
1799
+ hasRequiredArraySetLength = 1;
1800
+ var DESCRIPTORS = requireDescriptors();
1801
+ var isArray = requireIsArray();
1802
+
1803
+ var $TypeError = TypeError;
1804
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1805
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1806
+
1807
+ // Safari < 13 does not throw an error in this case
1808
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
1809
+ // makes no sense without proper strict mode support
1810
+ if (this !== undefined) return true;
1811
+ try {
1812
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1813
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
1814
+ } catch (error) {
1815
+ return error instanceof TypeError;
1816
+ }
1817
+ }();
1818
+
1819
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1820
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1821
+ throw new $TypeError('Cannot set read only .length');
1822
+ } return O.length = length;
1823
+ } : function (O, length) {
1824
+ return O.length = length;
1825
+ };
1826
+ return arraySetLength;
1827
+ }
1828
+
1777
1829
  var getIteratorMethod;
1778
1830
  var hasRequiredGetIteratorMethod;
1779
1831
 
@@ -1832,20 +1884,22 @@ function requireArrayFrom () {
1832
1884
  var isConstructor = requireIsConstructor();
1833
1885
  var lengthOfArrayLike = requireLengthOfArrayLike();
1834
1886
  var createProperty = requireCreateProperty();
1887
+ var setArrayLength = requireArraySetLength();
1835
1888
  var getIterator = requireGetIterator();
1836
1889
  var getIteratorMethod = requireGetIteratorMethod();
1890
+ var iteratorClose = requireIteratorClose();
1837
1891
 
1838
1892
  var $Array = Array;
1839
1893
 
1840
1894
  // `Array.from` method implementation
1841
1895
  // https://tc39.es/ecma262/#sec-array.from
1842
1896
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
1843
- var O = toObject(arrayLike);
1844
1897
  var IS_CONSTRUCTOR = isConstructor(this);
1845
1898
  var argumentsLength = arguments.length;
1846
1899
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1847
1900
  var mapping = mapfn !== undefined;
1848
1901
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1902
+ var O = toObject(arrayLike);
1849
1903
  var iteratorMethod = getIteratorMethod(O);
1850
1904
  var index = 0;
1851
1905
  var length, result, step, iterator, next, value;
@@ -1856,7 +1910,11 @@ function requireArrayFrom () {
1856
1910
  next = iterator.next;
1857
1911
  for (;!(step = call(next, iterator)).done; index++) {
1858
1912
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1859
- createProperty(result, index, value);
1913
+ try {
1914
+ createProperty(result, index, value);
1915
+ } catch (error) {
1916
+ iteratorClose(iterator, 'throw', error);
1917
+ }
1860
1918
  }
1861
1919
  } else {
1862
1920
  length = lengthOfArrayLike(O);
@@ -1866,7 +1924,7 @@ function requireArrayFrom () {
1866
1924
  createProperty(result, index, value);
1867
1925
  }
1868
1926
  }
1869
- result.length = index;
1927
+ setArrayLength(result, index);
1870
1928
  return result;
1871
1929
  };
1872
1930
  return arrayFrom;
@@ -1893,6 +1951,7 @@ function requireCheckCorrectnessOfIteration () {
1893
1951
  SAFE_CLOSING = true;
1894
1952
  }
1895
1953
  };
1954
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1896
1955
  iteratorWithReturn[ITERATOR] = function () {
1897
1956
  return this;
1898
1957
  };
@@ -1907,6 +1966,7 @@ function requireCheckCorrectnessOfIteration () {
1907
1966
  var ITERATION_SUPPORT = false;
1908
1967
  try {
1909
1968
  var object = {};
1969
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1910
1970
  object[ITERATOR] = function () {
1911
1971
  return {
1912
1972
  next: function () {
@@ -2278,8 +2338,7 @@ function requireEnvironmentIsIos () {
2278
2338
  hasRequiredEnvironmentIsIos = 1;
2279
2339
  var userAgent = requireEnvironmentUserAgent();
2280
2340
 
2281
- // eslint-disable-next-line redos/no-vulnerable -- safe
2282
- environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
2341
+ environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
2283
2342
  return environmentIsIos;
2284
2343
  }
2285
2344
 
@@ -3039,7 +3098,9 @@ function requireIterate () {
3039
3098
  var iterator, iterFn, index, length, result, next, step;
3040
3099
 
3041
3100
  var stop = function (condition) {
3042
- if (iterator) iteratorClose(iterator, 'normal');
3101
+ var $iterator = iterator;
3102
+ iterator = undefined;
3103
+ if ($iterator) iteratorClose($iterator, 'normal');
3043
3104
  return new Result(true, condition);
3044
3105
  };
3045
3106
 
@@ -3069,10 +3130,13 @@ function requireIterate () {
3069
3130
 
3070
3131
  next = IS_RECORD ? iterable.next : iterator.next;
3071
3132
  while (!(step = call(next, iterator)).done) {
3133
+ // `IteratorValue` errors should propagate without closing the iterator
3134
+ var value = step.value;
3072
3135
  try {
3073
- result = callFn(step.value);
3136
+ result = callFn(value);
3074
3137
  } catch (error) {
3075
- iteratorClose(iterator, 'throw', error);
3138
+ if (iterator) iteratorClose(iterator, 'throw', error);
3139
+ else throw error;
3076
3140
  }
3077
3141
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3078
3142
  } return new Result(false);
@@ -3489,9 +3553,15 @@ function requireEs_array_includes () {
3489
3553
  return !Array(1).includes();
3490
3554
  });
3491
3555
 
3556
+ // Safari 26.4- bug
3557
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
3558
+ // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
3559
+ return [, 1].includes(undefined, 1);
3560
+ });
3561
+
3492
3562
  // `Array.prototype.includes` method
3493
3563
  // https://tc39.es/ecma262/#sec-array.prototype.includes
3494
- $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3564
+ $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
3495
3565
  includes: function includes(el /* , fromIndex = 0 */) {
3496
3566
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3497
3567
  }
@@ -5349,26 +5419,22 @@ var Watermark = /** @class */ (function () {
5349
5419
  characterData: true, // 节点内容或节点文本的变动。
5350
5420
  });
5351
5421
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
5352
- var _i, mutationsList_1, item;
5353
- var _a;
5354
- return __generator(this, function (_b) {
5355
- switch (_b.label) {
5422
+ var _i, mutationsList_1, item, watermarkRemoved;
5423
+ return __generator(this, function (_a) {
5424
+ switch (_a.label) {
5356
5425
  case 0:
5357
5426
  _i = 0, mutationsList_1 = mutationsList;
5358
- _b.label = 1;
5427
+ _a.label = 1;
5359
5428
  case 1:
5360
5429
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
5361
5430
  item = mutationsList_1[_i];
5362
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
5363
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
5364
- (item.type === 'childList' &&
5365
- item.target === this.parentElement &&
5366
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
5431
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
5432
+ if (!watermarkRemoved) return [3 /*break*/, 3];
5367
5433
  this.remove();
5368
5434
  return [4 /*yield*/, this.create()];
5369
5435
  case 2:
5370
- _b.sent();
5371
- _b.label = 3;
5436
+ _a.sent();
5437
+ _a.label = 3;
5372
5438
  case 3:
5373
5439
  _i++;
5374
5440
  return [3 /*break*/, 1];
@@ -5377,10 +5443,7 @@ var Watermark = /** @class */ (function () {
5377
5443
  });
5378
5444
  }); });
5379
5445
  this.parentObserve.observe(this.parentElement, {
5380
- attributes: true, // 属性的变动
5381
5446
  childList: true, // 子节点的变动(指新增,删除或者更改)
5382
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
5383
- characterData: true, // 节点内容或节点文本的变动。
5384
5447
  });
5385
5448
  };
5386
5449
  return Watermark;