@bioturing/components 0.37.1 → 0.38.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.
Files changed (33) hide show
  1. package/dist/components/hooks/useResizable.d.ts +50 -0
  2. package/dist/components/hooks/useResizable.d.ts.map +1 -0
  3. package/dist/components/hooks/useResizable.js +148 -0
  4. package/dist/components/hooks/useResizable.js.map +1 -0
  5. package/dist/components/index.d.ts +1 -0
  6. package/dist/components/index.d.ts.map +1 -1
  7. package/dist/components/popup-panel/component.d.ts.map +1 -1
  8. package/dist/components/popup-panel/component.js +119 -112
  9. package/dist/components/popup-panel/component.js.map +1 -1
  10. package/dist/components/popup-panel/utils.d.ts +10 -0
  11. package/dist/components/popup-panel/utils.d.ts.map +1 -0
  12. package/dist/components/popup-panel/utils.js +13 -0
  13. package/dist/components/popup-panel/utils.js.map +1 -0
  14. package/dist/components/resizable/component.d.ts +2 -8
  15. package/dist/components/resizable/component.d.ts.map +1 -1
  16. package/dist/components/resizable/component.js +250 -248
  17. package/dist/components/resizable/component.js.map +1 -1
  18. package/dist/components/window-portal/component.d.ts +24 -0
  19. package/dist/components/window-portal/component.d.ts.map +1 -0
  20. package/dist/components/window-portal/component.js +120 -0
  21. package/dist/components/window-portal/component.js.map +1 -0
  22. package/dist/components/window-portal/index.d.ts +3 -0
  23. package/dist/components/window-portal/index.d.ts.map +1 -0
  24. package/dist/components/window-portal/types.d.ts +77 -0
  25. package/dist/components/window-portal/types.d.ts.map +1 -0
  26. package/dist/index.js +81 -79
  27. package/dist/index.js.map +1 -1
  28. package/dist/metadata.d.ts +8 -0
  29. package/dist/metadata.d.ts.map +1 -1
  30. package/dist/metadata.js +18 -0
  31. package/dist/metadata.js.map +1 -1
  32. package/dist/stats.html +1 -1
  33. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ import { default as React } from 'react';
2
+ type SharedProps = {
3
+ maxHeight?: number;
4
+ maxWidth?: number;
5
+ minHeight?: number;
6
+ minWidth?: number;
7
+ lockHorizontal?: boolean;
8
+ lockVertical?: boolean;
9
+ onResize?: (values: MoveValues) => void;
10
+ onDragEnd?: (values: MoveValues) => void;
11
+ onDragStart?: (values: MoveValues) => void;
12
+ disabled?: boolean;
13
+ maintainAspectRatio?: boolean;
14
+ };
15
+ export interface ResizableProps extends SharedProps {
16
+ interval?: number;
17
+ initialHeight?: number | string;
18
+ initialWidth?: number | string;
19
+ }
20
+ export interface ResizeHandleProps extends SharedProps {
21
+ parent?: React.RefObject<HTMLElement>;
22
+ interval?: number;
23
+ reverse?: boolean;
24
+ corner?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
25
+ }
26
+ export type MoveValues = {
27
+ newHeight: number;
28
+ heightDiff: number;
29
+ newWidth: number;
30
+ widthDiff: number;
31
+ };
32
+ export declare const useResizable: (options: ResizableProps) => {
33
+ rootRef: React.RefObject<HTMLDivElement>;
34
+ getRootProps: () => {
35
+ ref: React.RefObject<HTMLDivElement>;
36
+ style: {
37
+ height: string | number;
38
+ width: string | number;
39
+ };
40
+ };
41
+ getHandleProps: (handleProps?: ResizeHandleProps) => {
42
+ onMouseDown: (e: React.MouseEvent | React.TouchEvent) => void;
43
+ onTouchStart: (e: React.MouseEvent | React.TouchEvent) => void;
44
+ style: {
45
+ cursor: any;
46
+ };
47
+ };
48
+ };
49
+ export {};
50
+ //# sourceMappingURL=useResizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizable.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useResizable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,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B = (X) => {
9
+ const E = {
10
+ ...F,
11
+ ...X
12
+ }, m = C(null);
13
+ return {
14
+ rootRef: m,
15
+ getRootProps: () => {
16
+ const { initialHeight: p, initialWidth: n } = E;
17
+ return {
18
+ ref: m,
19
+ style: {
20
+ height: p,
21
+ width: n
22
+ }
23
+ };
24
+ },
25
+ getHandleProps: (p) => {
26
+ p || (p = {});
27
+ const {
28
+ parent: n = m,
29
+ interval: d = 1,
30
+ maxHeight: W = Number.MAX_SAFE_INTEGER,
31
+ maxWidth: D = Number.MAX_SAFE_INTEGER,
32
+ reverse: R,
33
+ lockHorizontal: w,
34
+ lockVertical: v,
35
+ onResize: y,
36
+ onDragEnd: M,
37
+ onDragStart: x,
38
+ minHeight: z = 0,
39
+ minWidth: A = 0,
40
+ disabled: H = !1,
41
+ maintainAspectRatio: L = !1,
42
+ corner: g
43
+ } = { ...E, ...p }, b = (r, c, s, o, t, l) => {
44
+ if (H) return;
45
+ const u = n?.current?.clientWidth || 0, h = n?.current?.clientHeight || 0;
46
+ let e = h, i = u;
47
+ const Y = g === "top-left" || g === "top-right", _ = g === "top-left" || g === "bottom-left", $ = R || Y ? -1 : 1, P = R || _ ? -1 : 1;
48
+ if (!v) {
49
+ const a = c + (r - s) * $;
50
+ e = Math.round(a / d) * d, e <= 0 && (e = d), e >= W && (e = W), e <= z && (e = z), n?.current && (n.current.style.height = `${e}px`);
51
+ }
52
+ if (!w) {
53
+ const a = t + (o - l) * P;
54
+ i = Math.round(a / d) * d, i <= 0 && (i = d), i >= D && (i = D), i <= A && (i = A), n?.current && (n.current.style.width = `${i}px`);
55
+ }
56
+ if (L) {
57
+ const a = u / h;
58
+ i / e > a ? (i = e * a, n?.current && (n.current.style.width = `${i}px`)) : (e = i / a, n?.current && (n.current.style.height = `${e}px`));
59
+ }
60
+ y && y({
61
+ newHeight: e,
62
+ heightDiff: e - h,
63
+ newWidth: i,
64
+ widthDiff: i - u
65
+ });
66
+ }, k = (r, c, s, o) => (t) => {
67
+ t instanceof MouseEvent && b(
68
+ t.clientY,
69
+ r,
70
+ c,
71
+ t.clientX,
72
+ s,
73
+ o
74
+ );
75
+ }, N = (r, c, s, o) => (t) => {
76
+ t.preventDefault(), t instanceof TouchEvent && b(
77
+ t.touches[0].clientY,
78
+ r,
79
+ c,
80
+ t.touches[0].clientX,
81
+ s,
82
+ o
83
+ );
84
+ }, S = (r, c, s, o, t) => {
85
+ function l() {
86
+ if (document.removeEventListener(c, r), document.removeEventListener(s, l), M) {
87
+ const u = n?.current?.clientWidth || 0, h = n?.current?.clientHeight || 0;
88
+ M({
89
+ newHeight: h,
90
+ heightDiff: h - o,
91
+ newWidth: u,
92
+ widthDiff: u - t
93
+ });
94
+ }
95
+ }
96
+ return l;
97
+ }, T = (r) => {
98
+ if (H) return;
99
+ const c = n?.current?.clientHeight || 0, s = n?.current?.clientWidth || 0;
100
+ let o = null, t = null, l = null;
101
+ if (r.type === "mousedown") {
102
+ const { clientY: h, clientX: e } = r;
103
+ o = k(
104
+ c,
105
+ h,
106
+ s,
107
+ e
108
+ ), t = "mousemove", l = "mouseup";
109
+ } else if (r.type === "touchstart") {
110
+ const { touches: h } = r, { clientY: e, clientX: i } = h[0];
111
+ o = N(
112
+ c,
113
+ e,
114
+ s,
115
+ i
116
+ ), t = "touchmove", l = "touchend";
117
+ }
118
+ if (!o || !t || !l) return;
119
+ x && x({
120
+ newHeight: c,
121
+ heightDiff: 0,
122
+ newWidth: s,
123
+ widthDiff: 0
124
+ });
125
+ const u = S(
126
+ o,
127
+ t,
128
+ l,
129
+ c,
130
+ s
131
+ );
132
+ document.addEventListener(t, o, { passive: !1 }), document.addEventListener(l, u);
133
+ };
134
+ let f;
135
+ return H ? f = "not-allowed" : w && v ? f = "default" : w ? f = "row-resize" : v ? f = "col-resize" : g === "top-left" || g === "bottom-right" ? f = "nwse-resize" : f = "nesw-resize", {
136
+ onMouseDown: T,
137
+ onTouchStart: T,
138
+ style: {
139
+ cursor: f
140
+ }
141
+ };
142
+ }
143
+ };
144
+ };
145
+ export {
146
+ B as useResizable
147
+ };
148
+ //# sourceMappingURL=useResizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizable.js","sources":["../../../src/components/hooks/useResizable.ts"],"sourcesContent":["import React, { useRef } from \"react\";\n\ntype SharedProps = {\n maxHeight?: number;\n maxWidth?: number;\n minHeight?: number;\n minWidth?: number;\n lockHorizontal?: boolean;\n lockVertical?: boolean;\n onResize?: (values: MoveValues) => void;\n onDragEnd?: (values: MoveValues) => void;\n onDragStart?: (values: MoveValues) => void;\n disabled?: boolean;\n maintainAspectRatio?: boolean;\n};\n\nexport interface ResizableProps extends SharedProps {\n interval?: number;\n initialHeight?: number | string;\n initialWidth?: number | string;\n}\n\nexport interface ResizeHandleProps extends SharedProps {\n parent?: React.RefObject<HTMLElement>;\n interval?: number;\n reverse?: boolean;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n}\n\nexport type MoveValues = {\n newHeight: number;\n heightDiff: number;\n newWidth: number;\n widthDiff: number;\n};\n\ntype HandleMouseMove = (\n startHeight: number,\n startY: number,\n startWidth: number,\n startX: number\n) => (e: Event) => void;\n\ntype HandleTouchMove = (\n startHeight: number,\n startY: number,\n startWidth: number,\n startX: number\n) => (e: Event) => void;\n\nenum MoveEvent {\n MouseMove = \"mousemove\",\n TouchMove = \"touchmove\",\n}\n\nenum EndEvent {\n MouseUp = \"mouseup\",\n TouchEnd = \"touchend\",\n}\n\nconst defaultProps: ResizableProps = {\n interval: 1,\n initialHeight: 100,\n initialWidth: 100,\n lockHorizontal: false,\n lockVertical: false,\n};\n\nexport const useResizable = (options: ResizableProps) => {\n const props: ResizableProps = {\n ...defaultProps,\n ...options,\n };\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n const getRootProps = () => {\n const { initialHeight, initialWidth } = props;\n return {\n ref: parentRef,\n style: {\n height: initialHeight,\n width: initialWidth,\n },\n };\n };\n\n const getHandleProps = (handleProps?: ResizeHandleProps) => {\n if (!handleProps) {\n handleProps = {};\n }\n const {\n parent = parentRef,\n interval = 1,\n maxHeight = Number.MAX_SAFE_INTEGER,\n maxWidth = Number.MAX_SAFE_INTEGER,\n reverse,\n lockHorizontal,\n lockVertical,\n onResize,\n onDragEnd,\n onDragStart,\n minHeight = 0,\n minWidth = 0,\n disabled = false,\n maintainAspectRatio = false,\n corner,\n } = { ...props, ...handleProps };\n\n const handleMove = (\n clientY: number,\n startHeight: number,\n startY: number,\n clientX: number,\n startWidth: number,\n startX: number\n ) => {\n if (disabled) return;\n const currentWidth = parent?.current?.clientWidth || 0;\n const currentHeight = parent?.current?.clientHeight || 0;\n let roundedHeight = currentHeight;\n let roundedWidth = currentWidth;\n\n // Determine resize direction based on corner\n const isTopCorner = corner === \"top-left\" || corner === \"top-right\";\n const isLeftCorner = corner === \"top-left\" || corner === \"bottom-left\";\n\n // For top corners, Y direction is reversed\n const yDirection = reverse ? -1 : isTopCorner ? -1 : 1;\n // For left corners, X direction is reversed\n const xDirection = reverse ? -1 : isLeftCorner ? -1 : 1;\n\n if (!lockVertical) {\n const newHeight = startHeight + (clientY - startY) * yDirection;\n // Round height to nearest interval\n roundedHeight = Math.round(newHeight / interval) * interval;\n if (roundedHeight <= 0) {\n roundedHeight = interval;\n }\n if (roundedHeight >= maxHeight) {\n roundedHeight = maxHeight;\n }\n if (roundedHeight <= minHeight) {\n roundedHeight = minHeight;\n }\n\n if (parent?.current) {\n parent.current.style.height = `${roundedHeight}px`;\n }\n }\n\n if (!lockHorizontal) {\n const newWidth = startWidth + (clientX - startX) * xDirection;\n // Round width to nearest interval\n roundedWidth = Math.round(newWidth / interval) * interval;\n if (roundedWidth <= 0) {\n roundedWidth = interval;\n }\n if (roundedWidth >= maxWidth) {\n roundedWidth = maxWidth;\n }\n if (roundedWidth <= minWidth) {\n roundedWidth = minWidth;\n }\n\n if (parent?.current) {\n parent.current.style.width = `${roundedWidth}px`;\n }\n }\n\n if (maintainAspectRatio) {\n const aspectRatio = currentWidth / currentHeight;\n const newAspectRatio = roundedWidth / roundedHeight;\n if (newAspectRatio > aspectRatio) {\n roundedWidth = roundedHeight * aspectRatio;\n if (parent?.current) {\n parent.current.style.width = `${roundedWidth}px`;\n }\n } else {\n roundedHeight = roundedWidth / aspectRatio;\n if (parent?.current) {\n parent.current.style.height = `${roundedHeight}px`;\n }\n }\n }\n if (onResize) {\n onResize({\n newHeight: roundedHeight,\n heightDiff: roundedHeight - currentHeight,\n newWidth: roundedWidth,\n widthDiff: roundedWidth - currentWidth,\n });\n }\n };\n\n const handleMouseMove: HandleMouseMove =\n (startHeight, startY, startWidth, startX) => (e: Event) => {\n if (!(e instanceof MouseEvent)) return;\n handleMove(\n e.clientY,\n startHeight,\n startY,\n e.clientX,\n startWidth,\n startX\n );\n };\n\n const handleTouchMove: HandleTouchMove =\n (startHeight, startY, startWidth, startX) => (e: Event) => {\n e.preventDefault();\n if (!(e instanceof TouchEvent)) return;\n handleMove(\n e.touches[0].clientY,\n startHeight,\n startY,\n e.touches[0].clientX,\n startWidth,\n startX\n );\n };\n\n const handleDragEnd = (\n handleMoveInstance: (e: Event) => void,\n moveEvent: \"mousemove\" | \"touchmove\",\n endEvent: \"mouseup\" | \"touchend\",\n startHeight: number,\n startWidth: number\n ) => {\n function dragHandler() {\n document.removeEventListener(moveEvent, handleMoveInstance);\n document.removeEventListener(endEvent, dragHandler);\n if (onDragEnd) {\n const currentWidth = parent?.current?.clientWidth || 0;\n const currentHeight = parent?.current?.clientHeight || 0;\n onDragEnd({\n newHeight: currentHeight,\n heightDiff: currentHeight - startHeight,\n newWidth: currentWidth,\n widthDiff: currentWidth - startWidth,\n });\n }\n }\n\n return dragHandler;\n };\n\n const handleDown = (e: React.MouseEvent | React.TouchEvent) => {\n if (disabled) return;\n\n const startHeight = parent?.current?.clientHeight || 0;\n const startWidth = parent?.current?.clientWidth || 0;\n\n let moveHandler = null;\n let moveEvent = null;\n let endEvent = null;\n if (e.type === \"mousedown\") {\n const { clientY, clientX } = e as React.MouseEvent;\n moveHandler = handleMouseMove(\n startHeight,\n clientY,\n startWidth,\n clientX\n );\n moveEvent = MoveEvent.MouseMove;\n endEvent = EndEvent.MouseUp;\n } else if (e.type === \"touchstart\") {\n const { touches } = e as React.TouchEvent;\n const { clientY, clientX } = touches[0];\n moveHandler = handleTouchMove(\n startHeight,\n clientY,\n startWidth,\n clientX\n );\n moveEvent = MoveEvent.TouchMove;\n endEvent = EndEvent.TouchEnd;\n }\n\n if (!moveHandler || !moveEvent || !endEvent) return;\n\n if (onDragStart) {\n onDragStart({\n newHeight: startHeight,\n heightDiff: 0,\n newWidth: startWidth,\n widthDiff: 0,\n });\n }\n\n const dragEndHandler = handleDragEnd(\n moveHandler,\n moveEvent,\n endEvent,\n startHeight,\n startWidth\n );\n\n // Attach the mousemove/mouseup/touchmove/touchend listeners to the document\n // so that we can handle the case where the user drags outside of the element\n document.addEventListener(moveEvent, moveHandler, { passive: false });\n document.addEventListener(endEvent, dragEndHandler);\n };\n\n let cursor;\n if (disabled) {\n cursor = \"not-allowed\";\n } else if (lockHorizontal && lockVertical) {\n cursor = \"default\";\n } else if (lockHorizontal) {\n cursor = \"row-resize\";\n } else if (lockVertical) {\n cursor = \"col-resize\";\n } else {\n // Determine cursor based on corner position\n // top-left (NW) and bottom-right (SE): nwse-resize (↖↘)\n // top-right (NE) and bottom-left (SW): nesw-resize (↗↙)\n if (corner === \"top-left\" || corner === \"bottom-right\") {\n cursor = \"nwse-resize\";\n } else {\n cursor = \"nesw-resize\";\n }\n }\n\n const style = {\n cursor,\n };\n\n return {\n onMouseDown: handleDown,\n onTouchStart: handleDown,\n style,\n };\n };\n\n return {\n rootRef: parentRef,\n getRootProps,\n getHandleProps,\n };\n};\n"],"names":["defaultProps","useResizable","options","props","parentRef","useRef","initialHeight","initialWidth","handleProps","parent","interval","maxHeight","maxWidth","reverse","lockHorizontal","lockVertical","onResize","onDragEnd","onDragStart","minHeight","minWidth","disabled","maintainAspectRatio","corner","handleMove","clientY","startHeight","startY","clientX","startWidth","startX","currentWidth","currentHeight","roundedHeight","roundedWidth","isTopCorner","isLeftCorner","yDirection","xDirection","newHeight","newWidth","aspectRatio","handleMouseMove","e","handleTouchMove","handleDragEnd","handleMoveInstance","moveEvent","endEvent","dragHandler","handleDown","moveHandler","touches","dragEndHandler","cursor"],"mappings":";AA4DA,MAAMA,IAA+B;AAAA,EACnC,UAAU;AAAA,EACV,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAChB,GAEaC,IAAe,CAACC,MAA4B;AACvD,QAAMC,IAAwB;AAAA,IAC5B,GAAGH;AAAA,IACH,GAAGE;AAAA,EAAA,GAGCE,IAAYC,EAAuB,IAAI;AAqQ7C,SAAO;AAAA,IACL,SAASD;AAAA,IACT,cArQmB,MAAM;AACzB,YAAM,EAAE,eAAAE,GAAe,cAAAC,EAAA,IAAiBJ;AACxC,aAAO;AAAA,QACL,KAAKC;AAAA,QACL,OAAO;AAAA,UACL,QAAQE;AAAA,UACR,OAAOC;AAAA,QAAA;AAAA,MACT;AAAA,IAEJ;AAAA,IA6PE,gBA3PqB,CAACC,MAAoC;AAC1D,MAAKA,MACHA,IAAc,CAAA;AAEhB,YAAM;AAAA,QACJ,QAAAC,IAASL;AAAA,QACT,UAAAM,IAAW;AAAA,QACX,WAAAC,IAAY,OAAO;AAAA,QACnB,UAAAC,IAAW,OAAO;AAAA,QAClB,SAAAC;AAAA,QACA,gBAAAC;AAAA,QACA,cAAAC;AAAA,QACA,UAAAC;AAAA,QACA,WAAAC;AAAA,QACA,aAAAC;AAAA,QACA,WAAAC,IAAY;AAAA,QACZ,UAAAC,IAAW;AAAA,QACX,UAAAC,IAAW;AAAA,QACX,qBAAAC,IAAsB;AAAA,QACtB,QAAAC;AAAA,MAAA,IACE,EAAE,GAAGpB,GAAO,GAAGK,EAAA,GAEbgB,IAAa,CACjBC,GACAC,GACAC,GACAC,GACAC,GACAC,MACG;AACH,YAAIT,EAAU;AACd,cAAMU,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AAA,YACAI;AAAA,YACAD;AAAA,UAAA,GAEFmB,IAAY,aACZC,IAAW;AAAA,QACb,WAAWL,EAAE,SAAS,cAAc;AAClC,gBAAM,EAAE,SAAAS,MAAYT,GACd,EAAE,SAAAlB,GAAS,SAAAG,MAAYwB,EAAQ,CAAC;AACtC,UAAAD,IAAcP;AAAA,YACZlB;AAAA,YACAD;AAAA,YACAI;AAAA,YACAD;AAAA,UAAA,GAEFmB,IAAY,aACZC,IAAW;AAAA,QACb;AAEA,YAAI,CAACG,KAAe,CAACJ,KAAa,CAACC,EAAU;AAE7C,QAAI9B,KACFA,EAAY;AAAA,UACV,WAAWQ;AAAA,UACX,YAAY;AAAA,UACZ,UAAUG;AAAA,UACV,WAAW;AAAA,QAAA,CACZ;AAGH,cAAMwB,IAAiBR;AAAA,UACrBM;AAAA,UACAJ;AAAA,UACAC;AAAA,UACAtB;AAAA,UACAG;AAAA,QAAA;AAKF,iBAAS,iBAAiBkB,GAAWI,GAAa,EAAE,SAAS,IAAO,GACpE,SAAS,iBAAiBH,GAAUK,CAAc;AAAA,MACpD;AAEA,UAAIC;AACJ,aAAIjC,IACFiC,IAAS,gBACAxC,KAAkBC,IAC3BuC,IAAS,YACAxC,IACTwC,IAAS,eACAvC,IACTuC,IAAS,eAKL/B,MAAW,cAAcA,MAAW,iBACtC+B,IAAS,gBAETA,IAAS,eAQN;AAAA,QACL,aAAaJ;AAAA,QACb,cAAcA;AAAA,QACd,OAPY;AAAA,UACZ,QAAAI;AAAA,QAAA;AAAA,MAMA;AAAA,IAEJ;AAAA,EAKE;AAEJ;"}
@@ -50,6 +50,7 @@ export * from './resizable/index';
50
50
  export * from './combobox/index';
51
51
  export * from './select-trigger/index';
52
52
  export * from './loader/index';
53
+ export * from './window-portal/index';
53
54
  export * from './utils/index';
54
55
  export * from './hooks/index';
55
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names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O,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACpE;AAED,eAAO,MAAM,UAAU,GAAI,mUAyBxB,eAAe,4CA+MjB,CAAC"}
@@ -1,182 +1,189 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
- import { Popover as i } from "@base-ui-components/react/popover";
4
- import { useMemo as Y, useRef as N, useState as Z, useEffect as _, useCallback as B } from "react";
5
- import { X as D } from "@bioturing/assets";
6
- import { PopupPanelSize as ee } from "./constants.js";
7
- import { Stack as re } from "../stack/index.js";
2
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
+ import { Popover as a } from "@base-ui-components/react/popover";
4
+ import { X as Y } from "@bioturing/assets";
5
+ import { useMemo as Z, useRef as S, useState as A, useEffect as _, useCallback as B } from "react";
6
+ import { Stack as ee } from "../stack/index.js";
7
+ import { PopupPanelSize as re } from "./constants.js";
8
8
  import './style.css';/* empty css */
9
- import { parseAntdPlacement as te, buildAntdPlacement as ne } from "../utils/placement.js";
10
- import { useDraggable as oe } from "../hooks/useDraggable.js";
11
- import { Resizable as ie } from "../resizable/component.js";
9
+ import { anchorToResizeHandles as te } from "./utils.js";
10
+ import { parseAntdPlacement as ne, buildAntdPlacement as oe } from "../utils/placement.js";
11
+ import { useDraggable as ie } from "../hooks/useDraggable.js";
12
+ import { Resizable as ae } from "../resizable/component.js";
12
13
  import { useControlledState as pe } from "../hooks/useControlledState.js";
13
- import { useCls as ae } from "../utils/antdUtils.js";
14
+ import { useCls as le } from "../utils/antdUtils.js";
14
15
  import { useTheme as se } from "../theme-provider/context/themeStore.js";
15
16
  import { clsx as p } from "../utils/cn.js";
16
- import { IconButton as le } from "../icon-button/component.js";
17
- const Re = ({
17
+ import { IconButton as ce } from "../icon-button/component.js";
18
+ const Ae = ({
18
19
  children: x,
19
20
  placement: z,
20
- openOnHover: k = !1,
21
- open: H,
22
- onOpenChange: I,
23
- content: K,
24
- title: d,
25
- trigger: j = "click",
26
- className: E,
27
- anchor: M,
28
- beforeCloseButton: w,
29
- afterCloseButton: y,
30
- afterTitle: f,
31
- size: m = "medium",
32
- footer: c,
33
- defaultOpen: T = !1,
34
- resizable: C = !1,
35
- draggable: F = !1,
36
- maintainAspectRatio: U = !1,
37
- classNames: t,
38
- modal: V = !1,
39
- closeOnClickOutside: X = !0,
40
- onPlacementChange: g,
41
- ...$
21
+ openOnHover: H = !1,
22
+ open: k,
23
+ onOpenChange: E,
24
+ content: I,
25
+ title: h,
26
+ trigger: K = "click",
27
+ className: T,
28
+ anchor: j,
29
+ beforeCloseButton: N,
30
+ afterCloseButton: w,
31
+ afterTitle: b,
32
+ size: P = "medium",
33
+ footer: u,
34
+ defaultOpen: M = !1,
35
+ resizable: y = !1,
36
+ draggable: D = !1,
37
+ maintainAspectRatio: F = !1,
38
+ classNames: n,
39
+ modal: U = !1,
40
+ closeOnClickOutside: V = !0,
41
+ onPlacementChange: v,
42
+ ...X
42
43
  }) => {
43
- const [h, O] = pe(
44
- H,
45
- I,
46
- T
44
+ const [R, C] = pe(
45
+ k,
46
+ E,
47
+ M
47
48
  // Always provide a default value to prevent undefined
48
- ), r = ae(), { className: q } = se(), u = te(z), R = Y(() => /* @__PURE__ */ e(D, { size: 16 }), []), A = N(null), b = N(u.side), P = N(u.align), [G, J] = Z(0);
49
+ ), r = le(), { className: $ } = se(), d = ne(z), O = Z(() => /* @__PURE__ */ e(Y, { size: 16 }), []), f = S(d.side), m = S(d.align), [q, G] = A(0), [s, J] = A(
50
+ null
51
+ );
49
52
  _(() => {
50
- const a = A.current;
51
- if (!a || !h) return;
52
- const s = new MutationObserver((W) => {
53
- let v = !1;
54
- if (W.forEach((o) => {
55
- if (o.type === "attributes" && o.attributeName === "data-side") {
56
- const n = a.getAttribute(o.attributeName);
57
- n && n !== b.current && (b.current = n, v = !0);
53
+ if (!s || !R) return;
54
+ const i = new MutationObserver((l) => {
55
+ let g = !1;
56
+ if (l.forEach((t) => {
57
+ if (t.type === "attributes" && t.attributeName === "data-side") {
58
+ const o = s.getAttribute(t.attributeName);
59
+ o && o !== f.current && (f.current = o, g = !0);
58
60
  }
59
- if (o.type === "attributes" && o.attributeName === "data-align") {
60
- const n = a.getAttribute(o.attributeName);
61
- n && n !== P.current && (P.current = n, v = !0);
61
+ if (t.type === "attributes" && t.attributeName === "data-align") {
62
+ const o = s.getAttribute(t.attributeName);
63
+ o && o !== m.current && (m.current = o, g = !0);
62
64
  }
63
- }), v) {
64
- const o = ne({
65
- side: b.current,
66
- align: P.current
65
+ }), g) {
66
+ const t = oe({
67
+ side: f.current,
68
+ align: m.current
67
69
  });
68
- J((n) => n + 1), g && g(o);
70
+ G((o) => o + 1), v && v(t);
69
71
  }
70
72
  });
71
- return s.observe(a, {
73
+ return i.observe(s, {
72
74
  attributes: !0,
73
75
  attributeFilter: ["data-side", "data-align"],
74
76
  attributeOldValue: !0
75
77
  }), () => {
76
- s.disconnect();
78
+ i.disconnect();
77
79
  };
78
- }, [g, h]);
79
- const L = B(() => /* @__PURE__ */ l("div", { className: p(r("popup-panel-header"), t?.header), children: [
80
- /* @__PURE__ */ l(
81
- re,
80
+ }, [v, R, s]);
81
+ const L = B(() => /* @__PURE__ */ c("div", { className: p(r("popup-panel-header"), n?.header), children: [
82
+ /* @__PURE__ */ c(
83
+ ee,
82
84
  {
83
85
  align: "center",
84
86
  gap: 8,
85
87
  className: r("popup-panel-title-wrapper"),
86
88
  children: [
87
89
  /* @__PURE__ */ e(
88
- i.Title,
90
+ a.Title,
89
91
  {
90
- render: /* @__PURE__ */ e("div", { className: p(r("grow", "truncate"), t?.title), children: d })
92
+ render: /* @__PURE__ */ e("div", { className: p(r("grow", "truncate"), n?.title), children: h })
91
93
  }
92
94
  ),
93
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
94
- w,
95
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
96
+ N,
95
97
  /* @__PURE__ */ e(
96
- i.Close,
98
+ a.Close,
97
99
  {
98
- render: /* @__PURE__ */ e(le, { children: R })
100
+ render: /* @__PURE__ */ e(ce, { children: O })
99
101
  }
100
102
  ),
101
- y
103
+ w
102
104
  ] })
103
105
  ]
104
106
  }
105
107
  ),
106
- f || null
108
+ b || null
107
109
  ] }), [
108
- y,
109
- f,
110
110
  w,
111
+ b,
112
+ N,
111
113
  r,
112
- t?.header,
113
- t?.title,
114
- R,
115
- d
116
- ]), { ref: Q } = oe(F), S = /* @__PURE__ */ l(
117
- i.Popup,
114
+ n?.header,
115
+ n?.title,
116
+ O,
117
+ h
118
+ ]), { ref: Q } = ie(D), W = /* @__PURE__ */ c(
119
+ a.Popup,
118
120
  {
119
121
  className: p(
120
122
  r("popup-panel"),
121
- r(`popup-panel-size-${m}`),
122
- E,
123
- t?.popup
123
+ r(`popup-panel-size-${P}`),
124
+ T,
125
+ n?.popup
124
126
  ),
125
127
  ref: Q,
126
128
  children: [
127
- d && L(),
128
- /* @__PURE__ */ e("div", { className: p(r("popup-panel-content"), t?.content), children: /* @__PURE__ */ e("div", { className: r("popup-panel-content-inner"), children: K }) }),
129
- c && /* @__PURE__ */ e("div", { className: p(r("popup-panel-footer"), t?.footer), children: typeof c == "function" ? c({ close: () => O(!1) }) : c })
129
+ h && L(),
130
+ /* @__PURE__ */ e("div", { className: p(r("popup-panel-content"), n?.content), children: /* @__PURE__ */ e("div", { className: r("popup-panel-content-inner"), children: I }) }),
131
+ u && /* @__PURE__ */ e("div", { className: p(r("popup-panel-footer"), n?.footer), children: typeof u == "function" ? u({ close: () => C(!1) }) : u })
130
132
  ]
131
133
  }
132
134
  );
133
- return /* @__PURE__ */ l(
134
- i.Root,
135
+ return /* @__PURE__ */ c(
136
+ a.Root,
135
137
  {
136
- openOnHover: j === "hover" ? !0 : k,
137
- open: h,
138
- onOpenChange: (a, s) => {
139
- (s.reason === "outside-press" || s.reason === "focus-out") && !X || O(a, s);
138
+ openOnHover: K === "hover" ? !0 : H,
139
+ open: R,
140
+ onOpenChange: (i, l) => {
141
+ (l.reason === "outside-press" || l.reason === "focus-out") && !V || C(i, l);
140
142
  },
141
- modal: V,
142
- ...$,
143
+ modal: U,
144
+ ...X,
143
145
  children: [
144
146
  /* @__PURE__ */ e(
145
- i.Trigger,
147
+ a.Trigger,
146
148
  {
147
149
  render: x,
148
- className: p(r("popup-panel-trigger"), t?.trigger)
150
+ className: p(r("popup-panel-trigger"), n?.trigger)
149
151
  }
150
152
  ),
151
- /* @__PURE__ */ e(i.Portal, { children: /* @__PURE__ */ e(
152
- i.Positioner,
153
+ /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ e(
154
+ a.Positioner,
153
155
  {
154
- ref: A,
156
+ ref: J,
155
157
  className: p(
156
158
  r("popup-panel-root"),
157
- q,
158
- t?.root
159
+ $,
160
+ n?.root
159
161
  ),
160
- side: u.side,
161
- align: u.align,
162
+ side: d.side,
163
+ align: d.align,
162
164
  sideOffset: 4,
163
- anchor: M,
165
+ anchor: j,
164
166
  style: {
165
- "--size-width": m ? ee[m] : void 0
167
+ "--size-width": P ? re[P] : void 0
166
168
  },
167
- children: C ? /* @__PURE__ */ e(
168
- ie,
169
+ render: ({ children: i, onDragEnd: l, onDragStart: g, ...t }) => y ? /* @__PURE__ */ e(
170
+ ae,
169
171
  {
170
- resizable: C,
171
- absolutePositioning: !0,
172
- resetKey: G,
173
- maintainAspectRatio: U,
172
+ resizable: y,
173
+ resetKey: q,
174
+ maintainAspectRatio: F,
174
175
  classNames: {
175
- resizeHandle: t?.resizeHandle
176
+ resizeHandle: n?.resizeHandle
176
177
  },
177
- children: S
178
+ handles: te(
179
+ f.current,
180
+ m.current
181
+ ),
182
+ ...t,
183
+ children: i
178
184
  }
179
- ) : S
185
+ ) : /* @__PURE__ */ e("div", { ...t, children: i }),
186
+ children: W
180
187
  }
181
188
  ) })
182
189
  ]
@@ -184,6 +191,6 @@ const Re = ({
184
191
  );
185
192
  };
186
193
  export {
187
- Re as PopupPanel
194
+ Ae as PopupPanel
188
195
  };
189
196
  //# sourceMappingURL=component.js.map