[frontend] chore(deps): update dependency react-grid-layout to v2 #4588
+6
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.5.3→2.2.2Release Notes
STRML/react-grid-layout (react-grid-layout)
v2.2.2Compare Source
🧪 Tests
🔧 Internal Changes
v2.2.1Compare Source
Bug Fixes
calcDragPositionfrom default position strategies since react-draggable handles parent-relative coordinates correctly. #2223compactor.compact()instead of the legacycompact()function. Added optionalcompactorprop to hooks (useGridLayout,useResponsiveLayout) that takes precedence overcompactType/allowOverlap. Fixed negative coordinate handling in compactors. #2222, fixes #2213removeDroppingPlaceholderidempotent and prevented negative counter values. #2220, fixes #2210Internal Changes
utils-compat.ts,responsive-compat.ts,calculate-compat.ts). These were internal implementation details and were never part of the public API.onMove()method fromCompactorinterface. Custom compactors should implement onlycompact().v2.2.0Compare Source
Bug Fixes
layoutRefpattern from GridLayout to GridItem's constraint context. #2214, fixes #2210dropConfig.onDragOverbeing ignored. The v2 API'sonDragOvercallback is now properly called when provided. #2215, fixes #2212compact()method never being called. GridLayout was extracting properties but ignoring the method implementations. #2216, fixes #2213calcStyle()andcalcDragPosition()methods never being called. Custom position strategies can now fully override positioning behavior. #2217thresholdproperty (default 3px for v2 API). Drag callbacks now wait until mouse moves the threshold distance before firing, preventing accidental drags on click. Legacy API uses threshold=0 for backwards compatibility. #2217, fixes #1341, #1401v2.1.1Compare Source
Bug Fixes
allowOverlapnot working in legacy mode. AddednoOverlapCompactorfor whencompactType=nullandallowOverlap=true. #2207layoutRefpattern to prevent callbacks from being recreated on every layout change. #2208layoutsprop. Added separate ref to track props vs state changes. #2209v2.1.0Compare Source
New Features
Pluggable Layout Constraints System
A new constraints system allows custom validation and transformation of layout items during drag and resize operations. #2190
Fast Compactors for Large Layouts
New O(n log n) compactors in
react-grid-layout/extrasfor layouts with 200+ items:fastVerticalCompactor- Up to 45x faster than standard vertical compaction. #2184fastHorizontalCompactor- Up to 74x faster than standard horizontal compaction. #2189, #2193Wrap Compactor
New
wrapCompactorfor paragraph-style layouts where items flow left-to-right and wrap to the next row. #2186Improved Examples
Bug Fixes
measureBeforeMountswitches from placeholder. #2198user-select: nonefrom grid items to restore auto-scroll behavior. #2188Tests
calcXYandcalcWH. #2185Internal Changes
v2.0.0Compare Source
Version 2 is a complete TypeScript rewrite with a modernized hooks-based API. See the RFC for the full design document.
Highlights
@types/react-grid-layoutneededuseContainerWidth,useGridLayout, anduseResponsiveLayouthooksgridConfig,dragConfig,resizeConfig,positionStrategy,compactor)react-grid-layout/legacyBreaking Changes
See the migration section in the README for detailed examples.
widthProp RequiredThe grid no longer auto-measures width. Use the new
useContainerWidthhook:Or use the legacy wrapper for backwards compatibility:
onDragStartThresholdonDragStartnow fires after 3px of mouse movement, not onmousedown. This fixes #1341 and #1401. UseonMouseDowndirectly on grid items if you need immediate response.Immutable Callback Parameters
Callback parameters (
layoutItem,placeholder) are now read-only. Mutating them inonResize/onDragcallbacks no longer works. UseonLayoutChangeor item constraints (minW,maxW, etc.) instead.data-gridProp in Legacy OnlyThe v2 API requires explicit
layoutprop. Thedata-gridpattern is only available via the legacy wrapper (react-grid-layout/legacy).Pluggable Compaction Algorithms
Compaction is now pluggable via the
Compactorinterface. The default compaction algorithm remains the same as v1 for backwards compatibility. For large layouts (200+ items), an optional O(n log n) fast compactor is available inreact-grid-layout/extras:Other Breaking Changes
verticalCompactprop removed - UsecompactType={null}orcompactor={noCompactor}New Features
Entry Points
Hooks
useContainerWidth()- Reactive container width measurement with ResizeObserveruseGridLayout()- Core layout state management for custom implementationsuseResponsiveLayout()- Responsive breakpoint managementComposable Configuration Interfaces
Pluggable Compactors
Create custom compaction algorithms by implementing the
Compactorinterface:Position Strategies
Control CSS positioning with the
PositionStrategyinterface:GridBackground Component
New optional component to visualize the grid structure:
Core Utilities
New
calcGridCellDimensionsutility for building custom grid overlays:React 18 Compatibility
flushSyncwarnings.flushSyncusage from drag and resize handlers.Bugfixes
moveDroppingItemwhereshouldDragwould incorrectly evaluate totruewhen only thetopposition changed.nodeis falsy inonResizeHandler.Internal Changes
src/core/(pure TS),src/react/(React bindings),src/legacy/(v1 compatibility)lib/folder and Flow configurationMigration Guide
Quick migration (no code changes):
Full migration (recommended for new features):
WidthProviderHOC withuseContainerWidthhookdata-gridprops with explicitlayoutpropgridConfig,dragConfig, etc.) for cleaner propsonLayoutChangeinsteadSee the README for detailed examples
Configuration
📅 Schedule: Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday ( * 0-4,22-23 * * 1-5 ), Only on Sunday and Saturday ( * * * * 0,6 ) in timezone Europe/Paris, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.