react-simple-dock 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -19
- package/{dist/index.d.ts → index.d.ts} +5 -0
- package/{dist/index.js → index.js} +3 -0
- package/package.json +6 -66
- package/types.js +1 -0
- package/dist/types.js +0 -6
- /package/{dist/index.css → index.css} +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/utils.d.ts → utils.d.ts} +0 -0
- /package/{dist/utils.js → utils.js} +0 -0
package/README.md
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
A set of React components to create a dockable interface, allowing to arrange and resize tabs.
|
|
4
4
|
|
|
5
|
-
## Installation
|
|
5
|
+
## Installation of the javascript package
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install react-simple-dock
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Installation of the PRET python package
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install pret-simple-dock
|
|
15
|
+
```
|
|
16
|
+
|
|
11
17
|
## Demo
|
|
12
18
|
|
|
13
19
|
[](https://codesandbox.io/p/sandbox/zwgwp3)
|
|
@@ -16,6 +22,7 @@ npm install react-simple-dock
|
|
|
16
22
|
|
|
17
23
|
```tsx
|
|
18
24
|
import React from "react";
|
|
25
|
+
import ReactDOM from "react-dom";
|
|
19
26
|
import { Layout, Panel } from "react-simple-dock";
|
|
20
27
|
import { DndProvider } from "react-dnd";
|
|
21
28
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
@@ -37,25 +44,74 @@ const DEFAULT_CONFIG = {
|
|
|
37
44
|
};
|
|
38
45
|
|
|
39
46
|
const App = () => (
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</div>
|
|
57
|
-
</DndProvider>
|
|
47
|
+
<div style={{ background: "#bdbdbd", width: "100vw", height: "100vh" }}>
|
|
48
|
+
<Layout
|
|
49
|
+
/* optional initial layout config */
|
|
50
|
+
defaultConfig={DEFAULT_CONFIG}
|
|
51
|
+
>
|
|
52
|
+
<Panel key="Panel 1">
|
|
53
|
+
<p>Content 1</p>
|
|
54
|
+
</Panel>
|
|
55
|
+
<Panel key="Panel 2" header={<i>Italic title</i>}>
|
|
56
|
+
<p>Content 2</p>
|
|
57
|
+
</Panel>
|
|
58
|
+
<Panel key="Panel 3">
|
|
59
|
+
<p>Content 3</p>
|
|
60
|
+
</Panel>
|
|
61
|
+
</Layout>
|
|
62
|
+
</div>
|
|
58
63
|
);
|
|
59
64
|
|
|
60
65
|
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(<App />);
|
|
61
66
|
```
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
### Installation
|
|
71
|
+
|
|
72
|
+
Clone the repository:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
git clone https://github.com/percevalw/react-simple-dock.git
|
|
76
|
+
cd react-simple-dock
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Install the dependencies:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yarn install
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Make your changes and run the demo:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
yarn start
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Build the javascript library
|
|
92
|
+
|
|
93
|
+
To build the javascript library:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
yarn build:lib
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Build the PRET python package
|
|
100
|
+
|
|
101
|
+
Ensure `pret` is installed.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
pip install pret
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If you have changed the signature of the components, you will need to update the python stubs.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pret stub . SimpleDock pret/ui/simple_dock/__init__.py
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
To build the python library and make it available in your environment:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install .
|
|
117
|
+
```
|
package/package.json
CHANGED
|
@@ -1,65 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simple-dock",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"main": "
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
6
|
-
"type": "module",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"main": "index.js",
|
|
7
5
|
"description": "Simple dock component for React",
|
|
8
6
|
"repository": "https://github.com/percevalw/react-simple-dock",
|
|
9
7
|
"author": "Perceval Wajsbürt <perceval.wajsburt@gmail.com>",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "react-scripts start",
|
|
12
|
-
"build": "react-scripts build",
|
|
13
|
-
"test": "react-scripts test",
|
|
14
|
-
"eject": "react-scripts eject",
|
|
15
|
-
"build:lib:babel": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__,*.md",
|
|
16
|
-
"build:lib": "rm -rf dist && tsc --build tsconfig.lib.json && cp src/lib/*.css dist && rm -rf lib/",
|
|
17
|
-
"prepublishOnly": "npm run build:lib",
|
|
18
|
-
"build:pret": "jlpm clean && jupyter labextension build .",
|
|
19
|
-
"build:pret:dev": "jlpm clean && jupyter labextension build --development True .",
|
|
20
|
-
"clean": "rm -rf pret/ui/simple_dock/js-extension lib",
|
|
21
|
-
"prepare": "husky install"
|
|
22
|
-
},
|
|
23
8
|
"dependencies": {
|
|
24
9
|
"react-dnd": ">=16.0.1",
|
|
25
10
|
"react-dnd-html5-backend": ">=16.0.1"
|
|
26
11
|
},
|
|
27
12
|
"peerDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"react": ">=
|
|
30
|
-
"react-dom": ">=16.0.0"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@testing-library/dom": "^10.4.0",
|
|
34
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
35
|
-
"@testing-library/react": "^16.2.0",
|
|
36
|
-
"@testing-library/user-event": "^13.5.0",
|
|
37
|
-
"@types/jest": "^27.5.2",
|
|
38
|
-
"@types/node": "^16.18.126",
|
|
39
|
-
"@types/react": "^19.0.10",
|
|
40
|
-
"@types/react-dom": "^19.0.4",
|
|
41
|
-
"babel-cli": "^6.26.0",
|
|
42
|
-
"husky": ">=6",
|
|
43
|
-
"lint-staged": ">=10",
|
|
44
|
-
"prettier": "^3.5.3",
|
|
45
|
-
"react": "^19.0.0",
|
|
46
|
-
"react-app-rewired": "^2.2.1",
|
|
47
|
-
"react-dom": "^19.0.0",
|
|
48
|
-
"react-scripts": "5.0.1",
|
|
49
|
-
"ts-loader": "^9.5.2",
|
|
50
|
-
"typescript": "^5.8.2",
|
|
51
|
-
"web-vitals": "^2.1.4"
|
|
52
|
-
},
|
|
53
|
-
"files": [
|
|
54
|
-
"dist",
|
|
55
|
-
"LICENSE",
|
|
56
|
-
"README.md"
|
|
57
|
-
],
|
|
58
|
-
"jupyterlab": {
|
|
59
|
-
"extension": "src/plugin.ts",
|
|
60
|
-
"schemaDir": "src/schema",
|
|
61
|
-
"outputDir": "pret/ui/simple_dock/js-extension",
|
|
62
|
-
"webpackConfig": "./webpack.jupyter.js"
|
|
13
|
+
"react": ">=17.0.0",
|
|
14
|
+
"react-dom": ">=17.0.0"
|
|
63
15
|
},
|
|
64
16
|
"browserslist": {
|
|
65
17
|
"production": [
|
|
@@ -73,17 +25,5 @@
|
|
|
73
25
|
"last 1 safari version"
|
|
74
26
|
]
|
|
75
27
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
"tabWidth": 4
|
|
79
|
-
},
|
|
80
|
-
"eslintConfig": {
|
|
81
|
-
"extends": [
|
|
82
|
-
"react-app",
|
|
83
|
-
"react-app/jest"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"lint-staged": {
|
|
87
|
-
"*.{js,css,md}": "prettier --write"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
28
|
+
"types": "index.d.ts"
|
|
29
|
+
}
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|