Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce useDndMonitor hook #187

Merged
merged 3 commits into from
Apr 18, 2021
Merged

Introduce useDndMonitor hook #187

merged 3 commits into from
Apr 18, 2021

Conversation

clauderic
Copy link
Owner

@clauderic clauderic commented Apr 5, 2021

This PR introduces the useDndMonitor hook. The useDndMonitor hook can be used within components wrapped in a DndContext provider to monitor the different drag and drop events that happen for that DndContext.

Example usage:

import {DndContext, useDndMonitor} from '@dnd-kit/core';

function App() {
  return (
    <DndContext>
      <Component />
    </DndContext>
  );
}

function Component() {
  useDndMonitor({
    onDragStart(event) {},
    onDragMove(event) {},
    onDragOver(event) {},
    onDragEnd(event) {},
    onDragCancel(event) {},
  })
}

@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2021

🦋 Changeset detected

Latest commit: 1beff9a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@dnd-kit/accessibility Patch
@dnd-kit/core Major
@dnd-kit/modifiers Patch
@dnd-kit/sortable Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2021

Size Change: +644 B (+1%)

Total Size: 57.3 kB

Filename Size Change
packages/accessibility/dist/accessibility.cjs.development.js 640 B +42 B (+7%) 🔍
packages/accessibility/dist/accessibility.cjs.production.min.js 486 B +25 B (+5%) 🔍
packages/accessibility/dist/accessibility.esm.js 503 B +46 B (+10%) ⚠️
packages/core/dist/core.cjs.development.js 15.2 kB +181 B (+1%)
packages/core/dist/core.cjs.production.min.js 9.79 kB +150 B (+2%)
packages/core/dist/core.esm.js 15 kB +200 B (+1%)
ℹ️ View Unchanged
Filename Size Change
packages/accessibility/dist/index.js 148 B 0 B
packages/core/dist/index.js 141 B 0 B
packages/modifiers/dist/index.js 144 B 0 B
packages/modifiers/dist/modifiers.cjs.development.js 642 B 0 B
packages/modifiers/dist/modifiers.cjs.production.min.js 471 B 0 B
packages/modifiers/dist/modifiers.esm.js 561 B 0 B
packages/sortable/dist/index.js 144 B 0 B
packages/sortable/dist/sortable.cjs.development.js 3.78 kB 0 B
packages/sortable/dist/sortable.cjs.production.min.js 2.48 kB 0 B
packages/sortable/dist/sortable.esm.js 3.66 kB 0 B
packages/utilities/dist/index.js 144 B 0 B
packages/utilities/dist/utilities.cjs.development.js 1.34 kB 0 B
packages/utilities/dist/utilities.cjs.production.min.js 802 B 0 B
packages/utilities/dist/utilities.esm.js 1.25 kB 0 B

compressed-size-action

@clauderic clauderic marked this pull request as ready for review April 18, 2021 02:55
@clauderic clauderic merged commit b406cb9 into master Apr 18, 2021
@clauderic clauderic deleted the use-dnd-monitor branch April 18, 2021 02:55
@github-actions github-actions bot mentioned this pull request Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant