@pyreon/dnd 0.34.0 → 0.36.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.
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["__pkgName","__pkgVersion"],"sources":["../package.json","../src/use-drag-monitor.ts","../src/use-draggable.ts","../src/use-droppable.ts","../src/use-file-drop.ts","../src/use-sortable.ts","../src/index.ts"],"sourcesContent":["","import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData } from './types'\n\nexport interface UseDragMonitorOptions {\n /** Called on any drag start in the page. */\n onDragStart?: (data: DragData) => void\n /** Called on any drop in the page. */\n onDrop?: (sourceData: DragData, targetData: DragData) => void\n /** Filter which drags to monitor. */\n canMonitor?: (data: DragData) => boolean\n}\n\nexport interface UseDragMonitorResult {\n /** Whether any element is currently being dragged. */\n isDragging: () => boolean\n /** Data of the currently dragging element (null if not dragging). */\n dragData: () => DragData | null\n}\n\n/**\n * Monitor all drag operations on the page.\n * Useful for global drag indicators, analytics, or coordination between\n * multiple drag-and-drop areas.\n *\n * @example\n * ```tsx\n * const { isDragging, dragData } = useDragMonitor({\n * canMonitor: (data) => data.type === \"card\",\n * onDrop: (source, target) => logDrop(source, target),\n * })\n *\n * <Show when={isDragging()}>\n * <div class=\"global-drag-overlay\">\n * Dragging: {() => dragData()?.name}\n * </div>\n * </Show>\n * ```\n */\nexport function useDragMonitor(options?: UseDragMonitorOptions): UseDragMonitorResult {\n if (isServer) return { isDragging: () => false, dragData: () => null }\n\n const isDragging = signal(false)\n const dragData = signal<DragData | null>(null)\n\n /* v8 ignore next 4 — opt-in canMonitor predicate; both arms structurally exercised but counted as one */\n const canMonitorFn = options?.canMonitor\n ? ({ source }: { source: { data: Record<string, unknown> } }) =>\n options.canMonitor?.(source.data as DragData) ?? true\n : null\n\n const cleanup = monitorForElements({\n ...(canMonitorFn ? { canMonitor: canMonitorFn } : {}),\n onDragStart: ({ source }) => {\n // batch() so subscribers to isDragging + dragData get notified once,\n // not twice. Drag events fire frequently; doubling subscriber work\n // per event compounds visibly on UIs with many drag-monitor consumers.\n batch(() => {\n isDragging.set(true)\n dragData.set(source.data as DragData)\n })\n options?.onDragStart?.(source.data as DragData)\n },\n onDrop: ({ source, location }) => {\n batch(() => {\n isDragging.set(false)\n dragData.set(null)\n })\n const targetData = location.current.dropTargets[0]?.data ?? {}\n options?.onDrop?.(source.data as DragData, targetData as DragData)\n },\n })\n\n onCleanup(cleanup)\n\n return { isDragging, dragData }\n}\n","import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData, UseDraggableOptions, UseDraggableResult } from './types'\n\n/**\n * Make an element draggable with signal-driven state.\n *\n * @example\n * ```tsx\n * let cardEl: HTMLElement | null = null\n *\n * const { isDragging } = useDraggable({\n * element: () => cardEl,\n * data: { id: card.id, type: \"card\" },\n * })\n *\n * <div ref={(el) => cardEl = el} class={isDragging() ? \"opacity-50\" : \"\"}>\n * {card.title}\n * </div>\n * ```\n */\nexport function useDraggable<T extends DragData = DragData>(\n options: UseDraggableOptions<T>,\n): UseDraggableResult {\n if (isServer) return { isDragging: () => false }\n\n const isDragging = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function setup() {\n // The hook may have unmounted before this deferred (queueMicrotask) setup\n // ran. onCleanup fired with `cleanup` still undefined (a no-op), so a\n // registration created here would never be torn down — bail instead.\n /* v8 ignore next — defensive disposed-during-setup guard; tested implicitly via lifecycle */\n if (disposed) return\n // Defensive re-setup teardown: `setup` is scheduled exactly once\n // (`queueMicrotask(setup)`) and never re-invoked, so `cleanup` is always\n // undefined here — this branch never fires in the current single-shot\n // design. Kept so a future re-setup trigger (element-change re-registration)\n // can't leak a double registration.\n /* v8 ignore next — defensive re-setup teardown; unreachable with single-shot queueMicrotask */\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n const resolveData = () =>\n typeof options.data === 'function' ? (options.data as () => T)() : options.data\n\n const handle = options.handle?.()\n cleanup = draggable({\n element: el,\n ...(handle ? { dragHandle: handle } : {}),\n getInitialData: resolveData,\n canDrag: () => {\n const disabled = options.disabled\n if (typeof disabled === 'function') return !disabled()\n return !disabled\n },\n onDragStart: () => {\n isDragging.set(true)\n options.onDragStart?.()\n },\n onDrop: () => {\n isDragging.set(false)\n options.onDragEnd?.()\n },\n })\n }\n\n // Defer setup to next microtask so refs are populated\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isDragging }\n}\n","import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData, UseDroppableOptions, UseDroppableResult } from './types'\n\n/**\n * Make an element a drop target with signal-driven state.\n *\n * @example\n * ```tsx\n * let zoneEl: HTMLElement | null = null\n *\n * const { isOver } = useDroppable({\n * element: () => zoneEl,\n * onDrop: (data) => handleDrop(data),\n * canDrop: (data) => data.type === \"card\",\n * })\n *\n * <div ref={(el) => zoneEl = el} class={isOver() ? \"bg-blue-50\" : \"\"}>\n * Drop here\n * </div>\n * ```\n */\nexport function useDroppable<T extends DragData = DragData>(\n options: UseDroppableOptions<T>,\n): UseDroppableResult {\n if (isServer) return { isOver: () => false }\n\n const isOver = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function setup() {\n // Unmounted before this deferred setup ran — don't register a target that\n // onCleanup (already fired with `cleanup` undefined) can never tear down.\n /* v8 ignore next — defensive disposed-during-setup guard */\n if (disposed) return\n // Defensive re-setup teardown: `setup` runs exactly once\n // (`queueMicrotask(setup)`, never re-invoked), so `cleanup` is always\n // undefined here — this branch never fires in the current single-shot\n // design. Kept so a future re-setup trigger can't leak a double target.\n /* v8 ignore next — defensive re-setup teardown; unreachable with single-shot queueMicrotask */\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n cleanup = dropTargetForElements({\n element: el,\n getData: () => {\n if (!options.data) return {}\n return typeof options.data === 'function' ? (options.data as () => T)() : options.data\n },\n canDrop: ({ source }) => {\n if (!options.canDrop) return true\n return options.canDrop(source.data as DragData)\n },\n onDragEnter: ({ source }) => {\n isOver.set(true)\n options.onDragEnter?.(source.data as DragData)\n },\n onDragLeave: () => {\n isOver.set(false)\n options.onDragLeave?.()\n },\n onDrop: ({ source }) => {\n isOver.set(false)\n options.onDrop?.(source.data as DragData)\n },\n })\n }\n\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isOver }\n}\n","import {\n dropTargetForExternal,\n monitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter'\nimport { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\n\nexport interface UseFileDropOptions {\n /** Element getter for the drop zone. */\n element: () => HTMLElement | null\n /** Called when files are dropped. */\n onDrop: (files: File[]) => void\n /** Filter accepted file types (e.g. [\"image/*\", \".pdf\"]). */\n accept?: string[]\n /** Maximum number of files. */\n maxFiles?: number\n /** Whether drop is disabled. */\n disabled?: boolean | (() => boolean)\n}\n\nexport interface UseFileDropResult {\n /** Whether files are being dragged over the drop zone. */\n isOver: () => boolean\n /** Whether files are being dragged anywhere on the page. */\n isDraggingFiles: () => boolean\n}\n\n/**\n * File drop zone with signal-driven state.\n * Uses the native file drag events via pragmatic-drag-and-drop.\n *\n * @example\n * ```tsx\n * let dropZone: HTMLElement | null = null\n *\n * const { isOver, isDraggingFiles } = useFileDrop({\n * element: () => dropZone,\n * accept: [\"image/*\", \".pdf\"],\n * maxFiles: 5,\n * onDrop: (files) => upload(files),\n * })\n *\n * <div\n * ref={(el) => dropZone = el}\n * class={isOver() ? \"drop-active\" : isDraggingFiles() ? \"drop-ready\" : \"\"}\n * >\n * Drop files here\n * </div>\n * ```\n */\nexport function useFileDrop(options: UseFileDropOptions): UseFileDropResult {\n if (isServer) return { isOver: () => false, isDraggingFiles: () => false }\n\n const isOver = signal(false)\n const isDraggingFiles = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function matchesAccept(file: File, accept: string[]): boolean {\n return accept.some((pattern) => {\n if (pattern.startsWith('.')) {\n return file.name.toLowerCase().endsWith(pattern.toLowerCase())\n }\n if (pattern.endsWith('/*')) {\n return file.type.startsWith(pattern.slice(0, -1))\n }\n return file.type === pattern\n })\n }\n\n function setup() {\n // Unmounted before this deferred setup ran — don't register a drop target\n // that onCleanup (already fired with `cleanup` undefined) can never remove.\n /* v8 ignore next — defensive disposed-during-setup guard */\n if (disposed) return\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n const cleanups: (() => void)[] = []\n\n // Monitor for file drags anywhere on the page\n cleanups.push(\n monitorForExternal({\n canMonitor: ({ source }) => containsFiles({ source }),\n onDragStart: () => isDraggingFiles.set(true),\n onDrop: () => isDraggingFiles.set(false),\n }),\n )\n\n // Drop target on the specific element\n cleanups.push(\n dropTargetForExternal({\n element: el,\n canDrop: ({ source }) => {\n const disabled = options.disabled\n if (typeof disabled === 'function' ? disabled() : disabled) return false\n return containsFiles({ source })\n },\n onDragEnter: () => isOver.set(true),\n onDragLeave: () => isOver.set(false),\n onDrop: ({ source }) => {\n // batch() so onDrop subscribers don't get notified twice\n // (isOver + isDraggingFiles) per file-drop event.\n batch(() => {\n isOver.set(false)\n isDraggingFiles.set(false)\n })\n\n let files = getFiles({ source })\n\n // Filter by accept\n if (options.accept && options.accept.length > 0) {\n files = files.filter((f) => matchesAccept(f, options.accept as string[]))\n }\n\n // Limit count\n if (options.maxFiles && files.length > options.maxFiles) {\n files = files.slice(0, options.maxFiles)\n }\n\n if (files.length > 0) {\n options.onDrop(files)\n }\n },\n }),\n )\n\n cleanup = () => {\n for (const fn of cleanups) fn()\n }\n }\n\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isOver, isDraggingFiles }\n}\n","import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine'\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element'\nimport {\n attachClosestEdge,\n type Edge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DropEdge, UseSortableOptions, UseSortableResult } from './types'\n\nconst SORT_KEY = '__pyreon_sortable_key'\nconst SORT_ID = '__pyreon_sortable_id'\nconst SORT_GROUP = '__pyreon_sortable_group'\nconst SORT_PAYLOAD = '__pyreon_sortable_payload'\n\nlet _sortableCounter = 0\n\n// Module-level registry of live sortable instances — used to dispatch\n// cross-list drop notifications from the destination back to the source\n// (W18). Keyed by sortableId.\nconst _sortableRegistry = new Map<\n string,\n {\n groupId: string | undefined\n onCrossListDrop: ((item: unknown) => void) | undefined\n }\n>()\n\n/**\n * Sortable list with signal-driven state, auto-scroll, and edge detection.\n *\n * Features:\n * - Keyed drag items matching `<For by={...}>` pattern\n * - Auto-scroll when dragging near container edges\n * - Closest-edge detection (drop above/below or left/right)\n * - Axis constraint (vertical/horizontal)\n * - Keyboard reordering (Alt+Arrow keys)\n * - Optional cross-list `groupId` for Trello/Notion/Linear board layouts\n * (W18) — share the same `groupId` between two\n * sortable instances and items can be dragged between them. The\n * source's `onCrossListDrop(item)` removes; the destination's\n * `onCrossListReceive(item, index)` inserts.\n *\n * @example\n * ```tsx\n * const items = signal([\n * { id: \"1\", name: \"Alice\" },\n * { id: \"2\", name: \"Bob\" },\n * { id: \"3\", name: \"Charlie\" },\n * ])\n *\n * const { containerRef, itemRef, activeId, overId, overEdge } = useSortable({\n * items,\n * by: (item) => item.id,\n * onReorder: (newItems) => items.set(newItems),\n * })\n *\n * <ul ref={containerRef}>\n * <For each={items()} by={item => item.id}>\n * {(item) => (\n * <li\n * ref={itemRef(item.id)}\n * class={activeId() === item.id ? \"dragging\" : \"\"}\n * style={overId() === item.id ? `border-${overEdge()}: 2px solid blue` : \"\"}\n * >\n * {item.name}\n * </li>\n * )}\n * </For>\n * </ul>\n * ```\n */\nexport function useSortable<T>(options: UseSortableOptions<T>): UseSortableResult {\n if (isServer) {\n const noop = (_el: HTMLElement | null) => {}\n return {\n containerRef: noop,\n itemRef: () => noop,\n activeId: () => null,\n overId: () => null,\n overEdge: () => null,\n }\n }\n\n const sortableId = `sortable-${++_sortableCounter}`\n const activeId = signal<string | number | null>(null)\n const overId = signal<string | number | null>(null)\n const overEdge = signal<DropEdge | null>(null)\n const axis = options.axis ?? 'vertical'\n const groupId = options.groupId\n\n // Register so siblings in the same group can call our onCrossListDrop\n // when they receive one of our items.\n _sortableRegistry.set(sortableId, {\n groupId,\n onCrossListDrop: options.onCrossListDrop as ((item: unknown) => void) | undefined,\n })\n\n // Shared (container-level) pdnd cleanups — drained once on unmount.\n const cleanups: (() => void)[] = []\n // Per-item pdnd cleanups, keyed by sort key. Disposed individually on\n // item unmount / re-register so a churning list doesn't accumulate\n // dead registrations for the sortable's whole lifetime.\n const itemCleanups = new Map<string | number, () => void>()\n\n /** Perform the reorder based on current active/over/edge state. */\n function performReorder() {\n const dragId = activeId.peek()\n const dropId = overId.peek()\n const edge = overEdge.peek()\n /* v8 ignore next — defensive null/equal id guards */\n if (dragId == null || dropId == null || dragId === dropId) return\n\n const currentItems = options.items()\n const dragIndex = currentItems.findIndex((item) => options.by(item) === dragId)\n const dropIndex = currentItems.findIndex((item) => options.by(item) === dropId)\n /* v8 ignore next — defensive findIndex-not-found guards; ids come from active drag */\n if (dragIndex === -1 || dropIndex === -1) return\n\n const reordered = [...currentItems]\n const [moved] = reordered.splice(dragIndex, 1)\n /* v8 ignore next — defensive splice fallback; dragIndex was just verified */\n if (!moved) return\n\n // Determine insert position based on closest edge\n /* v8 ignore next 7 — ternary combinatorics; structurally exercised in browser e2e but not unit-coverable per arm */\n const rawInsert =\n edge === 'bottom' || edge === 'right'\n ? dropIndex >= dragIndex\n ? dropIndex\n : dropIndex + 1\n : dropIndex <= dragIndex\n ? dropIndex\n : dropIndex - 1\n const insertAt = Math.max(0, Math.min(rawInsert, reordered.length))\n\n reordered.splice(insertAt, 0, moved)\n options.onReorder(reordered)\n }\n\n /** Returns true when `source` belongs to this sortable or to a sibling\n * in the same `groupId`. */\n function acceptsSource(source: { data: Record<string, unknown> }): boolean {\n if (source.data[SORT_ID] === sortableId) return true\n if (groupId && source.data[SORT_GROUP] === groupId) return true\n return false\n }\n\n function containerRef(el: HTMLElement | null) {\n // Pyreon's runtime calls refs with `null` on unmount; the per-element\n // pdnd cleanups are already registered via `onCleanup` below, so we\n // can no-op the unmount-time call.\n if (!el) return\n // Auto-scroll when dragging near container edges\n cleanups.push(\n autoScrollForElements({\n element: el,\n canScroll: ({ source }) => acceptsSource(source),\n }),\n )\n\n // Container is a drop target for reorder finalization OR for\n // appending a cross-list item at the end of this column.\n cleanups.push(\n dropTargetForElements({\n element: el,\n getData: () => ({ [SORT_ID]: sortableId, [SORT_GROUP]: groupId }),\n canDrop: ({ source }) => acceptsSource(source),\n onDrop: ({ source }) => {\n // Item-level dropTarget for cross-list drops marks the source\n // data as handled — container skips so we don't insert twice.\n const handled = (source.data as Record<string, unknown>)\n .__pyreon_sortable_handled\n if (source.data[SORT_ID] === sortableId) {\n // Same-list drop on container edge → reorder finalization.\n performReorder()\n } else if (\n !handled &&\n groupId &&\n source.data[SORT_GROUP] === groupId &&\n options.onCrossListReceive\n ) {\n // Cross-list drop on the container itself (not on an item) →\n // append to the end of this column.\n const item = source.data[SORT_PAYLOAD] as T\n const sourceSortableId = source.data[SORT_ID] as string\n const targetIndex = options.items().length\n options.onCrossListReceive(item, targetIndex)\n const sourceInstance = _sortableRegistry.get(sourceSortableId)\n sourceInstance?.onCrossListDrop?.(item)\n }\n // batch() the 3-signal reset so subscribers reading any of\n // activeId/overId/overEdge get notified once per drop, not\n // three times. Fires on every container-level drop.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n },\n }),\n )\n\n // Keyboard reordering: Alt+Arrow keys\n const keyHandler = (e: KeyboardEvent) => {\n if (!e.altKey) return\n\n const isUp = axis === 'vertical' ? e.key === 'ArrowUp' : e.key === 'ArrowLeft'\n const isDown = axis === 'vertical' ? e.key === 'ArrowDown' : e.key === 'ArrowRight'\n if (!isUp && !isDown) return\n\n const focused = document.activeElement as HTMLElement | null\n if (!focused || !el.contains(focused)) return\n\n const focusedKey = focused.dataset.pyreonSortKey\n if (!focusedKey) return\n\n e.preventDefault()\n\n const currentItems = options.items()\n const currentIndex = currentItems.findIndex((item) => String(options.by(item)) === focusedKey)\n /* v8 ignore next — defensive findIndex guard; focusedKey is from active item */\n if (currentIndex === -1) return\n\n const targetIndex = isUp ? currentIndex - 1 : currentIndex + 1\n if (targetIndex < 0 || targetIndex >= currentItems.length) return\n\n const reordered = [...currentItems]\n const temp = reordered[currentIndex]\n reordered[currentIndex] = reordered[targetIndex] as T\n reordered[targetIndex] = temp as T\n options.onReorder(reordered)\n\n // Restore focus after DOM update\n requestAnimationFrame(() => {\n const items = el.querySelectorAll('[data-pyreon-sort-key]')\n for (const item of items) {\n if ((item as HTMLElement).dataset.pyreonSortKey === focusedKey) {\n ;(item as HTMLElement).focus()\n break\n }\n }\n })\n }\n\n el.addEventListener('keydown', keyHandler)\n cleanups.push(() => el.removeEventListener('keydown', keyHandler))\n }\n\n function itemRef(key: string | number): (el: HTMLElement | null) => void {\n return (el: HTMLElement | null) => {\n // Per-key disposal. The ref fires with the element on mount and\n // with `null` on unmount. The old code pushed every registration\n // onto the shared `cleanups[]` and made the null branch a pure\n // no-op — so for a `<For>`-rendered sortable (the documented usage:\n // todo list / kanban) every removed item's pdnd `draggable` /\n // `dropTargetForElements` registration (and its pointer/drag\n // listeners on the now-detached node) leaked until the WHOLE\n // sortable unmounted. Dispose the prior registration for this key\n // on BOTH unmount (el === null) and re-registration (same key,\n // new element) so the live set tracks live items, not all-ever.\n const prev = itemCleanups.get(key)\n if (prev) {\n prev()\n itemCleanups.delete(key)\n }\n if (!el) return\n el.dataset.pyreonSortKey = String(key)\n if (!el.hasAttribute('tabindex')) el.setAttribute('tabindex', '0')\n el.setAttribute('role', 'listitem')\n el.setAttribute('aria-roledescription', 'sortable item')\n\n const allowedEdges: Edge[] = axis === 'vertical' ? ['top', 'bottom'] : ['left', 'right']\n\n const cleanup = combine(\n draggable({\n element: el,\n getInitialData: () => {\n const currentItems = options.items()\n const item = currentItems.find((i) => options.by(i) === key)\n return {\n [SORT_KEY]: key,\n [SORT_ID]: sortableId,\n [SORT_GROUP]: groupId,\n // Carry the actual item value when groupId is set so a\n // sibling sortable's onDrop can receive it without a\n // separate registry lookup. Plain reference (pdnd doesn't\n // serialize) — safe within a single document.\n [SORT_PAYLOAD]: groupId ? item : undefined,\n }\n },\n onDragStart: () => activeId.set(key),\n onDrop: () => {\n queueMicrotask(() => {\n // batch() — same 3-signal reset shape as the container\n // onDrop above. Per-item drops fire this branch.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n })\n },\n }),\n dropTargetForElements({\n element: el,\n getData: ({ input, element }) =>\n attachClosestEdge(\n { [SORT_KEY]: key, [SORT_ID]: sortableId, [SORT_GROUP]: groupId },\n { input, element, allowedEdges },\n ),\n canDrop: ({ source }) => acceptsSource(source),\n onDragEnter: ({ self }) => {\n overId.set(key)\n overEdge.set(extractClosestEdge(self.data) as DropEdge | null)\n },\n onDrag: ({ self }) => {\n overEdge.set(extractClosestEdge(self.data) as DropEdge | null)\n },\n onDragLeave: () => {\n if (overId.peek() === key) {\n overId.set(null)\n overEdge.set(null)\n }\n },\n onDrop: ({ source, self }) => {\n // Same-list drops are handled by the container's onDrop via\n // performReorder. Item-level onDrop fires for cross-list\n // shapes — insert at THIS item's index, then propagate to\n // the source to remove.\n if (source.data[SORT_ID] === sortableId) return\n if (\n !groupId ||\n source.data[SORT_GROUP] !== groupId ||\n !options.onCrossListReceive\n ) {\n return\n }\n const item = source.data[SORT_PAYLOAD] as T\n const edge = extractClosestEdge(self.data) as DropEdge | null\n const currentItems = options.items()\n const targetIndex = currentItems.findIndex(\n (i) => options.by(i) === key,\n )\n /* v8 ignore next — defensive findIndex guard */\n if (targetIndex === -1) return\n /* v8 ignore next 4 — ternary combinatorics */\n const insertAt =\n edge === 'bottom' || edge === 'right'\n ? targetIndex + 1\n : Math.max(0, targetIndex)\n options.onCrossListReceive(item, insertAt)\n const sourceSortableId = source.data[SORT_ID] as string\n const sourceInstance = _sortableRegistry.get(sourceSortableId)\n sourceInstance?.onCrossListDrop?.(item)\n // Mark so the container's onDrop (which also fires) skips\n // re-inserting at the end of the list.\n ;(source.data as Record<string, unknown>).__pyreon_sortable_handled =\n true\n },\n }),\n )\n\n itemCleanups.set(key, cleanup)\n }\n }\n\n onCleanup(() => {\n for (const cleanup of cleanups) cleanup()\n cleanups.length = 0\n for (const cleanup of itemCleanups.values()) cleanup()\n itemCleanups.clear()\n _sortableRegistry.delete(sortableId)\n // batch() the final 3-signal reset so any subscriber that survives\n // the dispose order (unusual but possible — e.g. an external store\n // holding refs) sees one notify, not three.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n })\n\n return { containerRef, itemRef, activeId, overId, overEdge }\n}\n","import { name as __pkgName, version as __pkgVersion } from '../package.json' with { type: 'json' }\nimport { registerSingleton } from '@pyreon/reactivity'\n\n// Singleton sentinel — fail-loud detection of duplicate @pyreon/dnd\n// instances in the same heap. See @pyreon/reactivity/singleton-sentinel for\n// full rationale. Hardcoded version is acceptable here — it's a diagnostic\n// aid, not a load-bearing identity check.\nregisterSingleton(__pkgName, __pkgVersion, import.meta.url)\n\nexport type {\n DragData,\n DropEdge,\n DropLocation,\n UseDraggableOptions,\n UseDraggableResult,\n UseDroppableOptions,\n UseDroppableResult,\n UseSortableOptions,\n UseSortableResult,\n} from './types'\n\nexport type { UseDragMonitorOptions, UseDragMonitorResult } from './use-drag-monitor'\nexport { useDragMonitor } from './use-drag-monitor'\n\nexport { useDraggable } from './use-draggable'\nexport { useDroppable } from './use-droppable'\nexport type { UseFileDropOptions, UseFileDropResult } from './use-file-drop'\nexport { useFileDrop } from './use-file-drop'\nexport { useSortable } from './use-sortable'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuCA,SAAgB,eAAe,SAAuD;CACpF,IAAI,UAAU,OAAO;EAAE,kBAAkB;EAAO,gBAAgB;CAAK;CAErE,MAAM,aAAa,OAAO,KAAK;CAC/B,MAAM,WAAW,OAAwB,IAAI;;CAG7C,MAAM,eAAe,SAAS,cACzB,EAAE,aACD,QAAQ,aAAa,OAAO,IAAgB,KAAK,OACnD;CAwBJ,UAtBgB,mBAAmB;EACjC,GAAI,eAAe,EAAE,YAAY,aAAa,IAAI,CAAC;EACnD,cAAc,EAAE,aAAa;GAI3B,YAAY;IACV,WAAW,IAAI,IAAI;IACnB,SAAS,IAAI,OAAO,IAAgB;GACtC,CAAC;GACD,SAAS,cAAc,OAAO,IAAgB;EAChD;EACA,SAAS,EAAE,QAAQ,eAAe;GAChC,YAAY;IACV,WAAW,IAAI,KAAK;IACpB,SAAS,IAAI,IAAI;GACnB,CAAC;GACD,MAAM,aAAa,SAAS,QAAQ,YAAY,IAAI,QAAQ,CAAC;GAC7D,SAAS,SAAS,OAAO,MAAkB,UAAsB;EACnE;CACF,CAEgB,CAAC;CAEjB,OAAO;EAAE;EAAY;CAAS;AAChC;;;;;;;;;;;;;;;;;;;;;ACvDA,SAAgB,aACd,SACoB;CACpB,IAAI,UAAU,OAAO,EAAE,kBAAkB,MAAM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ACjB,OAAO,IAAI,IAAI;GACf,SAAS,IAAI,IAAI;EACnB,CAAC;CACH,CAAC;CAED,OAAO;EAAE;EAAc;EAAS;EAAU;EAAQ;CAAS;AAC7D;;;;AC1XA,kBAAkBA,MAAWC,SAAc,OAAO,KAAK,GAAG"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["__pkgName","__pkgVersion"],"sources":["../package.json","../src/use-drag-monitor.ts","../src/use-draggable.ts","../src/use-droppable.ts","../src/use-file-drop.ts","../src/use-sortable.ts","../src/index.ts"],"sourcesContent":["","import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData } from './types'\n\nexport interface UseDragMonitorOptions {\n /** Called on any drag start in the page. */\n onDragStart?: (data: DragData) => void\n /** Called on any drop in the page. */\n onDrop?: (sourceData: DragData, targetData: DragData) => void\n /** Filter which drags to monitor. */\n canMonitor?: (data: DragData) => boolean\n}\n\nexport interface UseDragMonitorResult {\n /** Whether any element is currently being dragged. */\n isDragging: () => boolean\n /** Data of the currently dragging element (null if not dragging). */\n dragData: () => DragData | null\n}\n\n/**\n * Monitor all drag operations on the page.\n * Useful for global drag indicators, analytics, or coordination between\n * multiple drag-and-drop areas.\n *\n * @example\n * ```tsx\n * const { isDragging, dragData } = useDragMonitor({\n * canMonitor: (data) => data.type === \"card\",\n * onDrop: (source, target) => logDrop(source, target),\n * })\n *\n * <Show when={isDragging()}>\n * <div class=\"global-drag-overlay\">\n * Dragging: {() => dragData()?.name}\n * </div>\n * </Show>\n * ```\n */\nexport function useDragMonitor(options?: UseDragMonitorOptions): UseDragMonitorResult {\n if (isServer) return { isDragging: () => false, dragData: () => null }\n\n const isDragging = signal(false)\n const dragData = signal<DragData | null>(null)\n\n /* v8 ignore next 4 — opt-in canMonitor predicate; both arms structurally exercised but counted as one */\n const canMonitorFn = options?.canMonitor\n ? ({ source }: { source: { data: Record<string, unknown> } }) =>\n options.canMonitor?.(source.data as DragData) ?? true\n : null\n\n const cleanup = monitorForElements({\n ...(canMonitorFn ? { canMonitor: canMonitorFn } : {}),\n onDragStart: ({ source }) => {\n // batch() so subscribers to isDragging + dragData get notified once,\n // not twice. Drag events fire frequently; doubling subscriber work\n // per event compounds visibly on UIs with many drag-monitor consumers.\n batch(() => {\n isDragging.set(true)\n dragData.set(source.data as DragData)\n })\n options?.onDragStart?.(source.data as DragData)\n },\n onDrop: ({ source, location }) => {\n batch(() => {\n isDragging.set(false)\n dragData.set(null)\n })\n const targetData = location.current.dropTargets[0]?.data ?? {}\n options?.onDrop?.(source.data as DragData, targetData as DragData)\n },\n })\n\n onCleanup(cleanup)\n\n return { isDragging, dragData }\n}\n","import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData, UseDraggableOptions, UseDraggableResult } from './types'\n\n/**\n * Make an element draggable with signal-driven state.\n *\n * @example\n * ```tsx\n * let cardEl: HTMLElement | null = null\n *\n * const { isDragging } = useDraggable({\n * element: () => cardEl,\n * data: { id: card.id, type: \"card\" },\n * })\n *\n * <div ref={(el) => cardEl = el} class={isDragging() ? \"opacity-50\" : \"\"}>\n * {card.title}\n * </div>\n * ```\n */\nexport function useDraggable<T extends DragData = DragData>(\n options: UseDraggableOptions<T>,\n): UseDraggableResult {\n if (isServer) return { isDragging: () => false }\n\n const isDragging = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function setup() {\n // The hook may have unmounted before this deferred (queueMicrotask) setup\n // ran. onCleanup fired with `cleanup` still undefined (a no-op), so a\n // registration created here would never be torn down — bail instead.\n /* v8 ignore next — defensive disposed-during-setup guard; tested implicitly via lifecycle */\n if (disposed) return\n // Defensive re-setup teardown: `setup` is scheduled exactly once\n // (`queueMicrotask(setup)`) and never re-invoked, so `cleanup` is always\n // undefined here — this branch never fires in the current single-shot\n // design. Kept so a future re-setup trigger (element-change re-registration)\n // can't leak a double registration.\n /* v8 ignore next — defensive re-setup teardown; unreachable with single-shot queueMicrotask */\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n const resolveData = () =>\n typeof options.data === 'function' ? (options.data as () => T)() : options.data\n\n const handle = options.handle?.()\n cleanup = draggable({\n element: el,\n ...(handle ? { dragHandle: handle } : {}),\n getInitialData: resolveData,\n canDrag: () => {\n const disabled = options.disabled\n if (typeof disabled === 'function') return !disabled()\n return !disabled\n },\n onDragStart: () => {\n isDragging.set(true)\n options.onDragStart?.()\n },\n onDrop: () => {\n isDragging.set(false)\n options.onDragEnd?.()\n },\n })\n }\n\n // Defer setup to next microtask so refs are populated\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isDragging }\n}\n","import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DragData, UseDroppableOptions, UseDroppableResult } from './types'\n\n/**\n * Make an element a drop target with signal-driven state.\n *\n * @example\n * ```tsx\n * let zoneEl: HTMLElement | null = null\n *\n * const { isOver } = useDroppable({\n * element: () => zoneEl,\n * onDrop: (data) => handleDrop(data),\n * canDrop: (data) => data.type === \"card\",\n * })\n *\n * <div ref={(el) => zoneEl = el} class={isOver() ? \"bg-blue-50\" : \"\"}>\n * Drop here\n * </div>\n * ```\n */\nexport function useDroppable<T extends DragData = DragData>(\n options: UseDroppableOptions<T>,\n): UseDroppableResult {\n if (isServer) return { isOver: () => false }\n\n const isOver = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function setup() {\n // Unmounted before this deferred setup ran — don't register a target that\n // onCleanup (already fired with `cleanup` undefined) can never tear down.\n /* v8 ignore next — defensive disposed-during-setup guard */\n if (disposed) return\n // Defensive re-setup teardown: `setup` runs exactly once\n // (`queueMicrotask(setup)`, never re-invoked), so `cleanup` is always\n // undefined here — this branch never fires in the current single-shot\n // design. Kept so a future re-setup trigger can't leak a double target.\n /* v8 ignore next — defensive re-setup teardown; unreachable with single-shot queueMicrotask */\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n cleanup = dropTargetForElements({\n element: el,\n getData: () => {\n if (!options.data) return {}\n return typeof options.data === 'function' ? (options.data as () => T)() : options.data\n },\n canDrop: ({ source }) => {\n if (!options.canDrop) return true\n return options.canDrop(source.data as DragData)\n },\n onDragEnter: ({ source }) => {\n isOver.set(true)\n options.onDragEnter?.(source.data as DragData)\n },\n onDragLeave: () => {\n isOver.set(false)\n options.onDragLeave?.()\n },\n onDrop: ({ source }) => {\n isOver.set(false)\n options.onDrop?.(source.data as DragData)\n },\n })\n }\n\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isOver }\n}\n","import {\n dropTargetForExternal,\n monitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter'\nimport { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\n\nexport interface UseFileDropOptions {\n /** Element getter for the drop zone. */\n element: () => HTMLElement | null\n /** Called when files are dropped. */\n onDrop: (files: File[]) => void\n /** Filter accepted file types (e.g. [\"image/*\", \".pdf\"]). */\n accept?: string[]\n /** Maximum number of files. */\n maxFiles?: number\n /** Whether drop is disabled. */\n disabled?: boolean | (() => boolean)\n}\n\nexport interface UseFileDropResult {\n /** Whether files are being dragged over the drop zone. */\n isOver: () => boolean\n /** Whether files are being dragged anywhere on the page. */\n isDraggingFiles: () => boolean\n}\n\n/**\n * File drop zone with signal-driven state.\n * Uses the native file drag events via pragmatic-drag-and-drop.\n *\n * @example\n * ```tsx\n * let dropZone: HTMLElement | null = null\n *\n * const { isOver, isDraggingFiles } = useFileDrop({\n * element: () => dropZone,\n * accept: [\"image/*\", \".pdf\"],\n * maxFiles: 5,\n * onDrop: (files) => upload(files),\n * })\n *\n * <div\n * ref={(el) => dropZone = el}\n * class={isOver() ? \"drop-active\" : isDraggingFiles() ? \"drop-ready\" : \"\"}\n * >\n * Drop files here\n * </div>\n * ```\n */\nexport function useFileDrop(options: UseFileDropOptions): UseFileDropResult {\n if (isServer) return { isOver: () => false, isDraggingFiles: () => false }\n\n const isOver = signal(false)\n const isDraggingFiles = signal(false)\n let cleanup: (() => void) | undefined\n let disposed = false\n\n function matchesAccept(file: File, accept: string[]): boolean {\n return accept.some((pattern) => {\n if (pattern.startsWith('.')) {\n return file.name.toLowerCase().endsWith(pattern.toLowerCase())\n }\n if (pattern.endsWith('/*')) {\n return file.type.startsWith(pattern.slice(0, -1))\n }\n return file.type === pattern\n })\n }\n\n function setup() {\n // Unmounted before this deferred setup ran — don't register a drop target\n // that onCleanup (already fired with `cleanup` undefined) can never remove.\n /* v8 ignore next — defensive disposed-during-setup guard */\n if (disposed) return\n if (cleanup) cleanup()\n\n const el = options.element()\n if (!el) return\n\n const cleanups: (() => void)[] = []\n\n // Monitor for file drags anywhere on the page\n cleanups.push(\n monitorForExternal({\n canMonitor: ({ source }) => containsFiles({ source }),\n onDragStart: () => isDraggingFiles.set(true),\n onDrop: () => isDraggingFiles.set(false),\n }),\n )\n\n // Drop target on the specific element\n cleanups.push(\n dropTargetForExternal({\n element: el,\n canDrop: ({ source }) => {\n const disabled = options.disabled\n if (typeof disabled === 'function' ? disabled() : disabled) return false\n return containsFiles({ source })\n },\n onDragEnter: () => isOver.set(true),\n onDragLeave: () => isOver.set(false),\n onDrop: ({ source }) => {\n // batch() so onDrop subscribers don't get notified twice\n // (isOver + isDraggingFiles) per file-drop event.\n batch(() => {\n isOver.set(false)\n isDraggingFiles.set(false)\n })\n\n let files = getFiles({ source })\n\n // Filter by accept\n if (options.accept && options.accept.length > 0) {\n files = files.filter((f) => matchesAccept(f, options.accept as string[]))\n }\n\n // Limit count\n if (options.maxFiles && files.length > options.maxFiles) {\n files = files.slice(0, options.maxFiles)\n }\n\n if (files.length > 0) {\n options.onDrop(files)\n }\n },\n }),\n )\n\n cleanup = () => {\n for (const fn of cleanups) fn()\n }\n }\n\n queueMicrotask(setup)\n\n onCleanup(() => {\n disposed = true\n if (cleanup) cleanup()\n })\n\n return { isOver, isDraggingFiles }\n}\n","import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine'\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element'\nimport {\n attachClosestEdge,\n type Edge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge'\nimport { batch, isServer, onCleanup, signal } from '@pyreon/reactivity'\nimport type { DropEdge, UseSortableOptions, UseSortableResult } from './types'\n\nconst SORT_KEY = '__pyreon_sortable_key'\nconst SORT_ID = '__pyreon_sortable_id'\nconst SORT_GROUP = '__pyreon_sortable_group'\nconst SORT_PAYLOAD = '__pyreon_sortable_payload'\n\nlet _sortableCounter = 0\n\n// Module-level registry of live sortable instances — used to dispatch\n// cross-list drop notifications from the destination back to the source\n// (W18). Keyed by sortableId.\nconst _sortableRegistry = new Map<\n string,\n {\n groupId: string | undefined\n onCrossListDrop: ((item: unknown) => void) | undefined\n }\n>()\n\n/**\n * Sortable list with signal-driven state, auto-scroll, and edge detection.\n *\n * Features:\n * - Keyed drag items matching `<For by={...}>` pattern\n * - Auto-scroll when dragging near container edges\n * - Closest-edge detection (drop above/below or left/right)\n * - Axis constraint (vertical/horizontal)\n * - Keyboard reordering (Alt+Arrow keys)\n * - Optional cross-list `groupId` for Trello/Notion/Linear board layouts\n * (W18) — share the same `groupId` between two\n * sortable instances and items can be dragged between them. The\n * source's `onCrossListDrop(item)` removes; the destination's\n * `onCrossListReceive(item, index)` inserts.\n *\n * @example\n * ```tsx\n * const items = signal([\n * { id: \"1\", name: \"Alice\" },\n * { id: \"2\", name: \"Bob\" },\n * { id: \"3\", name: \"Charlie\" },\n * ])\n *\n * const { containerRef, itemRef, activeId, overId, overEdge } = useSortable({\n * items,\n * by: (item) => item.id,\n * onReorder: (newItems) => items.set(newItems),\n * })\n *\n * <ul ref={containerRef}>\n * <For each={items()} by={item => item.id}>\n * {(item) => (\n * <li\n * ref={itemRef(item.id)}\n * class={activeId() === item.id ? \"dragging\" : \"\"}\n * style={overId() === item.id ? `border-${overEdge()}: 2px solid blue` : \"\"}\n * >\n * {item.name}\n * </li>\n * )}\n * </For>\n * </ul>\n * ```\n */\nexport function useSortable<T>(options: UseSortableOptions<T>): UseSortableResult {\n if (isServer) {\n const noop = (_el: HTMLElement | null) => {}\n return {\n containerRef: noop,\n itemRef: () => noop,\n activeId: () => null,\n overId: () => null,\n overEdge: () => null,\n }\n }\n\n const sortableId = `sortable-${++_sortableCounter}`\n const activeId = signal<string | number | null>(null)\n const overId = signal<string | number | null>(null)\n const overEdge = signal<DropEdge | null>(null)\n const axis = options.axis ?? 'vertical'\n const groupId = options.groupId\n\n // Register so siblings in the same group can call our onCrossListDrop\n // when they receive one of our items.\n _sortableRegistry.set(sortableId, {\n groupId,\n onCrossListDrop: options.onCrossListDrop as ((item: unknown) => void) | undefined,\n })\n\n // Shared (container-level) pdnd cleanups — drained once on unmount.\n const cleanups: (() => void)[] = []\n // Per-item pdnd cleanups, keyed by sort key. Disposed individually on\n // item unmount / re-register so a churning list doesn't accumulate\n // dead registrations for the sortable's whole lifetime.\n const itemCleanups = new Map<string | number, () => void>()\n\n /** Perform the reorder based on current active/over/edge state. */\n function performReorder() {\n const dragId = activeId.peek()\n const dropId = overId.peek()\n const edge = overEdge.peek()\n /* v8 ignore next — defensive null/equal id guards */\n if (dragId == null || dropId == null || dragId === dropId) return\n\n const currentItems = options.items()\n const dragIndex = currentItems.findIndex((item) => options.by(item) === dragId)\n const dropIndex = currentItems.findIndex((item) => options.by(item) === dropId)\n /* v8 ignore next — defensive findIndex-not-found guards; ids come from active drag */\n if (dragIndex === -1 || dropIndex === -1) return\n\n const reordered = [...currentItems]\n const [moved] = reordered.splice(dragIndex, 1)\n /* v8 ignore next — defensive splice fallback; dragIndex was just verified */\n if (!moved) return\n\n // Determine insert position based on closest edge\n /* v8 ignore next 7 — ternary combinatorics; structurally exercised in browser e2e but not unit-coverable per arm */\n const rawInsert =\n edge === 'bottom' || edge === 'right'\n ? dropIndex >= dragIndex\n ? dropIndex\n : dropIndex + 1\n : dropIndex <= dragIndex\n ? dropIndex\n : dropIndex - 1\n const insertAt = Math.max(0, Math.min(rawInsert, reordered.length))\n\n reordered.splice(insertAt, 0, moved)\n options.onReorder(reordered)\n }\n\n /** Returns true when `source` belongs to this sortable or to a sibling\n * in the same `groupId`. */\n function acceptsSource(source: { data: Record<string, unknown> }): boolean {\n if (source.data[SORT_ID] === sortableId) return true\n if (groupId && source.data[SORT_GROUP] === groupId) return true\n return false\n }\n\n function containerRef(el: HTMLElement | null) {\n // Pyreon's runtime calls refs with `null` on unmount; the per-element\n // pdnd cleanups are already registered via `onCleanup` below, so we\n // can no-op the unmount-time call.\n if (!el) return\n // Auto-scroll when dragging near container edges\n cleanups.push(\n autoScrollForElements({\n element: el,\n canScroll: ({ source }) => acceptsSource(source),\n }),\n )\n\n // Container is a drop target for reorder finalization OR for\n // appending a cross-list item at the end of this column.\n cleanups.push(\n dropTargetForElements({\n element: el,\n getData: () => ({ [SORT_ID]: sortableId, [SORT_GROUP]: groupId }),\n canDrop: ({ source }) => acceptsSource(source),\n onDrop: ({ source }) => {\n // Item-level dropTarget for cross-list drops marks the source\n // data as handled — container skips so we don't insert twice.\n const handled = (source.data as Record<string, unknown>)\n .__pyreon_sortable_handled\n if (source.data[SORT_ID] === sortableId) {\n // Same-list drop on container edge → reorder finalization.\n performReorder()\n } else if (\n !handled &&\n groupId &&\n source.data[SORT_GROUP] === groupId &&\n options.onCrossListReceive\n ) {\n // Cross-list drop on the container itself (not on an item) →\n // append to the end of this column.\n const item = source.data[SORT_PAYLOAD] as T\n const sourceSortableId = source.data[SORT_ID] as string\n const targetIndex = options.items().length\n options.onCrossListReceive(item, targetIndex)\n const sourceInstance = _sortableRegistry.get(sourceSortableId)\n sourceInstance?.onCrossListDrop?.(item)\n }\n // batch() the 3-signal reset so subscribers reading any of\n // activeId/overId/overEdge get notified once per drop, not\n // three times. Fires on every container-level drop.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n },\n }),\n )\n\n // Keyboard reordering: Alt+Arrow keys\n const keyHandler = (e: KeyboardEvent) => {\n if (!e.altKey) return\n\n const isUp = axis === 'vertical' ? e.key === 'ArrowUp' : e.key === 'ArrowLeft'\n const isDown = axis === 'vertical' ? e.key === 'ArrowDown' : e.key === 'ArrowRight'\n if (!isUp && !isDown) return\n\n const focused = document.activeElement as HTMLElement | null\n if (!focused || !el.contains(focused)) return\n\n const focusedKey = focused.dataset.pyreonSortKey\n if (!focusedKey) return\n\n e.preventDefault()\n\n const currentItems = options.items()\n const currentIndex = currentItems.findIndex((item) => String(options.by(item)) === focusedKey)\n /* v8 ignore next — defensive findIndex guard; focusedKey is from active item */\n if (currentIndex === -1) return\n\n const targetIndex = isUp ? currentIndex - 1 : currentIndex + 1\n if (targetIndex < 0 || targetIndex >= currentItems.length) return\n\n const reordered = [...currentItems]\n const temp = reordered[currentIndex]\n reordered[currentIndex] = reordered[targetIndex] as T\n reordered[targetIndex] = temp as T\n options.onReorder(reordered)\n\n // Restore focus after DOM update\n requestAnimationFrame(() => {\n const items = el.querySelectorAll('[data-pyreon-sort-key]')\n for (const item of items) {\n if ((item as HTMLElement).dataset.pyreonSortKey === focusedKey) {\n ;(item as HTMLElement).focus()\n break\n }\n }\n })\n }\n\n el.addEventListener('keydown', keyHandler)\n cleanups.push(() => el.removeEventListener('keydown', keyHandler))\n }\n\n function itemRef(key: string | number): (el: HTMLElement | null) => void {\n return (el: HTMLElement | null) => {\n // Per-key disposal. The ref fires with the element on mount and\n // with `null` on unmount. The old code pushed every registration\n // onto the shared `cleanups[]` and made the null branch a pure\n // no-op — so for a `<For>`-rendered sortable (the documented usage:\n // todo list / kanban) every removed item's pdnd `draggable` /\n // `dropTargetForElements` registration (and its pointer/drag\n // listeners on the now-detached node) leaked until the WHOLE\n // sortable unmounted. Dispose the prior registration for this key\n // on BOTH unmount (el === null) and re-registration (same key,\n // new element) so the live set tracks live items, not all-ever.\n const prev = itemCleanups.get(key)\n if (prev) {\n prev()\n itemCleanups.delete(key)\n }\n if (!el) return\n el.dataset.pyreonSortKey = String(key)\n if (!el.hasAttribute('tabindex')) el.setAttribute('tabindex', '0')\n el.setAttribute('role', 'listitem')\n el.setAttribute('aria-roledescription', 'sortable item')\n\n const allowedEdges: Edge[] = axis === 'vertical' ? ['top', 'bottom'] : ['left', 'right']\n\n const cleanup = combine(\n draggable({\n element: el,\n getInitialData: () => {\n const currentItems = options.items()\n const item = currentItems.find((i) => options.by(i) === key)\n return {\n [SORT_KEY]: key,\n [SORT_ID]: sortableId,\n [SORT_GROUP]: groupId,\n // Carry the actual item value when groupId is set so a\n // sibling sortable's onDrop can receive it without a\n // separate registry lookup. Plain reference (pdnd doesn't\n // serialize) — safe within a single document.\n [SORT_PAYLOAD]: groupId ? item : undefined,\n }\n },\n onDragStart: () => activeId.set(key),\n onDrop: () => {\n queueMicrotask(() => {\n // batch() — same 3-signal reset shape as the container\n // onDrop above. Per-item drops fire this branch.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n })\n },\n }),\n dropTargetForElements({\n element: el,\n getData: ({ input, element }) =>\n attachClosestEdge(\n { [SORT_KEY]: key, [SORT_ID]: sortableId, [SORT_GROUP]: groupId },\n { input, element, allowedEdges },\n ),\n canDrop: ({ source }) => acceptsSource(source),\n onDragEnter: ({ self }) => {\n overId.set(key)\n overEdge.set(extractClosestEdge(self.data) as DropEdge | null)\n },\n onDrag: ({ self }) => {\n overEdge.set(extractClosestEdge(self.data) as DropEdge | null)\n },\n onDragLeave: () => {\n if (overId.peek() === key) {\n overId.set(null)\n overEdge.set(null)\n }\n },\n onDrop: ({ source, self }) => {\n // Same-list drops are handled by the container's onDrop via\n // performReorder. Item-level onDrop fires for cross-list\n // shapes — insert at THIS item's index, then propagate to\n // the source to remove.\n if (source.data[SORT_ID] === sortableId) return\n if (\n !groupId ||\n source.data[SORT_GROUP] !== groupId ||\n !options.onCrossListReceive\n ) {\n return\n }\n const item = source.data[SORT_PAYLOAD] as T\n const edge = extractClosestEdge(self.data) as DropEdge | null\n const currentItems = options.items()\n const targetIndex = currentItems.findIndex(\n (i) => options.by(i) === key,\n )\n /* v8 ignore next — defensive findIndex guard */\n if (targetIndex === -1) return\n /* v8 ignore next 4 — ternary combinatorics */\n const insertAt =\n edge === 'bottom' || edge === 'right'\n ? targetIndex + 1\n : Math.max(0, targetIndex)\n options.onCrossListReceive(item, insertAt)\n const sourceSortableId = source.data[SORT_ID] as string\n const sourceInstance = _sortableRegistry.get(sourceSortableId)\n sourceInstance?.onCrossListDrop?.(item)\n // Mark so the container's onDrop (which also fires) skips\n // re-inserting at the end of the list.\n ;(source.data as Record<string, unknown>).__pyreon_sortable_handled =\n true\n },\n }),\n )\n\n itemCleanups.set(key, cleanup)\n }\n }\n\n onCleanup(() => {\n for (const cleanup of cleanups) cleanup()\n cleanups.length = 0\n for (const cleanup of itemCleanups.values()) cleanup()\n itemCleanups.clear()\n _sortableRegistry.delete(sortableId)\n // batch() the final 3-signal reset so any subscriber that survives\n // the dispose order (unusual but possible — e.g. an external store\n // holding refs) sees one notify, not three.\n batch(() => {\n activeId.set(null)\n overId.set(null)\n overEdge.set(null)\n })\n })\n\n return { containerRef, itemRef, activeId, overId, overEdge }\n}\n","import { name as __pkgName, version as __pkgVersion } from '../package.json' with { type: 'json' }\nimport { registerSingleton } from '@pyreon/reactivity'\n\n// Singleton sentinel — fail-loud detection of duplicate @pyreon/dnd\n// instances in the same heap. See @pyreon/reactivity/singleton-sentinel for\n// full rationale. Hardcoded version is acceptable here — it's a diagnostic\n// aid, not a load-bearing identity check.\nregisterSingleton(__pkgName, __pkgVersion, import.meta.url)\n\nexport type {\n DragData,\n DropEdge,\n DropLocation,\n UseDraggableOptions,\n UseDraggableResult,\n UseDroppableOptions,\n UseDroppableResult,\n UseSortableOptions,\n UseSortableResult,\n} from './types'\n\nexport type { UseDragMonitorOptions, UseDragMonitorResult } from './use-drag-monitor'\nexport { useDragMonitor } from './use-drag-monitor'\n\nexport { useDraggable } from './use-draggable'\nexport { useDroppable } from './use-droppable'\nexport type { UseFileDropOptions, UseFileDropResult } from './use-file-drop'\nexport { useFileDrop } from './use-file-drop'\nexport { useSortable } from './use-sortable'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuCA,SAAgB,eAAe,SAAuD;CACpF,IAAI,UAAU,OAAO;EAAE,kBAAkB;EAAO,gBAAgB;CAAK;CAErE,MAAM,aAAa,OAAO,KAAK;CAC/B,MAAM,WAAW,OAAwB,IAAI;;CAG7C,MAAM,eAAe,SAAS,cACzB,EAAE,aACD,QAAQ,aAAa,OAAO,IAAgB,KAAK,OACnD;CAwBJ,UAtBgB,mBAAmB;EACjC,GAAI,eAAe,EAAE,YAAY,aAAa,IAAI,CAAC;EACnD,cAAc,EAAE,aAAa;GAI3B,YAAY;IACV,WAAW,IAAI,IAAI;IACnB,SAAS,IAAI,OAAO,IAAgB;GACtC,CAAC;GACD,SAAS,cAAc,OAAO,IAAgB;EAChD;EACA,SAAS,EAAE,QAAQ,eAAe;GAChC,YAAY;IACV,WAAW,IAAI,KAAK;IACpB,SAAS,IAAI,IAAI;GACnB,CAAC;GACD,MAAM,aAAa,SAAS,QAAQ,YAAY,EAAE,EAAE,QAAQ,CAAC;GAC7D,SAAS,SAAS,OAAO,MAAkB,UAAsB;EACnE;CACF,CAEgB,CAAC;CAEjB,OAAO;EAAE;EAAY;CAAS;AAChC;;;;;;;;;;;;;;;;;;;;;ACvDA,SAAgB,aACd,SACoB;CACpB,IAAI,UAAU,OAAO,EAAE,kBAAkB,MAAM;CAE/C,MAAM,aAAa,OAAO,KAAK;CAC/B,IAAI;CACJ,IAAI,WAAW;C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AAS,IAAI,IAAI;EACnB,CAAC;CACH,CAAC;CAED,OAAO;EAAE;EAAc;EAAS;EAAU;EAAQ;CAAS;AAC7D;;;;AC1XA,kBAAkBA,MAAWC,SAAc,OAAO,KAAK,GAAG"}
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/use-drag-monitor.ts","../../../src/use-draggable.ts","../../../src/use-droppable.ts","../../../src/use-file-drop.ts","../../../src/use-sortable.ts"],"mappings":";;KACY,QAAA,GAAW,MAAM;;KAGjB,QAAA;;UAGK,YAAA;EAHL;EAKV,IAAA,EAAM,QAAA;;EAEN,IAAA,EAAM,QAAQ;AAAA;AAAA,UAKC,mBAAA,WAA8B,QAAA,GAAW,QAAA;EAT7B;EAW3B,OAAA,QAAe,WAAA;EAPD;EASd,IAAA,EAAM,CAAA,UAAW,CAAA;EAXX;EAaN,MAAA,SAAe,WAAA;EAXT;EAaN,QAAA;EAbc;EAed,WAAA;EAVkC;EAYlC,SAAA;AAAA;AAAA,UAGe,kBAAA;EAbA;EAef,UAAU;AAAA;AAAA,UAKK,mBAAA,WAA8B,QAAA,GAAW,QAAA;EAhB9B;EAkB1B,OAAA,QAAe,WAAA;EAxBoB;EA0BnC,IAAA,GAAO,CAAA,UAAW,CAAA;EA1BsC;EA4BxD,OAAA,IAAW,UAAA,EAAY,QAAA;EA1BR;EA4Bf,WAAA,IAAe,UAAA,EAAY,QAAA;EA1BrB;EA4BN,WAAA;EA1BA;EA4BA,MAAA,IAAU,UAAA,EAAY,QAAA;AAAA;AAAA,UAGP,kBAAA;EAzBf;EA2BA,MAAM;AAAA;AAAA,UAKS,kBAAA;EA7BkB;EA+BjC,KAAA,QAAa,CAAA;EA7BH;EA+BV,EAAA,GAAK,IAAA,EAAM,CAAA;EA1BI;EA4Bf,SAAA,GAAY,KAAA,EAAO,CAAA;EA5Be;EA8BlC,IAAA;EA9BwD;;;;;;;;;;;;;EA4CxD,OAAA;EAxCA;;;;;EA8CA,eAAA,IAAmB,IAAA,EAAM,CAAA;EA1CzB;;;;;;EAiDA,kBAAA,IAAsB,IAAA,EAAM,CAAA,EAAG,WAAA;AAAA;AAAA,UAGhB,iBAAA;EA7CA;;;;AAET;AAKR;EA6CE,YAAA,GAAe,EAAA,EAAI,WAAA;EA7Cc;;;;;EAmDjC,OAAA,GAAU,GAAA,uBAA0B,EAAA,EAAI,WAAA;EAhBX;EAkB7B,QAAA;EArDkC;EAuDlC,MAAA;EArDa;EAuDb,QAAA,QAAgB,QAAA;AAAA;;;UCjHD,qBAAA;EDHG;ECKlB,WAAA,IAAe,IAAA,EAAM,QAAA;EDLM;ECO3B,MAAA,IAAU,UAAA,EAAY,QAAA,EAAU,UAAA,EAAY,QAAA;EDJlC;ECMV,UAAA,IAAc,IAAA,EAAM,QAAA;AAAA;AAAA,UAGL,oBAAA;EDTG;ECWlB,UAAA;EDR2B;ECU3B,QAAA,QAAgB,QAAQ;AAAA;;;;;;ADNV;AAKhB;;;;;;;;;;;;;iBCuBgB,cAAA,CAAe,OAAA,GAAU,qBAAA,GAAwB,oBAAoB;;;ADtCrF;;;;AAA6B;AAG7B;;;;AAAoB;AAGpB;;;;;;;AANA,iBEoBgB,YAAA,WAAuB,QAAA,GAAW,QAAA,
|
|
1
|
+
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/use-drag-monitor.ts","../../../src/use-draggable.ts","../../../src/use-droppable.ts","../../../src/use-file-drop.ts","../../../src/use-sortable.ts"],"mappings":";;KACY,QAAA,GAAW,MAAM;;KAGjB,QAAA;;UAGK,YAAA;EAHL;EAKV,IAAA,EAAM,QAAA;;EAEN,IAAA,EAAM,QAAQ;AAAA;AAAA,UAKC,mBAAA,WAA8B,QAAA,GAAW,QAAA;EAT7B;EAW3B,OAAA,QAAe,WAAA;EAPD;EASd,IAAA,EAAM,CAAA,UAAW,CAAA;EAXX;EAaN,MAAA,SAAe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AAA,QAAgB,QAAQ;AAAA;;;;;;ADNV;AAKhB;;;;;;;;;;;;;iBCuBgB,cAAA,CAAe,OAAA,GAAU,qBAAA,GAAwB,oBAAoB;;;ADtCrF;;;;AAA6B;AAG7B;;;;AAAoB;AAGpB;;;;;;;AANA,iBEoBgB,YAAA,WAAuB,QAAA,GAAW,QAAA,EAChD,OAAA,EAAS,mBAAA,CAAoB,CAAA,IAC5B,kBAAA;;;AFtBH;;;;AAA6B;AAG7B;;;;AAAoB;AAGpB;;;;;;;;AANA,iBGqBgB,YAAA,WAAuB,QAAA,GAAW,QAAA,EAChD,OAAA,EAAS,mBAAA,CAAoB,CAAA,IAC5B,kBAAA;;;UCjBc,kBAAA;EJNL;EIQV,OAAA,QAAe,WAAA;;EAEf,MAAA,GAAS,KAAA,EAAO,IAAI;EJVO;EIY3B,MAAA;EJTkB;EIWlB,QAAA;EJXkB;EIalB,QAAA;AAAA;AAAA,UAGe,iBAAA;;EAEf,MAAA;EJbA;EIeA,eAAe;AAAA;;;AJbD;AAKhB;;;;;;;;;;;;;;;;;;;;iBIkCgB,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,iBAAiB;;;AJjD3E;;;;AAA6B;AAG7B;;;;AAAoB;AAGpB;;;;;;;;;AAIgB;AAKhB;;;;;;;;;;;;;;;;;;;;;;;;AAfA,iBKwEgB,WAAA,IAAe,OAAA,EAAS,kBAAA,CAAmB,CAAA,IAAK,iBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/dnd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Signal-driven drag and drop for Pyreon — wraps @atlaskit/pragmatic-drag-and-drop",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/pyreon/pyreon/tree/main/packages/fundamentals/dnd#readme",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"lint": "oxlint ."
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@pyreon/core": "^0.
|
|
38
|
-
"@pyreon/reactivity": "^0.
|
|
37
|
+
"@pyreon/core": "^0.36.0",
|
|
38
|
+
"@pyreon/reactivity": "^0.36.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/pragmatic-drag-and-drop": "^1.8.1",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@pyreon/test-utils": "^0.13.
|
|
47
|
-
"@pyreon/typescript": "^0.
|
|
46
|
+
"@pyreon/test-utils": "^0.13.24",
|
|
47
|
+
"@pyreon/typescript": "^0.36.0",
|
|
48
48
|
"@pyreon/vitest-config": "0.13.3",
|
|
49
49
|
"@vitest/browser-playwright": "^4.1.8"
|
|
50
50
|
},
|