Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
TypeScript
12345678910111213141516171819202122232425262728293031323334353637/** * Shared visual tokens for all editor backends. Backend-specific editors * import these; do not duplicate prose/chrome classes elsewhere. */
/** Outer frame: border, surface, flex column filling the pane. */export const documentEditorFrameClass = 'border-border bg-background flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-md border';
/** Scroll region wrapping TipTap's EditorContent (or future editor roots). */export const documentEditorScrollClass = 'min-h-0 flex-1 overflow-y-auto [&_.ProseMirror]:min-h-0 [&_.ProseMirror]:flex-1 [&_.ProseMirror]:overflow-y-auto [&_.ProseMirror]:outline-none [&_.tiptap]:flex [&_.tiptap]:min-h-0 [&_.tiptap]:flex-1 [&_.tiptap]:flex-col';
/** ProseMirror content: typography, focus ring, placeholder pseudo-element. */export const proseMirrorClass = 'ProseMirror box-border min-h-0 w-full min-w-0 px-3 py-2 text-[15px] leading-relaxed text-foreground outline-none ' + 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--semantic-accent)] ' + '[&_blockquote]:border-border [&_blockquote]:mb-3 [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic ' + '[&_code]:rounded [&_code]:border [&_code]:border-border/50 [&_code]:bg-border/35 [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.9em] ' + '[&_h1]:mb-3 [&_h1]:mt-6 [&_h1]:text-2xl [&_h1]:font-semibold [&_h1]:first:mt-0 ' + '[&_h2]:mb-2 [&_h2]:mt-5 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:first:mt-0 ' + '[&_li]:my-1 [&_ol]:mb-3 [&_ol]:list-decimal [&_ol]:pl-6 ' + '[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-border [&_pre]:bg-border/25 [&_pre]:p-3 [&_pre]:text-sm ' + '[&_p]:mb-3 [&_strong]:font-semibold [&_a]:text-accent [&_a]:underline [&_ul]:mb-3 [&_ul]:list-disc [&_ul]:pl-6 ' + '[&_p.is-empty:first-child]:before:float-left [&_p.is-empty:first-child]:before:text-foreground/40 [&_p.is-empty:first-child]:before:content-[attr(data-placeholder)]';
/** Empty / unsupported-document state inside the same frame geometry. */export const documentEditorEmptyStateClass = 'border-border text-foreground/60 flex h-full min-h-0 w-full items-center justify-center rounded-md border border-dashed p-5 text-center text-sm';
/** TipTap `editorProps` shared by ProseMirror-based backends. */export function tiptapProseEditorProps() { return { attributes: { class: proseMirrorClass }, };}