/** * Typography + box-model classes that MUST stay identical between the editor * textarea and the painted highlight overlay underneath it. * * The overlay is positioned `absolute inset-0` over the textarea and paints the * visible text while the textarea keeps `text-transparent`. If the two layers * ever differ in font size, line height, padding or available content width, * soft-wrapped lines break at different columns; every difference shifts the * overlay text vertically against the caret/click geometry of the textarea * below it. Inserting an image markdown token (`![alt](/media/...png)`, one * giant unbreakable word) maximizes wrap-point sensitivity, which is why the * drift becomes obvious right after an upload. Both components import these * classes from here instead of duplicating them; keep new shared metrics here, * not inline in either component (see tests/int/wiki-editor-metrics.int.spec.ts). */ export const WIKI_EDITOR_METRICS = "px-3 py-2 font-mono text-sm"; /** * Classic scrollbars (Firefox, Safari, non-overlay Chrome) reserve layout width * inside the scrolling textarea, shrinking its content width relative to the * overflow-hidden overlay. Hiding the scrollbar keeps both boxes exactly the * same width everywhere; wheel/keyboard scrolling and the existing * caret-into-view logic still work without a draggable thumb. */ export const WIKI_EDITOR_SCROLLBAR_NONE = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden";