1- import { startDrag } from "@crabnebula/tauri-plugin-drag" ;
2- import { resolveResource } from "@tauri-apps/api/path" ;
31import { openPath } from "@tauri-apps/plugin-opener" ;
4- import { Flex , message } from "antd" ;
2+ import { Flex } from "antd" ;
53import type { HookAPI } from "antd/es/modal/useModal" ;
64import clsx from "clsx" ;
7- import type { DragEvent , FC } from "react" ;
5+ import type { FC } from "react" ;
86import { useSnapshot } from "valtio" ;
97import UnoIcon from "@/components/UnoIcon" ;
108import { MainContext } from "@/pages/Main" ;
@@ -86,22 +84,6 @@ const Item: FC<ItemProps> = (props) => {
8684 handlePaste ( ) ;
8785 } ;
8886
89- const handleDragStart = async ( event : DragEvent ) => {
90- event . preventDefault ( ) ;
91-
92- const icon = await resolveResource ( "assets/drag-icon.png" ) ;
93-
94- if ( type === "image" ) {
95- return startDrag ( { icon : value , item : [ value ] } ) ;
96- }
97-
98- if ( type === "files" ) {
99- return startDrag ( { icon, item : value } ) ;
100- }
101-
102- return message . warning ( "暂不支持拖拽文本" ) ;
103- } ;
104-
10587 const renderContent = ( ) => {
10688 switch ( type ) {
10789 case "text" :
@@ -125,12 +107,10 @@ const Item: FC<ItemProps> = (props) => {
125107 "antd-input-focus!" : rootState . activeId === id ,
126108 } ,
127109 ) }
128- draggable
129110 gap = { 4 }
130111 onClick = { ( ) => handleClick ( "single" ) }
131112 onContextMenu = { handleContextMenu }
132113 onDoubleClick = { ( ) => handleClick ( "double" ) }
133- onDragStart = { handleDragStart }
134114 vertical
135115 >
136116 < Header { ...rest } data = { data } handleNote = { handleNote } />
0 commit comments