Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nosferatu500 committed Apr 4, 2024
1 parent eb5e9ba commit 5082e07
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 69 deletions.
25 changes: 2 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lib"
],
"engines": {
"node": ">=18"
"node": ">=20.9"
},
"prettier": {
"semi": false,
Expand Down Expand Up @@ -97,7 +97,6 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@nosferatu500/react-dnd-scrollzone": "2.0.10",
"lodash.isequal": "^4.5.0",
"react-dnd": "14.0.4",
"react-dnd-html5-backend": "^14.1.0",
Expand Down
21 changes: 0 additions & 21 deletions src/react-sortable-tree.css

This file was deleted.

27 changes: 4 additions & 23 deletions src/react-sortable-tree.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
// @ts-nocheck

import React, { Component } from 'react'
import withScrolling, {
createHorizontalStrength,
createScrollingComponent,
createVerticalStrength,
} from '@nosferatu500/react-dnd-scrollzone'
import isEqual from 'lodash.isequal'
import { DndContext, DndProvider } from 'react-dnd'
import { HTML5Backend } from 'react-dnd-html5-backend'
import { VList, VListHandle } from 'virtua'
import NodeRendererDefault from './node-renderer-default'
import PlaceholderRendererDefault from './placeholder-renderer-default'
import './react-sortable-tree.css'
import TreeNode from './tree-node'
import TreePlaceholder from './tree-placeholder'
import { classnames } from './utils/classnames'
Expand Down Expand Up @@ -207,16 +201,6 @@ class ReactSortableTree extends Component {
this.dndType
)

// Prepare scroll-on-drag options for this list
this.scrollZoneVirtualList = (createScrollingComponent || withScrolling)(
React.forwardRef((props, ref) => {
const { dragDropManager, rowHeight, ...otherProps } = props
return <VList ref={this.listRef} {...otherProps} />
})
)
this.vStrength = createVerticalStrength(slideRegionSize)
this.hStrength = createHorizontalStrength(slideRegionSize)

this.state = {
draggingTreeData: undefined,
draggedNode: undefined,
Expand Down Expand Up @@ -694,14 +678,11 @@ class ReactSortableTree extends Component {
} else {
containerStyle = { height: '100%', ...containerStyle }

const ScrollZoneVirtualList = this.scrollZoneVirtualList
list = (
<ScrollZoneVirtualList
data={rows}
<VList
id="vlist"
ref={this.listRef}
dragDropManager={dragDropManager}
verticalStrength={this.vStrength}
horizontalStrength={this.hStrength}
className="rst__virtualScrollOverride"
style={innerStyle}>
{rows.map((item, index) => {
return this.renderRow(item, {
Expand All @@ -713,7 +694,7 @@ class ReactSortableTree extends Component {
swapLength,
})
})}
</ScrollZoneVirtualList>
</VList>
)
}

Expand Down

0 comments on commit 5082e07

Please sign in to comment.