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 +1,33 @@
|
|
|
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 = require("../to/toBoolean.cjs.js");
|
|
15
|
+
const videoPlayControl = async (videoElement, state) => {
|
|
16
|
+
if (state && videoElement.paused) {
|
|
17
|
+
const isPlaying = toBoolean.toBoolean(videoElement.dataset.playing);
|
|
18
|
+
if (isPlaying) return;
|
|
19
|
+
const playPromise = videoElement.play();
|
|
20
|
+
if (playPromise === void 0) return;
|
|
21
|
+
try {
|
|
22
|
+
await playPromise;
|
|
23
|
+
videoElement.currentTime = 0;
|
|
24
|
+
videoElement.dataset.playing = "true";
|
|
25
|
+
} catch (error) {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!state) {
|
|
29
|
+
videoElement.pause();
|
|
30
|
+
videoElement.dataset.playing = "false";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.videoPlayControl = videoPlayControl;
|
|
@@ -1,16 +1,33 @@
|
|
|
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 { toBoolean } from "../to/toBoolean.es.js";
|
|
13
|
+
const videoPlayControl = async (videoElement, state) => {
|
|
14
|
+
if (state && videoElement.paused) {
|
|
15
|
+
const isPlaying = toBoolean(videoElement.dataset.playing);
|
|
16
|
+
if (isPlaying) return;
|
|
17
|
+
const playPromise = videoElement.play();
|
|
18
|
+
if (playPromise === void 0) return;
|
|
7
19
|
try {
|
|
8
|
-
await
|
|
9
|
-
|
|
20
|
+
await playPromise;
|
|
21
|
+
videoElement.currentTime = 0;
|
|
22
|
+
videoElement.dataset.playing = "true";
|
|
23
|
+
} catch (error) {
|
|
10
24
|
}
|
|
11
25
|
}
|
|
12
|
-
|
|
26
|
+
if (!state) {
|
|
27
|
+
videoElement.pause();
|
|
28
|
+
videoElement.dataset.playing = "false";
|
|
29
|
+
}
|
|
13
30
|
};
|
|
14
31
|
export {
|
|
15
|
-
|
|
32
|
+
videoPlayControl
|
|
16
33
|
};
|
|
@@ -1 +1,16 @@
|
|
|
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 dayjs = require("dayjs");
|
|
15
|
+
const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日") => dayjs(date).format(format);
|
|
16
|
+
exports.changeDateStringToSpecificFormat = changeDateStringToSpecificFormat;
|
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
import dayjs from "dayjs";
|
|
13
|
+
const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日") => dayjs(date).format(format);
|
|
3
14
|
export {
|
|
4
|
-
|
|
15
|
+
changeDateStringToSpecificFormat
|
|
5
16
|
};
|
|
@@ -1 +1,20 @@
|
|
|
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 jsonStringToJsonObject = (string) => {
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(string);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.jsonStringToJsonObject = jsonStringToJsonObject;
|
|
@@ -1,9 +1,20 @@
|
|
|
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 jsonStringToJsonObject = (string) => {
|
|
2
13
|
try {
|
|
3
|
-
return JSON.parse(
|
|
4
|
-
} catch {
|
|
14
|
+
return JSON.parse(string);
|
|
15
|
+
} catch (error) {
|
|
5
16
|
}
|
|
6
17
|
};
|
|
7
18
|
export {
|
|
8
|
-
|
|
19
|
+
jsonStringToJsonObject
|
|
9
20
|
};
|
|
@@ -1 +1,19 @@
|
|
|
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 getGcd = require("./getGcd.cjs.js");
|
|
15
|
+
const getAspectRatio = (w, h) => {
|
|
16
|
+
const gcd = getGcd.getGcd(w, h);
|
|
17
|
+
return { w: w / gcd, h: h / gcd };
|
|
18
|
+
};
|
|
19
|
+
exports.getAspectRatio = getAspectRatio;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 { getGcd } from "./getGcd.es.js";
|
|
13
|
+
const getAspectRatio = (w, h) => {
|
|
14
|
+
const gcd = getGcd(w, h);
|
|
15
|
+
return { w: w / gcd, h: h / gcd };
|
|
5
16
|
};
|
|
6
17
|
export {
|
|
7
|
-
|
|
18
|
+
getAspectRatio
|
|
8
19
|
};
|
|
@@ -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 getClassNames = (target) => {
|
|
15
|
+
const list = String(target.classList).split(" ").filter((v) => v);
|
|
16
|
+
return list;
|
|
17
|
+
};
|
|
18
|
+
exports.getClassNames = getClassNames;
|
|
@@ -1,4 +1,18 @@
|
|
|
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 getClassNames = (target) => {
|
|
13
|
+
const list = String(target.classList).split(" ").filter((v) => v);
|
|
14
|
+
return list;
|
|
15
|
+
};
|
|
2
16
|
export {
|
|
3
|
-
|
|
17
|
+
getClassNames
|
|
4
18
|
};
|
|
@@ -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 getDocumentHeight = () => document.body.clientHeight - window.innerHeight;
|
|
15
|
+
exports.getDocumentHeight = getDocumentHeight;
|
|
@@ -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 getDocumentHeight = () => document.body.clientHeight - window.innerHeight;
|
|
2
13
|
export {
|
|
3
|
-
|
|
14
|
+
getDocumentHeight
|
|
4
15
|
};
|
|
@@ -1 +1,35 @@
|
|
|
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 getEventPaths = (evt) => {
|
|
15
|
+
var _a;
|
|
16
|
+
let path = ((_a = evt.composedPath) == null ? void 0 : _a.call(evt)) || null;
|
|
17
|
+
const target = evt.target;
|
|
18
|
+
if (path != null) {
|
|
19
|
+
path = path.indexOf(window) < 0 ? path.concat([window]) : path;
|
|
20
|
+
return path;
|
|
21
|
+
}
|
|
22
|
+
if (target instanceof Window) {
|
|
23
|
+
return [window];
|
|
24
|
+
}
|
|
25
|
+
const getParents = (node, memo) => {
|
|
26
|
+
const updatedMemo = memo || [];
|
|
27
|
+
const parentNode = node.parentNode;
|
|
28
|
+
if (!parentNode) {
|
|
29
|
+
return memo;
|
|
30
|
+
}
|
|
31
|
+
return getParents(parentNode, updatedMemo.concat([parentNode]));
|
|
32
|
+
};
|
|
33
|
+
return [target].concat(getParents(target, [])).concat([window]);
|
|
34
|
+
};
|
|
35
|
+
exports.getEventPaths = getEventPaths;
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 getEventPaths = (evt) => {
|
|
13
|
+
var _a;
|
|
14
|
+
let path = ((_a = evt.composedPath) == null ? void 0 : _a.call(evt)) || null;
|
|
15
|
+
const target = evt.target;
|
|
16
|
+
if (path != null) {
|
|
17
|
+
path = path.indexOf(window) < 0 ? path.concat([window]) : path;
|
|
18
|
+
return path;
|
|
19
|
+
}
|
|
20
|
+
if (target instanceof Window) {
|
|
8
21
|
return [window];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
}
|
|
23
|
+
const getParents = (node, memo) => {
|
|
24
|
+
const updatedMemo = memo || [];
|
|
25
|
+
const parentNode = node.parentNode;
|
|
26
|
+
if (!parentNode) {
|
|
27
|
+
return memo;
|
|
28
|
+
}
|
|
29
|
+
return getParents(parentNode, updatedMemo.concat([parentNode]));
|
|
12
30
|
};
|
|
13
|
-
return [
|
|
31
|
+
return [target].concat(getParents(target, [])).concat([window]);
|
|
14
32
|
};
|
|
15
33
|
export {
|
|
16
|
-
|
|
34
|
+
getEventPaths
|
|
17
35
|
};
|
|
@@ -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 toPositiveNumber = require("../to/toPositiveNumber.cjs.js");
|
|
15
|
+
const getGcd = (a, b) => {
|
|
16
|
+
const positiveA = toPositiveNumber.toPositiveNumber(Math.abs(a));
|
|
17
|
+
const positiveB = toPositiveNumber.toPositiveNumber(Math.abs(b));
|
|
18
|
+
if (positiveB === 0) return positiveA;
|
|
19
|
+
return getGcd(positiveB, positiveA % positiveB);
|
|
20
|
+
};
|
|
21
|
+
exports.getGcd = getGcd;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 { toPositiveNumber } from "../to/toPositiveNumber.es.js";
|
|
13
|
+
const getGcd = (a, b) => {
|
|
14
|
+
const positiveA = toPositiveNumber(Math.abs(a));
|
|
15
|
+
const positiveB = toPositiveNumber(Math.abs(b));
|
|
16
|
+
if (positiveB === 0) return positiveA;
|
|
17
|
+
return getGcd(positiveB, positiveA % positiveB);
|
|
5
18
|
};
|
|
6
19
|
export {
|
|
7
|
-
|
|
20
|
+
getGcd
|
|
8
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 getOrientation = () => {
|
|
15
|
+
const isLandscape = window.matchMedia("(orientation: landscape)").matches;
|
|
16
|
+
return isLandscape ? "landscape" : "portrait";
|
|
17
|
+
};
|
|
18
|
+
exports.getOrientation = getOrientation;
|
|
@@ -1,4 +1,18 @@
|
|
|
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 getOrientation = () => {
|
|
13
|
+
const isLandscape = window.matchMedia("(orientation: landscape)").matches;
|
|
14
|
+
return isLandscape ? "landscape" : "portrait";
|
|
15
|
+
};
|
|
2
16
|
export {
|
|
3
|
-
|
|
17
|
+
getOrientation
|
|
4
18
|
};
|
|
@@ -1 +1,19 @@
|
|
|
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 getParentList = (element) => {
|
|
15
|
+
const parentElement = element.parentElement;
|
|
16
|
+
if (!parentElement) return [element];
|
|
17
|
+
return [element].concat(getParentList(parentElement));
|
|
18
|
+
};
|
|
19
|
+
exports.getParentList = getParentList;
|
|
@@ -1,7 +1,19 @@
|
|
|
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 getParentList = (element) => {
|
|
13
|
+
const parentElement = element.parentElement;
|
|
14
|
+
if (!parentElement) return [element];
|
|
15
|
+
return [element].concat(getParentList(parentElement));
|
|
4
16
|
};
|
|
5
17
|
export {
|
|
6
|
-
|
|
18
|
+
getParentList
|
|
7
19
|
};
|
|
@@ -1 +1,30 @@
|
|
|
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 queryString = require("query-string");
|
|
15
|
+
const queryStringOptions = {
|
|
16
|
+
arrayFormat: "comma",
|
|
17
|
+
parseNumbers: true
|
|
18
|
+
};
|
|
19
|
+
const getQueryParams = (query, parseOptions) => {
|
|
20
|
+
const options = {
|
|
21
|
+
...queryStringOptions,
|
|
22
|
+
...parseOptions
|
|
23
|
+
};
|
|
24
|
+
const queryParsed = queryString.parse(window.location.search, options);
|
|
25
|
+
if (!queryParsed) return null;
|
|
26
|
+
const params = queryParsed[query];
|
|
27
|
+
if (params === null || params === void 0) return null;
|
|
28
|
+
return params;
|
|
29
|
+
};
|
|
30
|
+
exports.getQueryParams = getQueryParams;
|
|
@@ -1,16 +1,30 @@
|
|
|
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
|
+
import queryString from "query-string";
|
|
13
|
+
const queryStringOptions = {
|
|
3
14
|
arrayFormat: "comma",
|
|
4
|
-
parseNumbers:
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
15
|
+
parseNumbers: true
|
|
16
|
+
};
|
|
17
|
+
const getQueryParams = (query, parseOptions) => {
|
|
18
|
+
const options = {
|
|
19
|
+
...queryStringOptions,
|
|
20
|
+
...parseOptions
|
|
21
|
+
};
|
|
22
|
+
const queryParsed = queryString.parse(window.location.search, options);
|
|
23
|
+
if (!queryParsed) return null;
|
|
24
|
+
const params = queryParsed[query];
|
|
25
|
+
if (params === null || params === void 0) return null;
|
|
26
|
+
return params;
|
|
13
27
|
};
|
|
14
28
|
export {
|
|
15
|
-
|
|
29
|
+
getQueryParams
|
|
16
30
|
};
|
|
@@ -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 getRem = (px) => {
|
|
15
|
+
const baseFontSize = 16;
|
|
16
|
+
return `${px / baseFontSize}rem`;
|
|
17
|
+
};
|
|
18
|
+
exports.getRem = getRem;
|
|
@@ -1,4 +1,18 @@
|
|
|
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 getRem = (px) => {
|
|
13
|
+
const baseFontSize = 16;
|
|
14
|
+
return `${px / baseFontSize}rem`;
|
|
15
|
+
};
|
|
2
16
|
export {
|
|
3
|
-
|
|
17
|
+
getRem
|
|
4
18
|
};
|
|
@@ -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 getScrollbarWidth = () => window.innerWidth - document.body.clientWidth;
|
|
15
|
+
exports.getScrollbarWidth = getScrollbarWidth;
|