mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(core): allow bs snapshot dragging targets (#9093)
fix AF-1924, AF-1848, AF-1928, AF-1931
dnd between affine & editor
<div class='graphite__hidden'>
<div>🎥 Video uploaded on Graphite:</div>
<a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">
<img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">
</a>
</div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/dff3ceb1-dc82-4222-9b55-13be80b28b2f.mp4">20241210-1217-49.8960381.mp4</video>
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
import type { DNDData, ExternalDataAdapter } from './types';
|
||||
import type { DNDData, fromExternalData, toExternalData } from './types';
|
||||
|
||||
export const DNDContext = createContext<{
|
||||
/**
|
||||
* external data adapter.
|
||||
* Convert the external data to the draggable data that are known to affine.
|
||||
*
|
||||
* if this is provided, the drop target will handle external elements as well.
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
externalDataAdapter?: ExternalDataAdapter<DNDData>;
|
||||
fromExternalData?: fromExternalData<DNDData>;
|
||||
|
||||
/**
|
||||
* Convert the draggable data to the external data.
|
||||
* Mainly used to be consumed by blocksuite.
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
toExternalData?: toExternalData<DNDData>;
|
||||
}>({});
|
||||
|
||||
Reference in New Issue
Block a user