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,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
document.documentElement.style.removeProperty(key);
|
|
1
|
+
// src/libs/remove/remove-style-property-value.ts
|
|
2
|
+
var removeStylePropertyValue = (key) => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
document.documentElement.style.removeProperty(key);
|
|
6
5
|
};
|
|
7
6
|
exports.removeStylePropertyValue = removeStylePropertyValue;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
removeStylePropertyValue
|
|
1
|
+
// src/libs/remove/remove-style-property-value.ts
|
|
2
|
+
var removeStylePropertyValue = (key) => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
document.documentElement.style.removeProperty(key);
|
|
7
5
|
};
|
|
6
|
+
export { removeStylePropertyValue };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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/security/html-sanitize.ts
|
|
5
|
+
var STRING_OUTPUT_CONFIG = {
|
|
6
|
+
RETURN_DOM: false,
|
|
7
|
+
RETURN_DOM_FRAGMENT: false,
|
|
8
|
+
RETURN_TRUSTED_TYPE: false,
|
|
9
|
+
IN_PLACE: false
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
var htmlSanitize = (html, config = {}) => {
|
|
12
|
+
return isomorphic_dompurify.default.sanitize(html, {
|
|
13
|
+
...config,
|
|
14
|
+
...STRING_OUTPUT_CONFIG
|
|
15
|
+
});
|
|
12
16
|
};
|
|
13
|
-
|
|
17
|
+
var sanitizeHtml = htmlSanitize;
|
|
14
18
|
exports.htmlSanitize = htmlSanitize;
|
|
15
19
|
exports.sanitizeHtml = sanitizeHtml;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import DOMPurify from "isomorphic-dompurify";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// src/libs/security/html-sanitize.ts
|
|
3
|
+
var STRING_OUTPUT_CONFIG = {
|
|
4
|
+
RETURN_DOM: false,
|
|
5
|
+
RETURN_DOM_FRAGMENT: false,
|
|
6
|
+
RETURN_TRUSTED_TYPE: false,
|
|
7
|
+
IN_PLACE: false
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
htmlSanitize,
|
|
14
|
-
sanitizeHtml
|
|
9
|
+
var htmlSanitize = (html, config = {}) => {
|
|
10
|
+
return DOMPurify.sanitize(html, {
|
|
11
|
+
...config,
|
|
12
|
+
...STRING_OUTPUT_CONFIG
|
|
13
|
+
});
|
|
15
14
|
};
|
|
15
|
+
var sanitizeHtml = htmlSanitize;
|
|
16
|
+
export { htmlSanitize, sanitizeHtml };
|
|
@@ -1,5 +1,15 @@
|
|
|
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
|
-
exports.htmlSanitize =
|
|
5
|
-
exports.sanitizeHtml =
|
|
13
|
+
const require_html_sanitize = require("./html-sanitize.cjs");
|
|
14
|
+
exports.htmlSanitize = require_html_sanitize.htmlSanitize;
|
|
15
|
+
exports.sanitizeHtml = require_html_sanitize.sanitizeHtml;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
*/
|
|
12
|
+
export { htmlSanitize, sanitizeHtml } from "./html-sanitize.es.js";
|
package/dist/libs/set/index.cjs
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
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
|
-
const
|
|
8
|
-
const
|
|
9
|
-
exports.set100vh =
|
|
10
|
-
exports.set100vw =
|
|
11
|
-
exports.setAttribute =
|
|
12
|
-
exports.setScrollPositionToCenter =
|
|
13
|
-
exports.setSessionStorage =
|
|
14
|
-
exports.setStylePropertyValue =
|
|
13
|
+
const require_set_100vh = require("./set-100vh.cjs");
|
|
14
|
+
const require_set_100vw = require("./set-100vw.cjs");
|
|
15
|
+
const require_set_attribute = require("./set-attribute.cjs");
|
|
16
|
+
const require_set_scroll_position_to_center = require("./set-scroll-position-to-center.cjs");
|
|
17
|
+
const require_set_session_storage = require("./set-session-storage.cjs");
|
|
18
|
+
const require_set_style_property_value = require("./set-style-property-value.cjs");
|
|
19
|
+
exports.set100vh = require_set_100vh.set100vh;
|
|
20
|
+
exports.set100vw = require_set_100vw.set100vw;
|
|
21
|
+
exports.setAttribute = require_set_attribute.setAttribute;
|
|
22
|
+
exports.setScrollPositionToCenter = require_set_scroll_position_to_center.setScrollPositionToCenter;
|
|
23
|
+
exports.setSessionStorage = require_set_session_storage.setSessionStorage;
|
|
24
|
+
exports.setStylePropertyValue = require_set_style_property_value.setStylePropertyValue;
|
|
@@ -1,14 +1,18 @@
|
|
|
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 { set100vh } from "./set-100vh.es.js";
|
|
2
13
|
import { set100vw } from "./set-100vw.es.js";
|
|
3
14
|
import { setAttribute } from "./set-attribute.es.js";
|
|
4
15
|
import { setScrollPositionToCenter } from "./set-scroll-position-to-center.es.js";
|
|
5
16
|
import { setSessionStorage } from "./set-session-storage.es.js";
|
|
6
17
|
import { setStylePropertyValue } from "./set-style-property-value.es.js";
|
|
7
|
-
export {
|
|
8
|
-
set100vh,
|
|
9
|
-
set100vw,
|
|
10
|
-
setAttribute,
|
|
11
|
-
setScrollPositionToCenter,
|
|
12
|
-
setSessionStorage,
|
|
13
|
-
setStylePropertyValue
|
|
14
|
-
};
|
|
18
|
+
export { set100vh, set100vw, setAttribute, setScrollPositionToCenter, setSessionStorage, setStylePropertyValue };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
document.documentElement.style.setProperty(setProperty, `${vh}px`);
|
|
1
|
+
// src/libs/set/set-100vh.ts
|
|
2
|
+
var set100vh = (setProperty = "--vh") => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
const vh = window.innerHeight * .01;
|
|
5
|
+
document.documentElement.style.setProperty(setProperty, `${vh}px`);
|
|
7
6
|
};
|
|
8
7
|
exports.set100vh = set100vh;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
set100vh
|
|
1
|
+
// src/libs/set/set-100vh.ts
|
|
2
|
+
var set100vh = (setProperty = "--vh") => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
const vh = window.innerHeight * .01;
|
|
5
|
+
document.documentElement.style.setProperty(setProperty, `${vh}px`);
|
|
8
6
|
};
|
|
7
|
+
export { set100vh };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
document.documentElement.style.setProperty(setProperty, `${vw}px`);
|
|
1
|
+
// src/libs/set/set-100vw.ts
|
|
2
|
+
var set100vw = (setProperty = "--vw") => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
const vw = document.documentElement.clientWidth;
|
|
5
|
+
document.documentElement.style.setProperty(setProperty, `${vw}px`);
|
|
7
6
|
};
|
|
8
7
|
exports.set100vw = set100vw;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
set100vw
|
|
1
|
+
// src/libs/set/set-100vw.ts
|
|
2
|
+
var set100vw = (setProperty = "--vw") => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
const vw = document.documentElement.clientWidth;
|
|
5
|
+
document.documentElement.style.setProperty(setProperty, `${vw}px`);
|
|
8
6
|
};
|
|
7
|
+
export { set100vw };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
element.setAttribute(attribute, value);
|
|
1
|
+
// src/libs/set/set-attribute.ts
|
|
2
|
+
var setAttribute = (element, attribute, value) => {
|
|
3
|
+
element.setAttribute(attribute, value);
|
|
5
4
|
};
|
|
6
5
|
exports.setAttribute = setAttribute;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
setAttribute
|
|
1
|
+
// src/libs/set/set-attribute.ts
|
|
2
|
+
var setAttribute = (element, attribute, value) => {
|
|
3
|
+
element.setAttribute(attribute, value);
|
|
6
4
|
};
|
|
5
|
+
export { setAttribute };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
// src/libs/set/set-scroll-position-to-center.ts
|
|
2
|
+
var setScrollPositionToCenter = (rootElement, targetElement, behavior = "smooth") => {
|
|
3
|
+
const rootHalfW = rootElement.getBoundingClientRect().width / 2;
|
|
4
|
+
const targetHalfW = targetElement.getBoundingClientRect().width / 2;
|
|
5
|
+
const posLeft = targetElement.offsetLeft + targetHalfW - rootHalfW;
|
|
6
|
+
rootElement.scrollTo({
|
|
7
|
+
left: posLeft,
|
|
8
|
+
behavior
|
|
9
|
+
});
|
|
9
10
|
};
|
|
10
11
|
exports.setScrollPositionToCenter = setScrollPositionToCenter;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// src/libs/set/set-scroll-position-to-center.ts
|
|
2
|
+
var setScrollPositionToCenter = (rootElement, targetElement, behavior = "smooth") => {
|
|
3
|
+
const rootHalfW = rootElement.getBoundingClientRect().width / 2;
|
|
4
|
+
const targetHalfW = targetElement.getBoundingClientRect().width / 2;
|
|
5
|
+
const posLeft = targetElement.offsetLeft + targetHalfW - rootHalfW;
|
|
6
|
+
rootElement.scrollTo({
|
|
7
|
+
left: posLeft,
|
|
8
|
+
behavior
|
|
9
|
+
});
|
|
10
10
|
};
|
|
11
|
+
export { setScrollPositionToCenter };
|
|
@@ -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/set/set-session-storage.ts
|
|
5
|
+
var setSessionStorage = (key, value) => {
|
|
6
|
+
store2.default.session.set(key, value);
|
|
6
7
|
};
|
|
7
8
|
exports.setSessionStorage = setSessionStorage;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import store from "store2";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
setSessionStorage
|
|
2
|
+
// src/libs/set/set-session-storage.ts
|
|
3
|
+
var setSessionStorage = (key, value) => {
|
|
4
|
+
store.session.set(key, value);
|
|
7
5
|
};
|
|
6
|
+
export { setSessionStorage };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
document.documentElement.style.setProperty(key, value);
|
|
1
|
+
// src/libs/set/set-style-property-value.ts
|
|
2
|
+
var setStylePropertyValue = (key, value) => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
document.documentElement.style.setProperty(key, value);
|
|
6
5
|
};
|
|
7
6
|
exports.setStylePropertyValue = setStylePropertyValue;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
setStylePropertyValue
|
|
1
|
+
// src/libs/set/set-style-property-value.ts
|
|
2
|
+
var setStylePropertyValue = (key, value) => {
|
|
3
|
+
if (typeof window === "undefined") return;
|
|
4
|
+
document.documentElement.style.setProperty(key, value);
|
|
7
5
|
};
|
|
6
|
+
export { setStylePropertyValue };
|
package/dist/libs/to/index.cjs
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
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
|
-
exports.toBoolean =
|
|
6
|
-
exports.toPositiveNumber =
|
|
13
|
+
const require_to_boolean = require("./to-boolean.cjs");
|
|
14
|
+
const require_to_positive_number = require("./to-positive-number.cjs");
|
|
15
|
+
exports.toBoolean = require_to_boolean.toBoolean;
|
|
16
|
+
exports.toPositiveNumber = require_to_positive_number.toPositiveNumber;
|
package/dist/libs/to/index.es.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
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 { toBoolean } from "./to-boolean.es.js";
|
|
2
13
|
import { toPositiveNumber } from "./to-positive-number.es.js";
|
|
3
|
-
export {
|
|
4
|
-
toBoolean,
|
|
5
|
-
toPositiveNumber
|
|
6
|
-
};
|
|
14
|
+
export { toBoolean, toPositiveNumber };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return booleanStr ? booleanStr.toLowerCase() === "true" : false;
|
|
1
|
+
// src/libs/to/to-boolean.ts
|
|
2
|
+
var toBoolean = (booleanStr) => {
|
|
3
|
+
return booleanStr ? booleanStr.toLowerCase() === "true" : false;
|
|
5
4
|
};
|
|
6
5
|
exports.toBoolean = toBoolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
toBoolean
|
|
1
|
+
// src/libs/to/to-boolean.ts
|
|
2
|
+
var toBoolean = (booleanStr) => {
|
|
3
|
+
return booleanStr ? booleanStr.toLowerCase() === "true" : false;
|
|
6
4
|
};
|
|
5
|
+
export { toBoolean };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
// src/libs/to/to-positive-number.ts
|
|
2
|
+
var toPositiveNumber = (n) => Math.abs(n);
|
|
3
|
+
export { toPositiveNumber };
|
|
@@ -1,4 +1,14 @@
|
|
|
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
|
-
exports.wrapTextWithSpans =
|
|
13
|
+
const require_wrap_text_with_spans = require("./wrap-text-with-spans.cjs");
|
|
14
|
+
exports.wrapTextWithSpans = require_wrap_text_with_spans.wrapTextWithSpans;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
*/
|
|
12
|
+
export { wrapTextWithSpans } from "./wrap-text-with-spans.es.js";
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} else if (element.nodeType === Node.ELEMENT_NODE) {
|
|
17
|
-
for (const child of Array.from(element.childNodes)) {
|
|
18
|
-
wrapTextWithSpans(child);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
let runes2 = require("runes2");
|
|
2
|
+
// src/libs/transform/wrap-text-with-spans.ts
|
|
3
|
+
var wrapTextWithSpans = (element) => {
|
|
4
|
+
if (!element) return;
|
|
5
|
+
if (element.nodeType === Node.TEXT_NODE) {
|
|
6
|
+
const textContent = (element.textContent || "").trim();
|
|
7
|
+
const fragment = document.createDocumentFragment();
|
|
8
|
+
const graphemes = (0, runes2.runes)(textContent);
|
|
9
|
+
for (const grapheme of graphemes) {
|
|
10
|
+
const span = document.createElement("span");
|
|
11
|
+
span.textContent = grapheme;
|
|
12
|
+
fragment.appendChild(span);
|
|
13
|
+
}
|
|
14
|
+
element.replaceWith(fragment);
|
|
15
|
+
} else if (element.nodeType === Node.ELEMENT_NODE) for (const child of Array.from(element.childNodes)) wrapTextWithSpans(child);
|
|
21
16
|
};
|
|
22
17
|
exports.wrapTextWithSpans = wrapTextWithSpans;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { runes } from "runes2";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
wrapTextWithSpans(child);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
wrapTextWithSpans
|
|
2
|
+
// src/libs/transform/wrap-text-with-spans.ts
|
|
3
|
+
var wrapTextWithSpans = (element) => {
|
|
4
|
+
if (!element) return;
|
|
5
|
+
if (element.nodeType === Node.TEXT_NODE) {
|
|
6
|
+
const textContent = (element.textContent || "").trim();
|
|
7
|
+
const fragment = document.createDocumentFragment();
|
|
8
|
+
const graphemes = runes(textContent);
|
|
9
|
+
for (const grapheme of graphemes) {
|
|
10
|
+
const span = document.createElement("span");
|
|
11
|
+
span.textContent = grapheme;
|
|
12
|
+
fragment.appendChild(span);
|
|
13
|
+
}
|
|
14
|
+
element.replaceWith(fragment);
|
|
15
|
+
} else if (element.nodeType === Node.ELEMENT_NODE) for (const child of Array.from(element.childNodes)) wrapTextWithSpans(child);
|
|
22
16
|
};
|
|
17
|
+
export { wrapTextWithSpans };
|
package/dist/libs/wait/index.cjs
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
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
|
-
exports.sleep =
|
|
6
|
-
exports.waitForAllMediaLoaded =
|
|
13
|
+
const require_sleep = require("./sleep.cjs");
|
|
14
|
+
const require_wait_for_all_media_loaded = require("./wait-for-all-media-loaded.cjs");
|
|
15
|
+
exports.sleep = require_sleep.sleep;
|
|
16
|
+
exports.waitForAllMediaLoaded = require_wait_for_all_media_loaded.waitForAllMediaLoaded;
|
|
@@ -1,6 +1,14 @@
|
|
|
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 { sleep } from "./sleep.es.js";
|
|
2
13
|
import { waitForAllMediaLoaded } from "./wait-for-all-media-loaded.es.js";
|
|
3
|
-
export {
|
|
4
|
-
sleep,
|
|
5
|
-
waitForAllMediaLoaded
|
|
6
|
-
};
|
|
14
|
+
export { sleep, waitForAllMediaLoaded };
|