-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): drop doc onto split view (#9487)
fix AF-2068, AF-2069, AF-1175, AF-2061, AF-2079, AF-2034, AF-2080, AF-1960, AF-2081 1. replace `dnd-kit` with `@atlaskit/pragmatic-drag-and-drop` 2. allow creating split views by drag & drop the following a. WorkbenchLinks (route links), like journals, trash, all docs b. doc refs c. tags/collection 3. style adjustments to split view 4. remove split view's feature flag and make it GA for electron https://github.com/user-attachments/assets/6a3e4a25-faa2-4215-8eb0-983f44db6e8c
- Loading branch information
Showing
53 changed files
with
1,569 additions
and
900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { DNDData, fromExternalData } from './types'; | ||
|
||
export const isExternalDrag = <D extends DNDData>(args: { | ||
source: { data: D['draggable'] }; | ||
}) => { | ||
return !args.source['data']; | ||
}; | ||
|
||
export const getAdaptedEventArgs = < | ||
D extends DNDData, | ||
Args extends { source: { data: D['draggable'] } }, | ||
>( | ||
args: Args, | ||
fromExternalData?: fromExternalData<D>, | ||
isDropEvent = false | ||
): Args => { | ||
const data = | ||
isExternalDrag(args) && fromExternalData | ||
? fromExternalData( | ||
// @ts-expect-error hack for external data adapter (source has no data field) | ||
args as ExternalGetDataFeedbackArgs, | ||
isDropEvent | ||
) | ||
: args.source['data']; | ||
|
||
return { | ||
...args, | ||
source: { | ||
...args.source, | ||
data, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.