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.esm.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
|
*/
|
|
@@ -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 =
|
|
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.
|
|
557
|
+
version: '3.49.0',
|
|
558
558
|
mode: IS_PURE ? 'pure' : 'global',
|
|
559
|
-
copyright: '©
|
|
560
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
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;
|
|
@@ -625,7 +625,7 @@ function requireUid () {
|
|
|
625
625
|
|
|
626
626
|
var id = 0;
|
|
627
627
|
var postfix = Math.random();
|
|
628
|
-
var toString = uncurryThis(1.
|
|
628
|
+
var toString = uncurryThis(1.1.toString);
|
|
629
629
|
|
|
630
630
|
uid = function (key) {
|
|
631
631
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
@@ -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 &&
|
|
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
|
-
|
|
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
|
|
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 () {
|
|
@@ -1990,6 +2050,18 @@ function requireEnvironmentIsNode () {
|
|
|
1990
2050
|
return environmentIsNode;
|
|
1991
2051
|
}
|
|
1992
2052
|
|
|
2053
|
+
var path;
|
|
2054
|
+
var hasRequiredPath;
|
|
2055
|
+
|
|
2056
|
+
function requirePath () {
|
|
2057
|
+
if (hasRequiredPath) return path;
|
|
2058
|
+
hasRequiredPath = 1;
|
|
2059
|
+
var globalThis = requireGlobalThis();
|
|
2060
|
+
|
|
2061
|
+
path = globalThis;
|
|
2062
|
+
return path;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
1993
2065
|
var functionUncurryThisAccessor;
|
|
1994
2066
|
var hasRequiredFunctionUncurryThisAccessor;
|
|
1995
2067
|
|
|
@@ -2266,8 +2338,7 @@ function requireEnvironmentIsIos () {
|
|
|
2266
2338
|
hasRequiredEnvironmentIsIos = 1;
|
|
2267
2339
|
var userAgent = requireEnvironmentUserAgent();
|
|
2268
2340
|
|
|
2269
|
-
|
|
2270
|
-
environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
|
2341
|
+
environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
|
|
2271
2342
|
return environmentIsIos;
|
|
2272
2343
|
}
|
|
2273
2344
|
|
|
@@ -2698,6 +2769,7 @@ function requireEs_promise_constructor () {
|
|
|
2698
2769
|
var IS_PURE = requireIsPure();
|
|
2699
2770
|
var IS_NODE = requireEnvironmentIsNode();
|
|
2700
2771
|
var globalThis = requireGlobalThis();
|
|
2772
|
+
var path = requirePath();
|
|
2701
2773
|
var call = requireFunctionCall();
|
|
2702
2774
|
var defineBuiltIn = requireDefineBuiltIn();
|
|
2703
2775
|
var setPrototypeOf = requireObjectSetPrototypeOf();
|
|
@@ -2981,6 +3053,8 @@ function requireEs_promise_constructor () {
|
|
|
2981
3053
|
Promise: PromiseConstructor
|
|
2982
3054
|
});
|
|
2983
3055
|
|
|
3056
|
+
PromiseWrapper = path.Promise;
|
|
3057
|
+
|
|
2984
3058
|
setToStringTag(PromiseConstructor, PROMISE, false, true);
|
|
2985
3059
|
setSpecies(PROMISE);
|
|
2986
3060
|
return es_promise_constructor;
|
|
@@ -3024,7 +3098,9 @@ function requireIterate () {
|
|
|
3024
3098
|
var iterator, iterFn, index, length, result, next, step;
|
|
3025
3099
|
|
|
3026
3100
|
var stop = function (condition) {
|
|
3027
|
-
|
|
3101
|
+
var $iterator = iterator;
|
|
3102
|
+
iterator = undefined;
|
|
3103
|
+
if ($iterator) iteratorClose($iterator, 'normal');
|
|
3028
3104
|
return new Result(true, condition);
|
|
3029
3105
|
};
|
|
3030
3106
|
|
|
@@ -3054,10 +3130,13 @@ function requireIterate () {
|
|
|
3054
3130
|
|
|
3055
3131
|
next = IS_RECORD ? iterable.next : iterator.next;
|
|
3056
3132
|
while (!(step = call(next, iterator)).done) {
|
|
3133
|
+
// `IteratorValue` errors should propagate without closing the iterator
|
|
3134
|
+
var value = step.value;
|
|
3057
3135
|
try {
|
|
3058
|
-
result = callFn(
|
|
3136
|
+
result = callFn(value);
|
|
3059
3137
|
} catch (error) {
|
|
3060
|
-
iteratorClose(iterator, 'throw', error);
|
|
3138
|
+
if (iterator) iteratorClose(iterator, 'throw', error);
|
|
3139
|
+
else throw error;
|
|
3061
3140
|
}
|
|
3062
3141
|
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
3063
3142
|
} return new Result(false);
|
|
@@ -3474,9 +3553,15 @@ function requireEs_array_includes () {
|
|
|
3474
3553
|
return !Array(1).includes();
|
|
3475
3554
|
});
|
|
3476
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
|
+
|
|
3477
3562
|
// `Array.prototype.includes` method
|
|
3478
3563
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
3479
|
-
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
3564
|
+
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
|
|
3480
3565
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
3481
3566
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
3482
3567
|
}
|
|
@@ -4487,11 +4572,11 @@ var generateAnimationStyle = function (movable, backgroundRepeat) {
|
|
|
4487
4572
|
case 'repeat':
|
|
4488
4573
|
return 'animation: 200s linear 0s infinite alternate watermark !important;';
|
|
4489
4574
|
case 'repeat-x':
|
|
4490
|
-
return "animation: ".concat(horizontalDuration, "s
|
|
4575
|
+
return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-vertical !important;'");
|
|
4491
4576
|
case 'repeat-y':
|
|
4492
|
-
return "animation: ".concat(verticalDuration, "s
|
|
4577
|
+
return "animation: ".concat(verticalDuration, "s linear 0s infinite alternate watermark-horizontal !important;'");
|
|
4493
4578
|
case 'no-repeat':
|
|
4494
|
-
return "animation: ".concat(horizontalDuration, "s
|
|
4579
|
+
return "animation: ".concat(horizontalDuration, "s linear 0s infinite alternate watermark-horizontal, ").concat(verticalDuration, "s linear 0s infinite alternate watermark-vertical !important;");
|
|
4495
4580
|
default:
|
|
4496
4581
|
return '';
|
|
4497
4582
|
}
|
|
@@ -5334,26 +5419,22 @@ var Watermark = /** @class */ (function () {
|
|
|
5334
5419
|
characterData: true, // 节点内容或节点文本的变动。
|
|
5335
5420
|
});
|
|
5336
5421
|
this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
|
|
5337
|
-
var _i, mutationsList_1, item;
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
switch (_b.label) {
|
|
5422
|
+
var _i, mutationsList_1, item, watermarkRemoved;
|
|
5423
|
+
return __generator(this, function (_a) {
|
|
5424
|
+
switch (_a.label) {
|
|
5341
5425
|
case 0:
|
|
5342
5426
|
_i = 0, mutationsList_1 = mutationsList;
|
|
5343
|
-
|
|
5427
|
+
_a.label = 1;
|
|
5344
5428
|
case 1:
|
|
5345
5429
|
if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
|
|
5346
5430
|
item = mutationsList_1[_i];
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
(item.type === 'childList' &&
|
|
5350
|
-
item.target === this.parentElement &&
|
|
5351
|
-
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];
|
|
5352
5433
|
this.remove();
|
|
5353
5434
|
return [4 /*yield*/, this.create()];
|
|
5354
5435
|
case 2:
|
|
5355
|
-
|
|
5356
|
-
|
|
5436
|
+
_a.sent();
|
|
5437
|
+
_a.label = 3;
|
|
5357
5438
|
case 3:
|
|
5358
5439
|
_i++;
|
|
5359
5440
|
return [3 /*break*/, 1];
|
|
@@ -5362,10 +5443,7 @@ var Watermark = /** @class */ (function () {
|
|
|
5362
5443
|
});
|
|
5363
5444
|
}); });
|
|
5364
5445
|
this.parentObserve.observe(this.parentElement, {
|
|
5365
|
-
attributes: true, // 属性的变动
|
|
5366
5446
|
childList: true, // 子节点的变动(指新增,删除或者更改)
|
|
5367
|
-
subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
|
|
5368
|
-
characterData: true, // 节点内容或节点文本的变动。
|
|
5369
5447
|
});
|
|
5370
5448
|
};
|
|
5371
5449
|
return Watermark;
|