umaki 0.2.4 → 0.2.6
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/README.md +193 -79
- package/dist/LICENSE.txt +32 -0
- package/dist/_virtual/_commonjsHelpers.cjs.js +19 -1
- package/dist/_virtual/_commonjsHelpers.es.js +16 -5
- package/dist/_virtual/isBetween.cjs.js +15 -1
- package/dist/_virtual/isBetween.es.js +13 -2
- package/dist/index.cjs.js +99 -1
- package/dist/index.es.js +97 -86
- package/dist/libs/control/bgScrollStop.cjs.js +24 -1
- package/dist/libs/control/bgScrollStop.es.js +21 -4
- package/dist/libs/control/pd.cjs.js +15 -1
- package/dist/libs/control/pd.es.js +13 -2
- package/dist/libs/control/scrollToHash.cjs.js +47 -1
- package/dist/libs/control/scrollToHash.es.js +42 -16
- package/dist/libs/control/videoPlayControl.cjs.js +33 -1
- package/dist/libs/control/videoPlayControl.es.js +27 -10
- package/dist/libs/convert/changeDateStringToSpecificFormat.cjs.js +16 -1
- package/dist/libs/convert/changeDateStringToSpecificFormat.es.js +14 -3
- package/dist/libs/convert/jsonStringToJsonObject.cjs.js +20 -1
- package/dist/libs/convert/jsonStringToJsonObject.es.js +15 -4
- package/dist/libs/get/getAspectRatio.cjs.js +19 -1
- package/dist/libs/get/getAspectRatio.es.js +16 -5
- package/dist/libs/get/getClassNames.cjs.js +18 -1
- package/dist/libs/get/getClassNames.es.js +16 -2
- package/dist/libs/get/getDocumentHeight.cjs.js +15 -1
- package/dist/libs/get/getDocumentHeight.es.js +13 -2
- package/dist/libs/get/getEventPaths.cjs.js +35 -1
- package/dist/libs/get/getEventPaths.es.js +30 -12
- package/dist/libs/get/getGcd.cjs.js +21 -1
- package/dist/libs/get/getGcd.es.js +18 -5
- package/dist/libs/get/getOrientation.cjs.js +18 -1
- package/dist/libs/get/getOrientation.es.js +16 -2
- package/dist/libs/get/getParentList.cjs.js +19 -1
- package/dist/libs/get/getParentList.es.js +16 -4
- package/dist/libs/get/getQueryParams.cjs.js +30 -1
- package/dist/libs/get/getQueryParams.es.js +26 -12
- package/dist/libs/get/getRem.cjs.js +18 -1
- package/dist/libs/get/getRem.es.js +16 -2
- package/dist/libs/get/getScrollbarWidth.cjs.js +15 -1
- package/dist/libs/get/getScrollbarWidth.es.js +13 -2
- package/dist/libs/get/getSessionStorage.cjs.js +20 -1
- package/dist/libs/get/getSessionStorage.es.js +17 -5
- package/dist/libs/get/getStringLength.cjs.js +16 -1
- package/dist/libs/get/getStringLength.es.js +14 -3
- package/dist/libs/get/getStylePropertyValue.cjs.js +15 -1
- package/dist/libs/get/getStylePropertyValue.es.js +13 -2
- package/dist/libs/get/getStylePropertyValueToNumber.cjs.js +16 -1
- package/dist/libs/get/getStylePropertyValueToNumber.es.js +14 -3
- package/dist/libs/get/getUaData.cjs.js +34 -1
- package/dist/libs/get/getUaData.es.js +30 -12
- package/dist/libs/is/isBetweenDateTime.cjs.js +25 -1
- package/dist/libs/is/isBetweenDateTime.es.js +21 -8
- package/dist/libs/is/isExistAllElements.cjs.js +17 -1
- package/dist/libs/is/isExistAllElements.es.js +15 -2
- package/dist/libs/is/isIpad.cjs.js +21 -1
- package/dist/libs/is/isIpad.es.js +18 -6
- package/dist/libs/is/isKeyExists.cjs.js +17 -1
- package/dist/libs/is/isKeyExists.es.js +15 -2
- package/dist/libs/is/isSafari.cjs.js +22 -1
- package/dist/libs/is/isSafari.es.js +19 -5
- package/dist/libs/is/isScrollable.cjs.js +19 -1
- package/dist/libs/is/isScrollable.es.js +16 -4
- package/dist/libs/is/isTouchSupport.cjs.js +16 -1
- package/dist/libs/is/isTouchSupport.es.js +14 -3
- package/dist/libs/remove/removeAllHtmlTags.cjs.js +23 -1
- package/dist/libs/remove/removeAllHtmlTags.es.js +21 -7
- package/dist/libs/remove/removeAttribute.cjs.js +17 -1
- package/dist/libs/remove/removeAttribute.es.js +14 -3
- package/dist/libs/remove/removeSessionStorage.cjs.js +18 -1
- package/dist/libs/remove/removeSessionStorage.es.js +15 -4
- package/dist/libs/remove/removeStylePropertyValue.cjs.js +17 -1
- package/dist/libs/remove/removeStylePropertyValue.es.js +14 -3
- package/dist/libs/set/set100vh.cjs.js +18 -1
- package/dist/libs/set/set100vh.es.js +15 -4
- package/dist/libs/set/set100vw.cjs.js +18 -1
- package/dist/libs/set/set100vw.es.js +15 -4
- package/dist/libs/set/setAttribute.cjs.js +17 -1
- package/dist/libs/set/setAttribute.es.js +14 -3
- package/dist/libs/set/setScrollPositionToCenter.cjs.js +21 -1
- package/dist/libs/set/setScrollPositionToCenter.es.js +18 -4
- package/dist/libs/set/setSessionStorage.cjs.js +18 -1
- package/dist/libs/set/setSessionStorage.es.js +15 -4
- package/dist/libs/set/setStylePropertyValue.cjs.js +17 -1
- package/dist/libs/set/setStylePropertyValue.es.js +14 -3
- package/dist/libs/to/toBoolean.cjs.js +17 -1
- package/dist/libs/to/toBoolean.es.js +15 -2
- package/dist/libs/to/toPositiveNumber.cjs.js +15 -1
- package/dist/libs/to/toPositiveNumber.es.js +13 -2
- package/dist/libs/transform/wrapTextWithSpans.cjs.js +31 -1
- package/dist/libs/transform/wrapTextWithSpans.es.js +27 -13
- package/dist/libs/wait/sleep.cjs.js +17 -1
- package/dist/libs/wait/sleep.es.js +15 -2
- package/dist/libs/wait/waitForAllMediaLoaded.cjs.js +55 -1
- package/dist/libs/wait/waitForAllMediaLoaded.es.js +47 -20
- package/dist/node_modules/dayjs/plugin/isBetween.cjs.js +30 -1
- package/dist/node_modules/dayjs/plugin/isBetween.es.js +25 -14
- package/package.json +2 -1
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
import DOMPurify from "isomorphic-dompurify";
|
|
13
|
+
const removeAllHtmlTags = (string) => {
|
|
14
|
+
const sanitizeString = DOMPurify.sanitize(string, {
|
|
15
|
+
ALLOWED_TAGS: [],
|
|
16
|
+
KEEP_CONTENT: true,
|
|
17
|
+
USE_PROFILES: { html: false }
|
|
18
|
+
});
|
|
19
|
+
return sanitizeString.replace(/<\/?[^>]+(>|$)/g, "");
|
|
20
|
+
};
|
|
7
21
|
export {
|
|
8
|
-
|
|
22
|
+
removeAllHtmlTags
|
|
9
23
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const removeAttribute = (element, attribute) => {
|
|
15
|
+
element.removeAttribute(attribute);
|
|
16
|
+
};
|
|
17
|
+
exports.removeAttribute = removeAttribute;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const removeAttribute = (element, attribute) => {
|
|
13
|
+
element.removeAttribute(attribute);
|
|
3
14
|
};
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
removeAttribute
|
|
6
17
|
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const store = require("store2");
|
|
15
|
+
const removeSessionStorage = (key) => {
|
|
16
|
+
store.session.remove(key);
|
|
17
|
+
};
|
|
18
|
+
exports.removeSessionStorage = removeSessionStorage;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
import store from "store2";
|
|
13
|
+
const removeSessionStorage = (key) => {
|
|
14
|
+
store.session.remove(key);
|
|
4
15
|
};
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
removeSessionStorage
|
|
7
18
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const removeStylePropertyValue = (key) => {
|
|
15
|
+
document.documentElement.style.removeProperty(key);
|
|
16
|
+
};
|
|
17
|
+
exports.removeStylePropertyValue = removeStylePropertyValue;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const removeStylePropertyValue = (key) => {
|
|
13
|
+
document.documentElement.style.removeProperty(key);
|
|
3
14
|
};
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
removeStylePropertyValue
|
|
6
17
|
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const set100vh = (setProperty = "--vh") => {
|
|
15
|
+
const vh = window.innerHeight * 0.01;
|
|
16
|
+
document.documentElement.style.setProperty(setProperty, `${vh}px`);
|
|
17
|
+
};
|
|
18
|
+
exports.set100vh = set100vh;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const set100vh = (setProperty = "--vh") => {
|
|
13
|
+
const vh = window.innerHeight * 0.01;
|
|
14
|
+
document.documentElement.style.setProperty(setProperty, `${vh}px`);
|
|
4
15
|
};
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
set100vh
|
|
7
18
|
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const set100vw = (setProperty = "--vw") => {
|
|
15
|
+
const vw = document.documentElement.clientWidth;
|
|
16
|
+
document.documentElement.style.setProperty(setProperty, `${vw}px`);
|
|
17
|
+
};
|
|
18
|
+
exports.set100vw = set100vw;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const set100vw = (setProperty = "--vw") => {
|
|
13
|
+
const vw = document.documentElement.clientWidth;
|
|
14
|
+
document.documentElement.style.setProperty(setProperty, `${vw}px`);
|
|
4
15
|
};
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
set100vw
|
|
7
18
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const setAttribute = (element, attribute, value) => {
|
|
15
|
+
element.setAttribute(attribute, value);
|
|
16
|
+
};
|
|
17
|
+
exports.setAttribute = setAttribute;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const setAttribute = (element, attribute, value) => {
|
|
13
|
+
element.setAttribute(attribute, value);
|
|
3
14
|
};
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
setAttribute
|
|
6
17
|
};
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const setScrollPositionToCenter = (rootElement, targetElement, behavior = "smooth") => {
|
|
15
|
+
const rootHalfW = rootElement.getBoundingClientRect().width / 2;
|
|
16
|
+
const buttonHalfW = targetElement.getBoundingClientRect().width / 2;
|
|
17
|
+
const currentPosLeft = targetElement.offsetLeft + buttonHalfW;
|
|
18
|
+
const posLeft = currentPosLeft - rootHalfW;
|
|
19
|
+
rootElement.scrollTo({ left: posLeft, behavior });
|
|
20
|
+
};
|
|
21
|
+
exports.setScrollPositionToCenter = setScrollPositionToCenter;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const setScrollPositionToCenter = (rootElement, targetElement, behavior = "smooth") => {
|
|
13
|
+
const rootHalfW = rootElement.getBoundingClientRect().width / 2;
|
|
14
|
+
const buttonHalfW = targetElement.getBoundingClientRect().width / 2;
|
|
15
|
+
const currentPosLeft = targetElement.offsetLeft + buttonHalfW;
|
|
16
|
+
const posLeft = currentPosLeft - rootHalfW;
|
|
17
|
+
rootElement.scrollTo({ left: posLeft, behavior });
|
|
4
18
|
};
|
|
5
19
|
export {
|
|
6
|
-
|
|
20
|
+
setScrollPositionToCenter
|
|
7
21
|
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const store = require("store2");
|
|
15
|
+
const setSessionStorage = (key, value) => {
|
|
16
|
+
store.session.set(key, value);
|
|
17
|
+
};
|
|
18
|
+
exports.setSessionStorage = setSessionStorage;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
import store from "store2";
|
|
13
|
+
const setSessionStorage = (key, value) => {
|
|
14
|
+
store.session.set(key, value);
|
|
4
15
|
};
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
setSessionStorage
|
|
7
18
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const setStylePropertyValue = (key, value) => {
|
|
15
|
+
document.documentElement.style.setProperty(key, value);
|
|
16
|
+
};
|
|
17
|
+
exports.setStylePropertyValue = setStylePropertyValue;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const setStylePropertyValue = (key, value) => {
|
|
13
|
+
document.documentElement.style.setProperty(key, value);
|
|
3
14
|
};
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
setStylePropertyValue
|
|
6
17
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const toBoolean = (booleanStr) => {
|
|
15
|
+
return booleanStr ? booleanStr.toLowerCase() === "true" : false;
|
|
16
|
+
};
|
|
17
|
+
exports.toBoolean = toBoolean;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const toBoolean = (booleanStr) => {
|
|
13
|
+
return booleanStr ? booleanStr.toLowerCase() === "true" : false;
|
|
14
|
+
};
|
|
2
15
|
export {
|
|
3
|
-
|
|
16
|
+
toBoolean
|
|
4
17
|
};
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const toPositiveNumber = (n) => Math.abs(n);
|
|
15
|
+
exports.toPositiveNumber = toPositiveNumber;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const toPositiveNumber = (n) => Math.abs(n);
|
|
2
13
|
export {
|
|
3
|
-
|
|
14
|
+
toPositiveNumber
|
|
4
15
|
};
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const wrapTextWithSpans = (element) => {
|
|
15
|
+
if (!element) return;
|
|
16
|
+
if (element.nodeType === Node.TEXT_NODE) {
|
|
17
|
+
const textContent = (element.textContent || "").trim();
|
|
18
|
+
const fragment = document.createDocumentFragment();
|
|
19
|
+
for (const char of textContent) {
|
|
20
|
+
const span = document.createElement("span");
|
|
21
|
+
span.textContent = char;
|
|
22
|
+
fragment.appendChild(span);
|
|
23
|
+
}
|
|
24
|
+
element.replaceWith(fragment);
|
|
25
|
+
} else if (element.nodeType === Node.ELEMENT_NODE) {
|
|
26
|
+
for (const child of Array.from(element.childNodes)) {
|
|
27
|
+
wrapTextWithSpans(child);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.wrapTextWithSpans = wrapTextWithSpans;
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const wrapTextWithSpans = (element) => {
|
|
13
|
+
if (!element) return;
|
|
14
|
+
if (element.nodeType === Node.TEXT_NODE) {
|
|
15
|
+
const textContent = (element.textContent || "").trim();
|
|
16
|
+
const fragment = document.createDocumentFragment();
|
|
17
|
+
for (const char of textContent) {
|
|
18
|
+
const span = document.createElement("span");
|
|
19
|
+
span.textContent = char;
|
|
20
|
+
fragment.appendChild(span);
|
|
21
|
+
}
|
|
22
|
+
element.replaceWith(fragment);
|
|
23
|
+
} else if (element.nodeType === Node.ELEMENT_NODE) {
|
|
24
|
+
for (const child of Array.from(element.childNodes)) {
|
|
25
|
+
wrapTextWithSpans(child);
|
|
26
|
+
}
|
|
13
27
|
}
|
|
14
28
|
};
|
|
15
29
|
export {
|
|
16
|
-
|
|
30
|
+
wrapTextWithSpans
|
|
17
31
|
};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.2.6
|
|
5
|
+
* description: A utility that is often used in web production.
|
|
6
|
+
* author: TsubasaHiga
|
|
7
|
+
* homepage: https://github.com/TsubasaHiga/umaki
|
|
8
|
+
* Released under the MIT License
|
|
9
|
+
*
|
|
10
|
+
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
11
|
+
* For license information, please see LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const sleep = (time) => {
|
|
15
|
+
return new Promise((resolve) => setTimeout(resolve, time * 1e3, "foo"));
|
|
16
|
+
};
|
|
17
|
+
exports.sleep = sleep;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.2.6
|
|
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
|
+
const sleep = (time) => {
|
|
13
|
+
return new Promise((resolve) => setTimeout(resolve, time * 1e3, "foo"));
|
|
14
|
+
};
|
|
2
15
|
export {
|
|
3
|
-
|
|
16
|
+
sleep
|
|
4
17
|
};
|