- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL - 修复 HomePage.tsx 中所有图片引用 - 修复 CoursePage.tsx 中所有图片引用 - 确保图片在 GitHub Pages 上正确加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8.6 KiB
@dnd-kit/utilities
3.2.2
Patch Changes
3.2.1
Patch Changes
3.2.0
Minor Changes
-
#748
59ca82bThanks @clauderic! - Introduced thefindFirstFocusableNodeutility function that returns the first focusable node within a given HTMLElement, or the element itself if it is focusable. -
#733
035021aThanks @clauderic! - Introduced theuseEventhook based on implementation breakdown in the RFC. In the future, this hook will be used as a polyfill if the native React hook is unavailble.
3.1.0
Minor Changes
-
#518
6310227Thanks @clauderic! - Major internal refactor of measuring and collision detection.Summary of changes
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions.
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump.
Breaking changes:
- By default,
@dnd-kitnow ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers.- Transforms applied to the droppable and draggable nodes are ignored by default, because the recommended approach for moving items on the screen is to use the transform property, which can interfere with the calculation of collisions.
- Consumers can choose an alternate approach that does consider transforms for specific use-cases if needed by configuring the measuring prop of . Refer to the example.
- Reduced the number of concepts related to measuring from
ViewRect,LayoutRectto just a single concept ofClientRect.- The
ClientRectinterface no longer holds theoffsetTopandoffsetLeftproperties. For most use-cases, you can replaceoffsetTopwithtopandoffsetLeftwithleft. - Replaced the following exports from the
@dnd-kit/corepackage withgetClientRect:getBoundingClientRectgetViewRectgetLayoutRectgetViewportLayoutRect
- The
- Removed
translatedRectfrom theSensorContextinterface. Replace usage withcollisionRect. - Removed
activeNodeClientRecton theDndContextinterface. Replace withactiveNodeRect.
- By default,
-
528c67eThanks @clauderic! - Introduced theuseLatestValuehook, which returns a ref that holds the latest value of a given argument. Optionally, the second argument can be used to customize the dependencies passed to the effect.
Patch Changes
- #561
02edd26Thanks @clauderic! - - TheuseNodeRefhook'sonChangeargument now receives both the current node and the previous node that were attached to the ref.- The
onChangeargument is only called if the previous node differs from the current node
- The
3.0.2
Patch Changes
- #532
dfa8d69Thanks @Nauss! - fix:isWindowhas been updated to support checking wether an element is a window object in Electron applications.
3.0.1
Patch Changes
-
#509
1c6369eThanks @clauderic! - Helpers have been updated to support rendering in foreignwindowcontexts (viaReactDOM.renderorReactDOM.createPortal).For example, checking if an element is an instance of an
HTMLElementis normally done like so:if (element instanceof HTMLElement)However, when rendering in a different window, this can return false even if the element is indeed an HTMLElement, because this code is equivalent to:
if (element instanceof window.HTMLElement)And in this case, the
windowof theelementis different from the main execution contextwindow, because we are rendering via a portal into another window.This can be solved by finding the local window of the element:
const elementWindow = element.ownerDocument.defaultView; if (element instanceof elementWindow.HTMLElement)
3.0.0
Major Changes
- #373
1f5ca27Thanks @clauderic! - Added react to peerDependencies of @dnd-kit/utilities
Minor Changes
- #334
13be602Thanks @trentmwillis! - MoveCoordinatesinterface along withgetEventCoordinates,isMouseEventandisTouchEventhelpers to @dnd-kit/utilities
Patch Changes
- #437
0e628bcThanks @chestozo! - Added PointerEvent support to thegetEventCoordinatesmethod. This fixes testing the PointerSensor with Cypress (#436)
2.0.0
Major Changes
-
a9d92cf#174 Thanks @clauderic! - Distributed assets now only target modern browsers. Browserlist config:defaults last 2 version not IE 11 not deadIf you need to support older browsers, include the appropriate polyfills in your project's build process.
1.0.3
Patch Changes
6a5c8a1#154 Thanks @clauderic! - Update implementation of FirstArgument
1.0.2
Patch Changes
423610c#56 Thanks @clauderic! - Add MIT license to package.json and distributed files
1.0.1
Patch Changes
0b343c7#52 Thanks @clauderic! - Add repository entry to package.json files
1.0.0
Major Changes
2912350Thanks @clauderic! - Initial public release.
0.1.0
Minor Changes
7bd4568#30 - Initial beta release, authored by @clauderic.