Référence de l'API

Cette référence est générée depuis les sources. Rien n'y figure sans commentaire de documentation : la couverture cesse d'être un dénominateur, et vous lisez cent pour cent de ce qui a été documenté délibérément plutôt qu'une fraction de ce qui se trouve exporté.

La référence décrit ; les guides expliquent. Quand une entrée demande un concept, elle renvoie au guide au lieu de le refaire — c'est cette couture qui empêche les deux de diverger.

@nbe/core

The headless editor: block store, seven invertible operations, transactions, selection, history and commands. Zero DOM.

NomGenreDescription
ancestorsfonctionBounded parentId walk; returns the ancestor chain (nearest first).
anchoredThreadsfonctionEvery thread id anchored anywhere in the document, and where.
applyAutoformatfonctionApply an autoformat rule: strip the prefix and convert the block.
applyDividerAutoformatfonction'---' becomes a divider with a fresh paragraph after it.
applyInlineFormatfonctionStrip the delimiters and mark what they enclosed. Deleting only the delimiters (rather than replacing the span) keeps marks already inside the content, so `**a *b* c**` ends bold with the italic intact.
applyMarkfonctionAdd or remove a mark over [from, to). A mark of the same type is replaced, unless the type stacks — see @nbe/core!MarkSpec.multiple.
applyOpfonctionApply one operation to the document.
applyTextReplacementfonctionSwap the sequence for its character, keeping the marks it was typed under so an arrow inside a bold run stays bold. One dispatch, so one `⌘Z` puts the literal text back.
applyViewfonctionPure view evaluation: filters (AND) then stable multi-sort.
atfonctionTag a contribution with a precedence.
BlockCategorytypeThree kinds of block, and every behavioural question follows from which one you have: - `text` carries inline content, so it owns a caret and is edited - `void` has no text (image, divider, page link, database): there is no caret to place, so a press on it is a grab, not an edit - `layout` is structure (columns, page): never a drag target of its own
BlockPlugininterfaceA block plugin: one declaration covering every surface a block touches. `schema` is JSON-serializable and free of behaviour on purpose — the static renderer and a future Swift port consume it without executing any JavaScript. Everything else is behaviour and lives beside it rather than inside it.
BlockSpecinterfaceThe declarative description of a block type.
BlockStoreinterfaceWhere a document's blocks live.
byPrecedencefonctionSort contributions by category, then by the order they were registered in.
CommentMessageinterfaceOne message in a thread.
COMPUTED_TYPESconstanteProperty types whose value is derived, never authored.
computeRowfonctionResolve a row's derived properties (formula, rollup). Authored values pass through untouched. Formulas may reference other formulas; a cycle resolves to null instead of hanging — one bad formula must never take a table down.
DatabaseDatainterfaceWhat a database view needs from its host.
deleteBackwardfonctionDelete the selected range, or one perceived character backward.
deleteTextSelectionfonctionDelete a text selection, including one spanning several blocks: the tail of the first block and the head of the last are removed, blocks fully inside disappear, and the remainder of the last block merges into the first — exactly what a user expects from pressing Backspace over a selection.
docFromJSONfonctionBuild a document from stored JSON, migrating it when given a schema.
documentOrderfonctionEvery block id in reading order — depth-first from the root.
EditorclasseThe document, its schema, its selection, and the only way to change any of them.
evaluateExprfonctionEvaluate an AST. Never throws — invalid operations produce null.
evaluateFormulafonctionParse + evaluate in one call. Parse errors yield null (use parseFormula to surface them).
evaluateViewfonctionFilters + sorts + optional grouping in one call (what views actually need). Derived properties are resolved FIRST so formulas and rollups can be filtered, sorted and grouped on like any other column.
expandsForwardfonctionTrue when typing *after* this mark should continue it.
formatValuefonctionHuman formatting of a cell value for read-only display.
formulaDependenciesfonctionProperty names a formula reads — the dependency edges for cycle detection.
FormulaValuetypeFormula language (AQ#8): a small, total, pure expression evaluator. Design rules, all deliberate: - no I/O, no clock, no randomness — a formula is a pure function of the row, so results are reproducible, cacheable, and safe to recompute anywhere (browser, CLI, future native client) - never throws at evaluation time: bad input yields `null`, so one broken formula can never take a table down. Parse errors ARE reported, because they are authoring feedback. - properties are referenced by name via prop("Name"), which keeps formulas readable and lets the schema rename them without touching ids
GRAPHEME_AWAREconstanteTrue when this engine can segment properly rather than by surrogate pair.
graphemeBoundariesfonctionCluster boundaries within `text`, as offsets, including 0 and `length`.
graphemeLengthfonctionHow many perceived characters `text` contains.
groupRowsfonctionGroup rows by a property. Group order follows the property's declared options (so board columns keep the schema order), then any ad-hoc values, with the no-value group last. A multi-select row appears in every group it belongs to — the Notion board behavior.
hasMarkfonctionTrue if the entire [from, to) range carries a mark of this type.
indentfonctionTab: nest the block under its previous sibling (Notion indent).
insertColumnsfonctionA column layout, asked for rather than dragged into being.
insertParagraphAfterfonctionPut an empty paragraph right after a block, and the caret in it.
insertTextfonctionInsert a plain-text run at the caret, replacing any selected range first.
lossyfonctionDeclare that a format cannot represent this block faithfully.
MarkdownProjectioninterfaceHow a block becomes markdown and comes back. Both directions are required, and that is the point. A plugin author who only implements `toMarkdown` has written a block that silently degrades on re-import; the type refuses it. When a format genuinely cannot represent a block, say so with lossy rather than omitting the handler.
markExpansionfonctionHow a mark expands, defaulting to `after`.
MarkExpansiontypeWhich side of a mark absorbs text typed against it. - `after` — typing at the end continues the mark. What emphasis should do. - `before` — typing at the start continues it. - `both` — either edge. - `none` — the mark keeps exactly the characters it was applied to.
MARKSconstanteThe closed mark set of §2.2, with its edge behaviour.
marksAtfonctionMarks the next typed character should carry.
matchAutoformatfonctionThe rule for what was typed, or null.
matchInlineFormatfonctionInline markdown span ending exactly at the caret, or null.
matchTextReplacementfonctionThe replacement ending exactly at the caret, or null.
memoryCommentsfonctionA store held in memory.
mergeBackwardfonctionBackspace-at-start semantics: non-paragraph converts to paragraph first (Notion behavior), then paragraph merges into the previous inline block.
mergeForwardfonctionDelete-at-end semantics: pull the next visible block into this one. A void next block (divider, image) gets block-selected instead of destroyed.
migrateBlockfonctionBring one block up to the schema's current version.
migrateJSONfonctionMigrate a whole document tree, depth-first.
MigrationtypeUpgrades a block by exactly one version.
moveBlocksfonctionMove blocks to an explicit position (drag & drop before/after).
moveBlocksVerticalfonctionMove a contiguous group of sibling blocks one slot up or down.
moveIntoColumnsfonctionDrop blocks on the left/right edge of a target (ARCHITECTURE §7): wraps the target in a column_list, or adds a column when the target is already one.
needsAttentionfonctionTrue when the report contains anything a caller should act on.
newMessagefonctionBuild a message, filling in the parts a caller should not have to.
newThreadfonctionBuild a thread from its first message.
nextGraphemefonctionThe offset one perceived character after `offset`.
nextWordfonctionWhere a forward word-delete should stop, from `offset`.
normalizeRunsfonctionMerge adjacent runs with identical mark sets, drop empty runs.
OptypeThe closed operation set (ARCHITECTURE §3). Every mutation flows through these. Applying an op returns its exact inverse ops.
orphanThreadsfonctionThreads whose text is gone.
outdentfonctionShift+Tab: move the block after its parent, one level up.
parseFormulafonctionParse a formula source into an AST. Throws FormulaError on bad syntax.
PluginRegistryclassePer-editor, never module-global. ProseMirror's module-level `PluginKey` produces a long-running class of failure — "Adding different instances of a keyed plugin" — whenever two copies of a package load, and our own `block-actions.ts` and `block-toolbar.ts` are the same mistake in miniature: two editors on one page share their registries today. Module-level *keys* are fine; module-level *values* are not.
PluginVersionErrorclasseThrown when a plugin declares a contract version this build cannot honour.
PointinterfaceA position in inline text: (blockId, UTF-16 offset). Never persisted.
PrecedencetypeWhere a contribution sits relative to others of its kind. Named categories, not numbers, and this is the single most evidence-backed decision in the plugin design. A module in isolation cannot know what numbers other modules picked — they are points on an undifferentiated range, i.e. z-index. Lexical shipped five numeric buckets, found you could not get in front of a listener at your own level, and had to add negative constants that bit-mask back into the same bucket. Tiptap shipped its ordering backwards for a long time and nobody noticed, because the resulting order is unobservable. Within a category, registration order decides. That is observable in the array the host wrote.
prevGraphemefonctionThe offset one perceived character before `offset`.
prevWordfonctionWhere a backward word-delete should stop, from `offset`.
PropertyTypetypeDatabase model (ARCHITECTURE §2.5, phase 3): the four record kinds. - the `database` BLOCK (schema.ts) is the placement in a page (view block) - CollectionSchema (typed properties) and ViewConfig (layout/filter/sort) are workspace-level records owned by the host - rows are ordinary pages whose props carry { collectionId, properties } This module is the pure evaluation engine; rendering lives in @nbe/dom and storage in the host. Formulas, relations and rollups are evaluated here: `computeRow` resolves them before any filter, sort or grouping runs, so a computed column behaves like any other (AQ#8).
rangeHasMarkfonctionTrue when every covered stretch of the range carries the mark.
rangeInBlockfonctionThe covered [from, to) inside one block of a resolved range.
RankedinterfaceA value with a precedence attached. `at()` is how you tag one.
registerMarkfonctionRegister or override a mark's edge behaviour, for a plugin's own mark.
relationIdsfonctionRelation values are stored as an array of related page ids.
reportfonctionApply the configured reaction to a set of violations.
resolveTextRangefonctionPut a text selection into document order and enumerate the inline blocks it covers. Everything that acts on a range (delete, format, copy) works from this, so cross-block behaviour is defined in exactly one place.
selectedBlocksfonctionResolve a block selection to its top-level selected blocks: the blocks in the visible range whose ancestors are not themselves selected (a selected block always implies its whole subtree).
setColumnCountfonctionAdd or remove columns, keeping what was written in them.
setColumnRatiosfonctionHow the width is shared out: one `ratio` per column, as `flex-grow`.
singleBlockRangefonctionThe selected range when it lies in a single block, in document order and snapped off any character it would bisect.
snapGraphemefonctionMove an offset onto the nearest cluster boundary.
spanExitfonctionWhere the caret has to go to get *out* of the span it is inside.
splitBlockfonctionEnter semantics (ProseMirror-inspired chain, ARCHITECTURE §3): empty non-paragraph → turn into paragraph; else split at the caret.
TEXT_REPLACEMENTSconstanteThe pairs, longest first — `endsWith` takes the first hit, so `-->` has to be tried before `->` or the arrow eats the second dash.
threadIdsInfonctionThe thread ids a block's text is marked with.
threadsInDocumentOrderfonctionThreads in the order their anchors appear down the page.
toggleCheckedfonctionTick or untick every to-do among `ids`.
toggleMarkfonctionToggle a mark over the current text selection (single block for now).
toggleMarkRangefonctionToggle a mark over a range, across blocks when the selection spans them.
validateBlockfonctionCheck one block against its spec.
validateDocfonctionCheck every block in a document.
ValidationModetypeHow a violation is surfaced.
ViolationinterfacePer-block validation at apply.
visibleBlocksfonctionDepth-first order of visible blocks (collapsed toggles hide their children).
visiblePropertiesfonctionProperties shown in a view, in schema order, honoring `hidden`.

@nbe/dom

The single contenteditable view: rendering, keymaps, clipboard, drag, overlays and the UI primitives.

NomGenreDescription
attachTooltipfonctionAttach a tooltip to an element. Each target owns its tooltip node rather than sharing one module-level element: with a shared node, one control hiding its tooltip removes the node another control just showed, so tooltips flicker or never appear at all. The node is also dropped when the target leaves the DOM, and *that* is the hard half. A tooltip hides on `mouseleave` — but **an element removed from the document never fires one**, and the chrome this is attached to is removed all the time: the gutter hides when the pointer leaves a block, a toolbar rebuilds, a menu closes. So the pointer moves away, the button vanishes, no event arrives, and the label sits there pointing at nothing (reported 2026-08-10, with a screenshot of « Commenter ce bloc » alone in the margin). Checking `isConnected` at show time was already here and could not catch it: by then the tooltip is up, and the removal happens afterwards. So while one is on screen — one at a time, and rarely — a frame loop watches for the target going away. Cheap, and it needs no further gesture from the user, which a "hide on the next pointermove" fix would.
autoUpdatefonctionKeep a floating element glued to a live anchor across scroll, viewport resize, anchor movement AND its own content changing size. That last one is what makes filtering menus behave: a menu placed above its anchor is positioned from its own height, so when the list shrinks to one item the box must move back DOWN or it visibly floats away from what it is attached to. A ResizeObserver on the floating element catches every such change — content edits, images loading, fonts swapping — without the caller having to remember to reposition.
blockClickRecognizerconstanteNotion-style routing: pressing anywhere on a block's row — its padding, its gutter, the empty area right of short text — places the caret at the nearest text position instead of silently doing nothing, which used to leave the model selection stale so later keystrokes landed at the old spot.
BlockKeyHandlertypeReturn true when the key was handled; the keymap then stops.
BlockRenderContextinterfaceThe editing-surface half of a block plugin. `BlockPlugin.view` is typed `unknown` in core, because core must never depend on the DOM; this is where it is refined. A plugin package therefore splits by entry point — the schema entry depends on `core`, the `/dom` entry on `dom` — which is what §9 of the architecture always anticipated and what keeps the markdown and static-renderer packages free of DOM. Everything here replaces a closed dispatch that exists today: | contribution | replaces | |---|---| | `render` | a whole-block branch of `render.ts` | | `chrome` | a row-decorating case of `render.ts`'s switch | | `actions` | `block-actions.ts`'s module-global registry | | `toolbar` | `block-toolbar.ts`'s module-global registry | | `slash` | an entry of `slash.ts`'s `ITEMS` array | | `turnInto` | an entry of `block-types.ts`'s `TURN_INTO` | | `keys` | a branch of `keymap.ts` | | `features` | an `attach*` hardwired into the default feature list | | `styles` | a slice of `style/blocks.css` |
blockToolbarFeatureconstanteThe per-block toolbar shown on hover.
builtinBlocksconstanteNo built-in block plugins ship from `@nbe/dom`. Deliberately empty rather than a barrel of everything: Tiptap's `StarterKit` statically imports about twenty extensions, so `configure({ heading: false })` turns a block off and leaves its code in the bundle. Ergonomics and tree-shaking are in direct conflict there and the kit wins. A host composes the array it wants: ```ts import { callout } from '@nbe/blocks-callout/dom' new EditorView(el, editor, { blocks: [callout] }) ``` The block types still built into the view's switch are not plugins yet; they need no registration.
canPaintCrossBlockfonctionTrue when this browser can paint a cross-block selection.
caretLinefonctionWhether the caret is on the block's first or last *visual* line.
classicFeaturesconstanteThe older kind of editor: a page of text with a toolbar, no block chrome.
clipboardFeatureconstanteCopy, cut and the full paste pipeline.
closeAllOverlaysfonctionClose everything. Used when an editor is destroyed under an open overlay.
CommentAuthorinterfaceA person, for display beside what they said.
CommentContextinterfaceWhat a comment affordance was pointing at.
commentMarkersFeatureconstanteA commented block says so in the right margin, without being hovered.
CommentThreadOptionsinterface
computePositionfonctionPure positioning: viewport-relative coordinates for a floating element. Flips to the opposite side when the preferred side overflows and the other side fits; always clamps inside the viewport padding. (Micro floating-ui — ponytail: no shift/arrow middleware until a real need appears.)
createActionButtonfonctionThe one way to build an action control in this editor. Every surface (block gutter, block toolbar, selection toolbar, link card, database chrome, block-rendered affordances) goes through here, so tooltip, accessible name, popover-toggle behaviour and selection preservation are decided once instead of being remembered at ~40 call sites.
createDragGhostfonctionA drag preview that follows the pointer: clones of what is being dragged, stacked, with a count badge when several items travel together. In-house because native HTML5 drag images cannot be styled or updated (decision D8) — this is the piece that makes dragging feel physical, and it is shared by block drag and board-card drag.
createDropZonefonctionEmpty-media placeholder: click to choose, drop to fill, or paste a URL. Returns the element; the caller owns placement.
createHoverZonefonctionHover controller for block chrome. Fixes the classic hover loss: listens on document (not the content element), resolves targets by geometry so the left margin still hovers the adjacent block, keeps the target while the pointer is over the floating chrome, and hides only after a grace delay.
createSegmentedfonctionA small set of mutually exclusive choices, shown at once. A select hides its options behind a click; for two to four visual choices — text alignment, a callout variant — showing them is both faster and self-documenting.
crossBlockHighlightFeatureconstantePaints a text selection that spans blocks, which the browser will not hold.
databaseFeatureconstanteInteractive database views. Needs a `database` host to do anything.
debugHoldingfonctionTrue while the chrome is pinned. Cheap enough for a hover path.
DEFAULT_ALIGNconstanteWhere a media block sits when nobody has said.
defaultExportFormatsconstanteThe three formats this package can produce on its own.
defaultFeaturesconstanteEverything that makes the editor feel like the demo.
defaultLabelsconstanteThe labels an editor uses when a host names none.
defaultLeftGutterconstanteThe + button and the ⋮⋮ handle, in that order.
defaultRecognizersconstantePrecedence, most specific first. This list is the arbitration story.
defaultRightGutterconstanteJust the comment button, and only when `onComment` is set.
dismissedByfonctionTrue when the press that just closed an overlay happened inside `trigger`. A trigger button must TOGGLE its overlay: without this, pressing it again dismisses (outside press) and the click that follows immediately reopens, which reads as a broken button. Trigger handlers call this and bail. Still time-bounded, because it genuinely is about one press-then-click pair rather than about state — but the window only has to outlive a single browser-generated click, not a user gesture.
documentSizefonctionCount the document as a reader sees it: visible blocks, plain text.
DomBlockPlugininterfaceA plugin whose `view` has been refined to this layer's type.
domToModelPointfonctionMap a DOM position to a (blockId, offset) model point.
draggablefonctionPointer-based drag session (in-house by decision D8 — see docs/research/hard-interactions.md). Robustness rules learned the hard way: - move/up/cancel listen on `window`, not the handle: if the handle is hidden, re-rendered or detached mid-drag, the session still ends. - pointer capture is attempted as an extra (it keeps events flowing when the pointer leaves the window) but is never relied upon. - the session also ends on Escape, pointercancel, window blur, and a second pointer going down — a drag can never be left dangling. - callbacks are exception-safe: a throw in onMove/onDrop still runs the caller's cancel path instead of freezing the page in drag state.
dragMechanicsfonctionThe two things a router-owned drag still needs: a movement threshold and edge auto-scroll. Everything else `draggable()` does — window-level listeners, Escape, blur, pointercancel, exception safety, teardown — the gesture router already provides, so a recognizer must not re-implement it. This is the shared remainder, extracted rather than copied.
EditableTopologyinterfaceWhere the editable boundary is — the one thing that separates "one contenteditable per block" (D1) from "a single editable root". The insight that makes this cheap: today's code conflates two different elements under the name "leaf". - the **leaf** is the element whose text maps 1:1 to a block's model text. It exists in both topologies, and every selection primitive needs it to answer "which block, which offset". - the **host** is the element carrying `contenteditable`. It is what the browser will and will not drag-select across. Per-block, they are the same element. Single-host, the leaf is a plain div and the host is the content root. Once they are separate names, every interaction module can be written against the host without caring which topology it is running under — and the question the cross-block selection driver actually asks, *"will the browser natively span these two?"*, reduces to `hostOf(a) === hostOf(b)`.
editInlinefonctionReplace an element's content with a text field, commit on Enter or blur, restore on Escape. The inline-edit pattern `database.ts` hand-rolled for cells and titles.
EditorFeatureinterfaceA feature is anything that attaches behaviour to a mounted view and can be removed again.
EditorViewclasseA document, projected into the DOM, and everything that makes editing it feel like an editor.
EditorViewOptionsinterfaceEverything a host can change when mounting an editor.
EmojiEntrytypeAn emoji and what it is called, one string per language.
ESCAPE_SELF_ATTRconstanteA control inside an overlay that needs Escape for itself — cancelling an edit rather than closing the overlay — marks itself with this attribute. The stack listens in the capture phase on purpose: an open overlay must beat the editor's keymap, or Escape would drop out of text mode behind an open menu. Capture means nothing deeper ever gets a chance, so the one legitimate exception has to be declared rather than discovered.
exportFeatureconstante`⌘P` offers Markdown, plain text and print-to-PDF. Not in `defaultFeatures`.
ExportFormatinterfaceTake the page with you: `⌘P` offers the formats this document can become.
FieldOptionsinterfaceThe form layer of the UI primitives. It exists because the two per-block-type registries that will become the plugin API — `block-actions.ts` and `block-toolbar.ts` — already hand-roll their inputs, and `database.ts` hand-rolls ten of them. A block author with nothing to reach for writes raw DOM, and raw DOM then *is* the contract. Three rules every control here obeys, so no call site has to remember them: 1. **Escape belongs to the control.** A field inside a menu must cancel its own edit rather than close the menu, so everything here carries `data-nbe-escape-self` and the overlay stack yields to it. 2. **Keys stay inside.** Editor keymaps listen on the content and menus navigate with arrows; a field that lets its keydown bubble gets its text interpreted as commands. Everything here stops propagation. 3. **Commit is explicit.** Enter commits, Escape reverts, blur commits — once. Comparing against the last committed value is what separates "commit on blur" from "commit twice when Enter also blurs".
findFeatureconstante`⌘F` finds in the page. **Not in defaultFeatures**, deliberately: in a browser that key is the browser's, and replacing it with something worse is one of the things this project's competitors are resented for. Add it in a host that has no browser find to take — a plugin pane, a desktop shell.
findHitsfonctionEvery occurrence of `query` in the visible document, in reading order.
findScrollParentfonctionNearest scrollable ancestor (falls back to the document scroller).
FollowControlinterfaceFollowing someone: the viewport goes where they go.
formatfonctionFill `{name}` placeholders in a label.
formatToolbarFeatureconstanteThe floating format toolbar shown over a text selection.
gesturesFeatureconstantePointer arbitration: text selection, block click-routing, the rubber band.
GutterActioninterfaceOne button in a hover gutter.
gutterFeatureconstanteThe hover gutter: the + button, the ⋮⋮ handle, its menu, and drag & drop.
GutterItemtypeAn entry in a gutter: one of the editor's own buttons, by name, or your own.
iconfonctionBuild an inline SVG icon element. Unknown names render nothing visible.
inputFeatureconstanteReading and writing text: beforeinput, composition, the DOM reconciler.
insertBlocksAtfonctionPut blocks where the caret is — the insertion half of paste and drop.
isModfonctionTrue when the event carries this platform's command modifier.
keymapFeatureconstanteKeyboard commands and navigation.
labelsForfonctionThe pack for a code, English for anything else.
leafOffonctionThe element whose text maps 1:1 to a block's model text, in any topology.
linkHoverFeatureconstanteThe hover card on a link, for editing or opening it.
LinkPasteOptionsinterfaceWhat a link should become, asked at the moment it arrives.
LOCALE_NAMESconstanteFor a picker: the code and the language's name in itself.
LOCALESconstanteThe languages that ship.
loneLinkfonctionThe same offer, for a link that is already in the document.
MENTION_MARKconstanteInline page mentions: `@` opens a picker, choosing inserts a live reference.
MentionCandidateinterfaceA page the host offers for `@` completion.
mentionRunsfonctionThe runs a chosen mention becomes: the reference, then a trailing space.
mentionsFeatureconstante`@` opens the page-mention picker. Inert without an `onSearchPages` host.
MenuFilterinterfaceThe search field of a combobox: a menu you filter by typing.
minimalFeaturesconstanteThe smallest editor that still edits: type, navigate, select, paste.
nativeRangeSpansfonctionWill the browser natively drag-select from `a` to `b`? Derived rather than implemented per topology: a drag-selection is constrained to the editing host it started in, so the answer is simply whether both ends share one. Per-block that is false across blocks, which is why the cross-block driver exists; single-host it is always true, which switches that driver off without it needing to know why.
offerLinkTreatmentsfonctionOffer the treatments for a link that has just been pasted.
openCommentThreadfonctionOpen the discussion on a block. Wire it to `onComment`.
openExportfonctionOpen the export menu on a mounted view, from outside the keyboard.
openFindfonctionOpen the find bar on a mounted view, from outside the keyboard.
openOverlaysfonctionEverything currently open, deepest last. Exposed for the Escape chain.
openPagePickerfonctionPoint a `link_to_page` block at a page, found by searching the host.
openPagePickerOnfonctionThe picker anchored to a block, for the slash menu and the ⋮⋮ menu alike.
outsidePressFeatureconstanteDrops a block selection when a press lands outside the editor.
OverlayEntryinterfaceThe overlay stack: one place that owns "what is open, and what closes it". Before this, every overlay called `dismissable()` and attached its own capture-phase listeners. That made Escape a broadcast — a menu opened from inside a popover closed both — and made an outside-press decision that each overlay took alone, so a nested overlay dismissed its own parent. A stack answers both correctly and cheaply: - Escape closes the TOP entry and stops. - An outside press is judged against the whole stack, then closes every entry above the deepest one that contains the press. One document listener serves every overlay, regardless of how many are open.
peerSelectionfonctionThis editor's selection, flattened into what a peer needs to see.
perBlockTopologyconstanteD1 as shipped: every leaf is its own `plaintext-only` host. `plaintext-only` is the whole reason this topology is attractive — the browser refuses to inject markup, so the model stays the only source of structure. The fallback to `true` exists because Firefox only shipped `plaintext-only` recently; there the MutationObserver defence carries the weight instead.
pickFilefonctionFile intake primitives shared by every block that accepts media. Kept dependency-free: a File becomes either a base64 data URL (works with zero host wiring) or an opaque asset ref when the host provides a store.
PopoverOptionsinterfaceA floating panel with arbitrary content. `menu.ts` was doing two jobs: a keyboard-navigable list, and the generic "something floats next to this anchor" container. So every non-list overlay — the image drop zone, the formula editor, a property panel — had to pretend to be a menu item by passing `{ kind: 'custom', el }`. That is the escape hatch becoming the API, in miniature: a block plugin wanting a small form had no honest way to ask for one. A popover is the container without the list: positioning, the overlay stack, and nothing else. `createMenu` keeps the list behaviour and is now one *kind* of popover rather than the only floating thing that exists.
positionFloatingfonctionApply computePosition to a floating element already attached to <body>.
PressContextinterfaceOne press, one owner. Five modules used to listen for pointerdown on the same surface and each decide, by sniffing the target, whether the press was theirs. Nothing arbitrated: precedence was whatever order `view.ts` happened to attach them in, and two could start on the same press. Worse, they coordinated through wall-clock windows — `textIntentActive()` at 500 ms, `justRubberBanded()` at 300 ms — because they had no shared notion of what was currently happening. Every one of those was a real bug fix, and every one was timing-fragile: a slow frame moved the boundary and the bug came back as an unreproducible flake. The router classifies a press once, hands it to exactly one recognizer, and publishes what is running. Modules ask about state instead of guessing from timestamps.
pushOverlayfonctionPush an overlay onto the stack. The returned function pops it — call it from the overlay's own close path, and it is safe to call twice.
readOnlyFeaturesconstanteNothing attached: the document renders and never changes.
refreshCommentMarkersfonctionRepaint the markers — for a host whose counts live outside the document.
RemotePeerinterfaceA peer, as this package needs to see one.
RemoteSelectiontypeWhere a peer is.
removeCommentThreadfonctionDelete a thread and the anchor that pointed at it.
requestFullscreenfonctionFill the screen with one element — the lightbox, spelled the platform's way.
resizeHandlesfonctionBuild the handles a resizable surface carries.
resolveLabelsfonctionMerge a partial override over the defaults.
revealfonctionPut an element on screen — and *only* when it is not already there.
REVEAL_MARGINconstanteBreathing room above a block scrolled to the top on purpose.
rubberBandRecognizerconstantePress on empty editor space and drag: top-level blocks intersecting the band's vertical range become a block selection.
selectionSyncFeatureconstanteMirrors the browser selection into the model.
shortcutfonctionA shortcut, spelled the way this platform spells it.
singleHostTopologyconstanteThe alternative D1 never got its spike against: one editable root. It buys native cross-block selection for free and costs a permanently editable container the browser will happily restructure — which is exactly the trade the roadmap wanted measured. Shipping it as a topology is what makes that measurement a config change rather than a rewrite.
slashMenuFeatureconstante`/` opens the block menu.
SlotNametypeWhere chrome that is not a block may live. See EditorView.slot.
stickyFormatToolbarFeatureconstanteThe same toolbar, pinned above the document instead — the older WYSIWYG shape, always visible.
textSelectRecognizerconstanteSelecting text, including across blocks. Inside one editing host the browser does this natively and better than we would, so we stay out of the way entirely. Across hosts it will not: a `Selection` is clamped to the host the gesture started in, measured in Chromium 150 and 151 (`e2e/selection-topology.spec.ts`). `setBaseAndExtent` does not escape it, and neither does any temporary toggle of editability — the range dies the moment editability returns. So beyond that boundary the model carries the selection and the Highlight API paints it (`cross-block-highlight.ts`). That works because a plain `Range` spans hosts freely — only `Selection` is constrained — and because every range command already operates on the model rather than on the DOM. Under a single-host topology `nativeRangeSpans` stays true and none of this runs.
toContainerPointfonctionConvert a viewport point into coordinates inside a positioned container.
TriggerMenuOptionsinterfaceA menu opened by typing a character, filtered by what follows it.
TypefaceinterfaceOne of the faces a page can be set in.
TYPEFACESconstanteThe three that ship. The first is the default and needs no attribute.
viewportGuardFeatureconstanteKeeps the caret visible when a virtual keyboard opens over it.

@nbe/markdown

The human-readable projection: markdown in both directions, plus CSV and Obsidian-shaped view files for collections. Depends on core only.

NomGenreDescription
APP_SECTIONconstanteThe key every piece of editor-owned data hangs under.
blocksToMarkdownfonctionSerialize blocks to markdown.
documentToMarkdownfonctionWrite one back.
emitScalarfonctionA value as YAML: a plain scalar where that is unambiguous, JSON otherwise.
FrontmatterclasseThe frontmatter of one file: a small ordered map that remembers its source.
FrontmatterSplitinterfaceA file's frontmatter and the Markdown under it.
MarkdownDocumentinterfaceA Markdown file as this editor sees it: what the document *is*, and what it is *about*.
MarkdownOptionsinterfaceOptions carried through a whole serialization or parse.
markdownToBlocksfonctionParse markdown into blocks.
markdownToDocumentfonctionRead a Markdown file: its frontmatter, then its blocks.
parseScalarfonctionA YAML scalar, as the value it means.
readFrontmatterfonctionSplit a Markdown file into its frontmatter and its prose.
runsToMarkdownfonctionSerialize rich text.
slugifyfonctionA title reduced to what a filename and a wikilink target can both hold.
unknownMarkerfonctionThe line an unregistered block type is written as: `<!-- nbe:type {…} -->`.
unquotefonctionTake the quotes off a YAML string, keeping what is inside them.
writeFrontmatterfonctionPut a file back together.

@nbe/static-renderer

JSON to HTML without an editor instance and without DOM globals — for export, server rendering and static sites.

NomGenreDescription
renderBlocksToHTMLfonctionRender a list of sibling blocks to an HTML fragment.
RenderOptionsinterfaceStatic HTML rendering: schema JSON → HTML with no editor instance and no DOM APIs (SSR/CLI safe). Depends on @nbe/core only — never on @nbe/dom (ARCHITECTURE §9). Markdown projection lives in @nbe/markdown.
renderToHTMLfonctionRender a page (root block) to an HTML fragment.
renderToTextfonctionPlain text extraction (search indexes, previews, meta descriptions).