umaki 0.6.0 → 0.6.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 +59 -68
- 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 +1 -1
- package/dist/index.es.js +1 -1
- package/dist/libs/config/defaultConfig.cjs.js +1 -1
- package/dist/libs/config/defaultConfig.es.js +1 -1
- package/dist/libs/config/getConfig.cjs.js +1 -1
- package/dist/libs/config/getConfig.es.js +1 -1
- package/dist/libs/config/setConfig.cjs.js +1 -1
- package/dist/libs/config/setConfig.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 +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 +1 -1
- package/dist/libs/is/checkDeviceSize.es.js +1 -1
- 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 +4 -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,12 +16,46 @@ 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
|
-
- [Configuration](#configuration)
|
|
22
|
-
- [setConfig](#setconfig)
|
|
23
|
-
- [getConfig](#getconfig)
|
|
24
|
-
- [getConfigValue](#getconfigvalue)
|
|
25
59
|
- [Control](#control)
|
|
26
60
|
- [bgScrollStop](#bgscrollstop)
|
|
27
61
|
- [pd](#pd)
|
|
@@ -58,6 +92,7 @@ import { foo } from "umaki";
|
|
|
58
92
|
- [isSafari](#issafari)
|
|
59
93
|
- [isScrollable](#isscrollable)
|
|
60
94
|
- [isTouchSupport](#istouchsupport)
|
|
95
|
+
- [checkDeviceSize](#checkdevicesize)
|
|
61
96
|
- [Remove](#remove)
|
|
62
97
|
- [removeAllHtmlTags](#removeallhtmltags)
|
|
63
98
|
- [removeAttribute](#removeattribute)
|
|
@@ -81,50 +116,6 @@ import { foo } from "umaki";
|
|
|
81
116
|
- [Security](#security)
|
|
82
117
|
- [sanitizeHtml](#sanitizehtml)
|
|
83
118
|
|
|
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
|
-
|
|
128
119
|
## Control
|
|
129
120
|
|
|
130
121
|
### bgScrollStop
|
|
@@ -499,25 +490,6 @@ console.log(uaData);
|
|
|
499
490
|
|
|
500
491
|
## Is
|
|
501
492
|
|
|
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
493
|
### isAfterDateTime
|
|
522
494
|
|
|
523
495
|
A function that checks if the current date is after a specified date.
|
|
@@ -639,6 +611,25 @@ console.log(result); // true or false
|
|
|
639
611
|
|
|
640
612
|
[View file →](src/libs/is/isTouchSupport.ts)
|
|
641
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
|
+
|
|
642
633
|
## Remove
|
|
643
634
|
|
|
644
635
|
### removeAllHtmlTags
|
package/dist/_virtual/utc.cjs.js
CHANGED
package/dist/_virtual/utc.es.js
CHANGED
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.6.
|
|
4
|
+
* version: v0.6.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,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.6.
|
|
3
|
+
* version: v0.6.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,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);
|