@rxdrag/website-lib-core 0.0.77 → 0.0.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdrag/website-lib-core",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
@@ -91,7 +91,7 @@ export const MainMedia = ({
91
91
  lastMousePosRef.current.x,
92
92
  lastMousePosRef.current.y
93
93
  );
94
- }, 200);
94
+ }, 1000);
95
95
  },
96
96
  [enableZoom, isVideo, updateZoomPosition]
97
97
  );
@@ -116,6 +116,25 @@ export const MainMedia = ({
116
116
  setPosition({ x: 0, y: 0 });
117
117
  }, []);
118
118
 
119
+ const handleClick = useCallback(
120
+ (e: React.MouseEvent) => {
121
+ if (!enableZoom || isVideo) return;
122
+
123
+ if (hoverTimerRef.current) {
124
+ clearTimeout(hoverTimerRef.current);
125
+ }
126
+
127
+ if (isZoomed) {
128
+ setIsZoomed(false);
129
+ setPosition({ x: 0, y: 0 });
130
+ } else {
131
+ setIsZoomed(true);
132
+ updateZoomPosition(e.clientX, e.clientY);
133
+ }
134
+ },
135
+ [enableZoom, isVideo, isZoomed, updateZoomPosition]
136
+ );
137
+
119
138
  return (
120
139
  <div
121
140
  ref={mainAreaRef}
@@ -128,6 +147,7 @@ export const MainMedia = ({
128
147
  onMouseEnter={handleMouseEnter}
129
148
  onMouseMove={handleMouseMove}
130
149
  onMouseLeave={handleMouseLeave}
150
+ onClick={handleClick}
131
151
  >
132
152
  {/* Navigation Arrows - Hide when zoomed to avoid misclick */}
133
153
  {!isZoomed && (