prosemirror-beltype
v0.1.1
Published
BelType's fragmentainer for prosemirror-fragview: Cicero's page implementing fill over the engine's own objects, with the gaps filled the ProseMirror way.
Readme
prosemirror-beltype
BelType's fragmentainer for prosemirror-fragview: Cicero's page implementing fill over the engine's own objects, with every gap between a one-round host and an editor's view filled the ProseMirror way. The engine is not changed to do this and never learns ProseMirror's name; the view never learns the engine's. This package imports both.
Install and try it: npm install takes the engine from npm (@beltype/cicero) and the fragmented view from Codeberg at a pinned commit, so a clone needs nothing else on disk. An editor built on it lives in its own repository, prosemirror-beltype-venue: a six-page pagination specimen whose pages are cut as you type, installed from what is published. The specimen harness (npm run specimen) is the one part that needs local checkouts, BelType's (BELTYPE_ROOT) and the studio's (BELTYPE_STUDIO), whose generic schema it reads.
The plan and its phases are in docs/plan.md. The rule it builds under is BelType's decision record the engine knows no view.
Phase 1, the page as fragmentainer without reads, is built on its branch: CiceroPage fills one turn of the engine's build loop through the engine's own functions, and ciceroContainers hands the view a page per entry from the geometry table. Measured in BelType's own page against the CLI's round, the specimen's 9 pages and a 26-page fixture that reaches the Stonehand (8 Class B cuts, 13 Class A) agree page for page, first and last word, with no warning on either side; the showcase's first difference is its second page, where the engine repeats a table's header and this package does not yet. The phase found that a slice cannot be its own source in the engine's measure context (the Stonehand reads a second rendering outside it), that the view's editing host passes its text mechanics into a page, and that the renderer's adjoin is wrong after a forced break; docs/results.md has the record and what is not done.
The round after it, the page always advances, built on its branch: fill never throws (an uncuttable run at the page's start is taken whole and overflows, clipped, with one console line), and the shells are built as the engine builds them, by its own fragment functions on the rendered slice: the page edge's cut through a box (painted), an end-gap Class C (blank), and a cut through a row (each item at a place of its own), each said to the page after in the fill's next. Four fixtures written for them (a code block and a plate taller than the page, two end gaps, a table and a flex row cut through, the showcase's two-column glossary) agree with the CLI round page for page, first and last word; the specimen and the flow fixture still do; the studio's showcase under the generic schema settles at 74 pages against 76, its differences the reads, the carried floats and a fault of the engine's own continuation of a code block. docs/results.md has the record.
The round after that, the page starts at its first box, reads a page's name and its grab's cursor at its first in-flow box, past a running element or a whitespace leaf at its start, so the studio's report and manual have the old path's page counts and the showcase's cover is page 1 with its blank verso back; a running fixture agrees with the CLI round page for page (docs/results.md).
The round after that, the page presents what it renders, replaces every element a registered presenter matches with what the presenter makes, on the trial, the law copy and the shown slice, with the facsimile's intake taken by the factory when a slice first holds a PDF <object>: the studio's facsimile demo is 6 pages against the old path's 6, every page the same, and a facsimile fixture agrees with the CLI's 5 pages and its object boxes (docs/results.md, "The page presents what it renders").
The round after that, the host wears the dressing, has the factory ensure the engine's dressing, the words sheet and the continuation dressing, since no root runs under the view to adopt the five rules that keep a divided box from showing its beginnings or its end twice: a dressing fixture with a divided box for each rule agrees with the CLI's 11 pages, and in a document whose adopted sheets were all taken off before the view was mounted every resumed piece shows what the CLI's shows (docs/results.md, "The host wears the dressing").
The round after that, a space beside a space, adds collapsedSpaces() (src/spaces.js), a plugin for the editor's state: the document is HTML and whitespace collapses in the editor as in print, so a space that would collapse, beside a space or at a line's edge, is promoted to U+00A0 after every transaction, and model, CLI round and page agree on a visible character. In the studio under the switch, A B typed with real keys is A, U+0020, U+00A0, B and draws both spaces, one undo takes a space and its promotion, and the quiet press and the report keep every page (docs/results.md, "A space beside a space").
The round after that, late truth, like with like, has the Cicero page compare the border box it records after a fill with the observer's borderBoxSize, clear its records at every fill and announce moved only for a node it still shows: a node with padding had differed on every observation, so the quiet press's title page and the bolletta's third page refilled once a frame and the report's and the showcase's colophons while on screen. On every studio demo under the view the pages now dispatch no moved and the view no refill while nobody types, and a click under the view reaches the model (docs/results.md, "Late truth, like with like").
The round after that, the page wears its chrome, is phase 2's first: the factory keeps one hidden rendering of the whole state per state (Originals, src/originals.js), the engine's intake read off it, and every page reads its counters at its first word and its named strings and running elements over its interval, mapped from its model positions to the engine's word positions through the renderer's map, and draws its chrome as the root does: the folio, counter(pages) once the chain is complete, the strings, the author's counters, the running elements in their boxes. The trial wears the page's number and strings, so string() in the flow is measured with its value. Every fixture, a new chrome fixture and the specimen give the CLI's margin boxes and the state behind them page for page; the showcase's first difference against the CLI moved from page 25 to page 50 (docs/results.md, "The page wears its chrome").
The round after that, the Ledger is state, is phase 2's second: the Ledger is plugin state of this package (ledger(), src/ledger.js), one row per page under the view's entry key with the reads loop's warm tables, written by a transaction the Ledger appends to the view's own refill, and the factory's chain object (Chain, src/chain.js) seats the engine's settleReads around the view, its run the chain itself awaited settled. A host installs ledger() among its state's plugins. target-counter() and target-text() are delivered on the view's pages, equal to the CLI's on the specimen (15 of 15) and the chrome fixture, settled in as many runs as the CLI's; an edit redraws the chrome of the pages it does not refill, refills a page whose flow reads a moved string, and gives the view's own fresh fill page for page (docs/results.md, "The Ledger is state").
The round after that, the originals keep their parts, is phase 2's third: the originals are rendered whole once and then per top-level node, the new document's children matched to the last state's by identity, so a node an edit did not touch keeps its element, and the engine's own ForcingMemo is settled once per state against the sheets' reach and handed to the originals' walks and the reads loop's. A keystroke on the showcase renders one chapter instead of the whole state and is quiet in 20.4 to 25.6 ms against 26.0 to 32.4; where the sheets' reach is 0, as on most fixtures, the loop's walks keep every untouched chapter's part, and the showcase settled under reach 0 is quiet in 6.4 to 11.5 ms. Every page, the originals' reading and the delivered reads equal a fresh whole rendering after every edit measured (docs/results.md, "The originals keep their parts").
The round after that, the reach of a whole box, settles the memo with the engine's reading for the unit this host replaces, a whole top-level box (topLevelReach, BelType 8c6d8777), and drops this package's own scan for structural pseudo-classes: the specimen, the showcase and five of the studio's six demos read 0, the quiet press 1, so a keystroke reads one top-level box again and keeps every other's parts. A keystroke on the showcase is quiet in 7.6 to 12.5 ms against 22.3 to 30.4, and every edit measured equals a fresh whole rendering with the memo in use (docs/results.md, "The reach of a whole box").
