umaki 0.3.0 → 0.3.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/README.md +209 -197
- package/dist/_virtual/_commonjsHelpers.cjs.js +1 -1
- package/dist/_virtual/_commonjsHelpers.es.js +1 -1
- package/dist/_virtual/isBetween.cjs.js +1 -1
- package/dist/_virtual/isBetween.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/libs/control/bgScrollStop.cjs.js +1 -1
- package/dist/libs/control/bgScrollStop.es.js +1 -1
- package/dist/libs/control/pd.cjs.js +1 -1
- package/dist/libs/control/pd.es.js +1 -1
- package/dist/libs/control/scrollToHash.cjs.js +1 -1
- package/dist/libs/control/scrollToHash.es.js +1 -1
- package/dist/libs/control/videoPlayControl.cjs.js +3 -3
- package/dist/libs/control/videoPlayControl.d.ts +1 -1
- package/dist/libs/control/videoPlayControl.es.js +3 -3
- package/dist/libs/convert/changeDateStringToSpecificFormat.cjs.js +1 -1
- package/dist/libs/convert/changeDateStringToSpecificFormat.es.js +1 -1
- package/dist/libs/convert/jsonStringToJsonObject.cjs.js +1 -1
- package/dist/libs/convert/jsonStringToJsonObject.es.js +1 -1
- package/dist/libs/eventControl/debounce.cjs.js +1 -1
- package/dist/libs/eventControl/debounce.es.js +1 -1
- package/dist/libs/eventControl/throttle.cjs.js +1 -1
- package/dist/libs/eventControl/throttle.es.js +1 -1
- package/dist/libs/get/getAspectRatio.cjs.js +1 -1
- package/dist/libs/get/getAspectRatio.es.js +1 -1
- package/dist/libs/get/getClassNames.cjs.js +1 -1
- package/dist/libs/get/getClassNames.es.js +1 -1
- package/dist/libs/get/getDocumentHeight.cjs.js +1 -1
- package/dist/libs/get/getDocumentHeight.es.js +1 -1
- package/dist/libs/get/getEventPaths.cjs.js +1 -1
- package/dist/libs/get/getEventPaths.es.js +1 -1
- package/dist/libs/get/getGcd.cjs.js +1 -1
- package/dist/libs/get/getGcd.es.js +1 -1
- package/dist/libs/get/getOrientation.cjs.js +1 -1
- package/dist/libs/get/getOrientation.es.js +1 -1
- package/dist/libs/get/getParentList.cjs.js +1 -1
- package/dist/libs/get/getParentList.es.js +1 -1
- package/dist/libs/get/getQueryParams.cjs.js +5 -4
- package/dist/libs/get/getQueryParams.d.ts +6 -2
- package/dist/libs/get/getQueryParams.es.js +5 -4
- package/dist/libs/get/getRem.cjs.js +1 -1
- package/dist/libs/get/getRem.es.js +1 -1
- package/dist/libs/get/getScrollbarWidth.cjs.js +1 -1
- package/dist/libs/get/getScrollbarWidth.es.js +1 -1
- package/dist/libs/get/getSessionStorage.cjs.js +1 -1
- package/dist/libs/get/getSessionStorage.es.js +1 -1
- package/dist/libs/get/getStringLength.cjs.js +1 -1
- package/dist/libs/get/getStringLength.es.js +1 -1
- package/dist/libs/get/getStylePropertyValue.cjs.js +1 -1
- package/dist/libs/get/getStylePropertyValue.es.js +1 -1
- package/dist/libs/get/getStylePropertyValueToNumber.cjs.js +1 -1
- package/dist/libs/get/getStylePropertyValueToNumber.es.js +1 -1
- package/dist/libs/get/getUaData.cjs.js +1 -1
- package/dist/libs/get/getUaData.es.js +1 -1
- package/dist/libs/is/isBetweenDateTime.cjs.js +1 -1
- package/dist/libs/is/isBetweenDateTime.es.js +1 -1
- package/dist/libs/is/isExistAllElements.cjs.js +1 -1
- package/dist/libs/is/isExistAllElements.es.js +1 -1
- package/dist/libs/is/isIpad.cjs.js +1 -1
- package/dist/libs/is/isIpad.es.js +1 -1
- package/dist/libs/is/isKeyExists.cjs.js +1 -1
- package/dist/libs/is/isKeyExists.es.js +1 -1
- package/dist/libs/is/isSafari.cjs.js +1 -1
- package/dist/libs/is/isSafari.es.js +1 -1
- package/dist/libs/is/isScrollable.cjs.js +1 -1
- package/dist/libs/is/isScrollable.es.js +1 -1
- package/dist/libs/is/isTouchSupport.cjs.js +1 -1
- package/dist/libs/is/isTouchSupport.es.js +1 -1
- package/dist/libs/remove/removeAllHtmlTags.cjs.js +1 -1
- package/dist/libs/remove/removeAllHtmlTags.es.js +1 -1
- package/dist/libs/remove/removeAttribute.cjs.js +1 -1
- package/dist/libs/remove/removeAttribute.es.js +1 -1
- package/dist/libs/remove/removeSessionStorage.cjs.js +1 -1
- package/dist/libs/remove/removeSessionStorage.es.js +1 -1
- package/dist/libs/remove/removeStylePropertyValue.cjs.js +1 -1
- package/dist/libs/remove/removeStylePropertyValue.es.js +1 -1
- package/dist/libs/set/set100vh.cjs.js +1 -1
- package/dist/libs/set/set100vh.es.js +1 -1
- package/dist/libs/set/set100vw.cjs.js +1 -1
- package/dist/libs/set/set100vw.es.js +1 -1
- package/dist/libs/set/setAttribute.cjs.js +1 -1
- package/dist/libs/set/setAttribute.es.js +1 -1
- package/dist/libs/set/setScrollPositionToCenter.cjs.js +1 -1
- package/dist/libs/set/setScrollPositionToCenter.es.js +1 -1
- package/dist/libs/set/setSessionStorage.cjs.js +1 -1
- package/dist/libs/set/setSessionStorage.es.js +1 -1
- package/dist/libs/set/setStylePropertyValue.cjs.js +1 -1
- package/dist/libs/set/setStylePropertyValue.es.js +1 -1
- package/dist/libs/to/toBoolean.cjs.js +1 -1
- package/dist/libs/to/toBoolean.es.js +1 -1
- package/dist/libs/to/toPositiveNumber.cjs.js +1 -1
- package/dist/libs/to/toPositiveNumber.es.js +1 -1
- package/dist/libs/transform/wrapTextWithSpans.cjs.js +1 -1
- package/dist/libs/transform/wrapTextWithSpans.es.js +1 -1
- package/dist/libs/wait/sleep.cjs.js +1 -1
- package/dist/libs/wait/sleep.es.js +1 -1
- package/dist/libs/wait/waitForAllMediaLoaded.cjs.js +1 -1
- package/dist/libs/wait/waitForAllMediaLoaded.es.js +1 -1
- package/dist/node_modules/dayjs/plugin/isBetween.cjs.js +1 -1
- package/dist/node_modules/dayjs/plugin/isBetween.es.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*!
|
|
3
3
|
* name: umaki
|
|
4
|
-
* version: v0.3.
|
|
4
|
+
* version: v0.3.2
|
|
5
5
|
* description: A utility that is often used in web production.
|
|
6
6
|
* author: TsubasaHiga
|
|
7
7
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
14
|
const toBoolean = require("../to/toBoolean.cjs.js");
|
|
15
|
-
const videoPlayControl = async (videoElement, state) => {
|
|
15
|
+
const videoPlayControl = async (videoElement, state, currentTime) => {
|
|
16
16
|
if (state && videoElement.paused) {
|
|
17
17
|
const isPlaying = toBoolean.toBoolean(videoElement.dataset.playing);
|
|
18
18
|
if (isPlaying) return;
|
|
@@ -20,7 +20,7 @@ const videoPlayControl = async (videoElement, state) => {
|
|
|
20
20
|
if (playPromise === void 0) return;
|
|
21
21
|
try {
|
|
22
22
|
await playPromise;
|
|
23
|
-
videoElement.currentTime = 0;
|
|
23
|
+
videoElement.currentTime = currentTime || 0;
|
|
24
24
|
videoElement.dataset.playing = "true";
|
|
25
25
|
} catch (error) {
|
|
26
26
|
}
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* the video. The function also manages a custom `data-playing` attribute on the video element
|
|
12
12
|
* to track the playback state.
|
|
13
13
|
*/
|
|
14
|
-
export declare const videoPlayControl: (videoElement: HTMLVideoElement, state: boolean) => Promise<void>;
|
|
14
|
+
export declare const videoPlayControl: (videoElement: HTMLVideoElement, state: boolean, currentTime?: number) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: umaki
|
|
3
|
-
* version: v0.3.
|
|
3
|
+
* version: v0.3.2
|
|
4
4
|
* description: A utility that is often used in web production.
|
|
5
5
|
* author: TsubasaHiga
|
|
6
6
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* For license information, please see LICENSE.txt
|
|
11
11
|
*/
|
|
12
12
|
import { toBoolean } from "../to/toBoolean.es.js";
|
|
13
|
-
const videoPlayControl = async (videoElement, state) => {
|
|
13
|
+
const videoPlayControl = async (videoElement, state, currentTime) => {
|
|
14
14
|
if (state && videoElement.paused) {
|
|
15
15
|
const isPlaying = toBoolean(videoElement.dataset.playing);
|
|
16
16
|
if (isPlaying) return;
|
|
@@ -18,7 +18,7 @@ const videoPlayControl = async (videoElement, state) => {
|
|
|
18
18
|
if (playPromise === void 0) return;
|
|
19
19
|
try {
|
|
20
20
|
await playPromise;
|
|
21
|
-
videoElement.currentTime = 0;
|
|
21
|
+
videoElement.currentTime = currentTime || 0;
|
|
22
22
|
videoElement.dataset.playing = "true";
|
|
23
23
|
} catch (error) {
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*!
|
|
3
3
|
* name: umaki
|
|
4
|
-
* version: v0.3.
|
|
4
|
+
* version: v0.3.2
|
|
5
5
|
* description: A utility that is often used in web production.
|
|
6
6
|
* author: TsubasaHiga
|
|
7
7
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -16,12 +16,13 @@ const queryStringOptions = {
|
|
|
16
16
|
arrayFormat: "comma",
|
|
17
17
|
parseNumbers: true
|
|
18
18
|
};
|
|
19
|
-
const getQueryParams = (query,
|
|
20
|
-
const
|
|
19
|
+
const getQueryParams = (query, options = {}) => {
|
|
20
|
+
const { searchString = window.location.search, parseOptions } = options;
|
|
21
|
+
const queryOptions = {
|
|
21
22
|
...queryStringOptions,
|
|
22
23
|
...parseOptions
|
|
23
24
|
};
|
|
24
|
-
const queryParsed = queryString.parse(
|
|
25
|
+
const queryParsed = queryString.parse(searchString, queryOptions);
|
|
25
26
|
if (!queryParsed) return null;
|
|
26
27
|
const params = queryParsed[query];
|
|
27
28
|
if (params === null || params === void 0) return null;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ParseOptions } from 'query-string';
|
|
2
2
|
export type GetQueryParamsReturnType = string | number | (string | number | null)[] | null;
|
|
3
|
+
export type GetQueryParamsOptions = {
|
|
4
|
+
searchString?: string;
|
|
5
|
+
parseOptions?: ParseOptions;
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* Retrieves the value of a specified query parameter from the URL.
|
|
5
9
|
*
|
|
6
10
|
* @param query - The name of the query parameter to retrieve.
|
|
7
|
-
* @param
|
|
11
|
+
* @param options - Optional. An object containing searchString and parseOptions.
|
|
8
12
|
* @returns The value of the query parameter, which can be a string, number, array of strings or numbers, or null if the parameter is not found.
|
|
9
13
|
*/
|
|
10
|
-
export declare const getQueryParams: (query: string,
|
|
14
|
+
export declare const getQueryParams: (query: string, options?: GetQueryParamsOptions) => GetQueryParamsReturnType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: umaki
|
|
3
|
-
* version: v0.3.
|
|
3
|
+
* version: v0.3.2
|
|
4
4
|
* description: A utility that is often used in web production.
|
|
5
5
|
* author: TsubasaHiga
|
|
6
6
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -14,12 +14,13 @@ const queryStringOptions = {
|
|
|
14
14
|
arrayFormat: "comma",
|
|
15
15
|
parseNumbers: true
|
|
16
16
|
};
|
|
17
|
-
const getQueryParams = (query,
|
|
18
|
-
const
|
|
17
|
+
const getQueryParams = (query, options = {}) => {
|
|
18
|
+
const { searchString = window.location.search, parseOptions } = options;
|
|
19
|
+
const queryOptions = {
|
|
19
20
|
...queryStringOptions,
|
|
20
21
|
...parseOptions
|
|
21
22
|
};
|
|
22
|
-
const queryParsed = queryString.parse(
|
|
23
|
+
const queryParsed = queryString.parse(searchString, queryOptions);
|
|
23
24
|
if (!queryParsed) return null;
|
|
24
25
|
const params = queryParsed[query];
|
|
25
26
|
if (params === null || params === void 0) return null;
|