ui.startDragToCursor
Adds the specified element or content to responsive documents, which slot things into a text stream at the end of a drag event.
Parameters
eventDragStartEvent<E>A drag start event.
currentTargetEdragDataobjectElement or content to be added to the design at the end of the drag event.
Embed element to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "embed".
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
embedUrlstringThe URL of media that can be embedded, such as the URL of a YouTube video.
This URL must be supported by the Iframely API.
Video element or content to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "video".
resolveVideoReffunctionA function that returns a reference (ref) to a video asset in Canva's backend.
Returns
A Promise that resolves with the following object:
refVideoRefA unique identifier that references a video asset in Canva's backend.
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
fullSizeDimensionsThe dimensions of the full-size video.
- These dimensions are used when adding the video to the design
- If omitted, the
previewSizedimensions are used as a fallback.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
Image element or content to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "image".
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
resolveImageReffunctionA function that returns a reference (ref) to an audio asset in Canva's backend.
Returns
A Promise that resolves with the following object:
refImageRefA unique identifier that references an image asset in Canva's backend.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
fullSizeDimensionsThe dimensions of the full-size image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
Returns
Promise<void>