mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 04:39:41 +02:00
Implement a two-layer DnD system in @manacore/shared-ui/dnd that coexists with svelte-dnd-action (same-type reordering): - Layer 1 (Pointer Events): dragSource + dropTarget actions for cross-type drags (e.g. Tag → Task). Mobile-first with long-press (300ms) and haptic feedback. - Layer 2 (Passive Overlay): passiveDropZone action detects when svelte-dnd-action drags hover over external targets (e.g. Task → Tag pill, Task → Trash zone). - DragPreview: floating pill that follows the finger/cursor during Layer 1 drags. - ActionZone: auto-appearing drop zones (trash, archive) during any drag. Integrate into Todo app: - TagStrip pills: draggable (dragSource) + accept tasks (passiveDropZone) - TaskList items: accept tags (dropTarget) + register drags for passive layer - ViewColumn + FokusLayout: register svelte-dnd-action drags for passive layer - Layout: DragPreview + ActionZone (trash) added, tasks enriched with resolved label objects from shared tags so tag badges actually render on TaskItem. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
657 B
TypeScript
32 lines
657 B
TypeScript
// Types
|
|
export type {
|
|
DragType,
|
|
DragPayload,
|
|
TagDragData,
|
|
TaskDragData,
|
|
DragSourceOptions,
|
|
DropTargetOptions,
|
|
PassiveDropZoneOptions,
|
|
ActionZoneProps,
|
|
} from './types';
|
|
|
|
// Actions
|
|
export { dragSource } from './drag-source';
|
|
export { dropTarget } from './drop-target';
|
|
export { passiveDropZone } from './passive-drop';
|
|
|
|
// State
|
|
export {
|
|
dragState,
|
|
startDrag,
|
|
endDrag,
|
|
updatePointer,
|
|
setHoveredTarget,
|
|
registerSvelteActionDrag,
|
|
clearSvelteActionDrag,
|
|
isTypeBeingDragged,
|
|
} from './drag-state.svelte';
|
|
|
|
// Components
|
|
export { default as DragPreview } from './DragPreview.svelte';
|
|
export { default as ActionZone } from './ActionZone.svelte';
|