react-simple-dock 0.1.0 → 0.1.1
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 +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ A set of React components to create a dockable interface, allowing to arrange an
|
|
|
8
8
|
npm install react-simple-dock
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Demo
|
|
12
|
+
|
|
13
|
+
[](https://codesandbox.io/p/sandbox/zwgwp3)
|
|
14
|
+
|
|
11
15
|
## Usage
|
|
12
16
|
|
|
13
17
|
```tsx
|
|
@@ -55,7 +59,3 @@ const App = () => (
|
|
|
55
59
|
|
|
56
60
|
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(<App />);
|
|
57
61
|
```
|
|
58
|
-
|
|
59
|
-
## Demo
|
|
60
|
-
|
|
61
|
-
[](https://codesandbox.io/s/react-simple-dock-1j2j2?fontsize=14&hidenavigation=1&theme=dark)
|
package/dist/index.js
CHANGED
|
@@ -223,19 +223,19 @@ const Overlay = ({ panelElements, onDrop, rootConfig, }) => {
|
|
|
223
223
|
if (config.kind === "row" || config === rootConfig) {
|
|
224
224
|
const zoneWidth = width / (config.kind === "row" ? config.children.length + 1 : 2);
|
|
225
225
|
// check that the dragged item is not the last item in the row and a single tab
|
|
226
|
-
if (lastTabs.length > 1 || lastTabs[0] !== name) {
|
|
226
|
+
if (config === rootConfig || lastTabs.length > 1 || lastTabs[0] !== name) {
|
|
227
227
|
pushZone("RIGHT", left + width - zoneWidth, top, zoneWidth, height);
|
|
228
228
|
}
|
|
229
|
-
if (firstTabs.length > 1 || firstTabs[0] !== name) {
|
|
229
|
+
if (config === rootConfig || firstTabs.length > 1 || firstTabs[0] !== name) {
|
|
230
230
|
pushZone("LEFT", left, top, zoneWidth, height);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
if (config.kind === "column" || config === rootConfig) {
|
|
234
234
|
const zoneHeight = height / (config.kind === "column" ? config.children.length + 1 : 2);
|
|
235
|
-
if (lastTabs.length > 1 || lastTabs[0] !== name) {
|
|
235
|
+
if (config === rootConfig || lastTabs.length > 1 || lastTabs[0] !== name) {
|
|
236
236
|
pushZone("BOTTOM", left, top + height - zoneHeight, width, zoneHeight);
|
|
237
237
|
}
|
|
238
|
-
if (firstTabs.length > 1 || firstTabs[0] !== name) {
|
|
238
|
+
if (config === rootConfig || firstTabs.length > 1 || firstTabs[0] !== name) {
|
|
239
239
|
pushZone("TOP", left, top, width, zoneHeight);
|
|
240
240
|
}
|
|
241
241
|
}
|