@blockle/blocks-core 0.22.0 → 0.23.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/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/utils/math/math.d.ts +1 -2
- package/dist/utils/math/math.js +4 -10
- package/dist/utils/math/math.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { Theme } from './theme/makeTheme.js';
|
|
|
11
11
|
export { classnames } from './utils/classnames/classnames.js';
|
|
12
12
|
export { hasAnimationDuration } from './utils/dom/hasAnimationDuration.js';
|
|
13
13
|
export { alignItemsMap, justifyContentMap, type AlignItemsMap, type JustifyContentMap, } from './utils/flexbox/flexbox.js';
|
|
14
|
-
export {
|
|
14
|
+
export { clampAndRoundValue } from './utils/math/math.js';
|
|
15
15
|
export { mergeProps } from './utils/react/mergeProps.js';
|
|
16
16
|
export { composeRefs } from './utils/react/refs.js';
|
|
17
17
|
export { isObjectLike, type AnyString, type HTMLElementProps, type IsNumberUnion, type IsStringUnion, type IsUnion, type OptionalLiteral, type RecordLike, } from './utils/typing/helpers.js';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { makeTheme } from "./theme/makeTheme.js";
|
|
|
7
7
|
import { classnames } from "./utils/classnames/classnames.js";
|
|
8
8
|
import { hasAnimationDuration } from "./utils/dom/hasAnimationDuration.js";
|
|
9
9
|
import { alignItemsMap, justifyContentMap } from "./utils/flexbox/flexbox.js";
|
|
10
|
-
import {
|
|
10
|
+
import { clampAndRoundValue } from "./utils/math/math.js";
|
|
11
11
|
import { mergeProps } from "./utils/react/mergeProps.js";
|
|
12
12
|
import { composeRefs } from "./utils/react/refs.js";
|
|
13
13
|
import { isObjectLike } from "./utils/typing/helpers.js";
|
|
@@ -23,11 +23,11 @@ export {
|
|
|
23
23
|
blocksLayerAtom,
|
|
24
24
|
blocksLayerComponent,
|
|
25
25
|
breakpointNames,
|
|
26
|
+
clampAndRoundValue,
|
|
26
27
|
classnames,
|
|
27
28
|
composeRefs,
|
|
28
29
|
cssValueToNumber,
|
|
29
30
|
getAtomsAndProps,
|
|
30
|
-
getBoundValue,
|
|
31
31
|
getCSSScale,
|
|
32
32
|
getOriginalElementSize,
|
|
33
33
|
hasAnimationDuration,
|
|
@@ -39,6 +39,5 @@ export {
|
|
|
39
39
|
minMediaQuery,
|
|
40
40
|
parseCSSTransform,
|
|
41
41
|
rem,
|
|
42
|
-
roundToPrecision,
|
|
43
42
|
vars
|
|
44
43
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function getBoundValue(newValue: number, min: number, max: number, step: number): number;
|
|
1
|
+
export declare function clampAndRoundValue(newValue: number, min: number, max: number, step: number): number;
|
package/dist/utils/math/math.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
return Math.
|
|
4
|
-
}
|
|
5
|
-
function getBoundValue(newValue, min, max, step) {
|
|
6
|
-
let value = Math.round(newValue / step) * step;
|
|
7
|
-
value = Math.max(min, Math.min(max, value));
|
|
8
|
-
return value;
|
|
1
|
+
function clampAndRoundValue(newValue, min, max, step) {
|
|
2
|
+
const value = Math.round(newValue / step) * step;
|
|
3
|
+
return Math.max(min, Math.min(max, value));
|
|
9
4
|
}
|
|
10
5
|
export {
|
|
11
|
-
|
|
12
|
-
roundToPrecision
|
|
6
|
+
clampAndRoundValue
|
|
13
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|