umaki 0.4.3 → 0.6.0
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 +88 -0
- 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 +12 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +12 -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 +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 +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 +2 -0
- package/dist/libs/is/isAfterDateTime.cjs.js +18 -0
- package/dist/libs/is/isAfterDateTime.d.ts +10 -0
- package/dist/libs/is/isAfterDateTime.es.js +18 -0
- package/dist/libs/is/isAfterDateTime.test.d.ts +1 -0
- 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/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/plugin/isBetween.cjs.js +1 -1
- package/dist/node_modules/dayjs/plugin/isBetween.es.js +1 -1
- package/dist/node_modules/dayjs/plugin/timezone.cjs.js +1 -1
- package/dist/node_modules/dayjs/plugin/timezone.es.js +2 -2
- package/dist/node_modules/dayjs/plugin/utc.cjs.js +1 -1
- package/dist/node_modules/dayjs/plugin/utc.es.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,10 @@ import { foo } from "umaki";
|
|
|
18
18
|
|
|
19
19
|
## List of Utilities
|
|
20
20
|
|
|
21
|
+
- [Configuration](#configuration)
|
|
22
|
+
- [setConfig](#setconfig)
|
|
23
|
+
- [getConfig](#getconfig)
|
|
24
|
+
- [getConfigValue](#getconfigvalue)
|
|
21
25
|
- [Control](#control)
|
|
22
26
|
- [bgScrollStop](#bgscrollstop)
|
|
23
27
|
- [pd](#pd)
|
|
@@ -46,6 +50,7 @@ import { foo } from "umaki";
|
|
|
46
50
|
- [getStylePropertyValueToNumber](#getstylepropertyvaluetonumber)
|
|
47
51
|
- [getUaData](#getuadata)
|
|
48
52
|
- [Is](#is)
|
|
53
|
+
- [isAfterDateTime](#isafterdatetime)
|
|
49
54
|
- [isBetweenDateTime](#isbetweendatetime)
|
|
50
55
|
- [isExistAllElements](#isexistallelements)
|
|
51
56
|
- [isIpad](#isipad)
|
|
@@ -76,6 +81,50 @@ import { foo } from "umaki";
|
|
|
76
81
|
- [Security](#security)
|
|
77
82
|
- [sanitizeHtml](#sanitizehtml)
|
|
78
83
|
|
|
84
|
+
## Configuration
|
|
85
|
+
|
|
86
|
+
### setConfig
|
|
87
|
+
|
|
88
|
+
A function to set or update global configuration options for the umaki library.
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { setConfig } from "umaki";
|
|
92
|
+
|
|
93
|
+
// Set a custom breakpoint value
|
|
94
|
+
setConfig({ BREAKPOINT: 1024 });
|
|
95
|
+
|
|
96
|
+
// You can also add custom configuration properties
|
|
97
|
+
setConfig({ customValue: "example" });
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
[View file →](src/libs/config/setConfig.ts)
|
|
101
|
+
|
|
102
|
+
### getConfig
|
|
103
|
+
|
|
104
|
+
A function to retrieve the entire current configuration object.
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { getConfig } from "umaki";
|
|
108
|
+
|
|
109
|
+
const config = getConfig();
|
|
110
|
+
console.log(config.BREAKPOINT); // e.g. 768 (default) or custom value if set
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
[View file →](src/libs/config/getConfig.ts)
|
|
114
|
+
|
|
115
|
+
### getConfigValue
|
|
116
|
+
|
|
117
|
+
A function to retrieve a specific configuration value by key.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { getConfigValue } from "umaki";
|
|
121
|
+
|
|
122
|
+
const breakpoint = getConfigValue('BREAKPOINT');
|
|
123
|
+
console.log(breakpoint); // e.g. 768 (default) or custom value if set
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
[View file →](src/libs/config/getConfig.ts)
|
|
127
|
+
|
|
79
128
|
## Control
|
|
80
129
|
|
|
81
130
|
### bgScrollStop
|
|
@@ -450,6 +499,45 @@ console.log(uaData);
|
|
|
450
499
|
|
|
451
500
|
## Is
|
|
452
501
|
|
|
502
|
+
### checkDeviceSize
|
|
503
|
+
|
|
504
|
+
A function that checks the current device size based on window width and the configured breakpoint.
|
|
505
|
+
|
|
506
|
+
```ts
|
|
507
|
+
import { checkDeviceSize, setConfig } from "umaki";
|
|
508
|
+
|
|
509
|
+
// Using default breakpoint (768px)
|
|
510
|
+
const deviceSize = checkDeviceSize();
|
|
511
|
+
console.log(deviceSize); // 'md' if window.innerWidth > 768, otherwise 'sm'
|
|
512
|
+
|
|
513
|
+
// Customize the breakpoint
|
|
514
|
+
setConfig({ BREAKPOINT: 1024 });
|
|
515
|
+
const newDeviceSize = checkDeviceSize();
|
|
516
|
+
console.log(newDeviceSize); // 'md' if window.innerWidth > 1024, otherwise 'sm'
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
[View file →](src/libs/is/checkDeviceSize.ts)
|
|
520
|
+
|
|
521
|
+
### isAfterDateTime
|
|
522
|
+
|
|
523
|
+
A function that checks if the current date is after a specified date.
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
import { isAfterDateTime } from "umaki";
|
|
527
|
+
|
|
528
|
+
const targetDate = "2023-10-01";
|
|
529
|
+
const result = isAfterDateTime(targetDate);
|
|
530
|
+
console.log(result); // true or false
|
|
531
|
+
|
|
532
|
+
// With custom current date
|
|
533
|
+
import dayjs from "dayjs";
|
|
534
|
+
|
|
535
|
+
const customCurrentDate = "2023-11-15";
|
|
536
|
+
const resultWithCustomDate = isAfterDateTime(targetDate, dayjs(customCurrentDate));
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
[View file →](src/libs/is/isAfterDateTime.ts)
|
|
540
|
+
|
|
453
541
|
### isBetweenDateTime
|
|
454
542
|
|
|
455
543
|
A function that checks if the current date is between two specified dates.
|
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.0
|
|
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");
|
|
@@ -34,7 +37,9 @@ const getStringLength = require("./libs/get/getStringLength.cjs.js");
|
|
|
34
37
|
const getStylePropertyValue = require("./libs/get/getStylePropertyValue.cjs.js");
|
|
35
38
|
const getStylePropertyValueToNumber = require("./libs/get/getStylePropertyValueToNumber.cjs.js");
|
|
36
39
|
const getUaData = require("./libs/get/getUaData.cjs.js");
|
|
40
|
+
const isAfterDateTime = require("./libs/is/isAfterDateTime.cjs.js");
|
|
37
41
|
const isBetweenDateTime = require("./libs/is/isBetweenDateTime.cjs.js");
|
|
42
|
+
const checkDeviceSize = require("./libs/is/checkDeviceSize.cjs.js");
|
|
38
43
|
const isExistAllElements = require("./libs/is/isExistAllElements.cjs.js");
|
|
39
44
|
const isIpad = require("./libs/is/isIpad.cjs.js");
|
|
40
45
|
const isKeyExists = require("./libs/is/isKeyExists.cjs.js");
|
|
@@ -57,6 +62,10 @@ const toPositiveNumber = require("./libs/to/toPositiveNumber.cjs.js");
|
|
|
57
62
|
const wrapTextWithSpans = require("./libs/transform/wrapTextWithSpans.cjs.js");
|
|
58
63
|
const sleep = require("./libs/wait/sleep.cjs.js");
|
|
59
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;
|
|
60
69
|
exports.bgScrollStop = bgScrollStop.bgScrollStop;
|
|
61
70
|
exports.pd = pd.pd;
|
|
62
71
|
exports.scrollToHash = scrollToHash.scrollToHash;
|
|
@@ -80,7 +89,9 @@ exports.getStringLength = getStringLength.getStringLength;
|
|
|
80
89
|
exports.getStylePropertyValue = getStylePropertyValue.getStylePropertyValue;
|
|
81
90
|
exports.getStylePropertyValueToNumber = getStylePropertyValueToNumber.getStylePropertyValueToNumber;
|
|
82
91
|
exports.getUaData = getUaData.getUaData;
|
|
92
|
+
exports.isAfterDateTime = isAfterDateTime.isAfterDateTime;
|
|
83
93
|
exports.isBetweenDateTime = isBetweenDateTime.isBetweenDateTime;
|
|
94
|
+
exports.checkDeviceSize = checkDeviceSize.checkDeviceSize;
|
|
84
95
|
exports.isExistAllElements = isExistAllElements.isExistAllElements;
|
|
85
96
|
exports.isIpad = isIpad.isIpad;
|
|
86
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.0
|
|
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";
|
|
@@ -32,7 +35,9 @@ import { getStringLength } from "./libs/get/getStringLength.es.js";
|
|
|
32
35
|
import { getStylePropertyValue } from "./libs/get/getStylePropertyValue.es.js";
|
|
33
36
|
import { getStylePropertyValueToNumber } from "./libs/get/getStylePropertyValueToNumber.es.js";
|
|
34
37
|
import { getUaData } from "./libs/get/getUaData.es.js";
|
|
38
|
+
import { isAfterDateTime } from "./libs/is/isAfterDateTime.es.js";
|
|
35
39
|
import { isBetweenDateTime } from "./libs/is/isBetweenDateTime.es.js";
|
|
40
|
+
import { checkDeviceSize } from "./libs/is/checkDeviceSize.es.js";
|
|
36
41
|
import { isExistAllElements } from "./libs/is/isExistAllElements.es.js";
|
|
37
42
|
import { isIpad } from "./libs/is/isIpad.es.js";
|
|
38
43
|
import { isKeyExists } from "./libs/is/isKeyExists.es.js";
|
|
@@ -58,9 +63,13 @@ import { waitForAllMediaLoaded } from "./libs/wait/waitForAllMediaLoaded.es.js";
|
|
|
58
63
|
export {
|
|
59
64
|
bgScrollStop,
|
|
60
65
|
changeDateStringToSpecificFormat,
|
|
66
|
+
checkDeviceSize,
|
|
61
67
|
debounce,
|
|
68
|
+
defaultConfig,
|
|
62
69
|
getAspectRatio,
|
|
63
70
|
getClassNames,
|
|
71
|
+
getConfig,
|
|
72
|
+
getConfigValue,
|
|
64
73
|
getDocumentHeight,
|
|
65
74
|
getEventPaths,
|
|
66
75
|
getGcd,
|
|
@@ -75,6 +84,7 @@ export {
|
|
|
75
84
|
getStylePropertyValueToNumber,
|
|
76
85
|
getUaData,
|
|
77
86
|
htmlSanitize,
|
|
87
|
+
isAfterDateTime,
|
|
78
88
|
isBetweenDateTime,
|
|
79
89
|
isExistAllElements,
|
|
80
90
|
isIpad,
|
|
@@ -92,6 +102,7 @@ export {
|
|
|
92
102
|
set100vh,
|
|
93
103
|
set100vw,
|
|
94
104
|
setAttribute,
|
|
105
|
+
setConfig,
|
|
95
106
|
setScrollPositionToCenter,
|
|
96
107
|
setSessionStorage,
|
|
97
108
|
setStylePropertyValue,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* name: umaki
|
|
4
|
+
* version: v0.6.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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
|
+
}
|