feat(clipper): Added "Clip as screenshot" switch to allow clipping content as a screenshot and save it to Files

This commit is contained in:
Aman Harwara
2023-05-05 17:03:13 +05:30
parent 74f8f9fafe
commit 0d3b7f7d94
10 changed files with 96 additions and 20 deletions
@@ -29,6 +29,10 @@ export const getSuperJSONFromClipPayload = async (clipPayload: ClipPayload) => {
$getRoot().select()
$insertNodes(clipSourceParagraphNode)
if (typeof clipPayload.content !== 'string') {
throw new Error('Clip payload content is not a string')
}
const dom = parser.parseFromString(clipPayload.content, 'text/html')
const generatedNodes = $generateNodesFromDOM(editor, dom)
const nodesToInsert: LexicalNode[] = []