hlp 3.9.2 → 3.9.3
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/_js/_build/script.js +8 -4
- package/hlp.esm.js +8 -4
- package/package.json +13 -13
package/_js/_build/script.js
CHANGED
|
@@ -549,8 +549,10 @@ var hlp = class hlp {
|
|
|
549
549
|
xhr.setRequestHeader(headers__key, headers__value);
|
|
550
550
|
});
|
|
551
551
|
xhr.onload = () => {
|
|
552
|
-
if (xhr.readyState != 4 || args.allow_errors !== true && xhr.status != 200 && xhr.status != 304)
|
|
553
|
-
|
|
552
|
+
if (xhr.readyState != 4 || args.allow_errors !== true && xhr.status != 200 && xhr.status != 304) {
|
|
553
|
+
if (this.isJsonString(xhr.responseText)) reject(this.jsonStringToObject(xhr.responseText));
|
|
554
|
+
else reject(xhr.responseText);
|
|
555
|
+
}
|
|
554
556
|
if (this.isJsonString(xhr.responseText)) resolve(this.jsonStringToObject(xhr.responseText));
|
|
555
557
|
else resolve(xhr.responseText);
|
|
556
558
|
};
|
|
@@ -892,8 +894,10 @@ var hlp = class hlp {
|
|
|
892
894
|
static scrollTo(to, duration = 1e3, element = null, offset = 0, only_up = false) {
|
|
893
895
|
return new Promise((resolve) => {
|
|
894
896
|
if (element === null) element = document.scrollingElement || document.documentElement;
|
|
895
|
-
if (!hlp.isNumeric(to))
|
|
896
|
-
|
|
897
|
+
if (!hlp.isNumeric(to)) {
|
|
898
|
+
if (element === (document.scrollingElement || document.documentElement)) to = this.offsetTopWithMargin(to);
|
|
899
|
+
else to = to.getBoundingClientRect().top - parseInt(getComputedStyle(to).marginTop) - (element.getBoundingClientRect().top - element.scrollTop - parseInt(getComputedStyle(element).marginTop));
|
|
900
|
+
}
|
|
897
901
|
let offset_calc = 0;
|
|
898
902
|
let offsetArr = offset;
|
|
899
903
|
if (!Array.isArray(offsetArr)) offsetArr = [offsetArr];
|
package/hlp.esm.js
CHANGED
|
@@ -545,8 +545,10 @@ var hlp = class hlp {
|
|
|
545
545
|
xhr.setRequestHeader(headers__key, headers__value);
|
|
546
546
|
});
|
|
547
547
|
xhr.onload = () => {
|
|
548
|
-
if (xhr.readyState != 4 || args.allow_errors !== true && xhr.status != 200 && xhr.status != 304)
|
|
549
|
-
|
|
548
|
+
if (xhr.readyState != 4 || args.allow_errors !== true && xhr.status != 200 && xhr.status != 304) {
|
|
549
|
+
if (this.isJsonString(xhr.responseText)) reject(this.jsonStringToObject(xhr.responseText));
|
|
550
|
+
else reject(xhr.responseText);
|
|
551
|
+
}
|
|
550
552
|
if (this.isJsonString(xhr.responseText)) resolve(this.jsonStringToObject(xhr.responseText));
|
|
551
553
|
else resolve(xhr.responseText);
|
|
552
554
|
};
|
|
@@ -888,8 +890,10 @@ var hlp = class hlp {
|
|
|
888
890
|
static scrollTo(to, duration = 1e3, element = null, offset = 0, only_up = false) {
|
|
889
891
|
return new Promise((resolve) => {
|
|
890
892
|
if (element === null) element = document.scrollingElement || document.documentElement;
|
|
891
|
-
if (!hlp.isNumeric(to))
|
|
892
|
-
|
|
893
|
+
if (!hlp.isNumeric(to)) {
|
|
894
|
+
if (element === (document.scrollingElement || document.documentElement)) to = this.offsetTopWithMargin(to);
|
|
895
|
+
else to = to.getBoundingClientRect().top - parseInt(getComputedStyle(to).marginTop) - (element.getBoundingClientRect().top - element.scrollTop - parseInt(getComputedStyle(element).marginTop));
|
|
896
|
+
}
|
|
893
897
|
let offset_calc = 0;
|
|
894
898
|
let offsetArr = offset;
|
|
895
899
|
if (!Array.isArray(offsetArr)) offsetArr = [offsetArr];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hlp",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"main": "_js/_build/script.js",
|
|
5
5
|
"module": "hlp.esm.js",
|
|
6
6
|
"exports": {
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@prettier/plugin-php": "^0.25.0",
|
|
36
|
-
"@swc/core": "^1.
|
|
36
|
+
"@swc/core": "^1.16.2",
|
|
37
37
|
"@swc/jest": "^0.2.39",
|
|
38
38
|
"@types/jest": "^30.0.0",
|
|
39
|
-
"autoprefixer": "^10.5.
|
|
40
|
-
"caniuse-lite": "^1.0.
|
|
39
|
+
"autoprefixer": "^10.5.5",
|
|
40
|
+
"caniuse-lite": "^1.0.30001810",
|
|
41
41
|
"cli-error-notifier": "^3.0.2",
|
|
42
42
|
"concat": "^1.0.3",
|
|
43
43
|
"cross-spawn": "^7.0.6",
|
|
44
44
|
"del-cli": "^7.0.0",
|
|
45
45
|
"dotenv": "^17.4.2",
|
|
46
46
|
"env-cmd": "^11.0.0",
|
|
47
|
-
"eslint": "^10.
|
|
47
|
+
"eslint": "^10.10.0",
|
|
48
48
|
"exit": "^0.1.2",
|
|
49
49
|
"from-env": "^1.1.4",
|
|
50
|
-
"highlight.js": "^11.
|
|
50
|
+
"highlight.js": "^11.12.0",
|
|
51
51
|
"ismobilejs": "^1.1.1",
|
|
52
52
|
"jest": "^30",
|
|
53
53
|
"jest-cli": "^30",
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"jest-puppeteer": "^11.0.0",
|
|
56
56
|
"move-file-cli": "^3.0.0",
|
|
57
57
|
"ncp": "^2.0.0",
|
|
58
|
-
"npm-check-updates": "^23.0
|
|
58
|
+
"npm-check-updates": "^23.1.0",
|
|
59
59
|
"npm-run-all2": "^9.0.3",
|
|
60
60
|
"onchange": "^7.1.0",
|
|
61
|
-
"postcss": "^8.5.
|
|
62
|
-
"postcss-cli": "^
|
|
61
|
+
"postcss": "^8.5.28",
|
|
62
|
+
"postcss-cli": "^12.0.0",
|
|
63
63
|
"postcss-tailwind-data-attr": "^1.0.7",
|
|
64
64
|
"prettier": "^3.9.6",
|
|
65
|
-
"puppeteer": "^25.
|
|
65
|
+
"puppeteer": "^25.10.0",
|
|
66
66
|
"replace-in-file": "^9.0.0",
|
|
67
67
|
"rimraf": "^6.1.3",
|
|
68
68
|
"run-sequence": "^2.2.1",
|
|
69
|
-
"sass": "^1.
|
|
69
|
+
"sass": "^1.104.0",
|
|
70
70
|
"tailwindcss": "^4.3.3",
|
|
71
|
-
"terser": "^5.
|
|
71
|
+
"terser": "^5.51.2",
|
|
72
72
|
"typescript": "^7.0.2",
|
|
73
73
|
"vinyl-buffer": "^1.0.1",
|
|
74
74
|
"vinyl-source-stream": "^2.0.0",
|
|
75
|
-
"vite": "^8.2.
|
|
75
|
+
"vite": "^8.2.2"
|
|
76
76
|
},
|
|
77
77
|
"overrides": {
|
|
78
78
|
"@babel/core": "^7.29.7",
|