umaki 0.13.1 → 0.13.2
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/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/index.cjs +137 -127
- package/dist/index.es.js +17 -71
- package/dist/libs/callback/index.cjs +15 -5
- package/dist/libs/callback/index.es.js +12 -4
- package/dist/libs/callback/tap-async.cjs +5 -6
- package/dist/libs/callback/tap-async.es.js +6 -7
- package/dist/libs/callback/tap.cjs +4 -5
- package/dist/libs/callback/tap.es.js +5 -6
- package/dist/libs/config/_internal.cjs +2 -4
- package/dist/libs/config/_internal.es.js +3 -4
- package/dist/libs/config/default-config.cjs +2 -5
- package/dist/libs/config/default-config.es.js +3 -6
- package/dist/libs/config/get-config.cjs +6 -7
- package/dist/libs/config/get-config.es.js +6 -8
- package/dist/libs/config/index.cjs +18 -8
- package/dist/libs/config/index.es.js +12 -6
- package/dist/libs/config/set-config.cjs +13 -10
- package/dist/libs/config/set-config.es.js +13 -10
- package/dist/libs/control/bg-scroll-stop.cjs +6 -7
- package/dist/libs/control/bg-scroll-stop.es.js +6 -7
- package/dist/libs/control/copy-to-clipboard.cjs +9 -12
- package/dist/libs/control/copy-to-clipboard.es.js +10 -13
- package/dist/libs/control/index.cjs +21 -11
- package/dist/libs/control/index.es.js +12 -7
- package/dist/libs/control/pd.cjs +2 -3
- package/dist/libs/control/pd.es.js +3 -4
- package/dist/libs/control/scroll-to-hash.cjs +28 -35
- package/dist/libs/control/scroll-to-hash.es.js +29 -36
- package/dist/libs/control/video-play-control.cjs +17 -20
- package/dist/libs/control/video-play-control.es.js +17 -20
- package/dist/libs/convert/change-date-string-to-specific-format.cjs +13 -12
- package/dist/libs/convert/change-date-string-to-specific-format.es.js +5 -8
- package/dist/libs/convert/hex-to-rgb.cjs +15 -20
- package/dist/libs/convert/hex-to-rgb.es.js +16 -21
- package/dist/libs/convert/index.cjs +19 -9
- package/dist/libs/convert/index.es.js +12 -6
- package/dist/libs/convert/json-string-to-json-object.cjs +7 -8
- package/dist/libs/convert/json-string-to-json-object.es.js +8 -9
- package/dist/libs/convert/rgb-to-hex.cjs +6 -7
- package/dist/libs/convert/rgb-to-hex.es.js +7 -8
- package/dist/libs/eventControl/debounce.cjs +11 -14
- package/dist/libs/eventControl/debounce.es.js +12 -15
- package/dist/libs/eventControl/index.cjs +15 -5
- package/dist/libs/eventControl/index.es.js +12 -4
- package/dist/libs/eventControl/throttle.cjs +11 -14
- package/dist/libs/eventControl/throttle.es.js +12 -15
- package/dist/libs/get/get-aspect-ratio.cjs +9 -9
- package/dist/libs/get/get-aspect-ratio.es.js +9 -9
- package/dist/libs/get/get-class-names.cjs +3 -5
- package/dist/libs/get/get-class-names.es.js +4 -6
- package/dist/libs/get/get-document-height.cjs +4 -5
- package/dist/libs/get/get-document-height.es.js +5 -6
- package/dist/libs/get/get-event-paths.cjs +16 -21
- package/dist/libs/get/get-event-paths.es.js +17 -22
- package/dist/libs/get/get-gcd.cjs +8 -11
- package/dist/libs/get/get-gcd.es.js +8 -11
- package/dist/libs/get/get-gravatar-url.cjs +8 -10
- package/dist/libs/get/get-gravatar-url.es.js +6 -10
- package/dist/libs/get/get-orientation.cjs +4 -8
- package/dist/libs/get/get-orientation.es.js +5 -9
- package/dist/libs/get/get-parent-list.cjs +5 -6
- package/dist/libs/get/get-parent-list.es.js +6 -7
- package/dist/libs/get/get-query-params.cjs +19 -20
- package/dist/libs/get/get-query-params.es.js +18 -21
- package/dist/libs/get/get-random-int.cjs +8 -15
- package/dist/libs/get/get-random-int.es.js +9 -16
- package/dist/libs/get/get-relative-time.cjs +41 -25
- package/dist/libs/get/get-relative-time.es.js +42 -26
- package/dist/libs/get/get-rem.cjs +4 -8
- package/dist/libs/get/get-rem.es.js +5 -9
- package/dist/libs/get/get-rendered-line-height.cjs +49 -54
- package/dist/libs/get/get-rendered-line-height.es.js +50 -55
- package/dist/libs/get/get-scrollbar-width.cjs +4 -5
- package/dist/libs/get/get-scrollbar-width.es.js +5 -6
- package/dist/libs/get/get-session-storage.cjs +8 -7
- package/dist/libs/get/get-session-storage.es.js +6 -7
- package/dist/libs/get/get-string-length.cjs +3 -4
- package/dist/libs/get/get-string-length.es.js +3 -4
- package/dist/libs/get/get-style-property-value-to-number.cjs +3 -4
- package/dist/libs/get/get-style-property-value-to-number.es.js +3 -4
- package/dist/libs/get/get-style-property-value.cjs +4 -5
- package/dist/libs/get/get-style-property-value.es.js +5 -6
- package/dist/libs/get/get-ua-data.cjs +20 -21
- package/dist/libs/get/get-ua-data.es.js +17 -20
- package/dist/libs/get/index.cjs +49 -39
- package/dist/libs/get/index.es.js +14 -23
- package/dist/libs/is/check-device-size.cjs +6 -9
- package/dist/libs/is/check-device-size.es.js +6 -9
- package/dist/libs/is/index.cjs +33 -23
- package/dist/libs/is/index.es.js +13 -14
- package/dist/libs/is/is-after-date-time.cjs +7 -8
- package/dist/libs/is/is-after-date-time.es.js +5 -8
- package/dist/libs/is/is-between-date-time.cjs +12 -12
- package/dist/libs/is/is-between-date-time.es.js +7 -10
- package/dist/libs/is/is-exist-all-elements.cjs +3 -4
- package/dist/libs/is/is-exist-all-elements.es.js +4 -5
- package/dist/libs/is/is-in-viewport.cjs +60 -63
- package/dist/libs/is/is-in-viewport.es.js +61 -64
- package/dist/libs/is/is-ipad.cjs +8 -11
- package/dist/libs/is/is-ipad.es.js +7 -10
- package/dist/libs/is/is-key-exists.cjs +3 -4
- package/dist/libs/is/is-key-exists.es.js +4 -5
- package/dist/libs/is/is-online.cjs +4 -7
- package/dist/libs/is/is-online.es.js +5 -8
- package/dist/libs/is/is-safari.cjs +6 -9
- package/dist/libs/is/is-safari.es.js +6 -9
- package/dist/libs/is/is-scrollable.cjs +5 -6
- package/dist/libs/is/is-scrollable.es.js +6 -7
- package/dist/libs/is/is-touch-support.cjs +7 -9
- package/dist/libs/is/is-touch-support.es.js +8 -10
- package/dist/libs/remove/index.cjs +19 -9
- package/dist/libs/remove/index.es.js +12 -6
- package/dist/libs/remove/remove-all-html-tags.cjs +10 -10
- package/dist/libs/remove/remove-all-html-tags.es.js +8 -10
- package/dist/libs/remove/remove-attribute.cjs +3 -4
- package/dist/libs/remove/remove-attribute.es.js +4 -5
- package/dist/libs/remove/remove-session-storage.cjs +6 -5
- package/dist/libs/remove/remove-session-storage.es.js +4 -5
- package/dist/libs/remove/remove-style-property-value.cjs +4 -5
- package/dist/libs/remove/remove-style-property-value.es.js +5 -6
- package/dist/libs/security/html-sanitize.cjs +15 -11
- package/dist/libs/security/html-sanitize.es.js +13 -12
- package/dist/libs/security/index.cjs +14 -4
- package/dist/libs/security/index.es.js +12 -5
- package/dist/libs/set/index.cjs +23 -13
- package/dist/libs/set/index.es.js +12 -8
- package/dist/libs/set/set-100vh.cjs +5 -6
- package/dist/libs/set/set-100vh.es.js +6 -7
- package/dist/libs/set/set-100vw.cjs +5 -6
- package/dist/libs/set/set-100vw.es.js +6 -7
- package/dist/libs/set/set-attribute.cjs +3 -4
- package/dist/libs/set/set-attribute.es.js +4 -5
- package/dist/libs/set/set-scroll-position-to-center.cjs +9 -8
- package/dist/libs/set/set-scroll-position-to-center.es.js +10 -9
- package/dist/libs/set/set-session-storage.cjs +6 -5
- package/dist/libs/set/set-session-storage.es.js +4 -5
- package/dist/libs/set/set-style-property-value.cjs +4 -5
- package/dist/libs/set/set-style-property-value.es.js +5 -6
- package/dist/libs/to/index.cjs +15 -5
- package/dist/libs/to/index.es.js +12 -4
- package/dist/libs/to/to-boolean.cjs +3 -4
- package/dist/libs/to/to-boolean.es.js +4 -5
- package/dist/libs/to/to-positive-number.cjs +2 -3
- package/dist/libs/to/to-positive-number.es.js +3 -4
- package/dist/libs/transform/index.cjs +13 -3
- package/dist/libs/transform/index.es.js +12 -4
- package/dist/libs/transform/wrap-text-with-spans.cjs +15 -20
- package/dist/libs/transform/wrap-text-with-spans.es.js +15 -20
- package/dist/libs/wait/index.cjs +15 -5
- package/dist/libs/wait/index.es.js +12 -4
- package/dist/libs/wait/sleep.cjs +3 -4
- package/dist/libs/wait/sleep.es.js +4 -5
- package/dist/libs/wait/wait-for-all-media-loaded.cjs +29 -41
- package/dist/libs/wait/wait-for-all-media-loaded.es.js +30 -42
- package/package.json +14 -11
|
@@ -1,66 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
// src/libs/is/is-in-viewport.ts
|
|
2
|
+
var parseRootMargin = (rootMargin) => {
|
|
3
|
+
const parts = rootMargin.trim().split(/\s+/);
|
|
4
|
+
const parseValue = (value) => {
|
|
5
|
+
if (value.endsWith("%")) {
|
|
6
|
+
const percent = Number.parseFloat(value) / 100;
|
|
7
|
+
return window.innerWidth * percent;
|
|
8
|
+
}
|
|
9
|
+
return Number.parseFloat(value) || 0;
|
|
10
|
+
};
|
|
11
|
+
if (parts.length === 1) {
|
|
12
|
+
const value = parseValue(parts[0]);
|
|
13
|
+
return {
|
|
14
|
+
top: value,
|
|
15
|
+
right: value,
|
|
16
|
+
bottom: value,
|
|
17
|
+
left: value
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (parts.length === 2) {
|
|
21
|
+
const vertical = parseValue(parts[0]);
|
|
22
|
+
const horizontal = parseValue(parts[1]);
|
|
23
|
+
return {
|
|
24
|
+
top: vertical,
|
|
25
|
+
right: horizontal,
|
|
26
|
+
bottom: vertical,
|
|
27
|
+
left: horizontal
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (parts.length === 3) return {
|
|
31
|
+
top: parseValue(parts[0]),
|
|
32
|
+
right: parseValue(parts[1]),
|
|
33
|
+
bottom: parseValue(parts[2]),
|
|
34
|
+
left: parseValue(parts[1])
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
top: parseValue(parts[0]),
|
|
38
|
+
right: parseValue(parts[1]),
|
|
39
|
+
bottom: parseValue(parts[2]),
|
|
40
|
+
left: parseValue(parts[3])
|
|
41
|
+
};
|
|
40
42
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const visibleArea = visibleHeight * visibleWidth;
|
|
61
|
-
const elementArea = elementHeight * elementWidth;
|
|
62
|
-
if (elementArea === 0) return false;
|
|
63
|
-
const visibleRatio = visibleArea / elementArea;
|
|
64
|
-
return visibleRatio >= threshold;
|
|
43
|
+
var isInViewport = (element, options = {}) => {
|
|
44
|
+
const { threshold = 0, rootMargin = "0px" } = options;
|
|
45
|
+
const rect = element.getBoundingClientRect();
|
|
46
|
+
const margins = parseRootMargin(rootMargin);
|
|
47
|
+
const viewportTop = 0 - margins.top;
|
|
48
|
+
const viewportLeft = 0 - margins.left;
|
|
49
|
+
const viewportBottom = window.innerHeight + margins.bottom;
|
|
50
|
+
const viewportRight = window.innerWidth + margins.right;
|
|
51
|
+
if (threshold === 0) return rect.bottom > viewportTop && rect.right > viewportLeft && rect.top < viewportBottom && rect.left < viewportRight;
|
|
52
|
+
const elementHeight = rect.height;
|
|
53
|
+
const elementWidth = rect.width;
|
|
54
|
+
const visibleTop = Math.max(rect.top, viewportTop);
|
|
55
|
+
const visibleBottom = Math.min(rect.bottom, viewportBottom);
|
|
56
|
+
const visibleLeft = Math.max(rect.left, viewportLeft);
|
|
57
|
+
const visibleRight = Math.min(rect.right, viewportRight);
|
|
58
|
+
const visibleArea = Math.max(0, visibleBottom - visibleTop) * Math.max(0, visibleRight - visibleLeft);
|
|
59
|
+
const elementArea = elementHeight * elementWidth;
|
|
60
|
+
if (elementArea === 0) return false;
|
|
61
|
+
return visibleArea / elementArea >= threshold;
|
|
65
62
|
};
|
|
66
63
|
exports.isInViewport = isInViewport;
|
|
@@ -1,66 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
// src/libs/is/is-in-viewport.ts
|
|
2
|
+
var parseRootMargin = (rootMargin) => {
|
|
3
|
+
const parts = rootMargin.trim().split(/\s+/);
|
|
4
|
+
const parseValue = (value) => {
|
|
5
|
+
if (value.endsWith("%")) {
|
|
6
|
+
const percent = Number.parseFloat(value) / 100;
|
|
7
|
+
return window.innerWidth * percent;
|
|
8
|
+
}
|
|
9
|
+
return Number.parseFloat(value) || 0;
|
|
10
|
+
};
|
|
11
|
+
if (parts.length === 1) {
|
|
12
|
+
const value = parseValue(parts[0]);
|
|
13
|
+
return {
|
|
14
|
+
top: value,
|
|
15
|
+
right: value,
|
|
16
|
+
bottom: value,
|
|
17
|
+
left: value
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (parts.length === 2) {
|
|
21
|
+
const vertical = parseValue(parts[0]);
|
|
22
|
+
const horizontal = parseValue(parts[1]);
|
|
23
|
+
return {
|
|
24
|
+
top: vertical,
|
|
25
|
+
right: horizontal,
|
|
26
|
+
bottom: vertical,
|
|
27
|
+
left: horizontal
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (parts.length === 3) return {
|
|
31
|
+
top: parseValue(parts[0]),
|
|
32
|
+
right: parseValue(parts[1]),
|
|
33
|
+
bottom: parseValue(parts[2]),
|
|
34
|
+
left: parseValue(parts[1])
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
top: parseValue(parts[0]),
|
|
38
|
+
right: parseValue(parts[1]),
|
|
39
|
+
bottom: parseValue(parts[2]),
|
|
40
|
+
left: parseValue(parts[3])
|
|
41
|
+
};
|
|
38
42
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const visibleArea = visibleHeight * visibleWidth;
|
|
59
|
-
const elementArea = elementHeight * elementWidth;
|
|
60
|
-
if (elementArea === 0) return false;
|
|
61
|
-
const visibleRatio = visibleArea / elementArea;
|
|
62
|
-
return visibleRatio >= threshold;
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
isInViewport
|
|
43
|
+
var isInViewport = (element, options = {}) => {
|
|
44
|
+
const { threshold = 0, rootMargin = "0px" } = options;
|
|
45
|
+
const rect = element.getBoundingClientRect();
|
|
46
|
+
const margins = parseRootMargin(rootMargin);
|
|
47
|
+
const viewportTop = 0 - margins.top;
|
|
48
|
+
const viewportLeft = 0 - margins.left;
|
|
49
|
+
const viewportBottom = window.innerHeight + margins.bottom;
|
|
50
|
+
const viewportRight = window.innerWidth + margins.right;
|
|
51
|
+
if (threshold === 0) return rect.bottom > viewportTop && rect.right > viewportLeft && rect.top < viewportBottom && rect.left < viewportRight;
|
|
52
|
+
const elementHeight = rect.height;
|
|
53
|
+
const elementWidth = rect.width;
|
|
54
|
+
const visibleTop = Math.max(rect.top, viewportTop);
|
|
55
|
+
const visibleBottom = Math.min(rect.bottom, viewportBottom);
|
|
56
|
+
const visibleLeft = Math.max(rect.left, viewportLeft);
|
|
57
|
+
const visibleRight = Math.min(rect.right, viewportRight);
|
|
58
|
+
const visibleArea = Math.max(0, visibleBottom - visibleTop) * Math.max(0, visibleRight - visibleLeft);
|
|
59
|
+
const elementArea = elementHeight * elementWidth;
|
|
60
|
+
if (elementArea === 0) return false;
|
|
61
|
+
return visibleArea / elementArea >= threshold;
|
|
66
62
|
};
|
|
63
|
+
export { isInViewport };
|
package/dist/libs/is/is-ipad.cjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const clientData = getUaData.getUaData();
|
|
10
|
-
if (!clientData.touchSupport) return false;
|
|
11
|
-
return clientData.type === "laptop" && clientData.osName === "mac-os" && clientData.browserName === "safari" && getOrientation.getOrientation() === orientation;
|
|
1
|
+
const require_get_orientation = require("../get/get-orientation.cjs");
|
|
2
|
+
const require_get_ua_data = require("../get/get-ua-data.cjs");
|
|
3
|
+
// src/libs/is/is-ipad.ts
|
|
4
|
+
var isIpad = (orientation = "portrait") => {
|
|
5
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
6
|
+
const clientData = require_get_ua_data.getUaData();
|
|
7
|
+
if (!clientData.touchSupport) return false;
|
|
8
|
+
return clientData.type === "laptop" && clientData.osName === "mac-os" && clientData.browserName === "safari" && require_get_orientation.getOrientation() === orientation;
|
|
12
9
|
};
|
|
13
10
|
exports.isIpad = isIpad;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { getOrientation } from "../get/get-orientation.es.js";
|
|
2
2
|
import { getUaData } from "../get/get-ua-data.es.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return clientData.type === "laptop" && clientData.osName === "mac-os" && clientData.browserName === "safari" && getOrientation() === orientation;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
isIpad
|
|
3
|
+
// src/libs/is/is-ipad.ts
|
|
4
|
+
var isIpad = (orientation = "portrait") => {
|
|
5
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
6
|
+
const clientData = getUaData();
|
|
7
|
+
if (!clientData.touchSupport) return false;
|
|
8
|
+
return clientData.type === "laptop" && clientData.osName === "mac-os" && clientData.browserName === "safari" && getOrientation() === orientation;
|
|
13
9
|
};
|
|
10
|
+
export { isIpad };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return !!obj && Object.hasOwn(obj, key);
|
|
1
|
+
// src/libs/is/is-key-exists.ts
|
|
2
|
+
var isKeyExists = (obj, key) => {
|
|
3
|
+
return !!obj && Object.hasOwn(obj, key);
|
|
5
4
|
};
|
|
6
5
|
exports.isKeyExists = isKeyExists;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
return navigator.onLine;
|
|
1
|
+
// src/libs/is/is-online.ts
|
|
2
|
+
var isOnline = () => {
|
|
3
|
+
if (typeof navigator === "undefined") return true;
|
|
4
|
+
return navigator.onLine;
|
|
8
5
|
};
|
|
9
6
|
exports.isOnline = isOnline;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return navigator.onLine;
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
isOnline
|
|
1
|
+
// src/libs/is/is-online.ts
|
|
2
|
+
var isOnline = () => {
|
|
3
|
+
if (typeof navigator === "undefined") return true;
|
|
4
|
+
return navigator.onLine;
|
|
9
5
|
};
|
|
6
|
+
export { isOnline };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return clientData.browserName === "safari" || clientData.browserName === "mobile-safari";
|
|
8
|
-
}
|
|
9
|
-
return clientData.browserName === "safari";
|
|
1
|
+
const require_get_ua_data = require("../get/get-ua-data.cjs");
|
|
2
|
+
// src/libs/is/is-safari.ts
|
|
3
|
+
var isSafari = (includeMobileSafari = true) => {
|
|
4
|
+
const clientData = require_get_ua_data.getUaData();
|
|
5
|
+
if (includeMobileSafari) return clientData.browserName === "safari" || clientData.browserName === "mobile-safari";
|
|
6
|
+
return clientData.browserName === "safari";
|
|
10
7
|
};
|
|
11
8
|
exports.isSafari = isSafari;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { getUaData } from "../get/get-ua-data.es.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return clientData.browserName === "safari";
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
isSafari
|
|
2
|
+
// src/libs/is/is-safari.ts
|
|
3
|
+
var isSafari = (includeMobileSafari = true) => {
|
|
4
|
+
const clientData = getUaData();
|
|
5
|
+
if (includeMobileSafari) return clientData.browserName === "safari" || clientData.browserName === "mobile-safari";
|
|
6
|
+
return clientData.browserName === "safari";
|
|
11
7
|
};
|
|
8
|
+
export { isSafari };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return isScrollableX || isScrollableY;
|
|
1
|
+
// src/libs/is/is-scrollable.ts
|
|
2
|
+
var isScrollable = (element) => {
|
|
3
|
+
const isScrollableX = element.scrollWidth > element.clientWidth;
|
|
4
|
+
const isScrollableY = element.scrollHeight > element.clientHeight;
|
|
5
|
+
return isScrollableX || isScrollableY;
|
|
7
6
|
};
|
|
8
7
|
exports.isScrollable = isScrollable;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
isScrollable
|
|
1
|
+
// src/libs/is/is-scrollable.ts
|
|
2
|
+
var isScrollable = (element) => {
|
|
3
|
+
const isScrollableX = element.scrollWidth > element.clientWidth;
|
|
4
|
+
const isScrollableY = element.scrollHeight > element.clientHeight;
|
|
5
|
+
return isScrollableX || isScrollableY;
|
|
8
6
|
};
|
|
7
|
+
export { isScrollable };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
typeof navigator.msMaxTouchPoints === "number" && (navigator.msMaxTouchPoints ?? 0) > 0;
|
|
9
|
-
return hasTouchStart || hasTouchPoints || hasMsTouchPoints;
|
|
1
|
+
// src/libs/is/is-touch-support.ts
|
|
2
|
+
var isTouchSupport = () => {
|
|
3
|
+
if (typeof window === "undefined") return false;
|
|
4
|
+
const hasTouchStart = "ontouchstart" in window && window.ontouchstart !== void 0;
|
|
5
|
+
const hasTouchPoints = typeof navigator !== "undefined" && typeof navigator.maxTouchPoints === "number" && navigator.maxTouchPoints > 0;
|
|
6
|
+
const hasMsTouchPoints = typeof navigator !== "undefined" && typeof navigator.msMaxTouchPoints === "number" && (navigator.msMaxTouchPoints ?? 0) > 0;
|
|
7
|
+
return hasTouchStart || hasTouchPoints || hasMsTouchPoints;
|
|
10
8
|
};
|
|
11
9
|
exports.isTouchSupport = isTouchSupport;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
isTouchSupport
|
|
1
|
+
// src/libs/is/is-touch-support.ts
|
|
2
|
+
var isTouchSupport = () => {
|
|
3
|
+
if (typeof window === "undefined") return false;
|
|
4
|
+
const hasTouchStart = "ontouchstart" in window && window.ontouchstart !== void 0;
|
|
5
|
+
const hasTouchPoints = typeof navigator !== "undefined" && typeof navigator.maxTouchPoints === "number" && navigator.maxTouchPoints > 0;
|
|
6
|
+
const hasMsTouchPoints = typeof navigator !== "undefined" && typeof navigator.msMaxTouchPoints === "number" && (navigator.msMaxTouchPoints ?? 0) > 0;
|
|
7
|
+
return hasTouchStart || hasTouchPoints || hasMsTouchPoints;
|
|
11
8
|
};
|
|
9
|
+
export { isTouchSupport };
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.13.2
|
|
4
|
+
* description: A utility that is often used in web production.
|
|
5
|
+
* author: TsubasaHiga
|
|
6
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
7
|
+
* Released under the MIT License
|
|
8
|
+
*
|
|
9
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
10
|
+
* For license information, please see LICENSE.txt
|
|
11
|
+
*/
|
|
2
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
exports.removeAllHtmlTags =
|
|
8
|
-
exports.removeAttribute =
|
|
9
|
-
exports.removeSessionStorage =
|
|
10
|
-
exports.removeStylePropertyValue =
|
|
13
|
+
const require_remove_all_html_tags = require("./remove-all-html-tags.cjs");
|
|
14
|
+
const require_remove_attribute = require("./remove-attribute.cjs");
|
|
15
|
+
const require_remove_session_storage = require("./remove-session-storage.cjs");
|
|
16
|
+
const require_remove_style_property_value = require("./remove-style-property-value.cjs");
|
|
17
|
+
exports.removeAllHtmlTags = require_remove_all_html_tags.removeAllHtmlTags;
|
|
18
|
+
exports.removeAttribute = require_remove_attribute.removeAttribute;
|
|
19
|
+
exports.removeSessionStorage = require_remove_session_storage.removeSessionStorage;
|
|
20
|
+
exports.removeStylePropertyValue = require_remove_style_property_value.removeStylePropertyValue;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.13.2
|
|
4
|
+
* description: A utility that is often used in web production.
|
|
5
|
+
* author: TsubasaHiga
|
|
6
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
7
|
+
* Released under the MIT License
|
|
8
|
+
*
|
|
9
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
10
|
+
* For license information, please see LICENSE.txt
|
|
11
|
+
*/
|
|
1
12
|
import { removeAllHtmlTags } from "./remove-all-html-tags.es.js";
|
|
2
13
|
import { removeAttribute } from "./remove-attribute.es.js";
|
|
3
14
|
import { removeSessionStorage } from "./remove-session-storage.es.js";
|
|
4
15
|
import { removeStylePropertyValue } from "./remove-style-property-value.es.js";
|
|
5
|
-
export {
|
|
6
|
-
removeAllHtmlTags,
|
|
7
|
-
removeAttribute,
|
|
8
|
-
removeSessionStorage,
|
|
9
|
-
removeStylePropertyValue
|
|
10
|
-
};
|
|
16
|
+
export { removeAllHtmlTags, removeAttribute, removeSessionStorage, removeStylePropertyValue };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let isomorphic_dompurify = require("isomorphic-dompurify");
|
|
3
|
+
isomorphic_dompurify = require_runtime.__toESM(isomorphic_dompurify, 1);
|
|
4
|
+
// src/libs/remove/remove-all-html-tags.ts
|
|
5
|
+
var removeAllHtmlTags = (string) => {
|
|
6
|
+
return isomorphic_dompurify.default.sanitize(string, {
|
|
7
|
+
ALLOWED_TAGS: [],
|
|
8
|
+
KEEP_CONTENT: true,
|
|
9
|
+
USE_PROFILES: { html: false }
|
|
10
|
+
}).replace(/<\/?[^>]+(>|$)/g, "");
|
|
11
11
|
};
|
|
12
12
|
exports.removeAllHtmlTags = removeAllHtmlTags;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import DOMPurify from "isomorphic-dompurify";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
removeAllHtmlTags
|
|
2
|
+
// src/libs/remove/remove-all-html-tags.ts
|
|
3
|
+
var removeAllHtmlTags = (string) => {
|
|
4
|
+
return DOMPurify.sanitize(string, {
|
|
5
|
+
ALLOWED_TAGS: [],
|
|
6
|
+
KEEP_CONTENT: true,
|
|
7
|
+
USE_PROFILES: { html: false }
|
|
8
|
+
}).replace(/<\/?[^>]+(>|$)/g, "");
|
|
12
9
|
};
|
|
10
|
+
export { removeAllHtmlTags };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
element.removeAttribute(attribute);
|
|
1
|
+
// src/libs/remove/remove-attribute.ts
|
|
2
|
+
var removeAttribute = (element, attribute) => {
|
|
3
|
+
element.removeAttribute(attribute);
|
|
5
4
|
};
|
|
6
5
|
exports.removeAttribute = removeAttribute;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
removeAttribute
|
|
1
|
+
// src/libs/remove/remove-attribute.ts
|
|
2
|
+
var removeAttribute = (element, attribute) => {
|
|
3
|
+
element.removeAttribute(attribute);
|
|
6
4
|
};
|
|
5
|
+
export { removeAttribute };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let store2 = require("store2");
|
|
3
|
+
store2 = require_runtime.__toESM(store2, 1);
|
|
4
|
+
// src/libs/remove/remove-session-storage.ts
|
|
5
|
+
var removeSessionStorage = (key) => {
|
|
6
|
+
store2.default.session.remove(key);
|
|
6
7
|
};
|
|
7
8
|
exports.removeSessionStorage = removeSessionStorage;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import store from "store2";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
removeSessionStorage
|
|
2
|
+
// src/libs/remove/remove-session-storage.ts
|
|
3
|
+
var removeSessionStorage = (key) => {
|
|
4
|
+
store.session.remove(key);
|
|
7
5
|
};
|
|
6
|
+
export { removeSessionStorage };
|