solid-tiny-utils 0.5.0 → 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/dist/{chunk-AKFEDWEF.js → chunk-6OVLJ45M.js} +5 -5
- package/dist/chunk-ACZGS7DG.js +72 -0
- package/dist/chunk-KFLH3AZ6.js +40 -0
- package/dist/{chunk-GHJDTAVH.js → chunk-LEWF7QAQ.js} +4 -4
- package/dist/chunk-PD6VHMH6.js +26 -0
- package/dist/chunk-S7U3LZNS.js +23 -0
- package/dist/{chunk-IQGRRDJZ.js → chunk-TGWWPUWD.js} +1 -1
- package/dist/chunk-U5LQ2AS5.js +0 -0
- package/dist/{chunk-DV7LISIY.js → chunk-WJHRONQU.js} +1 -1
- package/dist/color/hex-rgb.d.ts +36 -0
- package/dist/color/hex-rgb.js +15 -0
- package/dist/color/index.d.ts +3 -0
- package/dist/color/index.js +30 -0
- package/dist/color/oklch-rgb.d.ts +49 -0
- package/dist/color/oklch-rgb.js +15 -0
- package/dist/color/validation.d.ts +26 -0
- package/dist/color/validation.js +18 -0
- package/dist/dom/css.js +3 -2
- package/dist/dom/index.js +3 -2
- package/dist/event/create-click-outside.js +7 -6
- package/dist/event/create-event-listener.js +7 -6
- package/dist/event/create-intersection-observer.js +6 -5
- package/dist/event/create-visibility-observer.js +6 -5
- package/dist/event/index.js +10 -9
- package/dist/event/make-event-listener.js +6 -5
- package/dist/fn/create-debounce.js +5 -4
- package/dist/fn/create-loop-exec.js +5 -4
- package/dist/fn/create-throttle.js +5 -4
- package/dist/fn/index.js +5 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +52 -19
- package/dist/reactive/access.js +3 -2
- package/dist/reactive/create-debounce-watch.js +5 -4
- package/dist/reactive/index.js +7 -6
- package/dist/types/index.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +15 -3
- package/dist/utils/number.d.ts +113 -0
- package/dist/utils/number.js +14 -0
- package/package.json +5 -5
- package/dist/{chunk-MEZ7CXEG.js → chunk-BLX3XSA6.js} +0 -0
- package/dist/{chunk-D3JAYNG6.js → chunk-QPEF6LHH.js} +3 -3
- package/dist/{chunk-WWEM5VJO.js → chunk-TDJLPDJF.js} +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeEventListener
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TGWWPUWD.js";
|
|
4
4
|
import {
|
|
5
5
|
noop
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
createWatch
|
|
9
|
-
} from "./chunk-4L6FK7MF.js";
|
|
6
|
+
} from "./chunk-QPEF6LHH.js";
|
|
10
7
|
import {
|
|
11
8
|
access
|
|
12
9
|
} from "./chunk-YK5QQQ43.js";
|
|
10
|
+
import {
|
|
11
|
+
createWatch
|
|
12
|
+
} from "./chunk-4L6FK7MF.js";
|
|
13
13
|
import {
|
|
14
14
|
clearArray
|
|
15
15
|
} from "./chunk-BT47ISVC.js";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clamp,
|
|
3
|
+
max
|
|
4
|
+
} from "./chunk-PD6VHMH6.js";
|
|
5
|
+
|
|
6
|
+
// src/color/oklch-rgb.ts
|
|
7
|
+
var PI_180 = Math.PI / 180;
|
|
8
|
+
var INV_PI_180 = 180 / Math.PI;
|
|
9
|
+
var linearToSRGB = (x) => x <= 31308e-7 ? 12.92 * x : 1.055 * x ** (1 / 2.4) - 0.055;
|
|
10
|
+
var sRGBToLinear = (x) => x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
|
|
11
|
+
function normalizeHue(hue) {
|
|
12
|
+
return (hue % 360 + 360) % 360;
|
|
13
|
+
}
|
|
14
|
+
function oklchToRgb(oklch) {
|
|
15
|
+
const { l, c, h } = oklch;
|
|
16
|
+
const clampedL = clamp(l, 0, 1);
|
|
17
|
+
const clampedC = max(0, c);
|
|
18
|
+
const normalizedH = normalizeHue(h);
|
|
19
|
+
const a_ = clampedC * Math.cos(normalizedH * PI_180);
|
|
20
|
+
const b_ = clampedC * Math.sin(normalizedH * PI_180);
|
|
21
|
+
const L = clampedL;
|
|
22
|
+
const A = a_;
|
|
23
|
+
const B = b_;
|
|
24
|
+
const l_ = L + 0.3963377774 * A + 0.2158037573 * B;
|
|
25
|
+
const m_ = L - 0.1055613458 * A - 0.0638541728 * B;
|
|
26
|
+
const s_ = L - 0.0894841775 * A - 1.291485548 * B;
|
|
27
|
+
const l3 = l_ ** 3;
|
|
28
|
+
const m3 = m_ ** 3;
|
|
29
|
+
const s3 = s_ ** 3;
|
|
30
|
+
let r = 4.0767416621 * l3 - 3.3077115913 * m3 + 0.2309699292 * s3;
|
|
31
|
+
let g = -1.2684380046 * l3 + 2.6097574011 * m3 - 0.3413193965 * s3;
|
|
32
|
+
let b = -0.0041960863 * l3 - 0.7034186147 * m3 + 1.707614701 * s3;
|
|
33
|
+
r = linearToSRGB(r);
|
|
34
|
+
g = linearToSRGB(g);
|
|
35
|
+
b = linearToSRGB(b);
|
|
36
|
+
return {
|
|
37
|
+
r: Math.round(clamp(r) * 255),
|
|
38
|
+
g: Math.round(clamp(g) * 255),
|
|
39
|
+
b: Math.round(clamp(b) * 255)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function rgbToOklch(rgb) {
|
|
43
|
+
const r = clamp(rgb.r, 0, 255);
|
|
44
|
+
const g = clamp(rgb.g, 0, 255);
|
|
45
|
+
const b = clamp(rgb.b, 0, 255);
|
|
46
|
+
const rLinear = sRGBToLinear(r / 255);
|
|
47
|
+
const gLinear = sRGBToLinear(g / 255);
|
|
48
|
+
const bLinear = sRGBToLinear(b / 255);
|
|
49
|
+
const l_ = Math.cbrt(
|
|
50
|
+
0.4122214708 * rLinear + 0.5363325363 * gLinear + 0.0514459929 * bLinear
|
|
51
|
+
);
|
|
52
|
+
const m_ = Math.cbrt(
|
|
53
|
+
0.2119034982 * rLinear + 0.6806995451 * gLinear + 0.1073969566 * bLinear
|
|
54
|
+
);
|
|
55
|
+
const s_ = Math.cbrt(
|
|
56
|
+
0.0883024619 * rLinear + 0.2817188376 * gLinear + 0.6299787005 * bLinear
|
|
57
|
+
);
|
|
58
|
+
const L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_;
|
|
59
|
+
const A = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_;
|
|
60
|
+
const B = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_;
|
|
61
|
+
const c = Math.sqrt(A * A + B * B);
|
|
62
|
+
let h = Math.atan2(B, A) * INV_PI_180;
|
|
63
|
+
if (h < 0) {
|
|
64
|
+
h += 360;
|
|
65
|
+
}
|
|
66
|
+
return { l: L, c, h };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
oklchToRgb,
|
|
71
|
+
rgbToOklch
|
|
72
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isArray
|
|
3
|
+
} from "./chunk-6G7GFZV2.js";
|
|
4
|
+
import {
|
|
5
|
+
clamp,
|
|
6
|
+
toHex
|
|
7
|
+
} from "./chunk-PD6VHMH6.js";
|
|
8
|
+
|
|
9
|
+
// src/color/hex-rgb.ts
|
|
10
|
+
var HEX_PREFIX_REGEX = /^#/;
|
|
11
|
+
var HEX_VALIDATION_REGEX = /^[0-9a-fA-F]{6}$/;
|
|
12
|
+
function hexToRgb(hex) {
|
|
13
|
+
if (!hex || typeof hex !== "string") {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
let value = hex.trim().replace(HEX_PREFIX_REGEX, "");
|
|
17
|
+
if (value.length === 3) {
|
|
18
|
+
value = value.split("").map((c) => c + c).join("");
|
|
19
|
+
}
|
|
20
|
+
if (!HEX_VALIDATION_REGEX.test(value)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const r = Number.parseInt(value.slice(0, 2), 16);
|
|
24
|
+
const g = Number.parseInt(value.slice(2, 4), 16);
|
|
25
|
+
const b = Number.parseInt(value.slice(4, 6), 16);
|
|
26
|
+
return { r, g, b };
|
|
27
|
+
}
|
|
28
|
+
function rgbToHex(rgb) {
|
|
29
|
+
const c = (v) => Math.round(clamp(v, 0, 255));
|
|
30
|
+
const rgb_ = isArray(rgb) ? rgb : [rgb.r, rgb.g, rgb.b];
|
|
31
|
+
const r = c(rgb_[0]);
|
|
32
|
+
const g = c(rgb_[1]);
|
|
33
|
+
const b = c(rgb_[2]);
|
|
34
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
hexToRgb,
|
|
39
|
+
rgbToHex
|
|
40
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
noop
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
createWatch
|
|
6
|
-
} from "./chunk-4L6FK7MF.js";
|
|
3
|
+
} from "./chunk-QPEF6LHH.js";
|
|
7
4
|
import {
|
|
8
5
|
access
|
|
9
6
|
} from "./chunk-YK5QQQ43.js";
|
|
7
|
+
import {
|
|
8
|
+
createWatch
|
|
9
|
+
} from "./chunk-4L6FK7MF.js";
|
|
10
10
|
import {
|
|
11
11
|
clearArray
|
|
12
12
|
} from "./chunk-BT47ISVC.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/utils/number.ts
|
|
2
|
+
function min(...numbers) {
|
|
3
|
+
return Math.min(...numbers);
|
|
4
|
+
}
|
|
5
|
+
function max(...numbers) {
|
|
6
|
+
return Math.max(...numbers);
|
|
7
|
+
}
|
|
8
|
+
function clamp(x, minimum = 0, maximum = 1) {
|
|
9
|
+
return min(maximum, max(minimum, x));
|
|
10
|
+
}
|
|
11
|
+
function inRange(x, minimum = 0, maximum = 1, inclusivity = "[]") {
|
|
12
|
+
const minCheck = inclusivity[0] === "[" ? x >= minimum : x > minimum;
|
|
13
|
+
const maxCheck = inclusivity[1] === "]" ? x <= maximum : x < maximum;
|
|
14
|
+
return minCheck && maxCheck;
|
|
15
|
+
}
|
|
16
|
+
function toHex(x, pad = 2) {
|
|
17
|
+
return x.toString(16).padStart(pad, "0");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
min,
|
|
22
|
+
max,
|
|
23
|
+
clamp,
|
|
24
|
+
inRange,
|
|
25
|
+
toHex
|
|
26
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hexToRgb
|
|
3
|
+
} from "./chunk-KFLH3AZ6.js";
|
|
4
|
+
import {
|
|
5
|
+
inRange
|
|
6
|
+
} from "./chunk-PD6VHMH6.js";
|
|
7
|
+
|
|
8
|
+
// src/color/validation.ts
|
|
9
|
+
function isValidRGB(rgb) {
|
|
10
|
+
return Object.values(rgb).every((x) => inRange(x, 0, 255));
|
|
11
|
+
}
|
|
12
|
+
function isValidOKLCH(oklch) {
|
|
13
|
+
return inRange(oklch.l) && oklch.c >= 0 && inRange(oklch.h, 0, 360);
|
|
14
|
+
}
|
|
15
|
+
function isValidHex(hex) {
|
|
16
|
+
return hexToRgb(hex) !== null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
isValidRGB,
|
|
21
|
+
isValidOKLCH,
|
|
22
|
+
isValidHex
|
|
23
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RGB } from './oklch-rgb.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a hex color string to RGB color values.
|
|
5
|
+
*
|
|
6
|
+
* Supports both 3-digit (#rgb) and 6-digit (#rrggbb) hex formats.
|
|
7
|
+
* The hash symbol (#) is optional.
|
|
8
|
+
*
|
|
9
|
+
* @param hex - Hex color string (e.g., "#ffcc00", "ffcc00", "#fc0", "fc0")
|
|
10
|
+
* @returns RGB object with r, g, b values (0-255), or null if invalid
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* hexToRgb("#ffcc00") // => { r: 255, g: 204, b: 0 }
|
|
15
|
+
* hexToRgb("fc0") // => { r: 255, g: 204, b: 0 }
|
|
16
|
+
* hexToRgb("#invalid") // => null
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function hexToRgb(hex: string): RGB | null;
|
|
20
|
+
/**
|
|
21
|
+
* Converts RGB color values to a hex color string.
|
|
22
|
+
*
|
|
23
|
+
* RGB values are automatically clamped to the 0-255 range.
|
|
24
|
+
*
|
|
25
|
+
* @param rgb - RGB object with r, g, b values
|
|
26
|
+
* @returns Hex color string with # prefix (e.g., "#ffcc00")
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* rgbToHex({ r: 255, g: 204, b: 0 }) // => "#ffcc00"
|
|
31
|
+
* rgbToHex({ r: 300, g: -10, b: 128 }) // => "#ff0080" (clamped values)
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function rgbToHex(rgb: RGB | [number, number, number]): string;
|
|
35
|
+
|
|
36
|
+
export { hexToRgb, rgbToHex };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hexToRgb,
|
|
3
|
+
rgbToHex
|
|
4
|
+
} from "../chunk-KFLH3AZ6.js";
|
|
5
|
+
import "../chunk-U5LQ2AS5.js";
|
|
6
|
+
import "../chunk-QQVSG76Z.js";
|
|
7
|
+
import "../chunk-Y4GYGFIT.js";
|
|
8
|
+
import "../chunk-BT47ISVC.js";
|
|
9
|
+
import "../chunk-KKFGUHFR.js";
|
|
10
|
+
import "../chunk-6G7GFZV2.js";
|
|
11
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
|
+
export {
|
|
13
|
+
hexToRgb,
|
|
14
|
+
rgbToHex
|
|
15
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "../chunk-BLX3XSA6.js";
|
|
2
|
+
import {
|
|
3
|
+
oklchToRgb,
|
|
4
|
+
rgbToOklch
|
|
5
|
+
} from "../chunk-ACZGS7DG.js";
|
|
6
|
+
import {
|
|
7
|
+
isValidHex,
|
|
8
|
+
isValidOKLCH,
|
|
9
|
+
isValidRGB
|
|
10
|
+
} from "../chunk-S7U3LZNS.js";
|
|
11
|
+
import {
|
|
12
|
+
hexToRgb,
|
|
13
|
+
rgbToHex
|
|
14
|
+
} from "../chunk-KFLH3AZ6.js";
|
|
15
|
+
import "../chunk-U5LQ2AS5.js";
|
|
16
|
+
import "../chunk-QQVSG76Z.js";
|
|
17
|
+
import "../chunk-Y4GYGFIT.js";
|
|
18
|
+
import "../chunk-BT47ISVC.js";
|
|
19
|
+
import "../chunk-KKFGUHFR.js";
|
|
20
|
+
import "../chunk-6G7GFZV2.js";
|
|
21
|
+
import "../chunk-PD6VHMH6.js";
|
|
22
|
+
export {
|
|
23
|
+
hexToRgb,
|
|
24
|
+
isValidHex,
|
|
25
|
+
isValidOKLCH,
|
|
26
|
+
isValidRGB,
|
|
27
|
+
oklchToRgb,
|
|
28
|
+
rgbToHex,
|
|
29
|
+
rgbToOklch
|
|
30
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
interface RGB {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}
|
|
6
|
+
interface OKLCH {
|
|
7
|
+
l: number;
|
|
8
|
+
c: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Converts OKLCH color to RGB color space.
|
|
13
|
+
*
|
|
14
|
+
* OKLCH is a perceptually uniform color space based on OKLab.
|
|
15
|
+
* Input values are automatically clamped to valid ranges.
|
|
16
|
+
*
|
|
17
|
+
* @param oklch - The OKLCH color to convert
|
|
18
|
+
* @param oklch.l - Lightness (0-1, will be clamped)
|
|
19
|
+
* @param oklch.c - Chroma (≥0, will be clamped)
|
|
20
|
+
* @param oklch.h - Hue in degrees (will be normalized to 0-360)
|
|
21
|
+
* @returns RGB color with values 0-255
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const rgb = oklchToRgb({ l: 0.7, c: 0.1, h: 200 });
|
|
26
|
+
* // => { r: 64, g: 177, b: 183 }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare function oklchToRgb(oklch: OKLCH): RGB;
|
|
30
|
+
/**
|
|
31
|
+
* Converts RGB color to OKLCH color space.
|
|
32
|
+
*
|
|
33
|
+
* RGB values are automatically clamped to 0-255 range.
|
|
34
|
+
*
|
|
35
|
+
* @param rgb - The RGB color to convert
|
|
36
|
+
* @param rgb.r - Red component (0-255, will be clamped)
|
|
37
|
+
* @param rgb.g - Green component (0-255, will be clamped)
|
|
38
|
+
* @param rgb.b - Blue component (0-255, will be clamped)
|
|
39
|
+
* @returns OKLCH color with l∈[0,1], c≥0, h∈[0,360)
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const oklch = rgbToOklch({ r: 64, g: 177, b: 183 });
|
|
44
|
+
* // => { l: 0.7, c: 0.1, h: 200 }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function rgbToOklch(rgb: RGB): OKLCH;
|
|
48
|
+
|
|
49
|
+
export { type OKLCH, type RGB, oklchToRgb, rgbToOklch };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
oklchToRgb,
|
|
3
|
+
rgbToOklch
|
|
4
|
+
} from "../chunk-ACZGS7DG.js";
|
|
5
|
+
import "../chunk-U5LQ2AS5.js";
|
|
6
|
+
import "../chunk-QQVSG76Z.js";
|
|
7
|
+
import "../chunk-Y4GYGFIT.js";
|
|
8
|
+
import "../chunk-BT47ISVC.js";
|
|
9
|
+
import "../chunk-KKFGUHFR.js";
|
|
10
|
+
import "../chunk-6G7GFZV2.js";
|
|
11
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
|
+
export {
|
|
13
|
+
oklchToRgb,
|
|
14
|
+
rgbToOklch
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RGB, OKLCH } from './oklch-rgb.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if RGB values are in valid range (0-255)
|
|
5
|
+
*/
|
|
6
|
+
declare function isValidRGB(rgb: RGB): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if OKLCH values are in valid ranges
|
|
9
|
+
*/
|
|
10
|
+
declare function isValidOKLCH(oklch: OKLCH): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if a string is a valid hex color format.
|
|
13
|
+
*
|
|
14
|
+
* @param hex - String to validate
|
|
15
|
+
* @returns `true` if the string is a valid hex color, `false` otherwise
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* isValidHex("#ffcc00") // => true
|
|
20
|
+
* isValidHex("fc0") // => true
|
|
21
|
+
* isValidHex("#invalid") // => false
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function isValidHex(hex: string): boolean;
|
|
25
|
+
|
|
26
|
+
export { isValidHex, isValidOKLCH, isValidRGB };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isValidHex,
|
|
3
|
+
isValidOKLCH,
|
|
4
|
+
isValidRGB
|
|
5
|
+
} from "../chunk-S7U3LZNS.js";
|
|
6
|
+
import "../chunk-KFLH3AZ6.js";
|
|
7
|
+
import "../chunk-U5LQ2AS5.js";
|
|
8
|
+
import "../chunk-QQVSG76Z.js";
|
|
9
|
+
import "../chunk-Y4GYGFIT.js";
|
|
10
|
+
import "../chunk-BT47ISVC.js";
|
|
11
|
+
import "../chunk-KKFGUHFR.js";
|
|
12
|
+
import "../chunk-6G7GFZV2.js";
|
|
13
|
+
import "../chunk-PD6VHMH6.js";
|
|
14
|
+
export {
|
|
15
|
+
isValidHex,
|
|
16
|
+
isValidOKLCH,
|
|
17
|
+
isValidRGB
|
|
18
|
+
};
|
package/dist/dom/css.js
CHANGED
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
mountStyle,
|
|
4
4
|
stringStyleToObject
|
|
5
5
|
} from "../chunk-DKZ3RJJI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-U5LQ2AS5.js";
|
|
7
7
|
import "../chunk-QQVSG76Z.js";
|
|
8
8
|
import "../chunk-Y4GYGFIT.js";
|
|
9
9
|
import "../chunk-BT47ISVC.js";
|
|
10
|
-
import "../chunk-6G7GFZV2.js";
|
|
11
10
|
import "../chunk-KKFGUHFR.js";
|
|
11
|
+
import "../chunk-6G7GFZV2.js";
|
|
12
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
13
|
export {
|
|
13
14
|
combineStyle,
|
|
14
15
|
mountStyle,
|
package/dist/dom/index.js
CHANGED
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
mountStyle,
|
|
5
5
|
stringStyleToObject
|
|
6
6
|
} from "../chunk-DKZ3RJJI.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-U5LQ2AS5.js";
|
|
8
8
|
import "../chunk-QQVSG76Z.js";
|
|
9
9
|
import "../chunk-Y4GYGFIT.js";
|
|
10
10
|
import "../chunk-BT47ISVC.js";
|
|
11
|
-
import "../chunk-6G7GFZV2.js";
|
|
12
11
|
import "../chunk-KKFGUHFR.js";
|
|
12
|
+
import "../chunk-6G7GFZV2.js";
|
|
13
|
+
import "../chunk-PD6VHMH6.js";
|
|
13
14
|
export {
|
|
14
15
|
combineStyle,
|
|
15
16
|
mountStyle,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClickOutside
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-WJHRONQU.js";
|
|
4
|
+
import "../chunk-TGWWPUWD.js";
|
|
5
|
+
import "../chunk-QPEF6LHH.js";
|
|
7
6
|
import "../chunk-YK5QQQ43.js";
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-4L6FK7MF.js";
|
|
8
|
+
import "../chunk-U5LQ2AS5.js";
|
|
9
9
|
import "../chunk-QQVSG76Z.js";
|
|
10
10
|
import "../chunk-Y4GYGFIT.js";
|
|
11
11
|
import "../chunk-BT47ISVC.js";
|
|
12
|
-
import "../chunk-6G7GFZV2.js";
|
|
13
12
|
import "../chunk-KKFGUHFR.js";
|
|
13
|
+
import "../chunk-6G7GFZV2.js";
|
|
14
|
+
import "../chunk-PD6VHMH6.js";
|
|
14
15
|
export {
|
|
15
16
|
createClickOutside
|
|
16
17
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createEventListener
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-6OVLJ45M.js";
|
|
4
|
+
import "../chunk-TGWWPUWD.js";
|
|
5
|
+
import "../chunk-QPEF6LHH.js";
|
|
7
6
|
import "../chunk-YK5QQQ43.js";
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-4L6FK7MF.js";
|
|
8
|
+
import "../chunk-U5LQ2AS5.js";
|
|
9
9
|
import "../chunk-QQVSG76Z.js";
|
|
10
10
|
import "../chunk-Y4GYGFIT.js";
|
|
11
11
|
import "../chunk-BT47ISVC.js";
|
|
12
|
-
import "../chunk-6G7GFZV2.js";
|
|
13
12
|
import "../chunk-KKFGUHFR.js";
|
|
13
|
+
import "../chunk-6G7GFZV2.js";
|
|
14
|
+
import "../chunk-PD6VHMH6.js";
|
|
14
15
|
export {
|
|
15
16
|
createEventListener
|
|
16
17
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIntersectionObserver
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-LEWF7QAQ.js";
|
|
4
|
+
import "../chunk-QPEF6LHH.js";
|
|
6
5
|
import "../chunk-YK5QQQ43.js";
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4L6FK7MF.js";
|
|
7
|
+
import "../chunk-U5LQ2AS5.js";
|
|
8
8
|
import "../chunk-QQVSG76Z.js";
|
|
9
9
|
import "../chunk-Y4GYGFIT.js";
|
|
10
10
|
import "../chunk-BT47ISVC.js";
|
|
11
|
-
import "../chunk-6G7GFZV2.js";
|
|
12
11
|
import "../chunk-KKFGUHFR.js";
|
|
12
|
+
import "../chunk-6G7GFZV2.js";
|
|
13
|
+
import "../chunk-PD6VHMH6.js";
|
|
13
14
|
export {
|
|
14
15
|
createIntersectionObserver
|
|
15
16
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVisibilityObserver
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-TDJLPDJF.js";
|
|
4
|
+
import "../chunk-QPEF6LHH.js";
|
|
6
5
|
import "../chunk-YK5QQQ43.js";
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4L6FK7MF.js";
|
|
7
|
+
import "../chunk-U5LQ2AS5.js";
|
|
8
8
|
import "../chunk-QQVSG76Z.js";
|
|
9
9
|
import "../chunk-Y4GYGFIT.js";
|
|
10
10
|
import "../chunk-BT47ISVC.js";
|
|
11
|
-
import "../chunk-6G7GFZV2.js";
|
|
12
11
|
import "../chunk-KKFGUHFR.js";
|
|
12
|
+
import "../chunk-6G7GFZV2.js";
|
|
13
|
+
import "../chunk-PD6VHMH6.js";
|
|
13
14
|
export {
|
|
14
15
|
createVisibilityObserver
|
|
15
16
|
};
|
package/dist/event/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import "../chunk-LUFOWTRW.js";
|
|
2
2
|
import {
|
|
3
3
|
createClickOutside
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WJHRONQU.js";
|
|
5
5
|
import {
|
|
6
6
|
createEventListener
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-6OVLJ45M.js";
|
|
8
8
|
import {
|
|
9
9
|
makeEventListener
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-TGWWPUWD.js";
|
|
11
11
|
import {
|
|
12
12
|
createIntersectionObserver
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-LEWF7QAQ.js";
|
|
14
14
|
import {
|
|
15
15
|
createVisibilityObserver
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-4L6FK7MF.js";
|
|
16
|
+
} from "../chunk-TDJLPDJF.js";
|
|
17
|
+
import "../chunk-QPEF6LHH.js";
|
|
19
18
|
import "../chunk-YK5QQQ43.js";
|
|
20
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-4L6FK7MF.js";
|
|
20
|
+
import "../chunk-U5LQ2AS5.js";
|
|
21
21
|
import "../chunk-QQVSG76Z.js";
|
|
22
22
|
import "../chunk-Y4GYGFIT.js";
|
|
23
23
|
import "../chunk-BT47ISVC.js";
|
|
24
|
-
import "../chunk-6G7GFZV2.js";
|
|
25
24
|
import "../chunk-KKFGUHFR.js";
|
|
25
|
+
import "../chunk-6G7GFZV2.js";
|
|
26
|
+
import "../chunk-PD6VHMH6.js";
|
|
26
27
|
export {
|
|
27
28
|
createClickOutside,
|
|
28
29
|
createEventListener,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeEventListener
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-TGWWPUWD.js";
|
|
4
|
+
import "../chunk-QPEF6LHH.js";
|
|
6
5
|
import "../chunk-YK5QQQ43.js";
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4L6FK7MF.js";
|
|
7
|
+
import "../chunk-U5LQ2AS5.js";
|
|
8
8
|
import "../chunk-QQVSG76Z.js";
|
|
9
9
|
import "../chunk-Y4GYGFIT.js";
|
|
10
10
|
import "../chunk-BT47ISVC.js";
|
|
11
|
-
import "../chunk-6G7GFZV2.js";
|
|
12
11
|
import "../chunk-KKFGUHFR.js";
|
|
12
|
+
import "../chunk-6G7GFZV2.js";
|
|
13
|
+
import "../chunk-PD6VHMH6.js";
|
|
13
14
|
export {
|
|
14
15
|
makeEventListener
|
|
15
16
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDebounce
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-QPEF6LHH.js";
|
|
5
4
|
import "../chunk-YK5QQQ43.js";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4L6FK7MF.js";
|
|
6
|
+
import "../chunk-U5LQ2AS5.js";
|
|
7
7
|
import "../chunk-QQVSG76Z.js";
|
|
8
8
|
import "../chunk-Y4GYGFIT.js";
|
|
9
9
|
import "../chunk-BT47ISVC.js";
|
|
10
|
-
import "../chunk-6G7GFZV2.js";
|
|
11
10
|
import "../chunk-KKFGUHFR.js";
|
|
11
|
+
import "../chunk-6G7GFZV2.js";
|
|
12
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
13
|
export {
|
|
13
14
|
createDebounce
|
|
14
15
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLoopExec
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-QPEF6LHH.js";
|
|
5
4
|
import "../chunk-YK5QQQ43.js";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4L6FK7MF.js";
|
|
6
|
+
import "../chunk-U5LQ2AS5.js";
|
|
7
7
|
import "../chunk-QQVSG76Z.js";
|
|
8
8
|
import "../chunk-Y4GYGFIT.js";
|
|
9
9
|
import "../chunk-BT47ISVC.js";
|
|
10
|
-
import "../chunk-6G7GFZV2.js";
|
|
11
10
|
import "../chunk-KKFGUHFR.js";
|
|
11
|
+
import "../chunk-6G7GFZV2.js";
|
|
12
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
13
|
export {
|
|
13
14
|
createLoopExec
|
|
14
15
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createThrottle
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-QPEF6LHH.js";
|
|
5
4
|
import "../chunk-YK5QQQ43.js";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4L6FK7MF.js";
|
|
6
|
+
import "../chunk-U5LQ2AS5.js";
|
|
7
7
|
import "../chunk-QQVSG76Z.js";
|
|
8
8
|
import "../chunk-Y4GYGFIT.js";
|
|
9
9
|
import "../chunk-BT47ISVC.js";
|
|
10
|
-
import "../chunk-6G7GFZV2.js";
|
|
11
10
|
import "../chunk-KKFGUHFR.js";
|
|
11
|
+
import "../chunk-6G7GFZV2.js";
|
|
12
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
13
|
export {
|
|
13
14
|
createThrottle
|
|
14
15
|
};
|
package/dist/fn/index.js
CHANGED
|
@@ -3,15 +3,16 @@ import {
|
|
|
3
3
|
createLoopExec,
|
|
4
4
|
createThrottle,
|
|
5
5
|
noop
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-4L6FK7MF.js";
|
|
6
|
+
} from "../chunk-QPEF6LHH.js";
|
|
8
7
|
import "../chunk-YK5QQQ43.js";
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-4L6FK7MF.js";
|
|
9
|
+
import "../chunk-U5LQ2AS5.js";
|
|
10
10
|
import "../chunk-QQVSG76Z.js";
|
|
11
11
|
import "../chunk-Y4GYGFIT.js";
|
|
12
12
|
import "../chunk-BT47ISVC.js";
|
|
13
|
-
import "../chunk-6G7GFZV2.js";
|
|
14
13
|
import "../chunk-KKFGUHFR.js";
|
|
14
|
+
import "../chunk-6G7GFZV2.js";
|
|
15
|
+
import "../chunk-PD6VHMH6.js";
|
|
15
16
|
export {
|
|
16
17
|
createDebounce,
|
|
17
18
|
createLoopExec,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { hexToRgb, rgbToHex } from './color/hex-rgb.js';
|
|
2
|
+
export { OKLCH, RGB, oklchToRgb, rgbToOklch } from './color/oklch-rgb.js';
|
|
3
|
+
export { isValidHex, isValidOKLCH, isValidRGB } from './color/validation.js';
|
|
1
4
|
export { combineStyle, mountStyle, stringStyleToObject } from './dom/css.js';
|
|
2
5
|
export { createClickOutside } from './event/create-click-outside.js';
|
|
3
6
|
export { createEventListener } from './event/create-event-listener.js';
|
|
@@ -14,6 +17,7 @@ export { MaybeAccessor, MaybeArray, MaybeNullableAccessor, MaybePromise } from '
|
|
|
14
17
|
export { clearArray, iterate, list, range } from './utils/array.js';
|
|
15
18
|
export { sleep } from './utils/async.js';
|
|
16
19
|
export { isArray, isClient, isDate, isEmpty, isFloat, isFn, isInt, isNumber, isObject, isPrimitive, isPromise, isString, isSymbol } from './utils/is.js';
|
|
20
|
+
export { clamp, inRange, max, min, toHex } from './utils/number.js';
|
|
17
21
|
export { draw, random, shuffle, uid } from './utils/random.js';
|
|
18
22
|
export { camel, capitalize, dash, pascal, snake, template, title, trim } from './utils/str.js';
|
|
19
23
|
export { createDebounce } from './fn/create-debounce.js';
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,60 @@
|
|
|
1
1
|
import "./chunk-SK6Y2YH6.js";
|
|
2
|
-
import "./chunk-AZAXMGEB.js";
|
|
3
2
|
import "./chunk-EZML2DEC.js";
|
|
4
3
|
import "./chunk-YXRZ2KMJ.js";
|
|
5
4
|
import {
|
|
6
5
|
dataIf
|
|
7
6
|
} from "./chunk-II6INKPZ.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
combineStyle,
|
|
11
|
-
mountStyle,
|
|
12
|
-
stringStyleToObject
|
|
13
|
-
} from "./chunk-DKZ3RJJI.js";
|
|
7
|
+
import "./chunk-AZAXMGEB.js";
|
|
14
8
|
import "./chunk-LUFOWTRW.js";
|
|
15
9
|
import {
|
|
16
10
|
createClickOutside
|
|
17
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WJHRONQU.js";
|
|
18
12
|
import {
|
|
19
13
|
createEventListener
|
|
20
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6OVLJ45M.js";
|
|
21
15
|
import {
|
|
22
16
|
makeEventListener
|
|
23
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TGWWPUWD.js";
|
|
24
18
|
import {
|
|
25
19
|
createIntersectionObserver
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LEWF7QAQ.js";
|
|
27
21
|
import {
|
|
28
22
|
createVisibilityObserver
|
|
29
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TDJLPDJF.js";
|
|
24
|
+
import "./chunk-BLX3XSA6.js";
|
|
25
|
+
import {
|
|
26
|
+
oklchToRgb,
|
|
27
|
+
rgbToOklch
|
|
28
|
+
} from "./chunk-ACZGS7DG.js";
|
|
29
|
+
import {
|
|
30
|
+
isValidHex,
|
|
31
|
+
isValidOKLCH,
|
|
32
|
+
isValidRGB
|
|
33
|
+
} from "./chunk-S7U3LZNS.js";
|
|
34
|
+
import {
|
|
35
|
+
hexToRgb,
|
|
36
|
+
rgbToHex
|
|
37
|
+
} from "./chunk-KFLH3AZ6.js";
|
|
38
|
+
import "./chunk-FFBJP5FE.js";
|
|
39
|
+
import {
|
|
40
|
+
combineStyle,
|
|
41
|
+
mountStyle,
|
|
42
|
+
stringStyleToObject
|
|
43
|
+
} from "./chunk-DKZ3RJJI.js";
|
|
30
44
|
import {
|
|
31
45
|
createDebounce,
|
|
32
46
|
createDebouncedWatch,
|
|
33
47
|
createLoopExec,
|
|
34
48
|
createThrottle,
|
|
35
49
|
noop
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
createWatch
|
|
39
|
-
} from "./chunk-4L6FK7MF.js";
|
|
50
|
+
} from "./chunk-QPEF6LHH.js";
|
|
40
51
|
import {
|
|
41
52
|
access
|
|
42
53
|
} from "./chunk-YK5QQQ43.js";
|
|
43
|
-
import
|
|
54
|
+
import {
|
|
55
|
+
createWatch
|
|
56
|
+
} from "./chunk-4L6FK7MF.js";
|
|
57
|
+
import "./chunk-U5LQ2AS5.js";
|
|
44
58
|
import {
|
|
45
59
|
draw,
|
|
46
60
|
random,
|
|
@@ -63,6 +77,9 @@ import {
|
|
|
63
77
|
list,
|
|
64
78
|
range
|
|
65
79
|
} from "./chunk-BT47ISVC.js";
|
|
80
|
+
import {
|
|
81
|
+
sleep
|
|
82
|
+
} from "./chunk-KKFGUHFR.js";
|
|
66
83
|
import {
|
|
67
84
|
isArray,
|
|
68
85
|
isClient,
|
|
@@ -79,12 +96,17 @@ import {
|
|
|
79
96
|
isSymbol
|
|
80
97
|
} from "./chunk-6G7GFZV2.js";
|
|
81
98
|
import {
|
|
82
|
-
|
|
83
|
-
|
|
99
|
+
clamp,
|
|
100
|
+
inRange,
|
|
101
|
+
max,
|
|
102
|
+
min,
|
|
103
|
+
toHex
|
|
104
|
+
} from "./chunk-PD6VHMH6.js";
|
|
84
105
|
export {
|
|
85
106
|
access,
|
|
86
107
|
camel,
|
|
87
108
|
capitalize,
|
|
109
|
+
clamp,
|
|
88
110
|
clearArray,
|
|
89
111
|
combineStyle,
|
|
90
112
|
createClickOutside,
|
|
@@ -99,6 +121,8 @@ export {
|
|
|
99
121
|
dash,
|
|
100
122
|
dataIf,
|
|
101
123
|
draw,
|
|
124
|
+
hexToRgb,
|
|
125
|
+
inRange,
|
|
102
126
|
isArray,
|
|
103
127
|
isClient,
|
|
104
128
|
isDate,
|
|
@@ -112,20 +136,29 @@ export {
|
|
|
112
136
|
isPromise,
|
|
113
137
|
isString,
|
|
114
138
|
isSymbol,
|
|
139
|
+
isValidHex,
|
|
140
|
+
isValidOKLCH,
|
|
141
|
+
isValidRGB,
|
|
115
142
|
iterate,
|
|
116
143
|
list,
|
|
117
144
|
makeEventListener,
|
|
145
|
+
max,
|
|
146
|
+
min,
|
|
118
147
|
mountStyle,
|
|
119
148
|
noop,
|
|
149
|
+
oklchToRgb,
|
|
120
150
|
pascal,
|
|
121
151
|
random,
|
|
122
152
|
range,
|
|
153
|
+
rgbToHex,
|
|
154
|
+
rgbToOklch,
|
|
123
155
|
shuffle,
|
|
124
156
|
sleep,
|
|
125
157
|
snake,
|
|
126
158
|
stringStyleToObject,
|
|
127
159
|
template,
|
|
128
160
|
title,
|
|
161
|
+
toHex,
|
|
129
162
|
trim,
|
|
130
163
|
uid
|
|
131
164
|
};
|
package/dist/reactive/access.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
access
|
|
3
3
|
} from "../chunk-YK5QQQ43.js";
|
|
4
|
-
import "../chunk-
|
|
4
|
+
import "../chunk-U5LQ2AS5.js";
|
|
5
5
|
import "../chunk-QQVSG76Z.js";
|
|
6
6
|
import "../chunk-Y4GYGFIT.js";
|
|
7
7
|
import "../chunk-BT47ISVC.js";
|
|
8
|
-
import "../chunk-6G7GFZV2.js";
|
|
9
8
|
import "../chunk-KKFGUHFR.js";
|
|
9
|
+
import "../chunk-6G7GFZV2.js";
|
|
10
|
+
import "../chunk-PD6VHMH6.js";
|
|
10
11
|
export {
|
|
11
12
|
access
|
|
12
13
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDebouncedWatch
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-QPEF6LHH.js";
|
|
5
4
|
import "../chunk-YK5QQQ43.js";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4L6FK7MF.js";
|
|
6
|
+
import "../chunk-U5LQ2AS5.js";
|
|
7
7
|
import "../chunk-QQVSG76Z.js";
|
|
8
8
|
import "../chunk-Y4GYGFIT.js";
|
|
9
9
|
import "../chunk-BT47ISVC.js";
|
|
10
|
-
import "../chunk-6G7GFZV2.js";
|
|
11
10
|
import "../chunk-KKFGUHFR.js";
|
|
11
|
+
import "../chunk-6G7GFZV2.js";
|
|
12
|
+
import "../chunk-PD6VHMH6.js";
|
|
12
13
|
export {
|
|
13
14
|
createDebouncedWatch
|
|
14
15
|
};
|
package/dist/reactive/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDebouncedWatch
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import {
|
|
5
|
-
createWatch
|
|
6
|
-
} from "../chunk-4L6FK7MF.js";
|
|
3
|
+
} from "../chunk-QPEF6LHH.js";
|
|
7
4
|
import {
|
|
8
5
|
access
|
|
9
6
|
} from "../chunk-YK5QQQ43.js";
|
|
10
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
createWatch
|
|
9
|
+
} from "../chunk-4L6FK7MF.js";
|
|
10
|
+
import "../chunk-U5LQ2AS5.js";
|
|
11
11
|
import "../chunk-QQVSG76Z.js";
|
|
12
12
|
import "../chunk-Y4GYGFIT.js";
|
|
13
13
|
import "../chunk-BT47ISVC.js";
|
|
14
|
-
import "../chunk-6G7GFZV2.js";
|
|
15
14
|
import "../chunk-KKFGUHFR.js";
|
|
15
|
+
import "../chunk-6G7GFZV2.js";
|
|
16
|
+
import "../chunk-PD6VHMH6.js";
|
|
16
17
|
export {
|
|
17
18
|
access,
|
|
18
19
|
createDebouncedWatch,
|
package/dist/types/index.js
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { clearArray, iterate, list, range } from './array.js';
|
|
2
2
|
export { sleep } from './async.js';
|
|
3
3
|
export { isArray, isClient, isDate, isEmpty, isFloat, isFn, isInt, isNumber, isObject, isPrimitive, isPromise, isString, isSymbol } from './is.js';
|
|
4
|
+
export { clamp, inRange, max, min, toHex } from './number.js';
|
|
4
5
|
export { draw, random, shuffle, uid } from './random.js';
|
|
5
6
|
export { camel, capitalize, dash, pascal, snake, template, title, trim } from './str.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-U5LQ2AS5.js";
|
|
2
2
|
import {
|
|
3
3
|
draw,
|
|
4
4
|
random,
|
|
@@ -21,6 +21,9 @@ import {
|
|
|
21
21
|
list,
|
|
22
22
|
range
|
|
23
23
|
} from "../chunk-BT47ISVC.js";
|
|
24
|
+
import {
|
|
25
|
+
sleep
|
|
26
|
+
} from "../chunk-KKFGUHFR.js";
|
|
24
27
|
import {
|
|
25
28
|
isArray,
|
|
26
29
|
isClient,
|
|
@@ -37,14 +40,20 @@ import {
|
|
|
37
40
|
isSymbol
|
|
38
41
|
} from "../chunk-6G7GFZV2.js";
|
|
39
42
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
clamp,
|
|
44
|
+
inRange,
|
|
45
|
+
max,
|
|
46
|
+
min,
|
|
47
|
+
toHex
|
|
48
|
+
} from "../chunk-PD6VHMH6.js";
|
|
42
49
|
export {
|
|
43
50
|
camel,
|
|
44
51
|
capitalize,
|
|
52
|
+
clamp,
|
|
45
53
|
clearArray,
|
|
46
54
|
dash,
|
|
47
55
|
draw,
|
|
56
|
+
inRange,
|
|
48
57
|
isArray,
|
|
49
58
|
isClient,
|
|
50
59
|
isDate,
|
|
@@ -60,6 +69,8 @@ export {
|
|
|
60
69
|
isSymbol,
|
|
61
70
|
iterate,
|
|
62
71
|
list,
|
|
72
|
+
max,
|
|
73
|
+
min,
|
|
63
74
|
pascal,
|
|
64
75
|
random,
|
|
65
76
|
range,
|
|
@@ -68,6 +79,7 @@ export {
|
|
|
68
79
|
snake,
|
|
69
80
|
template,
|
|
70
81
|
title,
|
|
82
|
+
toHex,
|
|
71
83
|
trim,
|
|
72
84
|
uid
|
|
73
85
|
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the smallest of the given numbers.
|
|
3
|
+
*
|
|
4
|
+
* This is a convenience wrapper around `Math.min` that provides better type safety
|
|
5
|
+
* and consistency with other utility functions.
|
|
6
|
+
*
|
|
7
|
+
* @param numbers - The numbers to compare
|
|
8
|
+
* @returns The smallest number from the input
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* min(1, 2, 3) // => 1
|
|
13
|
+
* min(-5, 0, 10) // => -5
|
|
14
|
+
* min(3.14, 2.71, 1.41) // => 1.41
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare function min(...numbers: number[]): number;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the largest of the given numbers.
|
|
20
|
+
*
|
|
21
|
+
* This is a convenience wrapper around `Math.max` that provides better type safety
|
|
22
|
+
* and consistency with other utility functions.
|
|
23
|
+
*
|
|
24
|
+
* @param numbers - The numbers to compare
|
|
25
|
+
* @returns The largest number from the input
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* max(1, 2, 3) // => 3
|
|
30
|
+
* max(-5, 0, 10) // => 10
|
|
31
|
+
* max(3.14, 2.71, 1.41) // => 3.14
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function max(...numbers: number[]): number;
|
|
35
|
+
/**
|
|
36
|
+
* Clamps a number to within the specified bounds.
|
|
37
|
+
*
|
|
38
|
+
* If the number is less than the minimum, returns the minimum.
|
|
39
|
+
* If the number is greater than the maximum, returns the maximum.
|
|
40
|
+
* Otherwise, returns the number unchanged.
|
|
41
|
+
*
|
|
42
|
+
* @param x - The number to clamp
|
|
43
|
+
* @param minimum - The lower bound (inclusive)
|
|
44
|
+
* @param maximum - The upper bound (inclusive)
|
|
45
|
+
* @returns The clamped number
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* clamp(0.5) // => 0.5 (within default 0-1 range)
|
|
50
|
+
* clamp(-0.1) // => 0 (clamped to minimum)
|
|
51
|
+
* clamp(1.5) // => 1 (clamped to maximum)
|
|
52
|
+
* clamp(15, 10, 20) // => 15 (within range)
|
|
53
|
+
* clamp(5, 10, 20) // => 10 (clamped to minimum)
|
|
54
|
+
* clamp(25, 10, 20) // => 20 (clamped to maximum)
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare function clamp(x: number, minimum?: number, maximum?: number): number;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if a number is within a specified range.
|
|
60
|
+
*
|
|
61
|
+
* Supports different inclusivity modes:
|
|
62
|
+
* - `'[]'` - Both bounds inclusive (default): `minimum ≤ x ≤ maximum`
|
|
63
|
+
* - `'()'` - Both bounds exclusive: `minimum < x < maximum`
|
|
64
|
+
* - `'[)'` - Lower inclusive, upper exclusive: `minimum ≤ x < maximum`
|
|
65
|
+
* - `'(]'` - Lower exclusive, upper inclusive: `minimum < x ≤ maximum`
|
|
66
|
+
*
|
|
67
|
+
* @param x - The number to check
|
|
68
|
+
* @param minimum - The lower bound of the range
|
|
69
|
+
* @param maximum - The upper bound of the range
|
|
70
|
+
* @param inclusivity - Specifies whether the bounds are inclusive or exclusive
|
|
71
|
+
* @returns `true` if the number is within the range, `false` otherwise
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // Default inclusive range [0, 1]
|
|
76
|
+
* inRange(0.5) // => true
|
|
77
|
+
* inRange(0) // => true (inclusive)
|
|
78
|
+
* inRange(1) // => true (inclusive)
|
|
79
|
+
* inRange(-0.1) // => false
|
|
80
|
+
* inRange(1.1) // => false
|
|
81
|
+
*
|
|
82
|
+
* // Custom range [10, 20]
|
|
83
|
+
* inRange(15, 10, 20) // => true
|
|
84
|
+
* inRange(10, 10, 20) // => true (inclusive)
|
|
85
|
+
* inRange(20, 10, 20) // => true (inclusive)
|
|
86
|
+
*
|
|
87
|
+
* // Exclusive bounds (10, 20)
|
|
88
|
+
* inRange(15, 10, 20, '()') // => true
|
|
89
|
+
* inRange(10, 10, 20, '()') // => false (exclusive)
|
|
90
|
+
* inRange(20, 10, 20, '()') // => false (exclusive)
|
|
91
|
+
*
|
|
92
|
+
* // Mixed inclusivity [10, 20)
|
|
93
|
+
* inRange(10, 10, 20, '[)') // => true (lower inclusive)
|
|
94
|
+
* inRange(20, 10, 20, '[)') // => false (upper exclusive)
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
declare function inRange(x: number, minimum?: number, maximum?: number, inclusivity?: '()' | '[]' | '[)' | '(]'): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Converts a number to a hexadecimal string.
|
|
100
|
+
*
|
|
101
|
+
* @param x - The number to convert
|
|
102
|
+
* @param pad - The number of digits to pad the output with (default: 2)
|
|
103
|
+
* @returns The hexadecimal representation of the number
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* toHEX(255) // => "ff"
|
|
108
|
+
* toHEX(255, 4) // => "00ff"
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare function toHex(x: number, pad?: number): string;
|
|
112
|
+
|
|
113
|
+
export { clamp, inRange, max, min, toHex };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-tiny-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A collection of tiny utilities for SolidJS applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
"@solidjs/testing-library": "^0.8.10",
|
|
18
18
|
"@testing-library/jest-dom": "^6.6.4",
|
|
19
19
|
"@testing-library/user-event": "^14.6.1",
|
|
20
|
+
"@types/culori": "^4.0.0",
|
|
20
21
|
"@types/node": "^24.2.1",
|
|
21
22
|
"@vitest/ui": "^3.2.4",
|
|
22
23
|
"commit-and-tag-version": "^12.5.1",
|
|
24
|
+
"culori": "^4.0.2",
|
|
23
25
|
"husky": "^9.1.7",
|
|
24
26
|
"jsdom": "^26.1.0",
|
|
25
27
|
"tsup": "^8.5.0",
|
|
@@ -47,15 +49,13 @@
|
|
|
47
49
|
"scripts": {
|
|
48
50
|
"build": "tsup",
|
|
49
51
|
"dev": "vite -c ./playground/vite.config.ts",
|
|
50
|
-
"test": "vitest",
|
|
52
|
+
"test": "vitest --run",
|
|
51
53
|
"clean": "rimraf dist node_modules pnpm-lock.yaml",
|
|
52
|
-
"test:run": "vitest --run",
|
|
53
54
|
"test:ui": "vitest --ui",
|
|
54
|
-
"test:coverage": "vitest --coverage",
|
|
55
55
|
"lint": "npx ultracite lint",
|
|
56
56
|
"lint:fix": "npx ultracite format",
|
|
57
57
|
"type-check": "tsc --noEmit --skipLibCheck",
|
|
58
|
-
"release": "pnpm type-check && pnpm lint:fix && pnpm test
|
|
58
|
+
"release": "pnpm type-check && pnpm lint:fix && pnpm test && commit-and-tag-version -i CHANGELOG.md --same-file",
|
|
59
59
|
"pub": "pnpm build && pnpm publish"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
File without changes
|