Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
c87715a
docs: fix broken links (#471)
Ephemera May 3, 2019
420d602
Update README to reflect project requirements in contributor section …
hannah Jul 3, 2019
c449524
feat: update react-dnd (#531)
kserjey Oct 14, 2019
5ce9e5b
chore(release): 2.7.0
lifejuggler Oct 14, 2019
f78e45e
Respect addAsFirstChild in addNodeUnderParent (#480)
manuelmager Oct 14, 2019
1b66ade
fixed null error (#514)
shorif2000 Nov 10, 2019
c3882a6
Fix drag hover performance (#503)
wombleton Nov 10, 2019
73aee4a
Update README.md (#493)
dotku Nov 10, 2019
ae87e32
Add propTypes definition to pass latest eslint-plugin-react (#484)
Sheile Nov 10, 2019
a1750f9
build(deps): [security] bump eslint-utils from 1.3.1 to 1.4.3 (#543)
dependabot-preview[bot] Nov 10, 2019
b7d6a1b
build(deps-dev): bump @babel/plugin-transform-modules-commonjs (#544)
dependabot-preview[bot] Nov 10, 2019
fc5eef9
build(deps-dev): bump enzyme-adapter-react-16 from 1.14.0 to 1.15.1 (…
dependabot-preview[bot] Nov 10, 2019
98a5354
build(deps): [security] bump lodash-es from 4.17.11 to 4.17.15 (#547)
dependabot-preview[bot] Nov 10, 2019
9f9f2bb
build(deps): [security] bump lodash.template from 4.4.0 to 4.5.0 (#549)
dependabot-preview[bot] Nov 10, 2019
a255678
build(deps-dev): bump coveralls from 3.0.2 to 3.0.7 (#546)
dependabot-preview[bot] Nov 10, 2019
a22fe79
build(deps): [security] bump mixin-deep from 1.3.1 to 1.3.2 (#552)
dependabot-preview[bot] Nov 10, 2019
dd1654c
build(deps): [security] bump safer-eval from 1.2.3 to 1.3.5 (#553)
dependabot-preview[bot] Nov 10, 2019
0b99a06
build(deps): [security] bump lodash from 4.17.11 to 4.17.15 (#551)
dependabot-preview[bot] Nov 10, 2019
331ef5d
build(deps-dev): bump rollup-plugin-commonjs from 9.2.0 to 9.3.4 (#557)
dependabot-preview[bot] Nov 12, 2019
862bfc9
build(deps-dev): bump codesandbox from 1.2.17 to 2.1.10 (#556)
dependabot-preview[bot] Nov 12, 2019
e11d89a
build(deps-dev): bump babel-loader from 8.0.4 to 8.0.6 (#555)
dependabot-preview[bot] Nov 12, 2019
7b19467
chore(release): 2.7.1
wuweiweiwu Nov 12, 2019
2659cec
build(deps-dev): bump rollup-plugin-babel from 4.0.3 to 4.3.3 (#554)
dependabot-preview[bot] Nov 12, 2019
8615412
fix: don't prettify changelog
wuweiweiwu Nov 12, 2019
e87c9a2
build(deps-dev): bump eslint-config-prettier from 3.3.0 to 6.5.0 (#560)
dependabot-preview[bot] Nov 12, 2019
6d2b0f6
build(deps-dev): bump rollup-plugin-node-resolve from 3.4.0 to 4.2.4 …
dependabot-preview[bot] Nov 12, 2019
d27d070
build(deps): bump react-dnd-html5-backend from 9.3.4 to 9.4.0 (#558)
dependabot-preview[bot] Nov 12, 2019
8e7f83d
fix: website imports
wuweiweiwu Nov 13, 2019
cd4a5af
chore: update dependencies
wuweiweiwu Nov 13, 2019
513c665
build(deps-dev): bump rollup from 1.27.0 to 1.27.3 (#573)
dependabot-preview[bot] Nov 25, 2019
9cf23de
build(deps-dev): bump coveralls from 3.0.7 to 3.0.8 (#572)
dependabot-preview[bot] Nov 25, 2019
c5b0b31
build(deps-dev): bump eslint-config-prettier from 6.5.0 to 6.7.0 (#571)
dependabot-preview[bot] Nov 25, 2019
7c98ac2
build(deps-dev): bump autoprefixer from 9.7.1 to 9.7.2 (#570)
dependabot-preview[bot] Nov 25, 2019
cd8f423
build(deps-dev): bump react-test-renderer from 16.11.0 to 16.12.0 (#565)
dependabot-preview[bot] Nov 25, 2019
95cb249
fix: site
wuweiweiwu Dec 13, 2019
6914959
fix: website pt 2
wuweiweiwu Dec 13, 2019
c664ade
fix: accidentally deleted own styling
wuweiweiwu Dec 13, 2019
26546c3
build(deps-dev): bump react from 16.11.0 to 16.12.0 (#563)
dependabot-preview[bot] Dec 14, 2019
fe6fbba
build(deps-dev): bump react-dom from 16.11.0 to 16.12.0 (#564)
dependabot-preview[bot] Dec 14, 2019
92b3a78
build(deps-dev): bump react-hot-loader from 4.12.17 to 4.12.18 (#567)
dependabot-preview[bot] Dec 14, 2019
6d59ba9
build(deps-dev): bump standard-version from 7.0.0 to 7.0.1 (#568)
dependabot-preview[bot] Dec 14, 2019
befda60
build(deps-dev): bump eslint from 6.6.0 to 6.7.2 (#588)
dependabot-preview[bot] Dec 14, 2019
a66ab3e
build(deps): [security] bump serialize-to-js from 3.0.0 to 3.0.2 (#591)
dependabot-preview[bot] Dec 14, 2019
47bf705
build(deps-dev): bump @babel/core from 7.7.2 to 7.7.5 (#593)
dependabot-preview[bot] Dec 14, 2019
b002b7a
build(deps): bump react-dnd-html5-backend from 9.4.0 to 10.0.2 (#595)
dependabot-preview[bot] Dec 14, 2019
3735588
build(deps-dev): bump @babel/cli from 7.7.0 to 7.7.5 (#596)
dependabot-preview[bot] Dec 14, 2019
c038d53
build(deps-dev): bump rollup from 1.27.3 to 1.27.12 (#600)
dependabot-preview[bot] Dec 14, 2019
d593d38
build(deps-dev): bump coveralls from 3.0.8 to 3.0.9
dependabot-preview[bot] Dec 16, 2019
66703d1
build(deps-dev): bump eslint-plugin-import from 2.18.2 to 2.20.0
dependabot-preview[bot] Jan 13, 2020
bda5cc6
build(deps-dev): bump @babel/plugin-transform-modules-commonjs
dependabot-preview[bot] Jan 14, 2020
106e2eb
build(deps-dev): bump autoprefixer from 9.7.2 to 9.7.4
dependabot-preview[bot] Jan 15, 2020
1b25be4
build(deps-dev): bump rollup from 1.27.12 to 1.29.1 (#635)
dependabot-preview[bot] Jan 22, 2020
7698d11
Merge pull request #628 from frontend-collective/dependabot/npm_and_y…
wuweiweiwu Jan 22, 2020
402afbb
Merge pull request #623 from frontend-collective/dependabot/npm_and_y…
wuweiweiwu Jan 22, 2020
67736ab
Merge pull request #620 from frontend-collective/dependabot/npm_and_y…
wuweiweiwu Jan 22, 2020
58f4532
Merge pull request #604 from frontend-collective/dependabot/npm_and_y…
wuweiweiwu Jan 22, 2020
231ea8e
build(deps-dev): bump @storybook/react from 5.2.6 to 5.3.8 (#637)
dependabot-preview[bot] Jan 22, 2020
8751ee5
build(deps-dev): bump rollup-plugin-postcss from 2.0.3 to 2.0.4 (#644)
dependabot-preview[bot] Jan 26, 2020
540f353
build(deps-dev): bump enzyme-adapter-react-16 from 1.15.1 to 1.15.2 (…
dependabot-preview[bot] Jan 26, 2020
cc126e3
build(deps-dev): bump react-dnd-test-backend from 9.4.0 to 10.0.2 (#602)
dependabot-preview[bot] Jan 26, 2020
aade2dc
build(deps-dev): bump codesandbox from 2.1.10 to 2.1.11 (#642)
dependabot-preview[bot] Jan 26, 2020
a64b8f0
build(deps-dev): bump react-hot-loader from 4.12.18 to 4.12.19 (#640)
dependabot-preview[bot] Jan 26, 2020
f82a3c0
build(deps-dev): bump standard-version from 7.0.1 to 7.1.0 (#647)
dependabot-preview[bot] Mar 6, 2020
95a8f4e
build(deps-dev): bump eslint-plugin-react from 7.16.0 to 7.18.3 (#656)
dependabot-preview[bot] Mar 6, 2020
c96e4b3
build(deps-dev): bump gh-pages from 2.1.1 to 2.2.0 (#650)
dependabot-preview[bot] Mar 6, 2020
eeeefd2
build(deps-dev): bump @storybook/addon-storyshots from 5.2.6 to 5.3.1…
dependabot-preview[bot] Mar 21, 2020
bb905ca
build(deps-dev): bump @storybook/addon-options from 5.2.6 to 5.3.17 (…
dependabot-preview[bot] Mar 21, 2020
11aecdd
build(deps): [security] bump acorn from 5.7.3 to 5.7.4 (#682)
dependabot-preview[bot] Mar 21, 2020
d6749b7
build(deps-dev): bump react-test-renderer from 16.12.0 to 16.13.0 (#681)
dependabot-preview[bot] Mar 21, 2020
be45b3c
build(deps-dev): bump @babel/cli from 7.7.5 to 7.8.4 (#680)
dependabot-preview[bot] Mar 21, 2020
2f6f930
build(deps-dev): bump eslint-config-prettier from 6.7.0 to 6.10.0 (#679)
dependabot-preview[bot] Mar 21, 2020
60a8a85
build(deps-dev): bump @babel/preset-env from 7.7.1 to 7.8.7 (#675)
dependabot-preview[bot] Mar 21, 2020
30749c7
feat: remove current codesandbox website
wuweiweiwu Mar 23, 2020
a3a6f64
chore: remove wrapWithSource
wuweiweiwu Mar 23, 2020
71c4742
chore: update storybook configs
wuweiweiwu Mar 23, 2020
c2c1075
fix: set themes using new api
wuweiweiwu Mar 23, 2020
8e87804
feat: adding FUNDING.yml
wuweiweiwu Mar 23, 2020
d55561e
fix: open collective link
wuweiweiwu Mar 23, 2020
1c1ed8c
Fix broken link in README (#700)
mottox2 May 14, 2020
9aeaf3d
Upgrade to react-dnd@11.1.3 (#747)
TdyP Jul 30, 2020
e528a4c
fix: scroll to search focused tree item (#756)
AKhodykin Jul 30, 2020
e84382d
build(deps): [security] bump elliptic from 6.5.1 to 6.5.3 (#760)
dependabot-preview[bot] Jul 30, 2020
1ae6e4b
build(deps-dev): bump eslint-plugin-react from 7.18.3 to 7.20.5 (#759)
dependabot-preview[bot] Jul 30, 2020
db3c812
build(deps): [security] bump lodash from 4.17.15 to 4.17.19 (#755)
dependabot-preview[bot] Jul 30, 2020
bf313ea
build(deps-dev): bump standard-version from 7.1.0 to 8.0.1 (#754)
dependabot[bot] Jul 30, 2020
888d47e
build(deps-dev): bump @babel/preset-env from 7.8.7 to 7.10.4 (#751)
dependabot-preview[bot] Jul 30, 2020
9d87f81
build(deps-dev): bump codesandbox from 2.1.11 to 2.1.16 (#741)
dependabot-preview[bot] Jul 30, 2020
1501d6a
build(deps-dev): bump coveralls from 3.0.9 to 3.1.0 (#708)
dependabot-preview[bot] Jul 30, 2020
27c217d
Update README.md
wuweiweiwu Jul 30, 2020
0815ca7
chore: update gh issue templates
wuweiweiwu Aug 10, 2020
7a07263
fix: remove outdated links from readme
wuweiweiwu Aug 10, 2020
2a5f741
"chore(release): 2.8.0"
wuweiweiwu Aug 10, 2020
3c29cbf
fix: add correct headers to issue templates
wuweiweiwu Aug 10, 2020
52f0bcf
fix: "Uncaught Invariant Violation: Expected to find a valid target."…
weirDozzz Jun 11, 2021
f482bc7
Update README.md
fritz-c May 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ module.exports = {
],
env: {
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
],
}
}
plugins: ['@babel/plugin-transform-modules-commonjs'],
},
},
};
16 changes: 8 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module.exports = {
extends: [
'eslint-config-airbnb',
'prettier',
'prettier/react'
],
extends: ['eslint-config-airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
env: {
browser: true,
jest: true
jest: true,
},
rules: {
'react/destructuring-assignment': 0,
'react/jsx-filename-extension': 0,
'react/prefer-stateless-function': 0,
'react/no-did-mount-set-state': 0,
'react/sort-comp': 0
'react/sort-comp': 0,
'react/jsx-props-no-spreading': 0,
'react/prop-types': 0,
'no-shadow': 0,
'jsx-a11y/label-has-associated-control': 0,
},
}
};
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: wuweiweiwu
open_collective: react-sortable-tree
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Bug Report
about: Bugs, missing documentation, or unexpected behavior 🤔.
---

# Reporting a Bug?

Please include either a failing unit test or a simple reproduction. You can start by forking the [CodeSandbox example](https://codesandbox.io/s/wkxvy3z15w)
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Feature request
about: Ideas and suggestions
---

# Requesting a Feature?

Provide as much information as possible about your requested feature. Here are a few questions you may consider answering:

- What's your use case? (Tell me about your application and what problem you're trying to solve.)
- What interface do you have in mind? (What new properties or methods do you think might be helpful?)
- Can you point to similar functionality with any existing libraries or components? (Working demos can be helpful.)
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
2 changes: 0 additions & 2 deletions .storybook/addons.js

This file was deleted.

16 changes: 0 additions & 16 deletions .storybook/config.js

This file was deleted.

3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
stories: ['../stories/index.js'],
};
11 changes: 11 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { addons } from '@storybook/addons';
import { create } from '@storybook/theming/create';

addons.setConfig({
theme: create({
base: 'light',
brandTitle: 'React Sortable Tree',
brandUrl: 'https://github.com/frontend-collective/react-sortable-tree',
gridCellSize: 12,
}),
});
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
# Change Log
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.8.0](https://github.com/frontend-collective/react-sortable-tree/compare/v2.7.1...v2.8.0) (2020-08-10)


### Features

* adding FUNDING.yml ([8e87804](https://github.com/frontend-collective/react-sortable-tree/commit/8e87804195fcc6cfc98ac0c8ae3a6f8511c05898))
* remove current codesandbox website ([30749c7](https://github.com/frontend-collective/react-sortable-tree/commit/30749c74deba9b254c674bc0ded4fe2e6eb4cdce))


### Bug Fixes

* accidentally deleted own styling ([c664ade](https://github.com/frontend-collective/react-sortable-tree/commit/c664adee1cc045a76a9f89c38b644aa996f38365))
* don't prettify changelog ([8615412](https://github.com/frontend-collective/react-sortable-tree/commit/86154120b0814a72ad45b23b4a24f45f2bbac225))
* open collective link ([d55561e](https://github.com/frontend-collective/react-sortable-tree/commit/d55561e91b6abc7268be261c55c95a1fac5627e9))
* remove outdated links from readme ([7a07263](https://github.com/frontend-collective/react-sortable-tree/commit/7a07263719044709ea177cd7d59ed0c0d56e86d0))
* scroll to search focused tree item ([#756](https://github.com/frontend-collective/react-sortable-tree/issues/756)) ([e528a4c](https://github.com/frontend-collective/react-sortable-tree/commit/e528a4c6167cf64a6c0ff43caf22be45cccb21e3))
* set themes using new api ([c2c1075](https://github.com/frontend-collective/react-sortable-tree/commit/c2c1075dfab844412f375174697ab30692b6055b))
* site ([95cb249](https://github.com/frontend-collective/react-sortable-tree/commit/95cb249e24fb8cab2134567f71447bd728228c1e))
* website imports ([8e7f83d](https://github.com/frontend-collective/react-sortable-tree/commit/8e7f83dc483c4697edd5ae29080316cf68de248a))
* website pt 2 ([6914959](https://github.com/frontend-collective/react-sortable-tree/commit/69149596c884cb28c83c17f238c7d7d186271c44))

<a name="2.7.1"></a>
## [2.7.1](https://github.com/frontend-collective/react-sortable-tree/compare/v2.7.0...v2.7.1) (2019-11-12)



<a name="2.7.0"></a>
# [2.7.0](https://github.com/frontend-collective/react-sortable-tree/compare/v2.6.2...v2.7.0) (2019-10-14)


### Features

* update react-dnd ([#531](https://github.com/frontend-collective/react-sortable-tree/issues/531)) ([c449524](https://github.com/frontend-collective/react-sortable-tree/commit/c449524))



<a name="2.6.2"></a>
## [2.6.2](https://github.com/frontend-collective/react-sortable-tree/compare/v2.6.1...v2.6.2) (2019-03-21)

Expand Down
10 changes: 0 additions & 10 deletions ISSUE_TEMPLATE.md

This file was deleted.

59 changes: 33 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Note on maintenance

This library is not actively maintained. [Please find and discuss alternatives here](https://github.com/frontend-collective/react-sortable-tree/discussions/942).

<div align="center">
<img src="https://cloud.githubusercontent.com/assets/4413963/18860410/26f64de8-84b8-11e6-9284-350308eed30a.png"/>
</div>
Expand All @@ -12,7 +16,7 @@
[![Coverage Status](https://coveralls.io/repos/github/frontend-collective/react-sortable-tree/badge.svg?branch=master)](https://coveralls.io/github/frontend-collective/react-sortable-tree?branch=master)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

> A React component for Drag-and-drop sortable representation of hierarchical data. Checkout the [demo](https://frontend-collective.github.io/react-sortable-tree/) for a demonstration of some basic features. Checkout the [storybook](https://frontend-collective.github.io/react-sortable-tree/storybook) for advanced usage.
> A React component for Drag-and-drop sortable representation of hierarchical data. Checkout the [Storybook](https://frontend-collective.github.io/react-sortable-tree/) for a demonstration of some basic and advanced features.

<div align="center">
<img src="https://cloud.githubusercontent.com/assets/4413963/19334888/2be8261c-913a-11e6-9508-4b347ae114b4.gif"/>
Expand Down Expand Up @@ -74,7 +78,10 @@ export default class Tree extends Component {
super(props);

this.state = {
treeData: [{ title: 'Chicken', children: [{ title: 'Egg' }] }],
treeData: [
{ title: 'Chicken', children: [{ title: 'Egg' }] },
{ title: 'Fish', children: [{ title: 'fingerline' }] },
],
};
}

Expand Down Expand Up @@ -113,7 +120,7 @@ export default class Tree extends Component {
| searchFocusOffset | number | Outline the <`searchFocusOffset`>th node and scroll to it. |
| onlyExpandSearchedNodes | boolean | Only expand the nodes that match searches. Collapses all other nodes. Defaults to `false`. |
| searchFinishCallback | func | Get the nodes that match the search criteria. Used for counting total matches, etc.<div>`(matches: { node: object, path: number[] or string[], treeIndex: number }[]): void`</div> |
| dndType | string | String value used by [react-dnd](http://react-dnd.github.io/react-dnd/docs-overview.html) (see overview at the link) for dropTargets and dragSources types. If not set explicitly, a default value is applied by react-sortable-tree for you for its internal use. **NOTE:** Must be explicitly set and the same value used in order for correct functioning of external nodes |
| dndType | string | String value used by [react-dnd](https://react-dnd.github.io/react-dnd/about) (see overview at the link) for dropTargets and dragSources types. If not set explicitly, a default value is applied by react-sortable-tree for you for its internal use. **NOTE:** Must be explicitly set and the same value used in order for correct functioning of external nodes |
| shouldCopyOnOutsideDrop | func or bool | Return true, or a callback returning true, and dropping nodes to react-dnd drop targets outside of the tree will not remove them from the tree. Defaults to `false`. <div>`({ node: object, prevPath: number[] or string[], prevTreeIndex: number, }): bool`</div> |
| reactVirtualizedListProps | object | Custom properties to hand to the internal [react-virtualized List](https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types) |
| style | object | Style applied to the container wrapping the tree (style defaults to `{height: '100%'}`) |
Expand All @@ -132,23 +139,23 @@ Need a hand turning your flat data into nested tree data?
Want to perform add/remove operations on the tree data without creating your own recursive function?
Check out the helper functions exported from [`tree-data-utils.js`](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js).

- [**`getTreeFromFlatData`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L972): Convert flat data (like that from a database) into nested tree data.
- [**`getFlatDataFromTree`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L939): Convert tree data back to flat data.
- [**`addNodeUnderParent`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L612): Add a node under the parent node at the given path.
- [**`removeNode`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L533): For a given path, get the node at that path, treeIndex, and the treeData with that node removed.
- [**`removeNodeAtPath`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L505): For a given path, remove the node and return the treeData.
- [**`changeNodeAtPath`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L409): Modify the node object at the given path.
- [**`map`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L359): Perform a change on every node in the tree.
- [**`walk`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L326): Visit every node in the tree in order.
- [**`getDescendantCount`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L60): Count how many descendants this node has.
- [**`getVisibleNodeCount`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L248): Count how many visible descendants this node has.
- [**`getVisibleNodeInfoAtIndex`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L286): Get the <targetIndex>th visible node in the tree data.
- [**`toggleExpandedForAll`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L389): Expand or close every node in the tree.
- [**`getNodeAtPath`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L572): Get the node at the input path.
- [**`insertNode`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L878): Insert the input node at the specified depth and minimumTreeIndex.
- [**`find`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L1070): Find nodes matching a search query in the tree.
- [**`isDescendant`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L1020): Check if a node is a descendant of another node.
- [**`getDepth`**](https://github.com/frontend-collective/react-sortable-tree/blob/master/src/utils/tree-data-utils.js#L1038): Get the longest path in the tree.
- **`getTreeFromFlatData`**: Convert flat data (like that from a database) into nested tree data.
- **`getFlatDataFromTree`**: Convert tree data back to flat data.
- **`addNodeUnderParent`**: Add a node under the parent node at the given path.
- **`removeNode`**: For a given path, get the node at that path, treeIndex, and the treeData with that node removed.
- **`removeNodeAtPath`**: For a given path, remove the node and return the treeData.
- **`changeNodeAtPath`**: Modify the node object at the given path.
- **`map`**: Perform a change on every node in the tree.
- **`walk`**: Visit every node in the tree in order.
- **`getDescendantCount`**: Count how many descendants this node has.
- **`getVisibleNodeCount`**: Count how many visible descendants this node has.
- **`getVisibleNodeInfoAtIndex`**: Get the <targetIndex>th visible node in the tree data.
- **`toggleExpandedForAll`**: Expand or close every node in the tree.
- **`getNodeAtPath`**: Get the node at the input path.
- **`insertNode`**: Insert the input node at the specified depth and minimumTreeIndex.
- **`find`**: Find nodes matching a search query in the tree.
- **`isDescendant`**: Check if a node is a descendant of another node.
- **`getDepth`**: Get the longest path in the tree.

## Themes

Expand Down Expand Up @@ -197,27 +204,27 @@ import { SortableTreeWithoutDndContext as SortableTree } from 'react-sortable-tr

Please read the [Code of Conduct](CODE_OF_CONDUCT.md). I actively welcome pull requests :)

After cloning the repository and running `npm install` inside, you can use the following commands to develop and build the project.
After cloning the repository and running `yarn install` inside, you can use the following commands to develop and build the project.

```sh
# Starts a webpack dev server that hosts a demo page with the component.
# It uses react-hot-loader so changes are reflected on save.
npm start
yarn start

# Start the storybook, which has several different examples to play with.
# Also hot-reloaded.
npm run storybook
yarn run storybook

# Runs the library tests
npm test
yarn test

# Lints the code with eslint
npm run lint
yarn run lint

# Lints and builds the code, placing the result in the dist directory.
# This build is necessary to reflect changes if you're
# `npm link`-ed to this repository from another local project.
npm run build
yarn run build
```

Pull requests are welcome!
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/react-dnd-html5-backend.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
import TestBackend from 'react-dnd-test-backend';
import { TestBackend } from 'react-dnd-test-backend';

module.exports = TestBackend;
module.exports = { HTML5Backend: TestBackend };
Loading