-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typings for DropTarget and DragSource decorators (#1134)
* Fix typings for DropTarget decorator The decorator function has to take a component accepting both, props and collected props - but it should return a component which only takes the own props * Fix typings for the DragSource decorator Same fix as for the DropTarget decorator * fix: correct typings in PR * fix: correct typings due to types issues in docs * refactor: update pr with typings per @lukyth suggestions This is a WIP - the TS decorators in examples are broken * docs: move documentation examples into a separate package This allows us to perform typescript validation on the examples outside of the Gatsby site, which uses babel and misses some issues. Unit tests for the examples will eventually land here as well. Ultimately, the text portion of these examples will go back into Gatsby as Markdown, including the functional example as a custom component. * docs: wire up the example pages to use the examples package * docs: upgrade typescript, correct ts issue in examples * docs: get docsite running
- Loading branch information
1 parent
48a1bf2
commit b0364b1
Showing
120 changed files
with
648 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "react-dnd-documentation-examples", | ||
"version": "5.0.0", | ||
"private": true, | ||
"description": "Drag and Drop for React", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/react-dnd/react-dnd.git" | ||
}, | ||
"license": "BSD-3-Clause", | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"build": "tsc", | ||
"test": "run-s clean build", | ||
"start": "tsc -w --preserveWatchOutput" | ||
}, | ||
"dependencies": { | ||
"@types/faker": "^4.1.4", | ||
"@types/styled-components": "^4.0.3", | ||
"dnd-core": "^4.0.5", | ||
"faker": "^4.1.0", | ||
"hoist-non-react-statics": "^2.5.0", | ||
"immutability-helper": "^2.8.1", | ||
"invariant": "^2.1.0", | ||
"lodash": "^4.17.11", | ||
"react-dnd": "^5.0.0", | ||
"react-dnd-html5-backend": "^5.0.1", | ||
"recompose": "^0.27.1", | ||
"shallowequal": "^1.1.0", | ||
"styled-components": "^4.0.3" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "16.3.14", | ||
"@types/react-dom": "16.0.9", | ||
"npm-run-all": "^4.1.3", | ||
"react": "^16.6.0", | ||
"rimraf": "^2.6.2", | ||
"typescript": "^3.1.6" | ||
}, | ||
"peerDependencies": { | ||
"react": ">= 16.3" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/documentation-examples/src/00 Chessboard/Overlay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react' | ||
|
||
export interface OverlayProps { | ||
color: string | ||
} | ||
|
||
const Overlay: React.SFC<OverlayProps> = ({ color }) => { | ||
return ( | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
height: '100%', | ||
width: '100%', | ||
zIndex: 1, | ||
opacity: 0.5, | ||
backgroundColor: color, | ||
}} | ||
/> | ||
) | ||
} | ||
|
||
export default Overlay |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.