Skip to content

Latest commit

 

History

History
176 lines (125 loc) · 12.2 KB

File metadata and controls

176 lines (125 loc) · 12.2 KB

@dnd-kit/solid

0.5.1

Patch Changes

  • Updated dependencies [e00be08]:
    • @dnd-kit/dom@0.5.1
    • @dnd-kit/abstract@0.5.1
    • @dnd-kit/state@0.5.1

0.5.0

Minor Changes

  • #2058 2dd8d0e Thanks @timagixe! - Allow useSortable, createSortable and Sortable to disable dragging and dropping independently with a disabled object while preserving the existing boolean behavior.

Patch Changes

  • #2031 33ce050 Thanks @clauderic! - Fixed DragDropProvider evaluating its children JSX twice on initial mount in @dnd-kit/solid. The provider now strips children from the props it forwards to DragDropManager, preventing the manager constructor's spread ({...input}) from invoking Solid's children getter and synthesizing an orphan component subtree whose reactive scope was never disposed.

  • #2043 a6bd445 Thanks @clauderic! - Include sourcemap files in published packages. The build emits .map files alongside each entry point and writes //# sourceMappingURL=... comments into the bundles, but the files field in package.json did not list the maps, so they were excluded from the npm tarball. Bundlers attempting to load the referenced maps would fail with ENOENT, producing warnings (or build failures in strict CI setups).

  • Updated dependencies [e4d1a7e, e25b1b1, 00fd955, e4792f3, f23afe0, 2dd8d0e]:

    • @dnd-kit/abstract@0.5.0
    • @dnd-kit/dom@0.5.0
    • @dnd-kit/state@0.5.0

0.4.0

Minor Changes

  • #1915 9b24dff Thanks @clauderic! - Redesign event type system to follow the DOM EventMap pattern. Introduces DragDropEventMap for event object types and DragDropEventHandlers for event handler signatures, replacing the ambiguously named DragDropEvents. Event type aliases (CollisionEvent, DragStartEvent, etc.) now derive directly from DragDropEventMap rather than using Parameters<> extraction.

    Migration guide

    • DragDropEvents has been split into two types:
      • DragDropEventMap — maps event names to event object types (like WindowEventMap)
      • DragDropEventHandlers — maps event names to (event, manager) => void handler signatures
    • If you were importing DragDropEvents to type event objects, use DragDropEventMap instead:
      // Before
      type MyEvent = Parameters<DragDropEvents<D, P, M>['dragend']>[0];
      // After
      type MyEvent = DragDropEventMap<D, P, M>['dragend'];
    • If you were importing DragDropEvents to type event handlers, use DragDropEventHandlers instead:
      // Before
      const handler: DragDropEvents<D, P, M>['dragend'] = (event, manager) => {};
      // After
      const handler: DragDropEventHandlers<D, P, M>['dragend'] = (
        event,
        manager
      ) => {};
    • The DragDropEvents re-export from @dnd-kit/react and @dnd-kit/solid has been removed. Import DragDropEventMap or DragDropEventHandlers from @dnd-kit/abstract directly if needed.
    • Convenience aliases (CollisionEvent, DragStartEvent, DragEndEvent, etc.) are unchanged and continue to work as before.
  • #1938 e69387d Thanks @clauderic! - Added per-entity plugin configuration and moved feedback from the Draggable entity to the Feedback plugin.

    Draggable entities now accept a plugins property for per-entity plugin configuration, using the existing Plugin.configure() pattern. Plugins can read per-entity options via source.pluginConfig(PluginClass).

    The feedback property ('default' | 'move' | 'clone' | 'none') has been moved from the Draggable entity to FeedbackOptions. Drop animation can also now be configured per-draggable.

    Plugins listed in an entity's plugins array are auto-registered on the manager if not already present. The Sortable class now uses this generic mechanism instead of its own custom registration logic.

    Migration guide

    The feedback property has been moved from the draggable/sortable hook input to per-entity Feedback plugin configuration.

    Before:

    import {FeedbackType} from '@dnd-kit/dom';
    
    useDraggable({id: 'item', feedback: 'clone'});
    useSortable({id: 'item', index: 0, feedback: 'clone'});

    After:

    import {Feedback} from '@dnd-kit/dom';
    
    useDraggable({
      id: 'item',
      plugins: [Feedback.configure({feedback: 'clone'})],
    });
    useSortable({
      id: 'item',
      index: 0,
      plugins: (defaults) => [
        ...defaults,
        Feedback.configure({feedback: 'clone'}),
      ],
    });

    Drop animation can now be configured per-draggable:

    useDraggable({
      id: 'item',
      plugins: [Feedback.configure({feedback: 'clone', dropAnimation: null})],
    });

Patch Changes

0.3.2

Patch Changes

  • Updated dependencies [7260746]:
    • @dnd-kit/dom@0.3.2
    • @dnd-kit/abstract@0.3.2
    • @dnd-kit/state@0.3.2

0.3.1

Patch Changes

  • Updated dependencies [4341114]:
    • @dnd-kit/abstract@0.3.1
    • @dnd-kit/dom@0.3.1
    • @dnd-kit/state@0.3.1

0.3.0

Minor Changes

  • 6a59647 Thanks @clauderic! - Allow plugins, sensors, and modifiers to accept a function that receives the defaults, making it easy to extend or configure them without replacing the entire array.

    // Add a plugin alongside the defaults
    const manager = new DragDropManager({
      plugins: (defaults) => [...defaults, MyPlugin],
    });
    // Configure a default plugin in React
    <DragDropProvider
      plugins={(defaults) => [
        ...defaults,
        Feedback.configure({dropAnimation: null}),
      ]}
    />

    Previously, passing plugins, sensors, or modifiers would replace the defaults entirely, requiring consumers to import and spread defaultPreset. The function form receives the default values as an argument, so consumers can add, remove, or configure individual entries without needing to know or maintain the full default list.

  • #1881 69f2772 Thanks @clauderic! - Add @dnd-kit/solid adapter package for SolidJS

  • 68e44de Thanks @clauderic! - Add isSortableOperation type guard and export SortableDraggable/SortableDroppable types.

    isSortableOperation(operation) narrows a DragOperationSnapshot so that source is typed as SortableDraggable and target as SortableDroppable, providing typed access to sortable-specific properties like index, initialIndex, group, and initialGroup.

    Re-exported from all framework packages (@dnd-kit/react/sortable, @dnd-kit/vue/sortable, @dnd-kit/svelte/sortable, @dnd-kit/solid/sortable).

Patch Changes

  • 5d64078 Thanks @clauderic! - Add dropAnimation prop to the DragOverlay component to allow consumers to disable or customize the drop animation that plays when a drag operation ends. Set to null to disable, pass {duration, easing} to customize timing, or provide a custom animation function for full control.

  • Updated dependencies [6a59647, 5d64078, 863ce2b, 863ce2b, e8ae539, 41d7e27, 68e44de]:

    • @dnd-kit/abstract@0.3.0
    • @dnd-kit/dom@0.3.0
    • @dnd-kit/state@0.3.0