From c75964632b9535aaf6990576d265b10b037e65ef Mon Sep 17 00:00:00 2001
From: mathuo <6710312+mathuo@users.noreply.github.com>
Date: Sun, 29 May 2022 16:21:20 +0100
Subject: [PATCH 1/3] chore: improve docs
---
README.md | 2 +-
packages/dockview/README.md | 2 +-
packages/docs/docs/api/_category_.json | 7 -
packages/docs/docs/components/_category_.json | 9 ++
.../docs/{api => components}/dockview.mdx | 29 ++--
.../docs/{api => components}/gridview.mdx | 0
.../docs/{api => components}/paneview.mdx | 143 ++++++++++++++----
.../docs/{api => components}/splitview.mdx | 13 +-
packages/docs/docusaurus.config.js | 24 ++-
.../src/components/dockview/contextMenu.scss | 28 ++++
.../src/components/dockview/contextMenu.tsx | 70 ++++-----
.../src/components/paneview/customHeader.tsx | 104 +++++++++++++
.../src/components/paneview/dragAndDrop.tsx | 102 +++++++++++++
packages/docs/src/pages/index.tsx | 4 +-
14 files changed, 441 insertions(+), 96 deletions(-)
delete mode 100644 packages/docs/docs/api/_category_.json
create mode 100644 packages/docs/docs/components/_category_.json
rename packages/docs/docs/{api => components}/dockview.mdx (94%)
rename packages/docs/docs/{api => components}/gridview.mdx (100%)
rename packages/docs/docs/{api => components}/paneview.mdx (75%)
rename packages/docs/docs/{api => components}/splitview.mdx (95%)
create mode 100644 packages/docs/src/components/dockview/contextMenu.scss
create mode 100644 packages/docs/src/components/paneview/customHeader.tsx
create mode 100644 packages/docs/src/components/paneview/dragAndDrop.tsx
diff --git a/README.md b/README.md
index 1983f0c99..214dc0e75 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
##
-Please see the website: https://mathuo.github.io/dockview/docs
+Please see the website: https://dockview.dev
Want to inspect the latest deployment? Go to https://unpkg.com/browse/dockview@latest/
diff --git a/packages/dockview/README.md b/packages/dockview/README.md
index 1983f0c99..214dc0e75 100644
--- a/packages/dockview/README.md
+++ b/packages/dockview/README.md
@@ -15,7 +15,7 @@
##
-Please see the website: https://mathuo.github.io/dockview/docs
+Please see the website: https://dockview.dev
Want to inspect the latest deployment? Go to https://unpkg.com/browse/dockview@latest/
diff --git a/packages/docs/docs/api/_category_.json b/packages/docs/docs/api/_category_.json
deleted file mode 100644
index 234c2c6d5..000000000
--- a/packages/docs/docs/api/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "API",
- "position": 2,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/packages/docs/docs/components/_category_.json b/packages/docs/docs/components/_category_.json
new file mode 100644
index 000000000..1cdf26b6f
--- /dev/null
+++ b/packages/docs/docs/components/_category_.json
@@ -0,0 +1,9 @@
+{
+ "label": "Components",
+ "collapsible": true,
+ "collapsed": false,
+ "link": {
+ "type": "generated-index",
+ "title": "Components"
+ },
+}
diff --git a/packages/docs/docs/api/dockview.mdx b/packages/docs/docs/components/dockview.mdx
similarity index 94%
rename from packages/docs/docs/api/dockview.mdx
rename to packages/docs/docs/components/dockview.mdx
index dc00eb9df..8bb05b64b 100644
--- a/packages/docs/docs/api/dockview.mdx
+++ b/packages/docs/docs/components/dockview.mdx
@@ -5,13 +5,14 @@ import {
} from '../../src/components/dockview/rendering';
import { DndDockview } from '../../src/components/dockview/dnd';
import { EventsDockview } from '../../src/components/dockview/events';
+import { ContextMenuDockview } from '../../src/components/dockview/contextMenu';
import Link from '@docusaurus/Link';
# Dockview
## Introduction
-Dockview is an abstraction built on top of [Gridviews](/docs/api/gridview) where each view is a tabbed container.
+Dockview is an abstraction built on top of [Gridviews](/docs/api/gridview) where each view is a container of many tabbed panels.
-```tsx
-const panel = event.api.addPanel(...);
-const anotherPanel = event.api.getPanel('somePanelid');
-```
-
You can access the panels associated group through the `panel.group` variable.
The group will always be defined and will change if a panel is moved into another group.
## DockviewReact Component
+You can create a Dockview through the use of the `ReactDockview` component.
+
```tsx
import { ReactDockview } from 'dockview';
```
@@ -53,7 +51,10 @@ import { ReactDockview } from 'dockview';
## Dockview API
-```tsx
+The Dockview API is exposed both at the `onReady` event and on each panel through `props.containerApi`.
+Through this API you can control general features of the component and access all added panels.
+
+```tsx title="Dockview API via Panel component"
const MyComponent = (props: IDockviewPanelProps<{ title: string }>) => {
// props.containerApi...
@@ -61,7 +62,7 @@ const MyComponent = (props: IDockviewPanelProps<{ title: string }>) => {
};
```
-```tsx
+```tsx title="Dockview API via the onReady callback"
const onReady = (event: DockviewReadyEvent) => {
// event.api...
};
@@ -147,7 +148,7 @@ const MyComponent = (props: IDockviewPanelProps<{ title: string }>) => {
### Locked group
Locking a group will disable all drop events for this group ensuring a user can not add additional panels to the group.
-You can still add groups to a locked panel programatically using the api.
+You can still add groups to a locked panel programatically using the API.
```tsx
panel.group.locked = true;
@@ -163,7 +164,15 @@ panel.group.header.hidden = true;
### Context Menu
-import { ContextMenuDockview } from '../../src/components/dockview/contextMenu';
+Since overriding the context menu is a such a common feature rather than defining a custom tab the `ReactDockview` component exposes the prop `onTabContextMenu`.
+You can alternatively define a custom tab component for more granular control.
+
+:::caution
+
+The `onTabContextMenu` is intended to be removed in a future release to further simplify the library.
+In the future you will be required to define a custom tab component to intercept the context menu events.
+
+:::
+```tsx title="Simple Paneview example"
+import {
+ IPaneviewPanelProps,
+ PaneviewReact,
+ PaneviewReadyEvent,
+} from 'dockview';
+
+const components = {
+ default: (props: IPaneviewPanelProps<{ title: string }>) => {
+ return (
+
+ {props.params.title}
+
+ );
+ },
+};
+
+SimplePaneview = () => {
+ const onReady = (event: PaneviewReadyEvent) => {
+ event.api.addPanel({
+ id: 'panel_1',
+ component: 'default',
+ params: {
+ title: 'Panel 1',
+ },
+ title: 'Panel 1',
+ });
+
+ event.api.addPanel({
+ id: 'panel_2',
+ component: 'default',
+ params: {
+ title: 'Panel 2',
+ },
+ title: 'Panel 2',
+ });
+
+ event.api.addPanel({
+ id: 'panel_3',
+ component: 'default',
+ params: {
+ title: 'Panel 3',
+ },
+ title: 'Panel 3',
+ });
+ };
+
+ return (
+
+ );
+};
+```
+
## PaneviewReact Component
+You can create a Paneview through the use of the `ReactPaneview` component.
+
```tsx
import { ReactPaneview } from 'dockview';
```
@@ -34,7 +113,10 @@ import { ReactPaneview } from 'dockview';
## Paneview API
-```tsx
+The Paneview API is exposed both at the `onReady` event and on each panel through `props.containerApi`.
+Through this API you can control general features of the component and access all added panels.
+
+```tsx title="Paneview API via Panel component"
const MyComponent = (props: IGridviewPanelProps<{ title: string }>) => {
// props.containerApi...
@@ -42,7 +124,7 @@ const MyComponent = (props: IGridviewPanelProps<{ title: string }>) => {
};
```
-```tsx
+```tsx title="Paneview API via the onReady callback"
const onReady = (event: GridviewReadyEvent) => {
// event.api...
};
@@ -74,7 +156,7 @@ const onReady = (event: GridviewReadyEvent) => {
| toJSON | `(): SerializedPaneview` | Serialization |
| clear | `(): void` | Clears the current layout |
-## Gridview Panel API
+## Paneview Panel API
```tsx
const MyComponent = (props: IGridviewPanelProps<{ title: string }>) => {
@@ -108,8 +190,20 @@ const MyComponent = (props: IGridviewPanelProps<{ title: string }>) => {
### Custom Header
-The above example shows the default header and will render the `title` along with a small icon to indicate a collapsed or expanded state.
-You can provide a custom header:
+You can provide a custom component to render an alternative header.
+
+
+
+
+
+You can provide a `headerComponent` option when creating a panel to tell the library to use a custom header component.
```tsx
const onReady = (event: PaneviewReadyEvent) => {
@@ -125,27 +219,12 @@ const onReady = (event: PaneviewReadyEvent) => {
};
```
-The above example shows the default header and will render the `title` along with a small icon to indicate a collapsed or expanded state.
-You can provide a custom header:
+This header must be defined in the collection of components provided to the `headerComponents` props for `ReactPaneivew`
```tsx
-const onReady = (event: PaneviewReadyEvent) => {
- event.api.addPanel({
- id: 'panel_1',
- component: 'default',
- headerComponent: 'myHeaderComponent',
- params: {
- valueA: 'A',
- },
- title: 'Panel 1',
- });
-};
-```
+import { IPaneviewPanelProps } from 'dockview';
-You can define a header component and listen to the expanded state to update the component accordingly.
-
-```tsx
-const CustomHeader = (props: IPaneviewPanelProps) => {
+const MyHeaderComponent = (props: IPaneviewPanelProps<{ title: string }>) => {
const [expanded, setExpanded] = React.useState(
props.api.isExpanded
);
@@ -165,7 +244,13 @@ const CustomHeader = (props: IPaneviewPanelProps) => {
};
return (
-
);
};
-```
-You should provide a value for the `headerComponents` React prop.
-
-```tsx
-const headerComponents = { myHeaderComponent: CustomHeader };
+const headerComponents = { myHeaderComponent: MyHeaderComponent };
```
### Drag And Drop
+
+If you provide the `PaneviewReact` component with the prop `onDidDrop` you will be able to interact with custom drop events.
+
+
diff --git a/packages/docs/docs/api/splitview.mdx b/packages/docs/docs/components/splitview.mdx
similarity index 95%
rename from packages/docs/docs/api/splitview.mdx
rename to packages/docs/docs/components/splitview.mdx
index b6daf2c4f..29bc25f53 100644
--- a/packages/docs/docs/api/splitview.mdx
+++ b/packages/docs/docs/components/splitview.mdx
@@ -6,9 +6,7 @@ import Link from '@docusaurus/Link';
## Introduction
-A Splitview is a collection resizable horizontally or vertically stacked panels.
-The Splitview exposes a component level API through the `onReady` event and through the `props.containerApi` variable on the panel props.
-A panel level API is exposed on each panel through it's props as `props.api`.
+A Splitview is a collection of resizable horizontally or vertically stacked panels.
) => {
@@ -139,7 +138,7 @@ const onReady = (event: SplitviewReadyEvent) => {
## Splitview Panel API
-The Splitview panel API is exposed on each panel and contains actions and variables specific to that panel.
+The Splitview panel API is exposed on each panel containing actions and variables specific to that panel.
```tsx title="Splitview panel API via Panel component"
const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
@@ -172,7 +171,7 @@ const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
## Advanced Features
-Listed below are some functionality avalaible to you through both the panel and component APIs. The live demo shows examples of these in real-time.
+Listed below are some functionalities avalaible through both the panel and component APIs. The live demo shows examples of these in real-time.
+ );
+};
diff --git a/packages/docs/src/pages/index.tsx b/packages/docs/src/pages/index.tsx
index cf0cce898..431d507a1 100644
--- a/packages/docs/src/pages/index.tsx
+++ b/packages/docs/src/pages/index.tsx
@@ -31,8 +31,8 @@ export default function Home(): JSX.Element {
const { siteConfig } = useDocusaurusContext();
return (
From 10e12340f978e9ff7a9702dc7f788ccceb70dd2c Mon Sep 17 00:00:00 2001
From: mathuo <6710312+mathuo@users.noreply.github.com>
Date: Sun, 29 May 2022 17:49:08 +0100
Subject: [PATCH 2/3] chore: add versions
---
packages/docs/docs/basics.mdx | 4 +-
packages/docs/docs/components/dockview.mdx | 10 +-
packages/docs/docs/components/gridview.mdx | 4 +-
packages/docs/docs/components/paneview.mdx | 6 +-
packages/docs/docs/components/splitview.mdx | 4 +-
packages/docs/docs/index.mdx | 8 +-
packages/docs/docs/theme.mdx | 2 +-
packages/docs/docusaurus.config.js | 27 +-
.../versioned_docs/version-1.4.3/basics.mdx | 117 +++++++
.../version-1.4.3/components/_category_.json | 9 +
.../version-1.4.3/components/dockview.mdx | 294 ++++++++++++++++++
.../version-1.4.3/components/gridview.mdx | 116 +++++++
.../version-1.4.3/components/paneview.mdx | 270 ++++++++++++++++
.../version-1.4.3/components/splitview.mdx | 242 ++++++++++++++
.../versioned_docs/version-1.4.3/index.mdx | 150 +++++++++
.../versioned_docs/version-1.4.3/theme.mdx | 80 +++++
.../version-1.4.3-sidebars.json | 8 +
packages/docs/versions.json | 3 +
18 files changed, 1312 insertions(+), 42 deletions(-)
create mode 100644 packages/docs/versioned_docs/version-1.4.3/basics.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/components/_category_.json
create mode 100644 packages/docs/versioned_docs/version-1.4.3/components/dockview.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/components/gridview.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/components/paneview.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/components/splitview.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/index.mdx
create mode 100644 packages/docs/versioned_docs/version-1.4.3/theme.mdx
create mode 100644 packages/docs/versioned_sidebars/version-1.4.3-sidebars.json
create mode 100644 packages/docs/versions.json
diff --git a/packages/docs/docs/basics.mdx b/packages/docs/docs/basics.mdx
index 2ad80bb6d..2cadf65bf 100644
--- a/packages/docs/docs/basics.mdx
+++ b/packages/docs/docs/basics.mdx
@@ -2,8 +2,8 @@
sidebar_position: 1
---
-import { SimpleSplitview } from '../src/components/simpleSplitview';
-import { SimpleSplitview2 } from '../src/components/simpleSplitview2';
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SimpleSplitview2 } from '@site/src/components/simpleSplitview2';
# Basics
diff --git a/packages/docs/docs/components/dockview.mdx b/packages/docs/docs/components/dockview.mdx
index 8bb05b64b..d48eb4cd8 100644
--- a/packages/docs/docs/components/dockview.mdx
+++ b/packages/docs/docs/components/dockview.mdx
@@ -1,11 +1,11 @@
-import { SimpleDockview } from '../../src/components/simpleDockview';
+import { SimpleDockview } from '@site/src/components/simpleDockview';
import {
RenderingDockview,
Checkbox,
-} from '../../src/components/dockview/rendering';
-import { DndDockview } from '../../src/components/dockview/dnd';
-import { EventsDockview } from '../../src/components/dockview/events';
-import { ContextMenuDockview } from '../../src/components/dockview/contextMenu';
+} from '@site/src/components/dockview/rendering';
+import { DndDockview } from '@site/src/components/dockview/dnd';
+import { EventsDockview } from '@site/src/components/dockview/events';
+import { ContextMenuDockview } from '@site/src/components/dockview/contextMenu';
import Link from '@docusaurus/Link';
# Dockview
diff --git a/packages/docs/docs/components/gridview.mdx b/packages/docs/docs/components/gridview.mdx
index 05b72565c..b4913a712 100644
--- a/packages/docs/docs/components/gridview.mdx
+++ b/packages/docs/docs/components/gridview.mdx
@@ -1,5 +1,5 @@
-import { SimpleGridview } from '../../src/components/simpleGridview';
-import { EventsGridview } from '../../src/components/gridview/events';
+import { SimpleGridview } from '@site/src/components/simpleGridview';
+import { EventsGridview } from '@site/src/components/gridview/events';
import Link from '@docusaurus/Link';
# Gridview
diff --git a/packages/docs/docs/components/paneview.mdx b/packages/docs/docs/components/paneview.mdx
index cbb087b16..b1906ddd8 100644
--- a/packages/docs/docs/components/paneview.mdx
+++ b/packages/docs/docs/components/paneview.mdx
@@ -1,6 +1,6 @@
-import { SimplePaneview } from '../../src/components/simplePaneview';
-import { CustomHeaderPaneview } from '../../src/components/paneview/customHeader';
-import { DragAndDropPaneview } from '../../src/components/paneview/dragAndDrop';
+import { SimplePaneview } from '@site/src/components/simplePaneview';
+import { CustomHeaderPaneview } from '@site/src/components/paneview/customHeader';
+import { DragAndDropPaneview } from '@site/src/components/paneview/dragAndDrop';
import Link from '@docusaurus/Link';
# Paneview
diff --git a/packages/docs/docs/components/splitview.mdx b/packages/docs/docs/components/splitview.mdx
index 29bc25f53..d932b9950 100644
--- a/packages/docs/docs/components/splitview.mdx
+++ b/packages/docs/docs/components/splitview.mdx
@@ -1,5 +1,5 @@
-import { SimpleSplitview } from '../../src/components/simpleSplitview';
-import { SplitviewExample1 } from '../../src/components/splitview/active';
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SplitviewExample1 } from '@site/src/components/splitview/active';
import Link from '@docusaurus/Link';
# Splitview
diff --git a/packages/docs/docs/index.mdx b/packages/docs/docs/index.mdx
index 1056e63ba..5f680279d 100644
--- a/packages/docs/docs/index.mdx
+++ b/packages/docs/docs/index.mdx
@@ -2,10 +2,10 @@
sidebar_position: 0
---
-import { SimpleSplitview } from '../src/components/simpleSplitview';
-import { SimpleGridview } from '../src/components/simpleGridview';
-import { SimplePaneview } from '../src/components/simplePaneview';
-import { SimpleDockview } from '../src/components/simpleDockview';
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SimpleGridview } from '@site/src/components/simpleGridview';
+import { SimplePaneview } from '@site/src/components/simplePaneview';
+import { SimpleDockview } from '@site/src/components/simpleDockview';
# Dockview
diff --git a/packages/docs/docs/theme.mdx b/packages/docs/docs/theme.mdx
index 1833dbdaa..912280116 100644
--- a/packages/docs/docs/theme.mdx
+++ b/packages/docs/docs/theme.mdx
@@ -2,7 +2,7 @@
sidebar_position: 3
---
-import { CustomCSSDockview } from '../src/components/dockview/customCss';
+import { CustomCSSDockview } from '@site/src/components/dockview/customCss';
# Theme
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index 841939d68..1eb412f9b 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -12,7 +12,7 @@ console.log(`isCI: ${process.env.CI}`);
const config = {
title: 'Dockview',
tagline: 'Zero dependency layout manager for React',
- url: 'https://dockview.dev',
+ url: 'https://your-docusaurus-test-site.com',
baseUrl: process.env.CI ? `/` : '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
@@ -87,28 +87,6 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
- metadata: [
- {
- name: 'keywords',
- content: [
- 'react',
- 'components',
- 'typescript',
- 'drag-and-drop',
- 'reactjs',
- 'layout',
- 'drag',
- 'drop',
- 'tabs',
- 'dock',
- 'docking',
- 'splitter',
- 'docking-library',
- 'layout-manager',
- 'docking-layout',
- ].join(' ,'),
- },
- ],
navbar: {
title: 'Dockview',
logo: {
@@ -128,6 +106,9 @@ const config = {
label: 'GitHub',
position: 'right',
},
+ {
+ type: 'docsVersionDropdown',
+ },
],
},
footer: {
diff --git a/packages/docs/versioned_docs/version-1.4.3/basics.mdx b/packages/docs/versioned_docs/version-1.4.3/basics.mdx
new file mode 100644
index 000000000..2cadf65bf
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/basics.mdx
@@ -0,0 +1,117 @@
+---
+sidebar_position: 1
+---
+
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SimpleSplitview2 } from '@site/src/components/simpleSplitview2';
+
+# Basics
+
+This section will take you through a number of concepts that can be applied to all dockview components.
+
+## Panels
+
+The below examples use `ReactSplitview` but the logic holds for `ReactPaneview`, `ReactGridview` and `ReactDockview` using their respective implementations and interfaces.
+All components require you to provide an `onReady` prop which you can use to build and control your component.
+
+### Adding a panel with parameters
+
+You can pass parameters to a panel through the `params` object
+
+```tsx
+const onReady = (event: SplitviewReadyEvent) => {
+ event.api.addPanel({
+ id: 'panel_1',
+ component: 'myComponent',
+ params: {
+ title: 'My Title',
+ },
+ });
+};
+```
+
+and you can access those properties through the `props.params` object. The TypeScript interface accepts an optional generic type `T` that corresponds to the params objects type.
+
+```tsx
+const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
+ return
{`My first panel has the title: ${props.params.title}`}
;
+};
+```
+
+## API
+
+There are two types of API you will interact with using `dockview`.
+
+- The `panel API` is accessible via `props.api` in user defined panels and via the `.api` variable found on panel instances. This API contains actions and variable related to the the individual panel.
+- The `container API` is accessible via `event.api` in the `onReady` events and `props.containerApi` in user defined panels. This API contains actions and variable related to the component as a whole.
+
+```tsx
+const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
+ React.useEffect(() => {
+ const disposable = props.api.onDidActiveChange((event) => {
+ console.log(`is panel active: ${event.isActive}`);
+ });
+
+ return () => {
+ disposable.dispose(); // remember to dispose of any subscriptions
+ };
+ }, [props.api]);
+
+ const addAnotherPanel = React.useCallback(() => {
+ props.containerApi.addPanel({
+ id: 'another_id',
+ component: 'anotherComponent',
+ });
+ }, [props.containerApi]);
+
+ return (
+
+ {`My first panel has the title: ${props.params.title}`}
+
+
+ );
+};
+```
+
+### Serialization
+
+All components support `toJSON(): T` which returns a Typed object representation of the components state. This same Typed object can be used to deserialize a view using `fromJSON(object: T): void`.
+
+## Auto resizing
+
+`SplitviewReact`, `GridviewReact`, `PaneviewReact` and `DockviewReact` will all automatically resize to fill the size of their parent element.
+Internally this is achieved using a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) which some users may need to polyfill.
+You can disable this by settings the `disableAutoResizing` prop to be `true`.
+
+You can manually resize a component using the API method `layout(width: number, height: number): void`.
+An advanced case may use this in conjunction with `disableAutoResizing=true` to allow a parent component to have ultimate control over the dimensions of the component.
+
+## Events
+
+Many API properties can be listened on using the `Event` pattern. For example `api.onDidFocusChange(() => {...})`.
+You should dispose of any event listeners you create cleaning up any listeners you would have created.
+
+```tsx
+React.useEffect(() => {
+ const disposable = api.onDidFocusChange(() => {
+ // write some code
+ });
+
+ return () => {
+ disposable.dispose();
+ };
+}, []);
+```
+
+## Proportional layout
+
+The `proportionalLayout` property indicates the expected behaviour of the component as it's container resizes, should all views resize equally or should just one view expand to fill the new space. `proportionalLayout` can be set as a property on `SplitviewReact` and `GridviewReact` components.
+Although not configurable on `DockviewReact` and `PaneviewReact` these both behave as if `proportionalLayout=true` was set for them.
+
+
+
+
+
+## Browser support
+
+dockview is intended to support all major browsers. Some users may require a polyfill for [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
diff --git a/packages/docs/versioned_docs/version-1.4.3/components/_category_.json b/packages/docs/versioned_docs/version-1.4.3/components/_category_.json
new file mode 100644
index 000000000..1cdf26b6f
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/components/_category_.json
@@ -0,0 +1,9 @@
+{
+ "label": "Components",
+ "collapsible": true,
+ "collapsed": false,
+ "link": {
+ "type": "generated-index",
+ "title": "Components"
+ },
+}
diff --git a/packages/docs/versioned_docs/version-1.4.3/components/dockview.mdx b/packages/docs/versioned_docs/version-1.4.3/components/dockview.mdx
new file mode 100644
index 000000000..d48eb4cd8
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/components/dockview.mdx
@@ -0,0 +1,294 @@
+import { SimpleDockview } from '@site/src/components/simpleDockview';
+import {
+ RenderingDockview,
+ Checkbox,
+} from '@site/src/components/dockview/rendering';
+import { DndDockview } from '@site/src/components/dockview/dnd';
+import { EventsDockview } from '@site/src/components/dockview/events';
+import { ContextMenuDockview } from '@site/src/components/dockview/contextMenu';
+import Link from '@docusaurus/Link';
+
+# Dockview
+
+## Introduction
+
+Dockview is an abstraction built on top of [Gridviews](/docs/api/gridview) where each view is a container of many tabbed panels.
+
+
+
+
+
+You can access the panels associated group through the `panel.group` variable.
+The group will always be defined and will change if a panel is moved into another group.
+
+## DockviewReact Component
+
+You can create a Dockview through the use of the `ReactDockview` component.
+
+```tsx
+import { ReactDockview } from 'dockview';
+```
+
+| Property | Type | Optional | Default | Description |
+| ------------------- | ------------------------------------ | -------- | ------- | --------------------------------------------------------------- |
+| onReady | (event: SplitviewReadyEvent) => void | No | | |
+| components | object | No | | |
+| tabComponents | object | Yes | | |
+| watermarkComponent | object | Yes | | |
+| hideBorders | boolean | Yes | false | |
+| className | string | Yes | '' | |
+| disableAutoResizing | boolean | Yes | false | See Auto Resizing |
+| onTabContextMenu | Event | Yes | false | |
+| onDidDrop | Event | Yes | false | |
+| showDndOverlay | Event | Yes | false | |
+
+## Dockview API
+
+The Dockview API is exposed both at the `onReady` event and on each panel through `props.containerApi`.
+Through this API you can control general features of the component and access all added panels.
+
+```tsx title="Dockview API via Panel component"
+const MyComponent = (props: IDockviewPanelProps<{ title: string }>) => {
+ // props.containerApi...
+
+ return
{`My first panel has the title: ${props.params.title}`}
{`My first panel has the title: ${props.params.title}`}
;
+};
+```
+
+| Property | Type | Description |
+| ---------------------- | ----------------------------------------------------------- | --------------- |
+| id | `string` | Panel id |
+| isFocused | `boolean` | Is panel focsed |
+| isActive | `boolean` | Is panel active |
+| width | `number` | Panel width |
+| height | `number` | Panel height |
+| onDidDimensionsChange | `Event` | |
+| onDidFocusChange | `Event` | |
+| onDidVisibilityChange | `Event` | |
+| onDidActiveChange | `Event` | |
+| setActive | `(): void` | |
+| | | |
+| onDidConstraintsChange | `onDidConstraintsChange: Event` | |
+| setConstraints | `(value: PanelConstraintChangeEvent2): void;` | |
+| setSize | `(event: SizeEvent): void` | |
+| | | |
+| group | `GroupPanel | undefined` |
+| isGroupActive | `boolean` | |
+| title | `string` | |
+| suppressClosable | `boolean` | |
+| close | `(): void` | |
+| setTitle | `(title: string): void` | |
+
+## Advanced Features
+
+### Locked group
+
+Locking a group will disable all drop events for this group ensuring a user can not add additional panels to the group.
+You can still add groups to a locked panel programatically using the API.
+
+```tsx
+panel.group.locked = true;
+```
+
+### Group header
+
+You may wish to hide the header section of a group. This can achieved through setting the `hidden` variable on `panel.group.header`.
+
+```tsx
+panel.group.header.hidden = true;
+```
+
+### Context Menu
+
+Since overriding the context menu is a such a common feature rather than defining a custom tab the `ReactDockview` component exposes the prop `onTabContextMenu`.
+You can alternatively define a custom tab component for more granular control.
+
+:::caution
+
+The `onTabContextMenu` is intended to be removed in a future release to further simplify the library.
+In the future you will be required to define a custom tab component to intercept the context menu events.
+
+:::
+
+
+
+
+
+### Rendering
+
+Although `DockviewReact` will only add those tabs that are visible to the DOM all associated React Components for each tab including those that
+are not initially visible will be created.
+This will mean that any hooks in those components will run and if you running expensive operations in the tabs you may end up doing a lot of initial
+work for what are hidden tabs.
+
+This is the default behaviour to ensure the greatest flexibility for the user but you can create a Higher-Order component wrapping your components that
+will ensure the component is only created if the tab is visible as below:
+
+```tsx
+import { PanelApi } from 'dockview';
+import * as React from 'react';
+
+function RenderWhenVisible<
+ T extends { api: Pick }
+>(component: React.FunctionComponent) {
+ const HigherOrderComponent = (props: T) => {
+ const [visible, setVisible] = React.useState(
+ props.api.isVisible
+ );
+
+ React.useEffect(() => {
+ const disposable = props.api.onDidVisibilityChange((event) =>
+ setVisible(event.isVisible)
+ );
+
+ return () => {
+ disposable.dispose();
+ };
+ }, [props.api]);
+
+ if (!visible) {
+ return null;
+ }
+
+ return React.createElement(component, props);
+ };
+ return HigherOrderComponent;
+}
+```
+
+```tsx
+const component = RenderWhenVisible(MyComponent);
+```
+
+Through toggling the checkbox you can see that when you only render those panels which are visible the underling React component is destroyed when it becomes hidden and re-created when it becomes visible.
+
+
+
+
+
+
+### Drag And Drop
+
+The component exposes some method to help determine whether external drag events should be interacted with or not.
+
+```tsx
+/**
+ * called when an ondrop event which does not originate from the dockview libray and
+ * passes the showDndOverlay condition occurs
+ **/
+const onDidDrop = (event: DockviewDropEvent) => {
+ const { group } = event;
+
+ event.api.addPanel({
+ id: 'test',
+ component: 'default',
+ position: {
+ referencePanel: group.activePanel.id,
+ direction: 'within',
+ },
+ });
+};
+
+/**
+ * called for drag over events which do not originate from the dockview library
+ * allowing the developer to decide where the overlay should be shown for a
+ * particular drag event
+ **/
+const showDndOverlay = (event: DockviewDndOverlayEvent) => {
+ return true;
+};
+
+return (
+
+);
+```
+
+
+
+### Events
+
+
diff --git a/packages/docs/versioned_docs/version-1.4.3/components/gridview.mdx b/packages/docs/versioned_docs/version-1.4.3/components/gridview.mdx
new file mode 100644
index 000000000..b4913a712
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/components/gridview.mdx
@@ -0,0 +1,116 @@
+import { SimpleGridview } from '@site/src/components/simpleGridview';
+import { EventsGridview } from '@site/src/components/gridview/events';
+import Link from '@docusaurus/Link';
+
+# Gridview
+
+## Introduction
+
+
+
+You can provide a `headerComponent` option when creating a panel to tell the library to use a custom header component.
+
+```tsx
+const onReady = (event: PaneviewReadyEvent) => {
+ event.api.addPanel({
+ id: 'panel_1',
+ component: 'default',
+ headerComponent: 'myHeaderComponent',
+ params: {
+ valueA: 'A',
+ },
+ title: 'Panel 1',
+ });
+};
+```
+
+This header must be defined in the collection of components provided to the `headerComponents` props for `ReactPaneivew`
+
+```tsx
+import { IPaneviewPanelProps } from 'dockview';
+
+const MyHeaderComponent = (props: IPaneviewPanelProps<{ title: string }>) => {
+ const [expanded, setExpanded] = React.useState(
+ props.api.isExpanded
+ );
+
+ React.useEffect(() => {
+ const disposable = props.api.onDidExpansionChange((event) => {
+ setExpanded(event.isExpanded);
+ });
+
+ return () => {
+ disposable.dispose();
+ };
+ }, []);
+
+ const onClick = () => {
+ props.api.setExpanded(!expanded);
+ };
+
+ return (
+
+
+ {props.params.title}
+
+ );
+};
+
+const headerComponents = { myHeaderComponent: MyHeaderComponent };
+```
+
+### Drag And Drop
+
+If you provide the `PaneviewReact` component with the prop `onDidDrop` you will be able to interact with custom drop events.
+
+
diff --git a/packages/docs/versioned_docs/version-1.4.3/components/splitview.mdx b/packages/docs/versioned_docs/version-1.4.3/components/splitview.mdx
new file mode 100644
index 000000000..d932b9950
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/components/splitview.mdx
@@ -0,0 +1,242 @@
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SplitviewExample1 } from '@site/src/components/splitview/active';
+import Link from '@docusaurus/Link';
+
+# Splitview
+
+## Introduction
+
+A Splitview is a collection of resizable horizontally or vertically stacked panels.
+
+
;
+ },
+};
+
+export const SimpleSplitview = () => {
+ const onReady = (event: SplitviewReadyEvent) => {
+ event.api.addPanel({
+ id: 'panel_1',
+ component: 'default',
+ params: {
+ title: 'Panel 1',
+ },
+ });
+
+ event.api.addPanel({
+ id: 'panel_2',
+ component: 'default',
+ params: {
+ title: 'Panel 2',
+ },
+ });
+
+ event.api.addPanel({
+ id: 'panel_3',
+ component: 'default',
+ params: {
+ title: 'Panel 3',
+ },
+ });
+ };
+
+ return (
+
+ );
+};
+```
+
+## SplitviewReact Component
+
+You can create a Splitview through the use of the `ReactSplitview` component.
+
+```tsx
+import { ReactSplitview } from 'dockview';
+```
+
+Using the `onReady` prop you can access to the component `api` and add panels either through deserialization or the individual addition of panels.
+
+| Property | Type | Optional | Default | Description |
+| ------------------- | -------------------------------------- | -------- | ------------------------ | --------------------------------------------------------------------------- |
+| onReady | `(event: SplitviewReadyEvent) => void` | No | | Function |
+| components | `Record` | No | | Panel renderers |
+| orientation | `Orientation` | Yes | `Orientation.HORIZONTAL` | Orientation of the Splitview |
+| proportionalLayout | `boolean` | Yes | `true` | See Proportional layout |
+| hideBorders | `boolean` | Yes | `false` | Hide the borders between panels |
+| className | `string` | Yes | `''` | Attaches a classname |
+| disableAutoResizing | `boolean` | Yes | `false` | See Auto Resizing |
+
+## Splitview API
+
+The Splitview API is exposed both at the `onReady` event and on each panel through `props.containerApi`.
+Through this API you can control general features of the component and access all added panels.
+
+```tsx title="Splitview API via Panel component"
+const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
+ // props.containerApi...
+
+ return
{`My first panel has the title: ${props.params.title}`}
;
+};
+```
+
+```tsx title="Splitview API via the onReady callback"
+const onReady = (event: SplitviewReadyEvent) => {
+ // event.api...
+};
+```
+
+| Property | Type | Description |
+| ------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------- |
+| height | `number` | Component pixel height |
+| width | `number` | Component pixel width |
+| minimumSize | `number` | The sum of the `minimumSize` property for each panel |
+| maximumSize | `number` | The sum of the `maximumSize` property for each panel |
+| length | `number` | Number of panels |
+| panels | `ISplitviewPanel[]` | All panels |
+| | | |
+| onDidLayoutChange | `Event` | Fires on layout change |
+| onDidLayoutFromJSON | `Event` | Fires of layout change caused by a fromJSON deserialization call |
+| onDidAddView | `Event` | Fires when a view is added |
+| onDidRemoveView | `Event` | Fires when a view is removed |
+| | | |
+| addPanel | `addPanel(options: AddSplitviewComponentOptions): ISplitviewPanel` | |
+| removePanel | `(panel: ISplitviewPanel, sizing?: Sizing): void` | |
+| getPanel | `(id:string): ISplitviewPanel \| undefined` | |
+| movePanel | `(from: number, to: number): void` | |
+| | |
+| updateOptions | `(options: SplitviewComponentUpdateOptions): void` | |
+| focus | `(): void` | Focus the active panel, if exists |
+| layout | `(width: number, height:number): void` | See Auto Resizing |
+| fromJSON | `(data: SerializedSplitview): void` | Serialization |
+| toJSON | `(): SerializedSplitview` | Serialization |
+| clear | `(): void` | Clears the current layout |
+
+## Splitview Panel API
+
+The Splitview panel API is exposed on each panel containing actions and variables specific to that panel.
+
+```tsx title="Splitview panel API via Panel component"
+const MyComponent = (props: ISplitviewPanelProps<{ title: string }>) => {
+ // props.api...
+
+ return
{`My first panel has the title: ${props.params.title}`}
;
+};
+```
+
+| Property | Type | Description |
+| ---------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| id | `string` | Panel id |
+| isFocused | `boolean` | Is panel focsed |
+| isActive | `boolean` | Is panel active |
+| isVisible | `boolean` | Is panel visible |
+| width | `number` | Panel width |
+| height | `number` | Panel height |
+| | | |
+| onDidDimensionsChange | `Event` | Fires when panel dimensions change |
+| onDidFocusChange | `Event` | Fire when panel is focused and blurred |
+| onDidVisibilityChange | `Event` | Fires when the panels visiblity property is changed (see Panel Visibility) |
+| onDidActiveChange | `Event` | Fires when the panels active property is changed (see Active Panel) |
+| onDidConstraintsChange | `onDidConstraintsChange: Event` | Fires when the panels size contrainsts change (see Panel Constraints) |
+| | | |
+| setVisible | `(isVisible: boolean): void` | |
+| setActive | `(): void` | |
+| | | |
+| setConstraints | `(value: PanelConstraintChangeEvent2): void;` | |
+| setSize | `(event: PanelSizeEvent): void` | |
+
+## Advanced Features
+
+Listed below are some functionalities avalaible through both the panel and component APIs. The live demo shows examples of these in real-time.
+
+
+
+
+
+### Visibility
+
+A panels visibility can be controlled and monitored through the following code.
+A panel with visibility set to `false` will remain as a part of the components list of panels but will not be rendered.
+
+```tsx
+const disposable = props.api.onDidVisibilityChange(({ isVisible }) => {
+ //
+});
+```
+
+```tsx
+api.setVisible(true);
+```
+
+### Active
+
+Only one panel in the `splitview` can be the active panel at any one time.
+Setting a panel as active will set all the others as inactive.
+A focused panel is always the active panel but an active panel is not always focused.
+
+```tsx
+const disposable = props.api.onDidActiveChange(({ isActive }) => {
+ //
+});
+```
+
+```tsx
+api.setActive();
+```
+
+### Contraints
+
+When adding a panel you can specify pixel size contraints
+
+```tsx
+event.api.addPanel({
+ id: 'panel_3',
+ component: 'default',
+ minimumSize: 100,
+ maximumSize: 1000,
+});
+```
+
+These contraints can be updated throughout the lifecycle of the `splitview` using the panel API
+
+```tsx
+props.api.onDidConstraintsChange(({ maximumSize, minimumSize }) => {
+ //
+});
+```
+
+```tsx
+api.setConstraints({
+ maximumSize: 200,
+ minimumSize: 400,
+});
+```
diff --git a/packages/docs/versioned_docs/version-1.4.3/index.mdx b/packages/docs/versioned_docs/version-1.4.3/index.mdx
new file mode 100644
index 000000000..5f680279d
--- /dev/null
+++ b/packages/docs/versioned_docs/version-1.4.3/index.mdx
@@ -0,0 +1,150 @@
+---
+sidebar_position: 0
+---
+
+import { SimpleSplitview } from '@site/src/components/simpleSplitview';
+import { SimpleGridview } from '@site/src/components/simpleGridview';
+import { SimplePaneview } from '@site/src/components/simplePaneview';
+import { SimpleDockview } from '@site/src/components/simpleDockview';
+
+# Dockview
+
+## Introduction
+
+**dockview** is a zero dependency layout manager that supports tab, grids and splitviews.
+
+## Features
+
+- Themable and customizable
+- Support for the serialization and deserialization of layouts
+- Drag and drop support
+
+## Quick start
+
+`dockview` has a peer dependency on `react >= 16.8.0` and `react-dom >= 16.8.0`. To install `dockview` you can run:
+
+```shell
+npm install dockview
+```
+
+You must also import the dockview stylesheet found under [`dockview/dict/styles/dockview.css`](https://unpkg.com/browse/dockview@latest/dist/styles/dockview.css),
+depending on your solution this might be:
+
+```css
+@import './node_modules/dockview/dist/styles/dockview.css';
+```
+
+A dark and light theme are provided, one of these classes (or a custom theme) must be attached at any point above your components in the HTML tree. To cover the entire web page you might attach the class to the `body` component:
+
+```html
+
+ ...
+
+
+ ...
+
+```
+
+There are 4 components you may want to use:
+
+Splitview
+
+