Move image zooming back to unvendorized lib (#6980)
* Move image zooming back to unvendorized lib * refactor * perf: Avoid mounting zoom dialog until interacted * Add captions to lightbox * lightbox
This commit is contained in:
@@ -171,6 +171,26 @@ export class ProsemirrorHelper {
|
||||
return comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates through the document to find all of the images.
|
||||
*
|
||||
* @param doc Prosemirror document node
|
||||
* @returns Array<Node> of images
|
||||
*/
|
||||
static getImages(doc: Node): Node[] {
|
||||
const images: Node[] = [];
|
||||
|
||||
doc.descendants((node) => {
|
||||
if (node.type.name === "image") {
|
||||
images.push(node);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
return images;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates through the document to find all of the tasks and their completion state.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user