mirror of
https://github.com/mathuo/dockview
synced 2025-02-02 06:25:44 +00:00
chore: docs
This commit is contained in:
parent
acdad8f439
commit
4222d32b8d
@ -13,16 +13,19 @@ If you feel anything is missing or unclear please let me know.
|
|||||||
|
|
||||||
## 🚀 Features
|
## 🚀 Features
|
||||||
|
|
||||||
- magnetic dnd controls [#177](https://github.com/mathuo/dockview/pull/177)
|
- Allow drag events to edge of dockview containers [#177](https://github.com/mathuo/dockview/pull/177)
|
||||||
- group dnd [#171](https://github.com/mathuo/dockview/pull/171)
|
- group dnd [#171](https://github.com/mathuo/dockview/pull/171)
|
||||||
- full width tabs [#171](https://github.com/mathuo/dockview/pull/177)
|
- full width tabs [#171](https://github.com/mathuo/dockview/pull/177)
|
||||||
- addPanel improvements
|
- addPanel improvements
|
||||||
- update parameters via panel.api.updateParameters
|
- update parameters via panel.api.updateParameters
|
||||||
- allow dnd on empty groups [#168](https://github.com/mathuo/dockview/pull/168)
|
- allow dnd on empty groups [#168](https://github.com/mathuo/dockview/pull/168)
|
||||||
|
- Change watermark logic [#194](https://github.com/mathuo/dockview/pull/194)
|
||||||
|
|
||||||
## 🛠 Miscs
|
## 🛠 Miscs
|
||||||
|
|
||||||
- Fix dockview panel.api.setSize to work as expected [#184](https://github.com/mathuo/dockview/pull/184)
|
- Fix dockview panel.api.setSize to work as expected [#184](https://github.com/mathuo/dockview/pull/184)
|
||||||
|
- Fix dockview setTitle [#190](https://github.com/mathuo/dockview/pull/190)
|
||||||
|
- Fix group dnd logic to filter for same dockview instance [#185](https://github.com/mathuo/dockview/pull/193)
|
||||||
- Update dependencies including the dev dependencies for dockview and all dependencies for the docs website.
|
- Update dependencies including the dev dependencies for dockview and all dependencies for the docs website.
|
||||||
[#180](https://github.com/mathuo/dockview/pull/180)
|
[#180](https://github.com/mathuo/dockview/pull/180)
|
||||||
- A variety of internal changes including file name changes
|
- A variety of internal changes including file name changes
|
@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
DockviewApi,
|
||||||
DockviewReact,
|
DockviewReact,
|
||||||
DockviewReadyEvent,
|
DockviewReadyEvent,
|
||||||
IDockviewPanelProps,
|
IDockviewPanelProps,
|
||||||
@ -33,6 +34,8 @@ const counter = (() => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
const Watermark = (props: IWatermarkPanelProps) => {
|
const Watermark = (props: IWatermarkPanelProps) => {
|
||||||
|
const isGroup = props.containerApi.groups.length > 0;
|
||||||
|
|
||||||
const addPanel = () => {
|
const addPanel = () => {
|
||||||
props.containerApi.addPanel({
|
props.containerApi.addPanel({
|
||||||
id: counter.next().toString(),
|
id: counter.next().toString(),
|
||||||
@ -63,12 +66,25 @@ const Watermark = (props: IWatermarkPanelProps) => {
|
|||||||
<span>
|
<span>
|
||||||
<button onClick={addPanel}>Add New Panel</button>
|
<button onClick={addPanel}>Add New Panel</button>
|
||||||
</span>
|
</span>
|
||||||
|
{isGroup && (
|
||||||
|
<span>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
props.close();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Close Group
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DockviewWatermark = () => {
|
export const DockviewWatermark = () => {
|
||||||
|
const [api, setApi] = React.useState<DockviewApi>();
|
||||||
|
|
||||||
const onReady = (event: DockviewReadyEvent) => {
|
const onReady = (event: DockviewReadyEvent) => {
|
||||||
// event.api.addPanel({
|
// event.api.addPanel({
|
||||||
// id: 'panel_1',
|
// id: 'panel_1',
|
||||||
@ -84,6 +100,16 @@ export const DockviewWatermark = () => {
|
|||||||
},
|
},
|
||||||
panels: {},
|
panels: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setApi(event.api);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClick = () => {
|
||||||
|
if (!api) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
api.addGroup();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -94,6 +120,9 @@ export const DockviewWatermark = () => {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div>
|
||||||
|
<button onClick={onClick}>Add Empty Group</button>
|
||||||
|
</div>
|
||||||
<DockviewReact
|
<DockviewReact
|
||||||
onReady={onReady}
|
onReady={onReady}
|
||||||
components={components}
|
components={components}
|
||||||
|
Loading…
Reference in New Issue
Block a user