Skip to content

Commit

Permalink
chore: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Feb 28, 2024
1 parent 80d1fc3 commit eec3c4d
Show file tree
Hide file tree
Showing 10 changed files with 553 additions and 358 deletions.
10 changes: 1 addition & 9 deletions packages/docs/docs/core/dnd/dragAndDrop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ sidebar_position: 1

import useBaseUrl from '@docusaurus/useBaseUrl';
import { MultiFrameworkContainer } from '@site/src/components/ui/container';
import DndDockview from '@site/sandboxes/dnd-dockview/src/app';
import DockviewExternalDnd from '@site/sandboxes/externaldnd-dockview/src/app';
import LiveExample from '@site/src/components/ui/exampleFrame';

import { DocRef } from '@site/src/components/ui/reference/docRef';
Expand All @@ -16,7 +14,7 @@ The dock makes heavy use of drag and drop functionalities.
<DocRef declaration="DockviewApi"
methods={[
'onWillDragPanel', 'onWillDragGroup',
'onWillDrop', 'onDidDrop', 'onWillShowOverlay'
'onWillDrop', 'onWillShowOverlay'
]}
/>

Expand Down Expand Up @@ -79,12 +77,6 @@ return (
);
```

## Intercepting Drag Events

You can intercept drag events to attach your own metadata using the `onWillDragPanel` and `onWillDragGroup` api methods.

<MultiFrameworkContainer sandboxId="dnd-dockview" react={DndDockview} />

## Third Party Dnd Libraries

This shows a simple example of a third-party library used inside a panel that relies on drag
Expand Down
31 changes: 31 additions & 0 deletions packages/docs/docs/core/dnd/external.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: 'External Dnd Events'
sidebar_position: 3
---

External Dnd events can be intercepted through a number of utilities.

import { DocRef } from '@site/src/components/ui/reference/docRef';
import LiveExample from '@site/src/components/ui/exampleFrame';

<DocRef declaration="DockviewApi"
methods={['onDidDrop']}
/>


<FrameworkSpecific framework='React'>
<DocRef declaration="IDockviewReactProps" methods={['showDndOverlay']} />
</FrameworkSpecific>

<FrameworkSpecific framework='JavaScript'>
<DocRef declaration="DockviewComponentOptions"
methods={['showDndOverlay']}
/>
</FrameworkSpecific>


## Intercepting Drag Events

You can intercept drag events to attach your own metadata using the `onWillDragPanel` and `onWillDragGroup` api methods.

<LiveExample framework='react' id="dockview/dnd-external" />
5 changes: 0 additions & 5 deletions packages/docs/docs/core/dnd/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ sidebar_position: 0
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import { MultiFrameworkContainer } from '@site/src/components/ui/container';
import DndDockview from '@site/sandboxes/dnd-dockview/src/app';
import DockviewExternalDnd from '@site/sandboxes/externaldnd-dockview/src/app';

import { DocRef } from '@site/src/components/ui/reference/docRef';

Dockview supports a wide variety of built-in Drag and Drop possibilities.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "dnd-dockview",
"name": "dockview.dnd-external",
"description": "",
"keywords": [
"dockview"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
DockviewApi,
DockviewDndOverlayEvent,
DockviewDropEvent,
DockviewDidDropEvent,
DockviewReact,
DockviewReadyEvent,
IDockviewPanelProps,
Expand Down Expand Up @@ -123,7 +123,7 @@ const DndDockview = (props: { renderVisibleOnly: boolean; theme?: string }) => {
setApi(event.api);
};

const onDidDrop = (event: DockviewDropEvent) => {
const onDidDrop = (event: DockviewDidDropEvent) => {
event.api.addPanel({
id: 'test',
component: 'default',
Expand Down
Loading

0 comments on commit eec3c4d

Please sign in to comment.