/* Throwaway: one wide screenshot of the writing surface, to look at it. */ import { OUT, launch, withFreshUser, createNotebook, createNote, typeInEditor } from "./lib.mjs"; const browser = await launch(); const session = await withFreshUser(browser, "shot"); const p = session.page; await p.setViewportSize({ width: 1680, height: 900 }); await createNotebook(p, "Look"); await createNote(p); await typeInEditor(p, "askjdnasjkdnkjasndjknkjaskjdnasjkdskajndjkanHelkl HALLLO"); await p.keyboard.press("Enter"); await p.keyboard.type("sdfsdfsdfsdfasddddd"); await p.waitForTimeout(1500); await p.screenshot({ path: `${OUT}/look.png` }); const box = await p.evaluate(() => { const pm = document.querySelector(".ProseMirror").getBoundingClientRect(); const pane = document.querySelector(".note-editor").parentElement.getBoundingClientRect(); return { pm: { x: Math.round(pm.x), w: Math.round(pm.width) }, pane: { x: Math.round(pane.x), w: Math.round(pane.width) } }; }); console.log(JSON.stringify(box)); await session.cleanup(); await browser.close();