umaki 0.5.0 → 0.6.1
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 +59 -1
- 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/_virtual/timezone.cjs.js +1 -1
- package/dist/_virtual/timezone.es.js +1 -1
- package/dist/_virtual/utc.cjs.js +1 -1
- package/dist/_virtual/utc.es.js +1 -1
- package/dist/index.cjs.js +10 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +10 -1
- package/dist/libs/config/config.test.d.ts +1 -0
- package/dist/libs/config/defaultConfig.cjs.js +17 -0
- package/dist/libs/config/defaultConfig.d.ts +5 -0
- package/dist/libs/config/defaultConfig.es.js +17 -0
- package/dist/libs/config/getConfig.cjs.js +24 -0
- package/dist/libs/config/getConfig.d.ts +14 -0
- package/dist/libs/config/getConfig.es.js +24 -0
- package/dist/libs/config/index.d.ts +7 -0
- package/dist/libs/config/setConfig.cjs.js +19 -0
- package/dist/libs/config/setConfig.d.ts +7 -0
- package/dist/libs/config/setConfig.es.js +19 -0
- package/dist/libs/config/types.d.ts +14 -0
- 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 +1 -1
- package/dist/libs/control/videoPlayControl.es.js +1 -1
- package/dist/libs/convert/changeDateStringToSpecificFormat.cjs.js +3 -3
- package/dist/libs/convert/changeDateStringToSpecificFormat.es.js +3 -3
- 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 +1 -1
- package/dist/libs/get/getQueryParams.es.js +1 -1
- 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/checkDeviceSize.cjs.js +22 -0
- package/dist/libs/is/checkDeviceSize.d.ts +5 -0
- package/dist/libs/is/checkDeviceSize.es.js +22 -0
- package/dist/libs/is/checkDeviceSize.test.d.ts +1 -0
- package/dist/libs/is/index.d.ts +1 -0
- package/dist/libs/is/isAfterDateTime.cjs.js +1 -1
- package/dist/libs/is/isAfterDateTime.es.js +1 -1
- package/dist/libs/is/isBetweenDateTime.cjs.js +2 -2
- package/dist/libs/is/isBetweenDateTime.es.js +2 -2
- 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 +9 -3
- package/dist/libs/is/isTouchSupport.es.js +9 -3
- package/dist/libs/is/isTouchSupport.test.d.ts +1 -0
- 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/security/htmlSanitize.cjs.js +1 -1
- package/dist/libs/security/htmlSanitize.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 → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/isBetween.cjs.js +3 -3
- package/dist/node_modules/{dayjs → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/isBetween.es.js +3 -3
- package/dist/node_modules/{dayjs → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/timezone.cjs.js +3 -3
- package/dist/node_modules/{dayjs → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/timezone.es.js +3 -3
- package/dist/node_modules/{dayjs → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/utc.cjs.js +3 -3
- package/dist/node_modules/{dayjs → .pnpm/dayjs@1.11.13/node_modules/dayjs}/plugin/utc.es.js +3 -3
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Umaki is your one-stop solution for web development utilities, bringing together a carefully curated collection of powerful tools in a single, easy-to-use package. Crafted from real-world development experience, these utilities solve common challenges and streamline your workflow. Have a utility in mind that would make your development easier? Feel free to open an issue—I'm actively expanding this collection!
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
@@ -16,6 +16,44 @@ A package that allows you to import frequently used utilities for web developmen
|
|
|
16
16
|
import { foo } from "umaki";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
### setConfig
|
|
22
|
+
|
|
23
|
+
A function to set or update global configuration options for the umaki library.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { setConfig } from "umaki";
|
|
27
|
+
|
|
28
|
+
// Set a custom breakpoint value
|
|
29
|
+
setConfig({ BREAKPOINT: 1024 });
|
|
30
|
+
|
|
31
|
+
// You can also add custom configuration properties
|
|
32
|
+
setConfig({ customValue: "example" });
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### getConfig
|
|
36
|
+
|
|
37
|
+
A function to retrieve the entire current configuration object.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { getConfig } from "umaki";
|
|
41
|
+
|
|
42
|
+
const config = getConfig();
|
|
43
|
+
console.log(config.BREAKPOINT); // e.g. 768 (default) or custom value if set
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### getConfigValue
|
|
47
|
+
|
|
48
|
+
A function to retrieve a specific configuration value by key.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import { getConfigValue } from "umaki";
|
|
52
|
+
|
|
53
|
+
const breakpoint = getConfigValue('BREAKPOINT');
|
|
54
|
+
console.log(breakpoint); // e.g. 768 (default) or custom value if set
|
|
55
|
+
```
|
|
56
|
+
|
|
19
57
|
## List of Utilities
|
|
20
58
|
|
|
21
59
|
- [Control](#control)
|
|
@@ -54,6 +92,7 @@ import { foo } from "umaki";
|
|
|
54
92
|
- [isSafari](#issafari)
|
|
55
93
|
- [isScrollable](#isscrollable)
|
|
56
94
|
- [isTouchSupport](#istouchsupport)
|
|
95
|
+
- [checkDeviceSize](#checkdevicesize)
|
|
57
96
|
- [Remove](#remove)
|
|
58
97
|
- [removeAllHtmlTags](#removeallhtmltags)
|
|
59
98
|
- [removeAttribute](#removeattribute)
|
|
@@ -572,6 +611,25 @@ console.log(result); // true or false
|
|
|
572
611
|
|
|
573
612
|
[View file →](src/libs/is/isTouchSupport.ts)
|
|
574
613
|
|
|
614
|
+
### checkDeviceSize
|
|
615
|
+
|
|
616
|
+
A function that checks the current device size based on window width and the configured breakpoint.
|
|
617
|
+
|
|
618
|
+
```ts
|
|
619
|
+
import { checkDeviceSize, setConfig } from "umaki";
|
|
620
|
+
|
|
621
|
+
// Using default breakpoint (768px)
|
|
622
|
+
const deviceSize = checkDeviceSize();
|
|
623
|
+
console.log(deviceSize); // 'md' if window.innerWidth > 768, otherwise 'sm'
|
|
624
|
+
|
|
625
|
+
// Customize the breakpoint
|
|
626
|
+
setConfig({ BREAKPOINT: 1024 });
|
|
627
|
+
const newDeviceSize = checkDeviceSize();
|
|
628
|
+
console.log(newDeviceSize); // 'md' if window.innerWidth > 1024, otherwise 'sm'
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
[View file →](src/libs/is/checkDeviceSize.ts)
|
|
632
|
+
|
|
575
633
|
## Remove
|
|
576
634
|
|
|
577
635
|
### removeAllHtmlTags
|
package/dist/_virtual/utc.cjs.js
CHANGED
package/dist/_virtual/utc.es.js
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*!
|
|
3
3
|
* name: umaki
|
|
4
|
-
* version: v0.
|
|
4
|
+
* version: v0.6.1
|
|
5
5
|
* description: A utility that is often used in web production.
|
|
6
6
|
* author: TsubasaHiga
|
|
7
7
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* For license information, please see LICENSE.txt
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
const getConfig = require("./libs/config/getConfig.cjs.js");
|
|
15
|
+
const setConfig = require("./libs/config/setConfig.cjs.js");
|
|
16
|
+
const defaultConfig = require("./libs/config/defaultConfig.cjs.js");
|
|
14
17
|
const bgScrollStop = require("./libs/control/bgScrollStop.cjs.js");
|
|
15
18
|
const pd = require("./libs/control/pd.cjs.js");
|
|
16
19
|
const scrollToHash = require("./libs/control/scrollToHash.cjs.js");
|
|
@@ -36,6 +39,7 @@ const getStylePropertyValueToNumber = require("./libs/get/getStylePropertyValueT
|
|
|
36
39
|
const getUaData = require("./libs/get/getUaData.cjs.js");
|
|
37
40
|
const isAfterDateTime = require("./libs/is/isAfterDateTime.cjs.js");
|
|
38
41
|
const isBetweenDateTime = require("./libs/is/isBetweenDateTime.cjs.js");
|
|
42
|
+
const checkDeviceSize = require("./libs/is/checkDeviceSize.cjs.js");
|
|
39
43
|
const isExistAllElements = require("./libs/is/isExistAllElements.cjs.js");
|
|
40
44
|
const isIpad = require("./libs/is/isIpad.cjs.js");
|
|
41
45
|
const isKeyExists = require("./libs/is/isKeyExists.cjs.js");
|
|
@@ -58,6 +62,10 @@ const toPositiveNumber = require("./libs/to/toPositiveNumber.cjs.js");
|
|
|
58
62
|
const wrapTextWithSpans = require("./libs/transform/wrapTextWithSpans.cjs.js");
|
|
59
63
|
const sleep = require("./libs/wait/sleep.cjs.js");
|
|
60
64
|
const waitForAllMediaLoaded = require("./libs/wait/waitForAllMediaLoaded.cjs.js");
|
|
65
|
+
exports.getConfig = getConfig.getConfig;
|
|
66
|
+
exports.getConfigValue = getConfig.getConfigValue;
|
|
67
|
+
exports.setConfig = setConfig.setConfig;
|
|
68
|
+
exports.defaultConfig = defaultConfig.defaultConfig;
|
|
61
69
|
exports.bgScrollStop = bgScrollStop.bgScrollStop;
|
|
62
70
|
exports.pd = pd.pd;
|
|
63
71
|
exports.scrollToHash = scrollToHash.scrollToHash;
|
|
@@ -83,6 +91,7 @@ exports.getStylePropertyValueToNumber = getStylePropertyValueToNumber.getStylePr
|
|
|
83
91
|
exports.getUaData = getUaData.getUaData;
|
|
84
92
|
exports.isAfterDateTime = isAfterDateTime.isAfterDateTime;
|
|
85
93
|
exports.isBetweenDateTime = isBetweenDateTime.isBetweenDateTime;
|
|
94
|
+
exports.checkDeviceSize = checkDeviceSize.checkDeviceSize;
|
|
86
95
|
exports.isExistAllElements = isExistAllElements.isExistAllElements;
|
|
87
96
|
exports.isIpad = isIpad.isIpad;
|
|
88
97
|
exports.isKeyExists = isKeyExists.isKeyExists;
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: umaki
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.6.1
|
|
4
4
|
* description: A utility that is often used in web production.
|
|
5
5
|
* author: TsubasaHiga
|
|
6
6
|
* homepage: https://github.com/TsubasaHiga/umaki
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
|
|
10
10
|
* For license information, please see LICENSE.txt
|
|
11
11
|
*/
|
|
12
|
+
import { getConfig, getConfigValue } from "./libs/config/getConfig.es.js";
|
|
13
|
+
import { setConfig } from "./libs/config/setConfig.es.js";
|
|
14
|
+
import { defaultConfig } from "./libs/config/defaultConfig.es.js";
|
|
12
15
|
import { bgScrollStop } from "./libs/control/bgScrollStop.es.js";
|
|
13
16
|
import { pd } from "./libs/control/pd.es.js";
|
|
14
17
|
import { scrollToHash } from "./libs/control/scrollToHash.es.js";
|
|
@@ -34,6 +37,7 @@ import { getStylePropertyValueToNumber } from "./libs/get/getStylePropertyValueT
|
|
|
34
37
|
import { getUaData } from "./libs/get/getUaData.es.js";
|
|
35
38
|
import { isAfterDateTime } from "./libs/is/isAfterDateTime.es.js";
|
|
36
39
|
import { isBetweenDateTime } from "./libs/is/isBetweenDateTime.es.js";
|
|
40
|
+
import { checkDeviceSize } from "./libs/is/checkDeviceSize.es.js";
|
|
37
41
|
import { isExistAllElements } from "./libs/is/isExistAllElements.es.js";
|
|
38
42
|
import { isIpad } from "./libs/is/isIpad.es.js";
|
|
39
43
|
import { isKeyExists } from "./libs/is/isKeyExists.es.js";
|
|
@@ -59,9 +63,13 @@ import { waitForAllMediaLoaded } from "./libs/wait/waitForAllMediaLoaded.es.js";
|
|
|
59
63
|
export {
|
|
60
64
|
bgScrollStop,
|
|
61
65
|
changeDateStringToSpecificFormat,
|
|
66
|
+
checkDeviceSize,
|
|
62
67
|
debounce,
|
|
68
|
+
defaultConfig,
|
|
63
69
|
getAspectRatio,
|
|
64
70
|
getClassNames,
|
|
71
|
+
getConfig,
|
|
72
|
+
getConfigValue,
|
|
65
73
|
getDocumentHeight,
|
|
66
74
|
getEventPaths,
|
|
67
75
|
getGcd,
|
|
@@ -94,6 +102,7 @@ export {
|
|
|
94
102
|
set100vh,
|
|
95
103
|
set100vw,
|
|
96
104
|
setAttribute,
|
|
105
|
+
setConfig,
|
|
97
106
|
setScrollPositionToCenter,
|
|
98
107
|
setSessionStorage,
|
|
99
108
|
setStylePropertyValue,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.6.1
|
|
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 defaultConfig = {
|
|
15
|
+
BREAKPOINT: 768
|
|
16
|
+
};
|
|
17
|
+
exports.defaultConfig = defaultConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.6.1
|
|
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 defaultConfig = {
|
|
13
|
+
BREAKPOINT: 768
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
defaultConfig
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.6.1
|
|
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 defaultConfig = require("./defaultConfig.cjs.js");
|
|
15
|
+
const currentConfig = { ...defaultConfig.defaultConfig };
|
|
16
|
+
const getConfig = () => {
|
|
17
|
+
return { ...currentConfig };
|
|
18
|
+
};
|
|
19
|
+
const getConfigValue = (key) => {
|
|
20
|
+
return currentConfig[key];
|
|
21
|
+
};
|
|
22
|
+
exports.currentConfig = currentConfig;
|
|
23
|
+
exports.getConfig = getConfig;
|
|
24
|
+
exports.getConfigValue = getConfigValue;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UmakiConfig } from './types';
|
|
2
|
+
declare const currentConfig: UmakiConfig;
|
|
3
|
+
/**
|
|
4
|
+
* Get the current configuration
|
|
5
|
+
* @returns The current configuration object
|
|
6
|
+
*/
|
|
7
|
+
export declare const getConfig: () => UmakiConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Get a specific configuration value by key
|
|
10
|
+
* @param key - The configuration key to retrieve
|
|
11
|
+
* @returns The value for the specified key, or undefined if the key doesn't exist
|
|
12
|
+
*/
|
|
13
|
+
export declare const getConfigValue: <K extends keyof UmakiConfig>(key: K) => UmakiConfig[K];
|
|
14
|
+
export { currentConfig };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.6.1
|
|
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 { defaultConfig } from "./defaultConfig.es.js";
|
|
13
|
+
const currentConfig = { ...defaultConfig };
|
|
14
|
+
const getConfig = () => {
|
|
15
|
+
return { ...currentConfig };
|
|
16
|
+
};
|
|
17
|
+
const getConfigValue = (key) => {
|
|
18
|
+
return currentConfig[key];
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
currentConfig,
|
|
22
|
+
getConfig,
|
|
23
|
+
getConfigValue
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.6.1
|
|
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 getConfig = require("./getConfig.cjs.js");
|
|
15
|
+
const setConfig = (config) => {
|
|
16
|
+
Object.assign(getConfig.currentConfig, config);
|
|
17
|
+
return { ...getConfig.currentConfig };
|
|
18
|
+
};
|
|
19
|
+
exports.setConfig = setConfig;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UmakiConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Set or update the configuration
|
|
4
|
+
* @param config - Configuration object with values to update
|
|
5
|
+
* @returns The updated configuration object
|
|
6
|
+
*/
|
|
7
|
+
export declare const setConfig: (config: Partial<UmakiConfig>) => UmakiConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: umaki
|
|
3
|
+
* version: v0.6.1
|
|
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 { currentConfig } from "./getConfig.es.js";
|
|
13
|
+
const setConfig = (config) => {
|
|
14
|
+
Object.assign(currentConfig, config);
|
|
15
|
+
return { ...currentConfig };
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
setConfig
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for the umaki library
|
|
3
|
+
*/
|
|
4
|
+
export interface UmakiConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Breakpoint value in pixels used for responsive design functions
|
|
7
|
+
* @default 768
|
|
8
|
+
*/
|
|
9
|
+
BREAKPOINT: number;
|
|
10
|
+
/**
|
|
11
|
+
* Any additional custom configuration properties
|
|
12
|
+
*/
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*!
|
|
3
3
|
* name: umaki
|
|
4
|
-
* version: v0.
|
|
4
|
+
* version: v0.6.1
|
|
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,8 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
14
14
|
const dayjs = require("dayjs");
|
|
15
|
-
const timezone = require("../../node_modules/dayjs/plugin/timezone.cjs.js");
|
|
16
|
-
const utc = require("../../node_modules/dayjs/plugin/utc.cjs.js");
|
|
15
|
+
const timezone = require("../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/timezone.cjs.js");
|
|
16
|
+
const utc = require("../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/utc.cjs.js");
|
|
17
17
|
const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日", tz) => {
|
|
18
18
|
if (tz) {
|
|
19
19
|
dayjs.extend(utc.default);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: umaki
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.6.1
|
|
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,8 +10,8 @@
|
|
|
10
10
|
* For license information, please see LICENSE.txt
|
|
11
11
|
*/
|
|
12
12
|
import dayjs from "dayjs";
|
|
13
|
-
import timezone from "../../node_modules/dayjs/plugin/timezone.es.js";
|
|
14
|
-
import utc from "../../node_modules/dayjs/plugin/utc.es.js";
|
|
13
|
+
import timezone from "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/timezone.es.js";
|
|
14
|
+
import utc from "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/utc.es.js";
|
|
15
15
|
const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日", tz) => {
|
|
16
16
|
if (tz) {
|
|
17
17
|
dayjs.extend(utc);
|