@bouko/react 3.1.9 → 3.2.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/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/layout/_.d.ts +1 -0
- package/dist/components/layout/_.js +1 -0
- package/dist/components/layout/rnd.d.ts +9 -0
- package/dist/components/layout/rnd.js +28 -0
- package/dist/hooks/audio/_.d.ts +2 -0
- package/dist/hooks/audio/_.js +2 -0
- package/dist/hooks/audio/sound.d.ts +1 -1
- package/dist/hooks/audio/sound.js +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/package.json +2 -1
|
@@ -7,6 +7,7 @@ export { default as PageHeading } from "./heading/page";
|
|
|
7
7
|
export * from "./layout/flex";
|
|
8
8
|
export * from "./tab";
|
|
9
9
|
export * from "./route";
|
|
10
|
+
export * from "./layout/_";
|
|
10
11
|
export { default as Pagination } from "./pagination";
|
|
11
12
|
export { default as Section } from "./section";
|
|
12
13
|
export { default as Button } from "./button/normal";
|
package/dist/components/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { default as PageHeading } from "./heading/page";
|
|
|
7
7
|
export * from "./layout/flex";
|
|
8
8
|
export * from "./tab";
|
|
9
9
|
export * from "./route";
|
|
10
|
+
export * from "./layout/_";
|
|
10
11
|
export { default as Pagination } from "./pagination";
|
|
11
12
|
export { default as Section } from "./section";
|
|
12
13
|
export { default as Button } from "./button/normal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Rnd } from "./rnd";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Rnd } from "./rnd";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
style?: string;
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
update: (min: number, size: number) => void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export default function RnD({ style, min, max, update, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Rnd as RndBase } from "react-rnd";
|
|
3
|
+
import { cn } from "@bouko/style";
|
|
4
|
+
export default function RnD({ style, min, max, update, children }) {
|
|
5
|
+
const gapSize = max - min;
|
|
6
|
+
const handleResize = (x, width) => {
|
|
7
|
+
update(x, width);
|
|
8
|
+
};
|
|
9
|
+
const handleDrag = (x) => {
|
|
10
|
+
update(x, gapSize);
|
|
11
|
+
};
|
|
12
|
+
return (_jsx(RndBase, { ...opts(min, max), className: cn("flex! justify-center items-center overflow-hidden", style), size: { width: gapSize, height: "100%" }, position: { x: min, y: 0 }, onResize: (e, dir, ref, d, pos) => handleResize(pos.x, ref.offsetWidth), onDragStop: (e, d) => handleDrag(d.x), children: children }));
|
|
13
|
+
}
|
|
14
|
+
const opts = (min, max) => ({
|
|
15
|
+
bounds: "parent",
|
|
16
|
+
axis: "x",
|
|
17
|
+
minWidth: 30,
|
|
18
|
+
default: {
|
|
19
|
+
x: min,
|
|
20
|
+
y: 0,
|
|
21
|
+
width: max - min,
|
|
22
|
+
height: "100%"
|
|
23
|
+
},
|
|
24
|
+
enableResizing: {
|
|
25
|
+
left: true,
|
|
26
|
+
right: true
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function useSound(filename?: string): import("use-sound/dist/types").PlayFunction | undefined;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,10 +2,8 @@ export { default as useElement } from "./element";
|
|
|
2
2
|
export { default as useContainer } from "./element/container";
|
|
3
3
|
export { default as useResize } from "./element/resize";
|
|
4
4
|
export { default as useInterval } from "./clock/interval";
|
|
5
|
-
export { default as useSound } from "./audio/sound";
|
|
6
5
|
export { withAudio, type DivRef, type AudioRef } from "./element/with-audio";
|
|
7
6
|
export * from "./router/params";
|
|
8
|
-
export * from "./auth";
|
|
9
7
|
export declare function useObjectUrl(): {
|
|
10
8
|
setFromBlob: (blob: Blob) => string;
|
|
11
9
|
revoke: () => void;
|
|
@@ -31,3 +29,5 @@ export declare function useConfig<T>({ fetcher, updater }: ConfigProps<T>): {
|
|
|
31
29
|
config: Record<string, T>;
|
|
32
30
|
update: (id: string, x: T) => Promise<void>;
|
|
33
31
|
};
|
|
32
|
+
export * from "./auth";
|
|
33
|
+
export * from "./audio/_";
|
package/dist/hooks/index.js
CHANGED
|
@@ -3,10 +3,8 @@ export { default as useElement } from "./element";
|
|
|
3
3
|
export { default as useContainer } from "./element/container";
|
|
4
4
|
export { default as useResize } from "./element/resize";
|
|
5
5
|
export { default as useInterval } from "./clock/interval";
|
|
6
|
-
export { default as useSound } from "./audio/sound";
|
|
7
6
|
export { withAudio } from "./element/with-audio";
|
|
8
7
|
export * from "./router/params";
|
|
9
|
-
export * from "./auth";
|
|
10
8
|
export function useObjectUrl() {
|
|
11
9
|
const urlRef = useRef(null);
|
|
12
10
|
const revoke = useCallback(() => {
|
|
@@ -54,3 +52,5 @@ export function useConfig({ fetcher, updater }) {
|
|
|
54
52
|
};
|
|
55
53
|
return { config, update };
|
|
56
54
|
}
|
|
55
|
+
export * from "./auth";
|
|
56
|
+
export * from "./audio/_";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "@bouko/react",
|
|
4
|
-
"version": "3.1
|
|
4
|
+
"version": "3.2.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"framer-motion": "^12.23.6",
|
|
42
42
|
"ms": "^2.1.3",
|
|
43
43
|
"react-dropzone": "^14.3.8",
|
|
44
|
+
"react-rnd": "^10.5.2",
|
|
44
45
|
"tailwind-merge": "^3.3.1",
|
|
45
46
|
"tailwind-variants": "^1.0.0",
|
|
46
47
|
"wavesurfer.js": "^7.10.1",
|