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.
- package/dist/es/src/core/watermark.js +8 -15
- package/dist/ie/es/node_modules/core-js/internals/array-from.js +11 -3
- package/dist/ie/es/node_modules/core-js/internals/array-set-length.js +39 -0
- package/dist/ie/es/node_modules/core-js/internals/check-correctness-of-iteration.js +2 -0
- package/dist/ie/es/node_modules/core-js/internals/environment-is-ios.js +1 -2
- package/dist/ie/es/node_modules/core-js/internals/function-bind-native.js +1 -1
- package/dist/ie/es/node_modules/core-js/internals/function-name.js +1 -1
- package/dist/ie/es/node_modules/core-js/internals/is-array.js +20 -0
- package/dist/ie/es/node_modules/core-js/internals/iterate.js +8 -3
- package/dist/ie/es/node_modules/core-js/internals/shared-store.js +3 -3
- package/dist/ie/es/node_modules/core-js/internals/to-string-tag-support.js +1 -1
- package/dist/ie/es/node_modules/core-js/modules/es.array.fill.js +1 -1
- package/dist/ie/es/node_modules/core-js/modules/es.array.from.js +1 -1
- package/dist/ie/es/node_modules/core-js/modules/es.array.includes.js +8 -2
- package/dist/ie/es/node_modules/core-js/modules/es.promise.js +1 -1
- package/dist/ie/es/src/core/watermark.js +8 -15
- package/dist/ie/index.cjs.js +94 -31
- package/dist/ie/index.cjs.js.map +1 -1
- package/dist/ie/index.cjs.min.js +1 -1
- package/dist/ie/index.esm.js +94 -31
- package/dist/ie/index.esm.js.map +1 -1
- package/dist/ie/index.esm.min.js +1 -1
- package/dist/ie/index.iife.js +94 -31
- package/dist/ie/index.iife.js.map +1 -1
- package/dist/ie/index.iife.min.js +1 -1
- package/dist/ie/index.umd.js +94 -31
- package/dist/ie/index.umd.js.map +1 -1
- package/dist/ie/index.umd.min.js +1 -1
- package/dist/index.cjs.js +9 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.esm.js +9 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.iife.js +9 -16
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.umd.js +9 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +57 -51
- /package/dist/ie/es/_virtual/{es.array.fill2.js → es2.array.fill.js} +0 -0
- /package/dist/ie/es/_virtual/{es.array.from2.js → es2.array.from.js} +0 -0
- /package/dist/ie/es/_virtual/{es.array.includes2.js → es2.array.includes.js} +0 -0
- /package/dist/ie/es/_virtual/{es.promise2.js → es2.promise.js} +0 -0
package/dist/ie/index.iife.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* watermark-js-plus v1.6.
|
|
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 =
|
|
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.
|
|
560
|
+
version: '3.49.0',
|
|
561
561
|
mode: IS_PURE ? 'pure' : 'global',
|
|
562
|
-
copyright: '©
|
|
563
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
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;
|
|
@@ -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 &&
|
|
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
|
-
|
|
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
|
|
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 () {
|
|
@@ -2281,8 +2341,7 @@ var WatermarkPlus = (function (exports) {
|
|
|
2281
2341
|
hasRequiredEnvironmentIsIos = 1;
|
|
2282
2342
|
var userAgent = requireEnvironmentUserAgent();
|
|
2283
2343
|
|
|
2284
|
-
|
|
2285
|
-
environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
|
2344
|
+
environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
|
|
2286
2345
|
return environmentIsIos;
|
|
2287
2346
|
}
|
|
2288
2347
|
|
|
@@ -3042,7 +3101,9 @@ var WatermarkPlus = (function (exports) {
|
|
|
3042
3101
|
var iterator, iterFn, index, length, result, next, step;
|
|
3043
3102
|
|
|
3044
3103
|
var stop = function (condition) {
|
|
3045
|
-
|
|
3104
|
+
var $iterator = iterator;
|
|
3105
|
+
iterator = undefined;
|
|
3106
|
+
if ($iterator) iteratorClose($iterator, 'normal');
|
|
3046
3107
|
return new Result(true, condition);
|
|
3047
3108
|
};
|
|
3048
3109
|
|
|
@@ -3072,10 +3133,13 @@ var WatermarkPlus = (function (exports) {
|
|
|
3072
3133
|
|
|
3073
3134
|
next = IS_RECORD ? iterable.next : iterator.next;
|
|
3074
3135
|
while (!(step = call(next, iterator)).done) {
|
|
3136
|
+
// `IteratorValue` errors should propagate without closing the iterator
|
|
3137
|
+
var value = step.value;
|
|
3075
3138
|
try {
|
|
3076
|
-
result = callFn(
|
|
3139
|
+
result = callFn(value);
|
|
3077
3140
|
} catch (error) {
|
|
3078
|
-
iteratorClose(iterator, 'throw', error);
|
|
3141
|
+
if (iterator) iteratorClose(iterator, 'throw', error);
|
|
3142
|
+
else throw error;
|
|
3079
3143
|
}
|
|
3080
3144
|
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
3081
3145
|
} return new Result(false);
|
|
@@ -3492,9 +3556,15 @@ var WatermarkPlus = (function (exports) {
|
|
|
3492
3556
|
return !Array(1).includes();
|
|
3493
3557
|
});
|
|
3494
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
|
+
|
|
3495
3565
|
// `Array.prototype.includes` method
|
|
3496
3566
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
3497
|
-
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
3567
|
+
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
|
|
3498
3568
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
3499
3569
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
3500
3570
|
}
|
|
@@ -5352,26 +5422,22 @@ var WatermarkPlus = (function (exports) {
|
|
|
5352
5422
|
characterData: true, // 节点内容或节点文本的变动。
|
|
5353
5423
|
});
|
|
5354
5424
|
this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
|
|
5355
|
-
var _i, mutationsList_1, item;
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
switch (_b.label) {
|
|
5425
|
+
var _i, mutationsList_1, item, watermarkRemoved;
|
|
5426
|
+
return __generator(this, function (_a) {
|
|
5427
|
+
switch (_a.label) {
|
|
5359
5428
|
case 0:
|
|
5360
5429
|
_i = 0, mutationsList_1 = mutationsList;
|
|
5361
|
-
|
|
5430
|
+
_a.label = 1;
|
|
5362
5431
|
case 1:
|
|
5363
5432
|
if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
|
|
5364
5433
|
item = mutationsList_1[_i];
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
(item.type === 'childList' &&
|
|
5368
|
-
item.target === this.parentElement &&
|
|
5369
|
-
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];
|
|
5370
5436
|
this.remove();
|
|
5371
5437
|
return [4 /*yield*/, this.create()];
|
|
5372
5438
|
case 2:
|
|
5373
|
-
|
|
5374
|
-
|
|
5439
|
+
_a.sent();
|
|
5440
|
+
_a.label = 3;
|
|
5375
5441
|
case 3:
|
|
5376
5442
|
_i++;
|
|
5377
5443
|
return [3 /*break*/, 1];
|
|
@@ -5380,10 +5446,7 @@ var WatermarkPlus = (function (exports) {
|
|
|
5380
5446
|
});
|
|
5381
5447
|
}); });
|
|
5382
5448
|
this.parentObserve.observe(this.parentElement, {
|
|
5383
|
-
attributes: true, // 属性的变动
|
|
5384
5449
|
childList: true, // 子节点的变动(指新增,删除或者更改)
|
|
5385
|
-
subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
|
|
5386
|
-
characterData: true, // 节点内容或节点文本的变动。
|
|
5387
5450
|
});
|
|
5388
5451
|
};
|
|
5389
5452
|
return Watermark;
|