@barocss/math-editor 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/API-SESSION.md +25 -1
  2. package/CHANGELOG.md +48 -0
  3. package/CLIPBOARD.md +54 -0
  4. package/EDITING-SCENARIOS.md +55 -20
  5. package/GETTING-STARTED.md +54 -0
  6. package/IMPLEMENTATION.md +10 -0
  7. package/KEYBOARD.md +41 -0
  8. package/LATEX-GUIDE.md +30 -2
  9. package/README.md +52 -10
  10. package/RELEASING.md +22 -8
  11. package/ROADMAP.md +106 -1
  12. package/STYLING.md +28 -1
  13. package/TEXT-EDITORS.md +157 -0
  14. package/VALIDATION.md +102 -0
  15. package/dist/dom/caret-geometry.js +1 -1
  16. package/dist/dom/help.d.ts +5 -0
  17. package/dist/dom/help.js +104 -0
  18. package/dist/dom/menu-position.js +4 -3
  19. package/dist/dom/readable-layout.d.ts +3 -0
  20. package/dist/dom/readable-layout.js +52 -0
  21. package/dist/dom/toolbar-catalog.d.ts +1 -1
  22. package/dist/dom/toolbar.d.ts +2 -0
  23. package/dist/dom/toolbar.js +8 -1
  24. package/dist/dom.d.ts +11 -1
  25. package/dist/dom.js +138 -15
  26. package/dist/enter-policy.js +1 -1
  27. package/dist/lines.d.ts +2 -0
  28. package/dist/lines.js +15 -0
  29. package/dist/locales/en.js +21 -3
  30. package/dist/locales/en.json +21 -3
  31. package/dist/locales/ko.js +21 -3
  32. package/dist/locales/ko.json +21 -3
  33. package/dist/math-editor-toolbar.js +2 -1
  34. package/dist/math-editor.d.ts +1 -0
  35. package/dist/math-editor.js +135 -39
  36. package/dist/model.d.ts +2 -0
  37. package/dist/model.js +23 -1
  38. package/dist/range.d.ts +10 -2
  39. package/dist/range.js +31 -6
  40. package/dist/selection-shortcuts.d.ts +13 -0
  41. package/dist/selection-shortcuts.js +35 -0
  42. package/dist/session.d.ts +1 -0
  43. package/dist/session.js +1 -1
  44. package/dist/symbols.d.ts +1 -1
  45. package/dist/symbols.js +1 -0
  46. package/dist/vertical-navigation.d.ts +5 -0
  47. package/dist/vertical-navigation.js +33 -0
  48. package/package.json +1 -1
  49. package/src/style.css +227 -57
package/API-SESSION.md CHANGED
@@ -135,7 +135,9 @@ Inline mode means one top-level row, not a fixed visual height. It rejects newli
135
135
  For a compact draft, pass `menuAvoidElements: () => [actionsElement]` to keep
136
136
  suggestions clear of Apply, Cancel and tool-expansion controls. The callback can
137
137
  return elements added after mounting. Placement remains constrained by the
138
- viewport and clipping ancestors; the menu scrolls when the available gap is short.
138
+ viewport and actual CSS clipping ancestors; a dialog role alone does not limit
139
+ the menu to the dialog height. Fixed menus can extend beyond a compact dialog
140
+ while remaining its DOM descendants. The menu scrolls when the available gap is short.
139
141
  This option changes presentation only and adds no model data.
140
142
 
141
143
  ## Saving without caret-only writes
@@ -333,3 +335,25 @@ transformations preserve the existing operand. The shortcut works with
333
335
  `toolbar: false` and `contextTools: false`, including inline mode. Normal text
334
336
  input continues to use the standard suggestion ordering; a context-only menu
335
337
  requires navigation before Enter can apply a change instead of a host commit.
338
+
339
+ ### Low-level boundary and vertical navigation helpers
340
+
341
+ The core exports `unwrapNext(state)` and `joinNextLine(state)` as immutable state operations, symmetric to `unwrapPrevious` and `joinPreviousLine`. Unsupported positions return the original state. Apply a changed state through a session/history transaction; these helpers do not commit it themselves.
342
+
343
+ `moveVertical(state, direction, geometry)` remains stateless. A custom editing surface can use `createVerticalNavigation()` for repeated vertical movement: call `move(state, direction, geometry)` and apply the returned caret. Call `reset()` after horizontal navigation, text/model changes or pointer placement. Keep this helper local to one view; never serialize its preferred column with the formula.
344
+
345
+ ### Keyboard help and separate toolbars
346
+
347
+ F1 opens localized keyboard/clipboard help in a focused React or native field. The native `DOMMathEditor.showHelp()` method and rich React `MathEditorHandle.showHelp()` method open the same help for a custom host button. Closing restores the previous input selection; opening help does not add a document/history entry.
348
+
349
+ A toolbar mounted separately from its field must identify the owner explicitly:
350
+
351
+ ```ts
352
+ const field = mountMathEditor(fieldHost, { session, toolbar: false });
353
+ const toolbar = mountMathToolbar(toolbarHost, session, {
354
+ onExecute: () => field.focus(),
355
+ onHelp: () => field.showHelp(),
356
+ });
357
+ ```
358
+
359
+ Built-in toolbars connect automatically. A separate toolbar without `onHelp` omits its help button instead of guessing which field to target. F1 still works in the field. Destroy the field to remove any open help. The help UI does not read the OS clipboard. Key remapping is not part of this API.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @barocss/math-editor
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Keep fraction terms at their resolved TeX size inside norms, absolute values,
8
+ parentheses and roots. Use the same font size for passive glyphs, active inputs
9
+ and measurement spans, including nested fractions and explicit fraction styles.
10
+ - Remove extra inline line-box descent from fence bodies so nested parentheses,
11
+ brackets and norms keep their contents aligned during display and editing.
12
+ Preserve fence height for fractions and other tall bodies.
13
+ - Size radical glyphs from the containing mathematical style and editing minimum.
14
+ Remove anonymous line-box descent and inactive boundary height from radicands,
15
+ so roots in exponents stay smaller than the base while tall contents still fit.
16
+ - Keep nested editing glyphs and inputs at a readable 14px minimum. Expose
17
+ `--me-min-font-size` for host configuration, with 0px preserving TeX size ratios.
18
+ Reserve line space for elevated scripts in React and native DOM editors so
19
+ larger nested math remains inside the editing surface without changing LaTeX.
20
+ - Add Ctrl+Left/Right (Option on macOS) to move by lexical units and whole math
21
+ structures. Add Shift to extend or shrink a selection. Apply the same behavior
22
+ in React and native DOM editors without changing document history. Move matrix
23
+ column deletion to Alt+Shift+Backspace to avoid a selection shortcut conflict.
24
+
25
+ ## 0.6.0
26
+
27
+ ### Minor Changes
28
+
29
+ - Complete forward structural deletion and next-line joining, preserving retained content and one-step Undo. Keep the preferred horizontal caret position across vertical movement in React and native DOM. Reject malformed structured clipboard data without falling back to destructive plain-text insertion, and reject multiline paste in React single-line fields. Share Enter policy so Shift+Enter bypasses suggestions and follows row/newline rules.
30
+
31
+ Add catalog-wide populated/empty deletion scenarios, structured and matrix clipboard checks, vertical/line editing, keyboard transformations, framework lifecycle and option updates, and extended host persistence/read-only scenarios. Provide a repository-owned browser runner and CI workflow alongside existing KaTeX comparisons.
32
+
33
+ Constrain inline surfaces to their host width so long formulas remain horizontally scrollable.
34
+
35
+ - Wrap selected math immediately with opening parentheses, brackets, braces, absolute-value bars, fraction slash, superscript and subscript keys. Preserve the selected content and move to the denominator or script slot for continued input. Share the behavior across React and native DOM fields, including inline adapters, and retain existing literal-text and unselected-input behavior.
36
+
37
+ Add keyboard, native-selection and drag regression scenarios with Undo/Redo checks, plus block and inline KaTeX rendering comparisons for the resulting notation.
38
+
39
+ Correct inline fraction term sizes and compact fraction row spacing to match their resolved mathematical style. Keep active inputs and passive glyphs aligned.
40
+
41
+ - Add localized keyboard and clipboard help in React and native DOM fields, available from the toolbar or F1 in a focused field. Preserve the formula and restore focus when help closes. Include beginner, clipboard and keyboard guides, and link to independent, model-checked practice exercises on the demo site.
42
+
43
+ Expose `showHelp()` on DOM and React handles and `onHelp` for an independently mounted toolbar, so help targets an explicit field. Restore native selection as well as focus after help closes.
44
+
45
+ ### Patch Changes
46
+
47
+ - Center the keyboard-selected suggestion within the available list space in React, DOM and text-source editors. Clamp scrolling at list boundaries, account for sticky source hints, and scroll only the suggestion list so the host document stays in place.
48
+ - Read the native input selection before processing keydown in React and DOM editors. Held arrow keys now cross token and structure boundaries without waiting for keyup or a delayed selection event. Add repeated-keydown browser coverage for both directions, fraction slots, Shift selection, continued typing and Undo.
49
+ - Allow fixed suggestion menus to use viewport space outside compact dialogs. Constrain menus by actual CSS clipping boundaries, not dialog semantics, while retaining host action-control avoidance.
50
+
3
51
  ## 0.5.0
4
52
 
5
53
  ### Minor Changes
package/CLIPBOARD.md ADDED
@@ -0,0 +1,54 @@
1
+ # Copy and paste formulas
2
+
3
+ Choose the method that matches your source. **Ordinary paste does not automatically parse LaTeX.**
4
+
5
+ | Source and goal | Method | Result |
6
+ | --- | --- | --- |
7
+ | Selected math → another math-editor field | Select a model range, copy, then paste at the destination | Editable structure is preserved when the browser retains the custom clipboard format |
8
+ | Ordinary text → a formula slot | Paste normally | Literal text insertion; suggestions can help with subsequent editing |
9
+ | LaTeX source → an editable formula | Open **Paste as LaTeX** with `Alt+Shift+V`, paste the source, then `Ctrl/Cmd+Enter` | Supported syntax becomes editable nodes at the caret or replaces the selected range |
10
+ | Formula → a LaTeX-aware application | Copy a formula range, or use the site's LaTeX Copy button | Plain clipboard text is LaTeX; the receiving application decides how to use it |
11
+ | Formula → a slide, document or image tool | Use **Copy image** or **Download image** in the site's rendering preview | PNG pixels; this is not an editable math model |
12
+
13
+ On macOS, use Cmd for copy/cut/paste and Option for Alt. The editor does not read the system clipboard just because you open the paste panel.
14
+
15
+ ## Move part of a formula
16
+
17
+ 1. Drag across the math, or extend a range with Shift+Left/Right.
18
+ 2. Press Ctrl/Cmd+C to copy. Use Ctrl/Cmd+X to cut.
19
+ 3. Click the destination. Place the caret where the formula should go, or select content to replace.
20
+ 4. Press Ctrl/Cmd+V. Check the result. Undo restores the previous content.
21
+
22
+ Selection inside one input can be a native text selection. A model range can include multiple tokens and nested structures. To copy the whole formula, focus the formula surface and use Select All; Select All inside an active input can select that input's text first. Check the highlight before copying.
23
+
24
+ Copying leaves the original unchanged. Cut and accepted structured paste are undoable. Pasted nodes receive fresh identities so editing one copy does not change the other.
25
+
26
+ ## Insert LaTeX without replacing the whole formula
27
+
28
+ Place the caret after your existing expression. Open Paste as LaTeX and enter:
29
+
30
+ ```latex
31
+ +\frac{a}{b}
32
+ ```
33
+
34
+ Press Ctrl/Cmd+Enter to insert. Escape closes the panel. If the source is unsupported or malformed, the panel shows a diagnostic and keeps the existing formula unchanged. Correct the source or close the panel.
35
+
36
+ The site's **Load LaTeX** control replaces the whole formula. **Paste as LaTeX** inserts at the current location. See [LaTeX support](LATEX-SCOPE.md) for parsing limits.
37
+
38
+ ## Matrices and multiline formulas
39
+
40
+ A selected rectangle of matrix cells carries row and column boundaries. Paste into a compatible matrix destination to replace that rectangle or grow from the target cell where supported. Tab-separated rectangular text can also supply matrix cells when the caret is in a matrix. Ragged, oversized or incompatible cell data is rejected.
41
+
42
+ Inline fields reject top-level multiline fragments. A multiline fragment also cannot be inserted inside an ordinary nested slot such as a fraction numerator. Matrix rows are internal structure; they are different from top-level formula lines.
43
+
44
+ ## When pasting does not produce editable math
45
+
46
+ - Another application or browser can discard custom clipboard formats. If only plain LaTeX remains, use Paste as LaTeX explicitly.
47
+ - Malformed custom formula data is rejected. It does not silently fall back to replacing your selection with plain text.
48
+ - An image contains no editable model. This library does not perform formula OCR.
49
+ - Clipboard permissions can prevent image copying. Use Download image as the site alternative.
50
+ - A host editor can handle clipboard operations outside the active math field. Put the caret inside the math field before pasting there.
51
+
52
+ Controlled browser clipboard tests pass for the recorded scope. Actual exchange through the OS clipboard, other applications and all browsers is not yet certified. See [validation](VALIDATION.md).
53
+
54
+ Try [the practice exercises](https://math-editor.barocss.com/#tutorial) or open [the keyboard reference](KEYBOARD.md).
@@ -1,5 +1,20 @@
1
1
  # Editing scenarios
2
2
 
3
+ ## Current milestone evidence — 2026-09-13
4
+
5
+ The supported-notation milestone passed **113 cases / 4,311 checkpoints** on the current candidate. Use [validation](VALIDATION.md) for exact reports and scope. Run all required suites through `node scripts/check-math-editor.mjs` with both demo servers running.
6
+
7
+ | Scenarios | Required executable coverage in this milestone |
8
+ | --- | --- |
9
+ | EDIT-006 / 015 | `deletion`: all 55 structure kinds at populated boundaries; applicable empty slots; grid preservation and exact history |
10
+ | EDIT-007 / 015 | `clipboard`: nested ranges, cross-instance transfer, cell rectangles, rejected malformed/multiline payloads |
11
+ | EDIT-013 / 016 / 034 | `vertical`, `lines`, `arrows`: preferred column, row/line changes, held keys and continued input |
12
+ | EDIT-003–005 / 029 / 033 | `transformations`, `shortcuts`, `continuous`: range selection, keyboard wrapping, nearest radical/fence targeting and history |
13
+ | EDIT-009–011 / 019 | `continuous`: all nine host demos; Apply/Cancel, save/reload/reopen, read-only, inline exit and prose continuation |
14
+ | EDIT-017 / 018 | `narrow`, `frameworks`, `bindings`, rendering audit: width constraints, locale/options, independent instances, cleanup and KaTeX agreement |
15
+
16
+ This table records the bounded milestone. The full register below also includes wider variations, optional tools and platform checks; a suite pass does not certify every variation of a numbered scenario. Real OS clipboard/IME remains manual. Existing historical mappings are retained where a narrower suite does not replace them.
17
+
3
18
  Use this document to manage editing behavior. [Supported features](SUPPORT.md)
4
19
  lists notation; this register describes what a person does with that notation.
5
20
  [Validation](VALIDATION.md) stores dated execution evidence. Neither the number
@@ -38,20 +53,20 @@ programmatic value assignment for a focus or typing assertion.
38
53
  | EDIT-003 | P0 — Selected suggestion | Type `abcd`. Select `cd` with Shift+Left twice. Use Down/Up, choose root, then Enter. Repeat with mouse drag. | The range stays selected while options change. Only `cd` is wrapped. The input receives focus after acceptance. | Rerun — `selection-suggestions-check.js`. Recorded 2026-09-09 for React and nine hosts before radical suggestions were added; rerun after suggestion changes. |
39
54
  | EDIT-004 | P0 — Return to a caret | Select part of `abcd`, press Left or Right, then type `q`. Repeat with a selection that includes a fraction. In the native field, dismiss the menu with Escape before testing Up/Down collapse. | Left uses the ordered start; Right uses the ordered end. Typing inserts at that edge instead of replacing the old range. A fraction boundary does not enter the wrong slot. | Rerun — `selection-collapse-check.js`, `tinymce-inline-check.js` |
40
55
  | EDIT-005 | P0 — Radical conversion | Load `\sqrt{x+1}`. Choose Change to Indexed root. Replace the selected `2` with `3`. Return to the radicand, then edit the index to `2` and convert back. Undo and Redo. | The radicand and nested nodes survive. Index `2` is selected on conversion. Index `3` cannot be silently discarded. One conversion is one Undo step. | Recorded, partial scope — `root-transform-check.js` (React/Quill, pointer and keyboard acceptance, 2026-09-09); `root-transform.test.ts` (Undo/Redo and nested trees). Browser Undo/Redo and the other hosts still need a run. |
41
- | EDIT-006 | P0 — Structure deletion | Create a fraction, scripts, aligned equations and cases. Test Backspace/Delete at inner and outer boundaries with empty and populated slots. Undo each deletion. | Behavior matches the documented boundary rule. Populated grid cells are not silently merged or lost. Undo restores content and structure. | Extend — `empty-slot-deletion-check.js` recorded React/DOM Delete, Backspace and Undo for empty roots, fractions, exponents and root indices on 2026-09-09. Grid and populated-boundary checks remain separate: `grid-deletion.test.ts`, `native-parity-check.js`. |
42
- | EDIT-007 | P0 — Copy and paste a range | Select text plus a nested fraction. Copy, move the caret, paste, then cut and Undo. Repeat across two editor instances. | The selected structure is preserved; unselected content stays unchanged. Cut can be undone. A rejected paste leaves the document unchanged. | Extend — `native-parity-check.js`, `token-paste-check.js`, `range.test.ts`; real OS clipboard coverage remains separate. |
56
+ | EDIT-006 | P0 — Structure deletion | Create a fraction, scripts, aligned equations and cases. Test Backspace/Delete at inner and outer boundaries with empty and populated slots. Undo each deletion. | Behavior matches the documented boundary rule. Populated grid cells are not silently merged or lost. Undo restores content and structure. | Recorded, scoped — `test/editing/deletion.browser.js`: 3 surfaces / 2,766 checkpoints, 55 catalog kinds, populated boundaries and applicable empty-slot checks; 2026-09-13. See current validation for explicit non-applicable spacing/grid cases. |
57
+ | EDIT-007 | P0 — Copy and paste a range | Select text plus a nested fraction. Copy, move the caret, paste, then cut and Undo. Repeat across two editor instances. | The selected structure is preserved; unselected content stays unchanged. Cut can be undone. A rejected paste leaves the document unchanged. | Recorded, scoped — `test/editing/clipboard.browser.js`: React/DOM block and inline, 76 checkpoints, nested ranges, cross-instance and matrix clipboard; 2026-09-13. Real OS clipboard remains separate. |
43
58
  | EDIT-008 | P0 — LaTeX import failure | Import `\frac{x}{y}+z`. Edit `x`. Attempt an unsupported command and malformed braces. Cancel, then reopen. | Valid input is editable. Invalid or unsupported input reports a diagnostic and retains the previous formula. Cancel does not replace host content. | Rerun — `latex-paste-host-check.js`, `latex-insertion.test.ts`, `latex.test.ts` |
44
- | EDIT-009 | P0 — Apply, Cancel and history | Open an existing host formula. Edit and Cancel. Reopen, edit and Apply. Run host Undo and Redo. | Cancel leaves the stored host data unchanged. Apply creates one host history operation. Host serialization contains formula data, not input/menu DOM. | Rerunhost fixtures, including `tinymce-inline-check.js`, `quill-composition-check.js`, `ckeditor-check.js` |
45
- | EDIT-010 | P0 — Save and reopen | Edit nested content, Apply, Save and Restore. Reload the stored host document and reopen the formula. | Structure, LaTeX and configured presentation survive. The formula is editable after restoration. Do not claim persistence from a preview-only check. | Rerun — `unified-check.js` and host-specific fixtures; record each supported storage format. |
46
- | EDIT-011 | P0 — Host boundary and read-only | Move from prose into an inline formula with a boundary arrow. Edit, exit and continue prose. Switch the host to read-only with a draft open. | Math key events do not edit prose. Read-only closes or disables the draft according to the host contract and prevents new mutations. | Rerun — `shared-boundary-check.js`, `host-check.js`, host-specific fixtures |
59
+ | EDIT-009 | P0 — Apply, Cancel and history | Open an existing host formula. Edit and Cancel. Reopen, edit and Apply. Run host Undo and Redo. | Cancel leaves the stored host data unchanged. Apply creates one host history operation. Host serialization contains formula data, not input/menu DOM. | Recorded, scoped — `test/editing/continuous.browser.js`, all nine demos on 2026-09-13; exact Apply/Cancel and configured host history. Editor.js host history is not configured. |
60
+ | EDIT-010 | P0 — Save and reopen | Edit nested content, Apply, Save and Restore. Reload the stored host document and reopen the formula. | Structure, LaTeX and configured presentation survive. The formula is editable after restoration. Do not claim persistence from a preview-only check. | Recorded, scoped — `test/editing/continuous.browser.js`, all nine demos on 2026-09-13; actual save/reload/restore, reopened editing and Cancel. |
61
+ | EDIT-011 | P0 — Host boundary and read-only | Move from prose into an inline formula with a boundary arrow. Edit, exit and continue prose. Switch the host to read-only with a draft open. | Math key events do not edit prose. Read-only closes or disables the draft according to the host contract and prevents new mutations. | Recorded, scoped — `test/editing/continuous.browser.js`: inline exit/prose continuation and active-draft read-only transitions. Programmatic read-only toggle isolates the transition from intentional pointer-blur Apply. |
47
62
  | EDIT-012 | P1 — Suggestion scrolling | Type `matrix`. Park the pointer over a menu item. Press Down repeatedly with pauses; reverse with Up. Test near the bottom of the viewport and in an iframe. | Each press moves one option. The selected option stays visible. The list does not jump back; the page and host do not scroll unexpectedly. | Rerun — `suggestion-arrow-check.js`, `suggestion-menu-clipping-check.js`, `iframe-field-check.js` |
48
- | EDIT-013 | P1 — Nested navigation | Enter `x_i^2`, a fraction inside a root, and a limit. Move with Left/Right, Up/Down and Tab at every slot boundary. | The nearest structure owns vertical movement when no suggestion menu is active. Selection and caret positions remain valid. | Rerun — `react-vertical-check.js`, `vertical-check.js`, `vertical-navigation.test.ts` |
63
+ | EDIT-013 | P1 — Nested navigation | Enter `x_i^2`, a fraction inside a root, and a limit. Move with Left/Right, Up/Down and Tab at every slot boundary. | The nearest structure owns vertical movement when no suggestion menu is active. Selection and caret positions remain valid. | Recorded, scoped — `vertical-column.browser.js`, `held-arrows.browser.js` and `vertical-navigation.test.ts`; preferred column and horizontal reset pass on 2026-09-13. Wider slot variations retain model tests. |
49
64
  | EDIT-014 | P1 — Rectangular matrix | Type `3x7` and accept the matrix. Fill cells; add/delete rows and columns. Test `1x2` and `2x1` boundaries. | Dimensions match the request. Existing cells retain their content. Cursor movement follows the resulting grid. | Rerun — `matrix-size-shortcut-check.js`, `matrix.test.ts`, `native-tools-host-check.js` |
50
65
  | EDIT-015 | P0 — Matrix range editing | Select a cell rectangle. Copy/paste, clear, Undo and transpose. Test a mismatched or oversized paste. | Cell boundaries and nested structures survive. Invalid operations leave the matrix unchanged. Draft operations do not create host history entries. | Rerun — `matrix-range-check.js`, `matrix-range-host-check.js`, `matrix-range.test.ts` |
51
- | EDIT-016 | P1 — Lines, alignment and cases | Create two lines. Insert aligned equations and cases; add a row and edit both columns. Try Enter in inline mode. | Block layouts retain their rows. Inline mode does not create an extra formula line. Enter follows the configured host commit policy. | Extend — `typing-check.js`, `lines.test.ts`, `equation.test.ts`, `embedding.test.ts`; add a combined browser flow. |
52
- | EDIT-017 | P1 — Preview agreement | Edit a nested root, scripts, tall fences, integrals with limits, and a chemical formula. Compare exported LaTeX in KaTeX at a matched base size. Repeat with the input active. | Mathematical structure agrees. Baselines, fences, indices and limits remain readable. Focus backgrounds and hit areas do not obscure notation. | Recorded metric baseline — 77 formulas / 288 React/DOM mode-size comparisons passed on 2026-09-10. See the source-only `test/rendering/STATUS.md` ledger. Selected metrics and active-input checks do not certify every glyph or every editing flow. |
53
- | EDIT-018 | P1 — Language and multiple instances | Switch en/ko with a draft open. Open another editor and its suggestions. Repeat with a registered custom locale. | Labels resolve, formulas do not change, focus and menus stay with the right instance, and search aliases use the locale fallback rules. | Rerun — `plugins-locale-check.js`, `shared-symbol-tools-check.js`, `locale-discovery.test.ts` |
54
- | EDIT-019 | P0 — Long edit session | Build a fraction, wrap a selection, convert a radical, insert a matrix, undo five steps, redo five, Apply, Save and reopen. Repeat without resetting the page. | No stuck focus, lost selection, duplicated operation or draft leakage. All checkpoints retain the expected formula. | Recorded, scoped — `test/editing/continuous.browser.js`, run with `pnpm --filter @barocss/math-editor test:editing`. React standalone block, Quill/Tiptap/ProseMirror/Lexical/TinyMCE/CKEditor/Slate in-place block/inline, and Editor.js/Gutenberg block passed on 2026-09-10 (17 targets, 499 checkpoints); includes two uninterrupted formula history chains and host Apply/Save/reload/Restore/Cancel. Editor.js has no host history integration, so document Undo/Redo remains unverified there. Inline additionally verifies Enter commit without new paragraphs, right-boundary exit, prose caret position and host Undo. TinyMCE uses its inline host, CKEditor uses ClassicEditor, and Gutenberg uses the standalone provider demo. Other configurations and native OS input remain unverified by this run. |
66
+ | EDIT-016 | P1 — Lines, alignment and cases | Create two lines. Insert aligned equations and cases; add a row and edit both columns. Try Enter in inline mode. | Block layouts retain their rows. Inline mode does not create an extra formula line. Enter follows the configured host commit policy. | Recorded, scoped — `test/editing/lines.browser.js`: 2 surfaces / 28 checkpoints, matrix/alignment/cases rows and split/merge; inline Enter also runs in `continuous.browser.js`. Core `embedding.test.ts` checks commit policy. |
67
+ | EDIT-017 | P1 — Preview agreement | Edit a nested root, scripts, tall fences, integrals with limits, and a chemical formula. Compare exported LaTeX in KaTeX at a matched base size. Repeat with the input active. | Mathematical structure agrees. Baselines, fences, indices and limits remain readable. Focus backgrounds and hit areas do not obscure notation. | Recorded metric baseline — 91 formulas / 330 comparisons passed on 2026-09-13; narrow-host editing also passed. See source-only `test/rendering/STATUS.md`; selected metrics do not certify every glyph. |
68
+ | EDIT-018 | P1 — Language and multiple instances | Switch en/ko with a draft open. Open another editor and its suggestions. Repeat with a registered custom locale. | Labels resolve, formulas do not change, focus and menus stay with the right instance, and search aliases use the locale fallback rules. | Recorded, scoped — `frameworks.browser.js` (8 samples / 60 checkpoints) and `bindings.browser.js` (5 bindings / 30 checkpoints), 2026-09-13; locale discovery/fallback remains covered by core tests. |
69
+ | EDIT-019 | P0 — Long edit session | Build a fraction, wrap a selection, convert a radical, insert a matrix, undo five steps, redo five, Apply, Save and reopen. Repeat without resetting the page. | No stuck focus, lost selection, duplicated operation or draft leakage. All checkpoints retain the expected formula. | Recorded, scoped — `test/editing/continuous.browser.js`: 17 targets / 532 checkpoints on 2026-09-13. Includes clipboard/history, Apply/Cancel, save/reload/reopen, read-only and inline prose continuation. Editor.js host history, TinyMCE iframe and installed WordPress admin are not included. |
55
70
  | EDIT-020 | P2 — Native IME and clipboard | On a real OS, compose Korean text, move the caret, use suggestions, cancel composition and paste with the system clipboard. | Composed text appears once; composition keys do not apply suggestions or host commands prematurely. Clipboard data is preserved according to the documented formats. | Manual — previously deferred by the user. Synthetic composition/DataTransfer checks do not certify OS behavior. |
56
71
 
57
72
  ## Contextual structure tools
@@ -162,13 +177,33 @@ register alone.
162
177
 
163
178
  ## Next work
164
179
 
165
- 1. Maintain the EDIT-019 baseline across all nine integration demos and React
166
- standalone block. Extend it separately to TinyMCE iframe, WordPress admin and
167
- other host configurations. Preserve exact checkpoints and host-history assertions.
168
- 2. Add missing browser steps for EDIT-006, EDIT-007 and EDIT-016. Include negative
169
- cases and real host Undo/Redo rather than testing only model transformations.
170
- 3. Reuse the EDIT-019 runner pattern for additional scenario IDs. It already
171
- records source fingerprints and fails on changed source or failed assertions.
172
- CI/release enforcement remains separate work.
173
- 4. Schedule Firefox/WebKit and real OS IME/clipboard coverage separately. Keep
174
- manual requirements visible without representing synthetic events as a substitute.
180
+ The [supported-notation milestone](ROADMAP.md#completed-milestone-reliable-editing-of-supported-notation--2026-09-13) is complete for its recorded desktop Chromium scope. Keep the 11 editing suites and full rendering audit as regression checks for subsequent changes.
181
+
182
+ 1. Validate Safari, Firefox and Windows Chromium, then real OS IME/clipboard and assistive input.
183
+ 2. Verify additional installed-host configurations, including TinyMCE iframe and WordPress admin.
184
+ 3. Define JSON migration/recovery and measured document-size/depth/performance budgets.
185
+ 4. Expand an editing scenario when a concrete defect or use case requires it. Compare the expected JSON tree and caret with actual edited output and KaTeX. Do not expand notation only to increase a feature count.
186
+
187
+ These are subsequent milestones. No pass is claimed for them by the current reports. Keep geometry reports in the source-only rendering ledger.
188
+
189
+ ## Direct selection wrapping EDIT-033
190
+
191
+ Select math by Shift+arrows, dragging, or native input selection. Press `(`, `[`, `{`, `|`, `/`, `^` or `_` without accepting a suggestion. Check retained content, the new caret slot, continued typing, one-step wrapping Undo and Redo. Include reversed and cross-slot selections, literal text, composition guards and multi-line rejection.
192
+
193
+ Run `pnpm --filter @barocss/math-editor test:editing --suite=shortcuts`.
194
+ The dedicated browser fixture covers React block and native DOM block/inline (63 cases). Core tests cover nested ranges and negative cases. OS IME remains a separate scenario. Geometry fixtures VIS-080–093 compare the resulting notation against KaTeX at 22px and 36px, including active input.
195
+
196
+ ## Held arrow navigation — EDIT-034
197
+
198
+ Hold Left or Right through a number, an operator and a variable. Every repeated keydown must use the current input caret. Token and structure boundaries must respond before keyup. Repeat the check through fraction numerator and denominator slots, in both directions. Then hold Shift+Left, collapse the range with Right, type and Undo. Caret movement must preserve the formula and must not emit a document change.
199
+
200
+ Run `pnpm --filter @barocss/math-editor test:editing --suite=arrows`.
201
+ The fixture covers React block and native DOM block/inline. It sends repeated real browser keydown events with one final keyup, and records every focused input and caret offset. Browser-generated key repeat covers the editor event path; physical keyboard repeat timing remains OS-controlled.
202
+
203
+ ## Learning and help — EDIT-035
204
+
205
+ Run `pnpm --filter @barocss/math-editor test:editing --suite=learning`.
206
+
207
+ Complete the five practice tasks with keyboard input: correction, selection-to-fraction, power, nearest root conversion and explicit LaTeX insertion. Reject a wrong answer; verify reset/close behavior and an unchanged playground. Pass criteria compare normalized model trees, not merely the rendered string. Test English and Korean help, toolbar access and F1 in React/native block and native inline fields. Closing must restore native selection, permit immediate wrapping/typing and preserve Undo. Destroying a field must remove open help.
208
+
209
+ The continuous host suite also opens/closes help before its existing editing chain. This tests the host draft boundary separately from standalone focus checks. Native OS F1/Fn routing and screen-reader behavior remain separate device checks.
@@ -0,0 +1,54 @@
1
+ # Learn to edit a formula
2
+
3
+ Start with [the five practice exercises](https://math-editor.barocss.com/#tutorial). They use a separate field and leave your playground formula unchanged. Each exercise checks the resulting formula model. You can reset an exercise, go back or close the practice area.
4
+
5
+ ## Make editing comfortable
6
+
7
+ If a fraction or nested formula feels small, choose **Math size → 26px** above
8
+ the playground. This enlarges the formula while keeping the relative sizes of
9
+ the base, exponent and radicand. A complex denominator makes the fraction taller;
10
+ it does not automatically enlarge the numerator.
11
+
12
+ 편집할 분수나 중첩 수식이 작게 느껴지면 위의 **수식 크기 → 26px**를 선택하세요.
13
+ 수식 내부의 크기 비율은 유지됩니다. 분모가 복잡해져도 분자 글자가 자동으로
14
+ 커지지는 않습니다. 편집 크기는 저장되는 LaTeX와 미리보기 이미지 크기를 바꾸지 않습니다.
15
+
16
+ Nested editing text has a 14px minimum. In a text-editor visual popup, use
17
+ **125%** or **150%** zoom for a larger editing view. Editing size does not change
18
+ saved LaTeX or the preview/export size. Embedded apps can configure a larger
19
+ minimum and must allow the equation's line height to grow; see [Styling](STYLING.md).
20
+
21
+ ## 1. Write, then correct
22
+
23
+ Type `x+1`. Click the number and change it to `2`. Use Left/Right to move the caret. A held arrow key should keep moving. Undo and Redo let you inspect changes without starting again.
24
+
25
+ ## 2. Build structure from existing input
26
+
27
+ Type `a+b`, then select it by dragging or using Shift+arrows. Press `/`. The selected expression becomes the numerator, and the denominator receives the caret. Type `2`.
28
+
29
+ You do not have to choose a fraction before writing its contents. Selected math can also be wrapped with `(`, `[`, `{`, `|`, `^` and `_`.
30
+
31
+ ## 3. Add a power or subscript
32
+
33
+ Select `x`, press `^`, then type `2`. Use `_` instead when you need a subscript. Use Tab to move between editable slots. The editor preserves the distinction between a base and its scripts.
34
+
35
+ ## 4. Change an existing structure
36
+
37
+ Click inside a square root. Press Alt+Down to open suggestions. Choose Change to Indexed root and press Enter. The new index is selected; type `3` to replace it. The radicand stays intact.
38
+
39
+ The same suggestion area offers supported bracket transformations when the caret is inside a bracketed expression. You do not need a toolbar. Escape closes the list; Undo reverses a conversion.
40
+
41
+ ## 5. Bring in existing LaTeX
42
+
43
+ Put the caret after a formula. Press Alt+Shift+V, enter `+c^2`, then Ctrl/Cmd+Enter. This adds parsed LaTeX at the caret. Ordinary paste inserts text or preserved editor clipboard data; it does not automatically interpret LaTeX.
44
+
45
+ Read [copy and paste](CLIPBOARD.md) before transferring formulas between applications. The site can also copy/download a PNG from its rendering preview. A PNG cannot be reopened as an editable formula.
46
+
47
+ ## Keep these controls nearby
48
+
49
+ - **F1:** keyboard and clipboard help inside the field.
50
+ - **Alt+Down:** suggestions and available transformations.
51
+ - **Tab / Shift+Tab:** move between slots.
52
+ - **Ctrl/Cmd+Z:** undo the last edit.
53
+
54
+ The [keyboard reference](KEYBOARD.md) explains selection, Enter and deletion rules. The [LaTeX guide](LATEX-GUIDE.md) covers more notation. Developers embedding a field can continue with [framework guides](ADAPTERS.md).
package/IMPLEMENTATION.md CHANGED
@@ -360,3 +360,13 @@ sides. The function name's measuring span adds no glyph padding.
360
360
  The spacing map contains structure IDs for these two families and token-offset
361
361
  keys for text. Other structure families keep their existing outer layout. This
362
362
  change does not alter LaTeX output, JSON, selection offsets or editing commands.
363
+
364
+ ## Editing boundary corrections — 2026-09-13
365
+
366
+ `unwrapNext` reuses the non-grid unwrapping operation, then restores the left-side caret. `joinNextLine` delegates to the existing line merge and keeps the join position. Grid deletion remains a distinct selection/removal operation; it does not pass through wrapper flattening.
367
+
368
+ Both renderers use a view-local preferred column for vertical navigation. The column is not stored in JSON or history. The current row supplies Y while the first vertical movement supplies X; typing, horizontal navigation and pointer placement reset it. Native caret selection is synchronized before keydown so held arrows do not wait for keyup.
369
+
370
+ React and DOM use `mathEnterAction` for Enter decisions. Structured clipboard input is validated before literal fallback. A present but malformed math payload is rejected; missing custom data can still use ordinary text. Single-line mode rejects multiple rows before applying the React paste result.
371
+
372
+ Editing regression runners use the repository-owned `scripts/math-playwright-cli.sh`. Controlled ClipboardEvents test handler behavior, not the OS clipboard. In host tests, permission changes occur without pointer blur: clicking outside an in-place field is a separate, intentional Apply operation. Editor.js cannot save while read-only, so its document equality check runs after editing is re-enabled.
package/KEYBOARD.md ADDED
@@ -0,0 +1,41 @@
1
+ # Keyboard reference
2
+
3
+ Open **Keyboard & clipboard help** from the math toolbar, or press **F1 while the formula has focus**. This also works in a toolbar-free inline field. Some keyboards require Fn+F1. Close help to return to the previously focused input without editing the formula.
4
+
5
+ Use Cmd on macOS and Ctrl on Windows/Linux. Alt is Option on macOS. The host and operating system can reserve keys; the field only handles its shortcuts while it has focus.
6
+
7
+ | Context | Keys | Action |
8
+ | --- | --- | --- |
9
+ | Active input | Left / Right | Move the caret; repeated keydown continues across token and slot boundaries |
10
+ | Active input, no suggestion menu | Up / Down | Move between supported structural slots or lines; repeated vertical movement retains the preferred column |
11
+ | Editable slots | Tab / Shift+Tab | Next / previous slot |
12
+ | Formula selection | Shift+Left / Right | Extend or shrink the selected range |
13
+ | Active formula | Ctrl+Left / Right (Option+Left / Right on macOS) | Move by text units or whole math structures |
14
+ | Active formula | Ctrl+Shift+Left / Right (Option+Shift+Left / Right on macOS) | Extend or shrink selection by text units or structures |
15
+ | Matrix cell | Alt+Shift+Backspace | Delete the current column; Undo restores it |
16
+ | Matrix cell | Alt+Shift+Up | Delete the current row; Undo restores it |
17
+ | Nonempty math selection | `(`, `[`, `{`, `\|` | Wrap in parentheses, brackets, braces or absolute value |
18
+ | Nonempty math selection | `/` | Use the selection as numerator; enter the denominator next |
19
+ | Nonempty math selection | `^` / `_` | Use the selection as base; enter the exponent or subscript next |
20
+ | Active formula | Alt+Down | Open suggestions, including transformations for the nearest supported structure |
21
+ | Suggestions open | Up / Down, Enter | Choose and apply a suggestion |
22
+ | Suggestions open | Escape | Dismiss suggestions before returning to ordinary navigation |
23
+ | Active formula | Ctrl/Cmd+Z / Ctrl/Cmd+Shift+Z | Undo / Redo |
24
+ | Selected range | Ctrl/Cmd+C / X | Copy / Cut |
25
+ | Active formula | Ctrl/Cmd+V | Paste available editor data or literal text |
26
+ | Active formula | Alt+Shift+V | Open Paste as LaTeX |
27
+ | LaTeX paste panel | Ctrl/Cmd+Enter / Escape | Insert / close the panel |
28
+ | Active formula | F1 | Open help |
29
+ | Context footer available | F6 | Move focus between the input and contextual controls |
30
+
31
+ ## Enter depends on context
32
+
33
+ An active suggestion normally receives Enter. Escape dismisses it first if you want a different action. Operand-only suggestions require navigation before Enter applies them, so ordinary Enter does not unexpectedly wrap an operand.
34
+
35
+ In a block field, Enter follows the configured newline/commit policy. Shift+Enter bypasses suggestion acceptance and creates a row in a grid or a line at the outer block level. Inline fields do not create top-level formula lines. Their completion and boundary-exit behavior belongs to the embedding host.
36
+
37
+ ## Delete depends on context
38
+
39
+ Backspace/Delete removes a selection. At a structure boundary it can unwrap retained contents. An empty slot can remove or reduce its enclosing structure. Populated grids require their grid selection/deletion policy so cells are not silently flattened. At the end of a top-level line, Delete joins the following line; Backspace at the next line's start joins backward. Undo restores the change.
40
+
41
+ The direct wrapping keys apply only to a nonempty math selection. Literal text, matrix rectangles and multiline ranges retain their own rules. See [selection editing](LATEX-GUIDE.md#select-replace-and-wrap), [copy and paste](CLIPBOARD.md) and [practice exercises](https://math-editor.barocss.com/#tutorial).
package/LATEX-GUIDE.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  This guide describes **version 0.2.0**, including bounded LaTeX import and editable notation. See [installation and API guides](README.md) for package usage and [the support contract](LATEX-SCOPE.md) for the exact grammar.
4
4
 
5
+ Start with [practice exercises](GETTING-STARTED.md), [copy and paste](CLIPBOARD.md), or the [keyboard reference](KEYBOARD.md).
6
+
5
7
  ## Load and edit a formula
6
8
 
7
9
  In the demo, open **Import LaTeX**, enter a supported expression and apply it. Click a displayed slot to edit it. A successful import is undoable; a failed import preserves the existing formula and returns diagnostics.
@@ -58,7 +60,23 @@ Standard function names: `sin`, `cos`, `tan`, `cot`, `sec`, `csc`, `arcsin`, `ar
58
60
 
59
61
  Drag across a formula to select a model range. The regular suggestion list offers fraction, root, superscript, subscript, parentheses, brackets and absolute value. Click a candidate, or use arrow keys and Enter. Compound bases receive parentheses when wrapped in an exponent.
60
62
 
61
- Typing a printable character replaces the selected range and resumes editing. Backspace/Delete removes the selection. Undo restores content. Wrapping multiple top-level lines is disabled. In combined scripts, Backspace in an empty script removes that side while retaining the other script.
63
+ With a nonempty math selection, these keys apply immediately without choosing a suggestion:
64
+
65
+ | Key | Result | Caret after wrapping |
66
+ | --- | --- | --- |
67
+ | `(` | Parentheses | After the closing parenthesis |
68
+ | `[` | Square brackets | After the closing bracket |
69
+ | `{` | Braces | After the closing brace |
70
+ | `\|` | Absolute value | After the closing bar |
71
+ | `/` | Fraction with selection as numerator | Empty denominator |
72
+ | `^` | Selection as the base of a power | Empty exponent |
73
+ | `_` | Selection as the subscript base | Empty subscript |
74
+
75
+ Compound power bases receive parentheses. Each wrap is one Undo step; subsequent typing is a separate edit. This works with mouse dragging, Shift+arrows and native input selections in React and DOM fields, including toolbar-free inline fields. The key handling is shared by the framework and host adapters through their renderer.
76
+
77
+ Other printable characters replace the selection. Without a selection, the existing suggestion behavior stays unchanged; `{` can still offer braces and cases. Literal text slots retain text input. Ctrl/Cmd/Alt combinations and IME composition are not structural shortcuts. Multi-line selections remain selected and unchanged when a wrapping key is pressed. Rectangular matrix-cell selection retains its own typing behavior.
78
+
79
+ Backspace/Delete removes the selection. Undo restores content. In combined scripts, Backspace in an empty script removes that side while retaining the other script.
62
80
 
63
81
  ## Text boundaries
64
82
 
@@ -68,7 +86,7 @@ The editor retains structure and canonical notation, not the exact original sour
68
86
 
69
87
  ## What should be added next?
70
88
 
71
- See the [prioritized LaTeX backlog](ROADMAP.md#remaining-latex-priorities-workspace-review-2026-09-08). Norm fences and additional integrals come first, followed by annotated braces and more accents. Fine spacing, styles and equation environments need explicit preservation policies. These are candidates, not current parser support.
89
+ Norms, triple/contour integrals, brace annotations and additional accents are already supported. See the [current roadmap](ROADMAP.md#subsequent-milestones) for remaining work. New notation must keep the model, parser, keyboard editing and rendering aligned.
72
90
 
73
91
  Each addition needs a documented JSON shape, import/export round trips, unsupported-input diagnostics, actual per-character typing, cursor movement, selection, deletion and Undo tests in both renderers. See [roadmap](ROADMAP.md) for progress and [validation](VALIDATION.md) for tested coverage.
74
92
 
@@ -281,3 +299,13 @@ An index containing braces or brackets is grouped when exported. For example,
281
299
  `\sqrt[{x^2}]{y}` and `\sqrt[{\left[a\right]}]{y}` keep the optional index
282
300
  argument intact. Grouping does not add a JSON node or remove editable structure.
283
301
  Simple indices continue to export as `\sqrt[3]{x}`.
302
+
303
+ ## Boundary deletion and continued editing
304
+
305
+ - At the outside right edge of a non-grid structure, Backspace removes the wrapper and retains its contents. At the outside left edge, Delete does the same and leaves the caret before the retained contents.
306
+ - An empty non-grid slot can remove its wrapper with Backspace or Delete. Removing an empty root index or one empty paired-script slot retains the other structure parts.
307
+ - Populated matrices, aligned equations and cases use a separate boundary selection before a second deletion removes the whole grid. Removing a wrapper never silently flattens a populated grid into text. A cell's ordinary text deletion remains local.
308
+ - Backspace at the start of a top-level line joins the previous line. Delete at the end joins the next line. Undo restores the original structure and lines.
309
+ - Repeated Up/Down movement retains its preferred horizontal position through shorter rows. Horizontal movement, typing and pointer placement reset that preference. Visible suggestions retain ownership of Up/Down; Escape dismisses them.
310
+ - Shift+Enter bypasses suggestions. In a grid it inserts a row; in a block top-level expression it follows the newline policy. Inline mode remains one top-level line.
311
+ - Invalid structured clipboard data leaves the formula unchanged and reports an error. Multiline paste is rejected in inline mode and inside nested math slots. Plain clipboard text remains literal; use the explicit LaTeX paste action for parsing.
package/README.md CHANGED
@@ -1,21 +1,24 @@
1
1
  # @barocss/math-editor
2
2
 
3
- See [Editing scenarios](EDITING-SCENARIOS.md) for stable scenario IDs, acceptance criteria, coverage gaps and per-run reporting.
4
-
5
-
6
3
  An embeddable math editor for writing LaTeX-compatible formulas. Edit expressions in place, select existing math, and wrap it in fractions, roots, powers or delimiters. The package includes a framework-independent model, a rich React editor, and a native DOM editor with framework adapters.
7
4
 
8
5
  This editor does not calculate, solve equations or parse arbitrary LaTeX.
9
6
 
10
- ## Packaging changes in 0.4.1
7
+ Selection shortcuts: highlight math and press `(`, `[`, `{`, `|`, `/`, `^` or `_` to wrap it immediately. Fractions focus the denominator; powers and subscripts focus their empty script. See [selection editing](LATEX-GUIDE.md#select-replace-and-wrap) for behavior and exceptions.
8
+
9
+ ## Learn the editor
10
+
11
+ Try the [interactive exercises](https://math-editor.barocss.com/#tutorial), read [copy and paste](https://math-editor.barocss.com/docs/clipboard.html), or open the [keyboard reference](https://math-editor.barocss.com/docs/keyboard.html). F1 opens help while a math field has focus, including toolbar-free inline fields.
12
+
13
+ ## Package ownership
11
14
 
12
15
  Each host plugin owns its source and version. Workspace apps import source without
13
16
  a prerequisite build; npm consumers receive generated runtime and declarations.
14
17
  The private common module is included in each plugin and is not installed separately.
15
18
 
16
- ## Editing additions in 0.4.0
19
+ ## Editing utilities
17
20
 
18
- The native renderer now edits one lexical token at a time, matching the main React field's role colors. New utilities provide **Paste as LaTeX** (Alt+Shift+V), **Recent & favorites** for symbols/templates, and contextual **bracket, fraction-size and limit-placement settings**. These utilities are included in 0.4.0. See [editing utilities and API](API-SESSION.md#editing-utilities--workspace).
21
+ The native renderer now edits one lexical token at a time, matching the main React field's role colors. New utilities provide **Paste as LaTeX** (Alt+Shift+V), **Recent & favorites** for symbols/templates, and contextual **bracket, fraction-size and limit-placement settings**. See [editing utilities and API](API-SESSION.md#editing-utilities--workspace).
19
22
 
20
23
  ## Packages
21
24
 
@@ -61,16 +64,16 @@ Each guide covers installation, document replacement, saving and lifecycle clean
61
64
 
62
65
  See [framework adapters and inline/custom toolbar integration](https://math-editor.barocss.com/docs/adapters.html), [custom locales](https://math-editor.barocss.com/docs/localization.html), and [progress / roadmap](https://math-editor.barocss.com/docs/roadmap.html). The new native renderer has explicit parity gaps; existing React consumers keep their current UI.
63
66
 
64
- **Included in 0.4.0:** the native toolbar now includes searchable All symbols, templates, matrix presets and active-grid controls. Native ranges show exact partial-text highlights, and a drag can start in the active input and continue across structures. See [renderer parity](https://math-editor.barocss.com/docs/adapters.html#current-renderer-parity) for the remaining limits.
67
+ The native toolbar includes searchable All symbols, templates, matrix presets and active-grid controls. Native ranges show exact partial-text highlights, and a drag can start in the active input and continue across structures. See [renderer parity](https://math-editor.barocss.com/docs/adapters.html#current-renderer-parity) for the remaining limits.
65
68
 
66
69
  For editor-only, external toolbar, LaTeX, preview, inline and popup compositions, see [Embedding](https://math-editor.barocss.com/docs/embedding.html) and the [layout examples](https://math-editor.barocss.com/layouts.html).
67
70
 
68
71
  ## Quick start
69
72
 
70
- Install version 0.4.1 from npm:
73
+ Install the latest published version from npm:
71
74
 
72
75
  ```sh
73
- npm install @barocss/math-editor@0.4.1
76
+ npm install @barocss/math-editor
74
77
  # For the rich React UI:
75
78
  npm install react react-dom
76
79
  ```
@@ -160,12 +163,14 @@ Native passive text preserves these lexical colors; its whole active run still u
160
163
  | Grid | Shift+Enter | Insert a row |
161
164
  | Matrix | Shift+Space | Insert a column |
162
165
  | Grid | Alt+Shift+Up | Delete the current row |
163
- | Matrix | Alt+Shift+Left | Delete the current column |
166
+ | Matrix | Alt+Shift+Backspace | Delete the current column |
164
167
  | Aligned / cases | Enter | Insert a row, unless applying a suggestion |
165
168
  | Just after a fraction/root/delimiter | Backspace | Unwrap, preserving contents |
166
169
  | Outer grid edge | Backspace / Delete | Delete empty grid; select filled grid first, press again to delete |
167
170
  | Preview surface | Cmd/Ctrl+A | Select the whole math document |
168
171
  | Active input | Cmd/Ctrl+A | Select the current input text: a React token or native logical run |
172
+ | Editor | Ctrl+Left / Right (Mac: Option+Left / Right) | Move to a lexical unit boundary; cross a fraction/root/fence as one structure |
173
+ | Editor | Same modifier + Shift+Left / Right | Extend or shrink selection by lexical units and structures |
169
174
  | Editor | Shift+Left / Right | Extend or shrink the model range across text and balanced structures |
170
175
  | Editor | Shift+Up / Down | Extend the model range across top-level lines using logical offsets |
171
176
  | Preview surface | Enter / F2 | Enter editing |
@@ -173,6 +178,8 @@ Native passive text preserves these lexical colors; its whole active run still u
173
178
  | Model selection | Backspace / Delete | Delete selection |
174
179
  | Editor | Cmd/Ctrl+Z / Cmd/Ctrl+Shift+Z | Undo / redo |
175
180
 
181
+ Unit movement stays within the current variable or number until its edge, then crosses an adjacent structure intact. From a nested slot edge it exits the enclosing structure. An unshifted unit arrow collapses an existing selection to its ordered edge. It does not change LaTeX or add undo entries. Matrix rectangle selection keeps its existing arrow behavior.
182
+
176
183
  Vertical arrows use the nearest inner structure before an enclosing grid, then fall back to another equation line. Paired scripts can move along their shared column; a base moves up to its superscript and down to its subscript. Visible suggestions retain Up/Down priority, including after Shift+arrow or drag selection. Enter applies the highlighted wrapper to the selected content; Left/Right restores the caret, and Shift+arrows adjusts the range. Composition, literal text and noncollapsed text selections do not trigger structural movement. React and native surfaces share this behavior.
177
184
 
178
185
  The framework-free `moveVertical(state, direction, geometry?)` helper is exported from `/core`. Without rendered geometry, it selects the first text run in the target slot and clamps the current offset. At a lexical token boundary, rendered geometry distinguishes the previous token's end from the next token's start. Each move uses the current caret's horizontal position; a preferred column is not retained across repeated moves through shorter rows. Shift+arrow selection remains a separate operation.
@@ -352,6 +359,16 @@ These operations are available in both renderers and the framework-free
352
359
 
353
360
  Use inherited CSS variables for colors, slot backgrounds, typography, toolbar density and menu appearance. Scoped themes also follow portaled suggestions in both renderers. See [Styling & themes](https://math-editor.barocss.com/docs/styling.html) for the public variables, dark/monochrome examples, shared toolbars and iframe/plugin sizing.
354
361
 
362
+ Nested fractions and scripts have a `14px` editing minimum. Set
363
+ `--me-min-font-size: 16px` on your editor wrapper for a larger minimum, or `0px`
364
+ for unmodified TeX size ratios. Inline rows grow to contain elevated scripts;
365
+ allow the host line height to grow too. This display setting does not change
366
+ the saved LaTeX. See [STYLING.md](./STYLING.md) for the size policy.
367
+
368
+ For complex fractions, try `--me-font-size: 26px` with
369
+ `--me-min-font-size: 16px`. Keep the preview/export size separate. In the website
370
+ playground, use **Math size → 26px**; visual text-editor popups also offer zoom.
371
+
355
372
  ## License
356
373
 
357
374
  MIT License. Copyright (c) 2026 barocss.com.
@@ -404,3 +421,28 @@ Automatic contextual suggestions do not consume Enter until you navigate them.
404
421
  The optional footer also offers bracket buttons via F6, Left/Right and Enter.
405
422
  Nested roots and fences share a nearest-wrapper target. See EDIT-029 through
406
423
  EDIT-032 in [Editing scenarios](EDITING-SCENARIOS.md).
424
+
425
+ ### Prime notation (workspace)
426
+
427
+ The symbol catalog supports `\prime`. LaTeX imports such as `f^{\prime}(x)`,
428
+ `f^\prime(x)` and `f^{\prime\prime}(x)` use editable superscript slots and
429
+ preserve the prime count on export. Bare `\prime` is a symbol; use a superscript
430
+ for derivative notation. Apostrophe shorthand such as `f'(x)` remains accepted.
431
+ The editor does not compare answers. Hosts own question-specific suggestions and grading.
432
+
433
+ ## Development validation
434
+
435
+ The [editing scenarios](https://math-editor.barocss.com/docs/editing-scenarios.html)
436
+ define expected input, selection, deletion, history and host behavior. The
437
+ [validation report](https://math-editor.barocss.com/docs/validation.html) records
438
+ what was actually checked, including browser and host limits.
439
+
440
+ From a source checkout, start both math demo servers and run
441
+ `node scripts/check-math-editor.mjs`. This checks the model, actual editing,
442
+ framework/host lifecycle, selected KaTeX geometry and documentation build.
443
+ Workspace changes and a passing check do not imply that npm or the site has
444
+ already been published. See the changesets and release guide before publishing.
445
+
446
+ ## Text editor plugins
447
+
448
+ CodeMirror 6, CodeMirror 5, and Monaco have separate source-editing adapters. A VS Code extension uses a Webview beside the document. See the [text editor guide](./TEXT-EDITORS.md) for package names, setup, source-preservation rules, and validation scope. WGSL/GLSL editing is separate.