jettypod 4.4.80 → 4.4.81
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.
|
@@ -117,11 +117,9 @@ export function DragProvider({ children, renderDragOverlay }: DragProviderProps)
|
|
|
117
117
|
}, []);
|
|
118
118
|
|
|
119
119
|
const startDrag = useCallback((item: WorkItem, cardRect: DOMRect, pointerX: number, pointerY: number) => {
|
|
120
|
-
console.log('[DragContext] startDrag called', { item: item.id, cardRect, pointerX, pointerY });
|
|
121
120
|
// Calculate offset from pointer to card's top-left corner
|
|
122
121
|
const offsetX = pointerX - cardRect.left;
|
|
123
122
|
const offsetY = pointerY - cardRect.top;
|
|
124
|
-
console.log('[DragContext] Setting drag state', { offsetX, offsetY, width: cardRect.width });
|
|
125
123
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
126
124
|
setDragPosition({ x: pointerX, y: pointerY });
|
|
127
125
|
setDraggedCardWidth(cardRect.width);
|
|
@@ -171,16 +169,6 @@ export function DragProvider({ children, renderDragOverlay }: DragProviderProps)
|
|
|
171
169
|
const overlayX = dragPosition.x - dragOffset.x;
|
|
172
170
|
const overlayY = dragPosition.y - dragOffset.y;
|
|
173
171
|
|
|
174
|
-
// Debug: log portal render conditions
|
|
175
|
-
console.log('[DragContext] Portal render check', {
|
|
176
|
-
hasDraggedItem: !!draggedItem,
|
|
177
|
-
hasRenderOverlay: !!renderDragOverlay,
|
|
178
|
-
hasDocument: typeof document !== 'undefined',
|
|
179
|
-
overlayX,
|
|
180
|
-
overlayY,
|
|
181
|
-
draggedCardWidth,
|
|
182
|
-
});
|
|
183
|
-
|
|
184
172
|
return (
|
|
185
173
|
<DragContext.Provider
|
|
186
174
|
value={{
|
|
@@ -215,8 +203,6 @@ export function DragProvider({ children, renderDragOverlay }: DragProviderProps)
|
|
|
215
203
|
pointerEvents: 'none',
|
|
216
204
|
transform: 'scale(1.02)',
|
|
217
205
|
boxShadow: '0 10px 30px rgba(0, 0, 0, 0.2)',
|
|
218
|
-
border: '4px solid red',
|
|
219
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
220
206
|
}}
|
|
221
207
|
>
|
|
222
208
|
{renderDragOverlay(draggedItem)}
|
|
@@ -224,27 +210,6 @@ export function DragProvider({ children, renderDragOverlay }: DragProviderProps)
|
|
|
224
210
|
document.body
|
|
225
211
|
)
|
|
226
212
|
}
|
|
227
|
-
{/* TEST: Always-visible portal to verify createPortal works */}
|
|
228
|
-
{typeof document !== 'undefined' &&
|
|
229
|
-
createPortal(
|
|
230
|
-
<div
|
|
231
|
-
style={{
|
|
232
|
-
position: 'fixed',
|
|
233
|
-
bottom: 20,
|
|
234
|
-
right: 20,
|
|
235
|
-
padding: '10px 20px',
|
|
236
|
-
background: 'green',
|
|
237
|
-
color: 'white',
|
|
238
|
-
fontWeight: 'bold',
|
|
239
|
-
zIndex: 9999,
|
|
240
|
-
borderRadius: 8,
|
|
241
|
-
}}
|
|
242
|
-
>
|
|
243
|
-
Portal Works! Dragging: {draggedItem ? `#${draggedItem.id}` : 'none'}
|
|
244
|
-
</div>,
|
|
245
|
-
document.body
|
|
246
|
-
)
|
|
247
|
-
}
|
|
248
213
|
</DragContext.Provider>
|
|
249
214
|
);
|
|
250
215
|
}
|
|
@@ -21,14 +21,10 @@ export function DraggableCard({ item, children, disabled = false }: DraggableCar
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const handleDragStart = (_event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => {
|
|
24
|
-
console.log('[DraggableCard] handleDragStart fired', { itemId: item.id, point: info.point });
|
|
25
24
|
wasDraggingRef.current = true;
|
|
26
25
|
if (cardRef.current) {
|
|
27
26
|
const rect = cardRef.current.getBoundingClientRect();
|
|
28
|
-
console.log('[DraggableCard] Card rect:', rect);
|
|
29
27
|
startDrag(item, rect, info.point.x, info.point.y);
|
|
30
|
-
} else {
|
|
31
|
-
console.warn('[DraggableCard] cardRef.current is null!');
|
|
32
28
|
}
|
|
33
29
|
};
|
|
34
30
|
|