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