@barocss/math-editor 0.4.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 (76) hide show
  1. package/API-SESSION.md +35 -1
  2. package/API-WEB-COMPONENT.md +2 -0
  3. package/CHANGELOG.md +109 -0
  4. package/CLIPBOARD.md +54 -0
  5. package/EDITING-SCENARIOS.md +209 -0
  6. package/GETTING-STARTED.md +54 -0
  7. package/IMPLEMENTATION.md +105 -0
  8. package/KEYBOARD.md +41 -0
  9. package/LATEX-GUIDE.md +52 -2
  10. package/LATEX-MODEL.md +12 -0
  11. package/LATEX-SCOPE.md +10 -1
  12. package/README.md +119 -23
  13. package/RELEASING.md +95 -10
  14. package/RENDERING-TESTS.md +79 -0
  15. package/ROADMAP.md +238 -6
  16. package/STYLING.md +28 -1
  17. package/TEXT-EDITORS.md +157 -0
  18. package/VALIDATION.md +433 -0
  19. package/dist/context-tools.d.ts +21 -0
  20. package/dist/context-tools.js +37 -0
  21. package/dist/dom/caret-geometry.js +1 -1
  22. package/dist/dom/context-keyboard.d.ts +2 -0
  23. package/dist/dom/context-keyboard.js +22 -0
  24. package/dist/dom/help.d.ts +5 -0
  25. package/dist/dom/help.js +104 -0
  26. package/dist/dom/menu-position.d.ts +3 -0
  27. package/dist/dom/menu-position.js +49 -4
  28. package/dist/dom/readable-layout.d.ts +3 -0
  29. package/dist/dom/readable-layout.js +52 -0
  30. package/dist/dom/toolbar-catalog.d.ts +1 -1
  31. package/dist/dom/toolbar.d.ts +2 -0
  32. package/dist/dom/toolbar.js +8 -1
  33. package/dist/dom.d.ts +13 -1
  34. package/dist/dom.js +323 -51
  35. package/dist/enter-policy.js +1 -1
  36. package/dist/latex.js +11 -0
  37. package/dist/lines.d.ts +2 -0
  38. package/dist/lines.js +15 -0
  39. package/dist/locales/en.js +33 -3
  40. package/dist/locales/en.json +33 -3
  41. package/dist/locales/ko.js +33 -3
  42. package/dist/locales/ko.json +33 -3
  43. package/dist/math-editor-toolbar.js +2 -1
  44. package/dist/math-editor.d.ts +4 -1
  45. package/dist/math-editor.js +506 -296
  46. package/dist/math-layout.d.ts +12 -0
  47. package/dist/math-layout.js +59 -0
  48. package/dist/math-spacing.d.ts +13 -0
  49. package/dist/math-spacing.js +87 -0
  50. package/dist/model.d.ts +6 -0
  51. package/dist/model.js +72 -5
  52. package/dist/range.d.ts +10 -2
  53. package/dist/range.js +31 -6
  54. package/dist/root-transform.d.ts +19 -0
  55. package/dist/root-transform.js +69 -0
  56. package/dist/selection-shortcuts.d.ts +13 -0
  57. package/dist/selection-shortcuts.js +35 -0
  58. package/dist/session.d.ts +1 -0
  59. package/dist/session.js +1 -1
  60. package/dist/suggestions.d.ts +9 -0
  61. package/dist/suggestions.js +53 -0
  62. package/dist/symbols.d.ts +1 -1
  63. package/dist/symbols.js +1 -0
  64. package/dist/vertical-navigation.d.ts +5 -0
  65. package/dist/vertical-navigation.js +33 -0
  66. package/dist/web-component.js +9 -1
  67. package/package.json +11 -3
  68. package/src/fonts/KaTeX_Math-Italic.woff2 +0 -0
  69. package/src/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  70. package/src/fonts/README.md +18 -0
  71. package/src/shapes/README.md +21 -0
  72. package/src/shapes/parenthesis-bottom.svg +1 -0
  73. package/src/shapes/parenthesis-top.svg +1 -0
  74. package/src/shapes/parenthesis.svg +1 -0
  75. package/src/shapes/radical.svg +1 -0
  76. package/src/style.css +882 -61
package/VALIDATION.md CHANGED
@@ -1,5 +1,188 @@
1
1
  # Validation report
2
2
 
3
+ ## Readability, geometry and navigation — release preparation, 2026-09-14
4
+
5
+ This candidate includes a configurable editing minimum, line clearance for
6
+ scripts, fraction descendant sizing, nested fence/radical fixes, token/structure
7
+ movement and selection, and visual text-popup zoom. The learning and styling
8
+ guides now recommend a 26px editing base for complex fractions, with a separate
9
+ preview/export size and an optional 16px nested minimum.
10
+
11
+ - Core regression checks: 1,743 unit tests passed; core and demo type checks passed.
12
+ - Focused browser checks: minimum-size editing, nested fences, script radicals,
13
+ keyboard movement/selection, and visual popup zoom. Detailed scope and limits
14
+ are recorded in the source-only records below.
15
+ - English/Korean site guidance explains the larger editing size. Public keyboard
16
+ help now documents Ctrl/Option movement and selection and the matrix column
17
+ deletion shortcut change.
18
+ - Historical full rendering and continuous-editing results below were obtained
19
+ before this candidate. They are not a fresh all-suite pass for the new size
20
+ policy. Exact curves/spacing and broader browser/platform QA remain open.
21
+ - This section records preparation, not npm publication or site deployment.
22
+
23
+ Source evidence: `test/rendering/STATUS.md`, `test/rendering/READABILITY.md`,
24
+ `test/editing/TOKEN-NAVIGATION.md`, and
25
+ `packages/math-editor-text/test/VISUAL-ZOOM.md` in the repository.
26
+
27
+ ## Learning and keyboard help — workspace, 2026-09-13
28
+
29
+ - EDIT-035: **4 results / 40 checkpoints passed**: five model-checked tutorial exercises, wrong-answer/reset/close behavior, unchanged playground, toolbar help, Korean labels, and F1 lifecycle on React block/native block/native inline. [Evidence](../../output/playwright/editing-scenarios/2026-09-13T12-33-34-456Z/REPORT.md).
30
+ - EDIT-019: **17 targets / 549 checkpoints passed**, including F1/Escape before the full continuous editing and host persistence chain. [Evidence](../../output/playwright/editing-scenarios/2026-09-13T12-31-33-614Z/REPORT.md).
31
+ - Core: **1,736 tests / 43 files**, core/demo type checks, package build and site build passed.
32
+ - Rendering: **330 PASS / 0 DIFF / 0 ERROR**, source stable. [Gallery](../../output/playwright/rendering-audit/2026-09-13T12-31-34-393Z/GALLERY.html). The new styles target help and the tutorial; mathematical geometry thresholds are unchanged.
33
+
34
+ The first toolbar-help check exposed native selection collapse after closing help; selection restoration now passes immediate wrapping and continued input. A separate toolbar now uses explicit `onHelp` ownership instead of guessing a target field. The tutorial's LaTeX readout is not an extra live status region. English semantic locale-key checks pass.
35
+
36
+ The consolidated CI entry point now includes the learning suite. These are local Chromium/macOS results. Actual OS F1/Fn routing, screen readers and system clipboard exchange remain unverified. No npm/site publication was performed.
37
+
38
+ ## Supported-notation editing milestone — workspace, 2026-09-13
39
+
40
+ The bounded milestone in [the roadmap](ROADMAP.md) passed its local gate. This is a workspace result; no package version or publication status changed.
41
+
42
+ - Core: **1,736 tests in 43 files**, strict core and browser-fixture type checks, and package build passed.
43
+ - Editing: **113 cases / 4,311 checkpoints** across 11 suites. All suites used identical source fingerprints, which still matched the candidate after execution.
44
+ - Rendering: **91 formulas / 330 PASS, 0 DIFF, 0 ERROR**. Existing thresholds were retained. Rendering sources matched the editing candidate. Twenty-one direct-shortcut cases also compare actual edited output with KaTeX.
45
+ - Main site/docs production build passed. The repository-owned runner and CI workflow use `node scripts/check-math-editor.mjs`. Workflow YAML and runner syntax passed; remote GitHub Actions execution is not claimed.
46
+
47
+ | Suite | Cases | Checkpoints | Result |
48
+ | --- | ---: | ---: | --- |
49
+ | EDIT-006 | 3 | 2766 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-56-52-074Z/REPORT.md) |
50
+ | EDIT-007 | 4 | 76 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-57-55-776Z/REPORT.md) |
51
+ | EDIT-013 | 2 | 10 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-58-09-267Z/REPORT.md) |
52
+ | EDIT-016 | 2 | 28 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-58-21-145Z/REPORT.md) |
53
+ | EDIT-018 | 8 | 60 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-58-33-699Z/REPORT.md) |
54
+ | EDIT-018-options | 5 | 30 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-58-46-765Z/REPORT.md) |
55
+ | EDIT-017-narrow | 3 | 12 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-58-58-829Z/REPORT.md) |
56
+ | EDIT-029 | 3 | 156 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-59-12-733Z/REPORT.md) |
57
+ | EDIT-034 | 3 | 131 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-59-30-658Z/REPORT.md) |
58
+ | EDIT-033 | 63 | 510 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T11-59-45-550Z/REPORT.md) |
59
+ | EDIT-019 | 17 | 532 | [PASS](../../output/playwright/editing-scenarios/2026-09-13T12-00-17-841Z/REPORT.md) |
60
+
61
+ [Consolidated evidence](../../output/playwright/math-editor-milestone/2026-09-13/REPORT.md) · [Rendering gallery](../../output/playwright/rendering-audit/2026-09-13T12-01-09-133Z/GALLERY.html)
62
+
63
+ Corrections include forward structure deletion, joining the following line, preferred vertical column retention, malformed clipboard rejection, multiline-paste rejection in React single-line fields, consistent Shift+Enter behavior and horizontal scrolling inside narrow inline hosts. English and Korean include the new invalid-clipboard message.
64
+
65
+ Clipboard checks use controlled ClipboardEvents/DataTransfer. Read-only is toggled without pointer blur to isolate the host state transition; clicking outside may intentionally apply a draft first. Editor.js data is checked after re-enabling because it cannot save while read-only. Its demo has no host Undo integration. Svelte option updates use its action API; the framework sample also covers actual Svelte mount/unmount.
66
+
67
+ Scope is desktop Chromium 152 on macOS with KaTeX 0.16.28. Safari, Firefox, Windows, real OS IME/clipboard, touch, screen readers, TinyMCE iframe and an installed WordPress admin are separate validation work. Geometry uses selected anchors and screenshot review, not complete pixel equality.
68
+
69
+ ## Held arrow navigation — workspace validation, 2026-09-13
70
+
71
+ - React and native DOM now read the live input selection before keydown handling. Delayed selection events no longer leave token/slot boundary checks one key repeat behind.
72
+ - EDIT-034: 3 renderer/mode targets passed 131 checkpoints with repeated keydown and one final keyup. Both horizontal directions, fraction slots, held Shift selection, collapse, continued input and Undo are covered.
73
+ - EDIT-033: 63 cases / 510 checkpoints passed, including 21 actual edited-output comparisons with KaTeX.
74
+ - EDIT-019: all 17 standalone/integration targets passed 499 continuous editing checkpoints.
75
+ - Core: 1,677 tests / 42 files, type checking and package build passed. Evidence is linked from the source-only editing test README. This change is not published yet.
76
+
77
+ ## Selection shortcuts — workspace validation, 2026-09-13
78
+
79
+ - Core: 1,677 tests / 42 files passed; type checking passed.
80
+ - EDIT-033: 63 cases / 510 checkpoints passed in Chromium. React block and native DOM block/inline each cover keyboard, native input and dragged selections, seven wrapping keys, continued typing and Undo/Redo.
81
+ - Geometry: 91 formulas / 330 combinations passed after fixing fraction term sizing and spacing. The same thresholds apply.
82
+ - Twenty-one keyboard cases also compare the actual edited output with KaTeX using the existing font-size and vertical-position thresholds.
83
+ - EDIT-019: all 17 standalone/integration targets passed 499 continuous editing checkpoints after the layout correction.
84
+ - Browser artifacts and measured rendering limits remain in the source-only editing/rendering ledgers. OS IME, other browser engines and the previously excluded host configurations remain separate work.
85
+
86
+ ## Inline fence transformation suggestions — workspace, 2026-09-09
87
+
88
+ Core: **584 tests in 36 files passed**. Core type checking and the main site/docs
89
+ build passed. `fence-suggestions-check.js` passed in Chromium for rich React and
90
+ all nine host demos, including menu reopening, keyboard acceptance, cancellation,
91
+ retained caret, continued typing and separate Undo entries. Editor.js is a block
92
+ host; this run does not claim an inline placement for that adapter.
93
+
94
+ `fence-context-check.js` passed all eight bracket choices through the optional
95
+ footer in the same ten editor views. `fence-inline-options-check.js` passed in a
96
+ native inline iframe with toolbar and footer disabled, including nearest nested
97
+ fence targeting, ko/en switching, unchanged document on locale changes, retained
98
+ input focus/caret, continued typing and teardown.
99
+
100
+ Existing root conversion suggestions were rerun in React and Quill and passed.
101
+ `fence-rendering-check.js` verifies the exported source after changing a bracket
102
+ around a fraction. The editor and KaTeX screenshots were visually inspected:
103
+ `output/playwright/fence-transform-editor.png` and
104
+ `output/playwright/fence-transform-katex.png`. This uses the existing delimiter
105
+ renderer and does not claim pixel-identical layout.
106
+
107
+ See EDIT-029 through EDIT-032 for acceptance criteria. This is local Chromium
108
+ workspace evidence, not a release, real OS IME or cross-browser certification.
109
+
110
+ ## Contextual radical tools — workspace, 2026-09-09
111
+
112
+ Core: **570 tests passed in 35 files**. Type checking and the main documentation/demo build passed.
113
+
114
+ `context-tools-check.js` passed in local Chromium for rich React and all nine
115
+ host examples: Tiptap, ProseMirror, Lexical, Editor.js, TinyMCE, CKEditor, Quill,
116
+ Slate and Gutenberg. It covers query-independent discovery, retained tools after
117
+ suggestion dismissal, F6/Escape focus, conversion, selected index editing, a
118
+ non-square-index explanation, radicand retention, Undo, leaving a radical and
119
+ hiding tools during model range selection.
120
+
121
+ `context-tools-options-check.js` passed for nearest nested targeting, native DOM
122
+ inside an iframe, owner-document keyboard focus, dynamic `contextTools`, en/ko
123
+ labels, synthetic composition guards, outside blur, teardown, and dynamic Web
124
+ Component `context-tools` attributes. Synthetic events do not certify OS IME.
125
+
126
+ The footer was visually inspected separately from the suggestion popup. Evidence
127
+ is in `output/playwright/context-tools-footer.png` and the two browser fixtures.
128
+ EDIT-021 through EDIT-028 record acceptance criteria and remaining checks: native
129
+ Tab order, document equality across locale changes, individual framework-wrapper
130
+ option smoke tests, and broader browsers/platforms. The new footer currently
131
+ covers square/indexed roots. Other structure families remain roadmap work.
132
+ These are workspace-source checks; no package or site was published.
133
+
134
+ ## Fractional scripts and empty-slot deletion — workspace, 2026-09-09
135
+
136
+ Core: 568 tests passed in 35 files; type checking and formatting passed. The
137
+ main documentation/demo build passed. `empty-slot-deletion-check.js` passed
138
+ 16 real-key checks across React/native DOM: Delete and Backspace from empty
139
+ root, fraction, exponent and root-index slots, retained content, focus and Undo.
140
+ Grid cells and populated rows are protected by the added core tests.
141
+
142
+ `rendering-regression-check.js` passed 12 Chromium comparisons: three formulas,
143
+ two base sizes and two renderers. Fraction terms matched KaTeX font sizes;
144
+ vertical offset differences were at most 0.109em against a 0.25em threshold.
145
+ Horizontal gap, active-input size and focus assertions passed. Matching-size
146
+ editor/KaTeX screenshots were visually inspected for the indexed-root power
147
+ and simple fractional power. Full pixel identity is not claimed.
148
+
149
+ Local evidence: `output/playwright/math-rendering-regression-evidence.json`
150
+ records metrics and source SHA-256 values. Screenshot pairs use the paths in
151
+ [Rendering checks](RENDERING-TESTS.md). This is workspace-source evidence, not
152
+ packed-release, all-host, cross-browser or full notation certification.
153
+
154
+ See [Editing scenarios](EDITING-SCENARIOS.md) for stable scenario IDs, acceptance criteria, coverage gaps and per-run reporting.
155
+
156
+
157
+ ## Radical conversion suggestions — workspace, 2026-09-09
158
+
159
+ Core tests: 558 passed in 34 files; type checking passed. Ten added cases cover
160
+ nested radicands, retained node IDs, selected index `2`, safe reverse conversion,
161
+ non-square and structured indices, nearest-root targeting, stale targets, empty
162
+ slots, localization, literal text and Undo/Redo.
163
+
164
+ `root-transform-check.js` passed in Chromium for rich React and Quill's native
165
+ DOM field. It checks pointer and arrow/Enter acceptance, selected index editing,
166
+ radicand preservation, reverse conversion, and rejection of index `3` conversion.
167
+ The generated LaTeX and KaTeX preview match; editor/KaTeX radical screenshots
168
+ were inspected. This does not certify every browser or every host adapter.
169
+
170
+ ## Selection suggestion navigation — workspace, 2026-09-09
171
+
172
+ `apps/math-integrations/tests/selection-suggestions-check.js` passed in Chromium
173
+ for rich React and all nine host integrations. The check covers Shift+arrow
174
+ ranges, Up/Down navigation, the Alt+Down alias, Enter wrapping the selected
175
+ characters, retained input focus after wrapping, and native mouse-drag selection.
176
+ No page errors were reported. Core tests: 548 passed; core type check passed.
177
+ `selection-collapse-check.js` also passed for React horizontal caret recovery,
178
+ fraction boundaries and resumed typing. `tinymce-inline-check.js` passed for
179
+ inline and classic iframe hosts, including vertical caret recovery after Escape
180
+ dismisses the wrapping menu, Apply/Cancel, serialization and Undo/Redo.
181
+
182
+ A visible wrapping menu now owns vertical arrows. Left/Right still collapses
183
+ a model selection to its ordered edge. This replaces the Alt-only menu
184
+ navigation policy in the historical selection-collapse record below.
185
+
3
186
  ## Styling and themes — workspace, 2026-09-09
4
187
 
5
188
  Release browser regression: all 385 existing Chromium cases passed across the
@@ -367,3 +550,253 @@ Core unit regression: **548 tests**. Shared integrations: **52 tests**. Core, in
367
550
  - Quill composition and typing regression fixtures pass, including read-only recovery, host history and matrix-cell entry.
368
551
 
369
552
  This is local Chromium evidence. OS IME, Safari/Firefox, installed WordPress and cross-application system clipboard checks were not repeated. No new mathematical grammar or numerical behavior is introduced. Release artifacts prepared before these changes require regeneration; nothing was published by this work.
553
+
554
+
555
+ ## EDIT-019 continuous editing — workspace, 2026-09-10
556
+
557
+ - Run: `2026-09-09T17-47-53-597Z`; source fingerprint remained stable.
558
+ - Evidence: [report](../../output/playwright/editing-scenarios/2026-09-09T17-47-53-597Z/REPORT.md), [checkpoints and source hashes](../../output/playwright/editing-scenarios/2026-09-09T17-47-53-597Z/report.json).
559
+ - Command: `pnpm --filter @barocss/math-editor test:editing`.
560
+ - Environment: Chromium 152 / macOS, English locale, workspace source.
561
+ - **React standalone block: PASS, 28 checkpoints. Quill in-place block: PASS, 29 checkpoints.**
562
+ - Real key input creates `fraction(indexedRoot(3, ab), 2) + matrix(1, 2; 3, 4)`;
563
+ an explicit tree assertion checks content and nesting. The last cell becomes
564
+ `456789` in a second uninterrupted typing chain.
565
+ - Both surfaces pass two five-step Undo/Redo chains, retained typing focus,
566
+ empty-root Delete/Undo/Redo and unchanged retained content. Each first history
567
+ step is compared with its recorded structural checkpoint.
568
+ - Quill draft operations leave host data unchanged. Apply is one host Undo step;
569
+ Redo restores it. Save, page reload, Restore and reopen preserve the Delta and
570
+ formula structure. The restored matrix remains editable; Cancel preserves the
571
+ saved document. React has no host persistence lifecycle, so that part is N/A.
572
+ - The runner fails on either scenario failure or a changed source fingerprint.
573
+ It stores the executed fixture, failure screenshots, diagnostics and final data.
574
+ - No runtime library changes were required. Earlier fixture failures exposed OS
575
+ `End` assumptions and selection of the wrong saved block; the final fixture
576
+ verifies caret offsets with arrows and reopens the uniquely identified formula.
577
+ - Not covered: other hosts, Quill inline mode, real OS IME/clipboard,
578
+ Firefox/WebKit, touch, accessibility and performance budgets. No release-wide
579
+ pass or new rendering pass is claimed.
580
+
581
+
582
+ ## EDIT-019 Quill inline extension — workspace, 2026-09-10
583
+
584
+ - Run: `2026-09-09T22-30-59-017Z`; source fingerprint remained stable.
585
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T22-30-59-017Z/REPORT.md) and
586
+ [checkpoints](../../output/playwright/editing-scenarios/2026-09-09T22-30-59-017Z/report.json).
587
+ - **React block: PASS (28 checkpoints); Quill block: PASS (29); Quill inline: PASS (30).**
588
+ - The unchanged continuous editing chain runs in all three targets. Renderer and
589
+ mode are recorded separately, including artifact names and the failure summary.
590
+ - Quill inline commits with Enter from the outer boundary. No extra formula line
591
+ or host paragraph appears; prose is unchanged by math editing.
592
+ - Apply/host Undo/Redo, Save/reload/Restore, re-edit and Cancel preserve the
593
+ inline formula. A later Right-arrow exit returns focus to Quill; typing `q`
594
+ inserts exactly one character immediately after that formula. Host Undo
595
+ restores the committed Delta, including formula data.
596
+ - Runtime library code was unchanged. The runner and scenario documentation were
597
+ extended; no npm publication or new rendering audit was required.
598
+ - Other hosts, standalone inline adapters, OS IME/clipboard, Firefox/WebKit,
599
+ touch, accessibility and performance remain outside this run.
600
+
601
+
602
+ ## EDIT-019 Tiptap and ProseMirror — workspace, 2026-09-10
603
+
604
+ - Run: `2026-09-09T22-39-51-097Z`, stable source fingerprint.
605
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T22-39-51-097Z/REPORT.md) and
606
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T22-39-51-097Z/report.json).
607
+ - **7 targets PASS / 205 checkpoints:** React block (28), Quill block/inline
608
+ (29/30), Tiptap block/inline (29/30), ProseMirror block/inline (29/30).
609
+ - Chromium 152 on macOS, English UI, workspace source. The extended runner hashes
610
+ both newly covered plugin sources and package metadata.
611
+ - Each target passes the existing continuous formula chain. Integrated hosts
612
+ additionally check Apply/host Undo/Redo, Save/reload/Restore, re-edit/Cancel,
613
+ retained formula data and unchanged prose/container structure. Inline targets
614
+ check Enter commit, right-boundary exit, exact prose position and host Undo.
615
+ - Initial integrated run `2026-09-09T22-36-38-459Z`: six PASS, Tiptap inline FAIL.
616
+ A quick prose edit after Restore shared the restored document's history event;
617
+ Undo removed both. The sample now brackets `setContent` with `closeHistory`
618
+ transactions, keeping the replacement and subsequent typing separate.
619
+ - Corrected run `2026-09-09T22-38-26-544Z`: seven PASS. The final run above repeats
620
+ all seven targets with the final runner documentation and source hashes.
621
+ - Integration-demo TypeScript and production build pass. Existing large-chunk
622
+ build warnings remain. Test source formatting passes. Core/plugin runtime
623
+ code was unchanged; the fix belongs to the Tiptap demo's restoration callback.
624
+ - Remaining: Lexical, Editor.js, TinyMCE, CKEditor, Slate and Gutenberg; native OS
625
+ IME/clipboard, other browser engines, touch, accessibility and performance.
626
+
627
+
628
+ ## EDIT-019 Lexical — workspace, 2026-09-10
629
+
630
+ - Run: `2026-09-09T23-08-15-353Z`, stable source fingerprint.
631
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T23-08-15-353Z/REPORT.md) and
632
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T23-08-15-353Z/report.json).
633
+ - **9 targets PASS / 264 checkpoints:** React block (28), Quill block/inline
634
+ (29/30), Tiptap block/inline (29/30), ProseMirror block/inline (29/30),
635
+ Lexical block/inline (29/30).
636
+ - Chromium 152 on macOS, English UI, workspace source. Fingerprints now include
637
+ the Lexical plugin source and package metadata.
638
+ - Lexical passes the full nested editing and two history chains, Apply as one
639
+ host Undo event, Redo, Save/reload/Restore, re-edit and Cancel. Inline also
640
+ passes Enter commit without a new paragraph, right-boundary exit, focus return,
641
+ typing immediately after the formula and host Undo.
642
+ - Host checks read Lexical serialized state and retain container boundaries and
643
+ formula atoms. Drafts must not change saved host state. Restoration must match
644
+ the complete saved JSON; math rendering alone is not the persistence check.
645
+ - The initial run `2026-09-09T23-06-35-494Z` reached Save/Restore in both Lexical
646
+ modes but used an incorrect locator for reopening. Lexical uses a mounted
647
+ `.bme-lexical-node` widget; `data-barocss-math` belongs to its HTML export.
648
+ The fixture now locates its live widget. No product code change was needed.
649
+ - Runner formatting passes. This change only extends tests and documentation;
650
+ no new build, package publication or rendering audit was required.
651
+ - Next: Editor.js, TinyMCE, CKEditor, Slate and Gutenberg. Native OS IME/clipboard,
652
+ other browser engines, touch, accessibility and performance remain outside this run.
653
+
654
+
655
+ ## EDIT-019 Editor.js — workspace, 2026-09-10
656
+
657
+ - Run: `2026-09-09T23-25-26-845Z`, stable source fingerprint.
658
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T23-25-26-845Z/REPORT.md) and
659
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T23-25-26-845Z/report.json).
660
+ - **10 targets PASS / 293 checkpoints:** React block (28), Quill/Tiptap/
661
+ ProseMirror/Lexical block and inline (29/30 each), Editor.js block (29).
662
+ - Chromium 152 on macOS, English UI, workspace source. Fingerprints include
663
+ Editor.js plugin source and package metadata.
664
+ - Editor.js passes nested fraction/root/matrix editing, suggestion selection,
665
+ two uninterrupted formula Undo/Redo chains, empty-root deletion/restoration,
666
+ Apply, Save/reload/Restore, re-edit and Cancel. Draft checks confirm saved host
667
+ data stays unchanged until Apply; prose blocks and block order remain intact.
668
+ - Async `save()` comparisons exclude only the generated `time` field. Block IDs,
669
+ saved model data, paragraph data and version remain in persistence assertions.
670
+ - **Editor.js host Undo/Redo is not covered:** the demo has no document history
671
+ integration. The runner records this limitation in `hostHistory`; it retains
672
+ the mandatory host Undo/Redo assertions for other configured hosts. Editor.js
673
+ inline mode is outside the block tool's contract.
674
+ - Test-source formatting passes. Only the runner, fixture and documentation
675
+ changed; no runtime fix, build, publication or new rendering audit was needed.
676
+ - Next: TinyMCE, CKEditor, Slate and Gutenberg. Native OS IME/clipboard, other
677
+ browser engines, touch, accessibility and performance remain separate work.
678
+
679
+
680
+ ## EDIT-019 TinyMCE — workspace, 2026-09-10
681
+
682
+ - Run: `2026-09-09T23-39-57-339Z`, stable source fingerprint.
683
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T23-39-57-339Z/REPORT.md) and
684
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T23-39-57-339Z/report.json).
685
+ - **12 targets PASS / 352 checkpoints:** React block (28), Quill/Tiptap/
686
+ ProseMirror/Lexical/TinyMCE block and inline (29/30 each), Editor.js block (29).
687
+ - Chromium 152 on macOS, English UI, workspace source. TinyMCE 8.9.0 uses
688
+ `inline: true` for its host. Both math modes are covered; classic iframe mode
689
+ is not covered by this run. Fingerprints include TinyMCE source and metadata.
690
+ - TinyMCE passes the sustained fraction/root/matrix chain, formula history,
691
+ draft isolation, one host Undo/Redo for Apply, Save/reload/Restore, re-edit and
692
+ Cancel. Inline also passes Enter commit, right-boundary exit, focus return,
693
+ typing immediately after the formula and host Undo.
694
+ - The fixture applies and reopens an empty atom before the chain because TinyMCE
695
+ inserts on Apply. This exposed a real bug: the empty preview renderer returned
696
+ no visible content, leaving no click target. The adapter now shows the existing
697
+ localized empty-formula message and skips the renderer for empty LaTeX.
698
+ Serialized content stays empty; the test checks the label does not leak into HTML.
699
+ - HTML comparisons retain the complete serialized document. A detached parser
700
+ reads prose and element boundaries for caret checks. Live locators exclude
701
+ TinyMCE's `.mce-offscreen-selection` clone inside the editable body.
702
+ - Diagnostic run `2026-09-09T23-38-20-112Z` confirmed that a reported prose Undo
703
+ failure was in the fixture: saved and actual HTML were identical, but building
704
+ the expected prose result had mutated the saved units array. The fixture now
705
+ copies that array. No timing wait or product history change is used to pass it.
706
+ - TinyMCE package TypeScript, two unit tests, build and changed-source formatting
707
+ pass. Package-local build also exposed a metafile path check using the wrong
708
+ working directory. The build now sets esbuild's working directory to the repo
709
+ root; the normal package build command succeeds with its dependency checks intact.
710
+ - Patch changeset: `.changeset/tiny-math-empty-preview.md`. No package was published.
711
+ - Remaining: CKEditor, Slate, Gutenberg, TinyMCE iframe mode, native OS
712
+ IME/clipboard and other browser/input environments. Editor.js document history
713
+ remains unverified because its demo has no host history integration.
714
+
715
+
716
+ ## EDIT-019 CKEditor — workspace, 2026-09-10
717
+
718
+ - Run: `2026-09-09T23-44-59-263Z`, stable source fingerprint.
719
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T23-44-59-263Z/REPORT.md) and
720
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T23-44-59-263Z/report.json).
721
+ - **14 targets PASS / 411 checkpoints:** React block (28), Quill/Tiptap/
722
+ ProseMirror/Lexical/TinyMCE/CKEditor block and inline (29/30 each),
723
+ Editor.js block (29).
724
+ - Chromium 152 on macOS, English UI, workspace source. CKEditor 48.5.0 uses the
725
+ local ClassicEditor demo. Fingerprints include CKEditor plugin source and
726
+ package metadata. This run does not cover other CKEditor builds or collaboration.
727
+ - CKEditor passes the sustained fraction/root/matrix chain, keyboard suggestion
728
+ selection, two formula Undo/Redo chains, empty-root deletion/restoration,
729
+ unchanged host data during drafts, Apply as one host Undo event and host Redo.
730
+ - Save/reload/Restore retains the complete serialized HTML and editable math
731
+ structure. Re-edit and Cancel leave that HTML unchanged. Inline also passes
732
+ Enter commit without another paragraph, Right-arrow exit, focus return,
733
+ prose input immediately after the formula and host Undo.
734
+ - The fixture reuses the detached HTML parser for prose/container checks and
735
+ copies parsed units when constructing expectations. Full saved-state equality
736
+ remains required for history and persistence checks.
737
+ - Test-source formatting passes. Only tests and documentation changed in this
738
+ extension; no runtime fix, additional build or package publication was needed.
739
+ - Next: Slate and Gutenberg. TinyMCE iframe hosts, other CKEditor builds,
740
+ native OS IME/clipboard and other browser/input environments remain separate
741
+ targets. Editor.js document history is still outside its demo's configuration.
742
+
743
+
744
+ ## EDIT-019 all integration demos — workspace, 2026-09-10
745
+
746
+ - Run: `2026-09-09T23-55-26-302Z`, stable source fingerprint.
747
+ - [Report](../../output/playwright/editing-scenarios/2026-09-09T23-55-26-302Z/REPORT.md) and
748
+ [checkpoints and hashes](../../output/playwright/editing-scenarios/2026-09-09T23-55-26-302Z/report.json).
749
+ - **17 targets PASS / 499 checkpoints**, covering all nine integration demos
750
+ plus standalone React block. Chromium 152 on macOS, English UI, workspace source.
751
+
752
+ | Editor | Tested math modes | Checkpoints | Host Undo/Redo |
753
+ | --- | --- | ---: | --- |
754
+ | React standalone | Block | 28 | Not applicable |
755
+ | Quill | Block + inline | 59 | PASS |
756
+ | Tiptap | Block + inline | 59 | PASS |
757
+ | ProseMirror | Block + inline | 59 | PASS |
758
+ | Lexical | Block + inline | 59 | PASS |
759
+ | Editor.js | Block | 29 | Not configured; unverified |
760
+ | TinyMCE | Block + inline, inline host | 59 | PASS |
761
+ | CKEditor | Block + inline, ClassicEditor | 59 | PASS |
762
+ | Slate | Block + inline | 59 | PASS |
763
+ | Gutenberg | Block, standalone provider | 29 | PASS |
764
+
765
+ - Slate passes the sustained nested editing chain, two formula Undo/Redo chains,
766
+ Apply as one host history event, Save/reload/Restore, re-edit and Cancel.
767
+ Inline also passes Enter commit, Right-arrow exit, host focus, exact prose
768
+ insertion position and host Undo. Comparisons retain the saved descendant
769
+ array and formula objects; prose checks also preserve paragraph boundaries.
770
+ - Gutenberg passes the same block chain and provider host Undo/Redo. Full saved
771
+ HTML equality includes WordPress comments and encoded math data. A separate
772
+ detached DOM comparison checks prose and block order; comments are not prose.
773
+ - Both new hosts keep saved document data unchanged while editing a draft.
774
+ Restore reproduces the full saved state and reopens the same editable model.
775
+ - Fingerprints now include Slate and Gutenberg source/package metadata, as well
776
+ as the previously covered hosts, core, shared helpers, demos and test runner.
777
+ - Formatting passes. This extension changed only tests and documentation; no
778
+ runtime fix, new build or publication was needed.
779
+ - This run covers local demo configurations. It does not replace the separate
780
+ WordPress admin/plugin ZIP checks. TinyMCE iframe, other CKEditor builds,
781
+ collaboration, native OS IME/clipboard, Firefox/WebKit, touch, accessibility
782
+ and performance remain separate targets. Editor.js/Gutenberg are block tools;
783
+ no inline mode is claimed for them.
784
+
785
+ ## Text editor integrations — 2026-09-13
786
+
787
+ - Source-range tests: 31 passing cases (`packages/math-editor-text/test/ranges.test.ts`).
788
+ - macOS Chromium browser adapters: 52 passing checkpoints across CodeMirror 6, CodeMirror 5, and Monaco. Includes nested root editing, display Enter, read-only changes, conflicting source, unsupported syntax, code exclusion, and Korean popup labels.
789
+ - VS Code 1.103.1 Extension Host: four command-opening checks and eight Webview Apply/Cancel/Undo/Redo checks across Markdown and LaTeX. A disposable copy uses a test-only DOM input driver; no test driver ships in the VSIX.
790
+ - Evidence: `output/playwright/math-text/`. Browser script: `apps/math-text-demo/test/editing.browser.js`. VS Code runner: `pnpm --filter barocss-math-editor test:extension`.
791
+ - Remaining coverage: Firefox/Safari, Windows/Linux shortcuts, screen readers, VS Code web/remote hosts, and custom Markdown/TeX dialect resolvers.
792
+
793
+ ## Direct source completion and example guides — 2026-09-13
794
+
795
+ - Shared source unit coverage: 37 passing checks, including range detection, fraction/root argument positions, rectangular matrices, symbol aliases, canonical export spellings and localized completion labels.
796
+ - Browser source completion: 42 checks across CodeMirror 5, CodeMirror 6 and Monaco. Covers command-only replacement, focus retention, one-step Undo/Redo, forward argument navigation, scrolling, explicit catalog opening, incomplete source, read-only state and visual-popup fallback.
797
+ - Additional source layout checks: 9 across the three hosts, covering indexed roots, reverse argument navigation, KaTeX preview placement and composition-event suspension. Synthetic composition events test gating; this is not a complete OS IME certification.
798
+ - Existing visual-popup browser suite: 52 checkpoints still pass.
799
+ - Example guides: 12 pages, including all nine document editors, with installation instructions and links checked against rendered HTML documentation.
800
+ - Text packages, main site and integration site build successfully. Main and integration bundles retain existing large-chunk warnings.
801
+ - Scripts: `apps/math-text-demo/test/source.browser.js`, `source-layout.browser.js`, `example-guides.browser.js`. Evidence is under `output/playwright/math-text/`.
802
+ - This does not establish Firefox/Safari, Windows/Linux, screen-reader or VS Code source-completion support. No npm or site publication was performed for this change.
@@ -0,0 +1,21 @@
1
+ import { type MathState, type MathStructure } from './model.js';
2
+ /** The closest supported wrapper owns the footer, even when roots and fences are nested. */
3
+ export declare function structureEditingContext(state: MathState): {
4
+ fence: MathStructure;
5
+ root?: undefined;
6
+ } | {
7
+ root: {
8
+ id: string;
9
+ kind: "root" | "indexedRoot";
10
+ target: "root" | "indexedRoot";
11
+ canTransform: boolean;
12
+ indexCaret: {
13
+ id: string;
14
+ start: number;
15
+ end: number;
16
+ } | undefined;
17
+ } | undefined;
18
+ fence?: undefined;
19
+ } | undefined;
20
+ /** Reject an action if focus has moved to a different wrapper since it was displayed. */
21
+ export declare function changeContextFence(state: MathState, id: string, kind: string): MathState;
@@ -0,0 +1,37 @@
1
+ import { documentRows, isLiteralText, } from './model.js';
2
+ import { fences } from './fences.js';
3
+ import { rootEditingContext } from './root-transform.js';
4
+ import { setMathPresentation } from './presentation.js';
5
+ /** The closest supported wrapper owns the footer, even when roots and fences are nested. */
6
+ export function structureEditingContext(state) {
7
+ if (isLiteralText(state.document, state.caret.id))
8
+ return;
9
+ const visit = (row, parent) => {
10
+ for (const node of row.children) {
11
+ if (node.type === 'text') {
12
+ if (node.id === state.caret.id)
13
+ return parent;
14
+ }
15
+ else {
16
+ const target = fences(node) || ['root', 'indexedRoot'].includes(node.type) ? node : parent;
17
+ for (const slot of node.slots) {
18
+ const found = visit(slot, target);
19
+ if (found)
20
+ return found;
21
+ }
22
+ }
23
+ }
24
+ };
25
+ const node = documentRows(state.document)
26
+ .map((row) => visit(row))
27
+ .find(Boolean);
28
+ if (!node)
29
+ return;
30
+ return fences(node) ? { fence: node } : { root: rootEditingContext(state) };
31
+ }
32
+ /** Reject an action if focus has moved to a different wrapper since it was displayed. */
33
+ export function changeContextFence(state, id, kind) {
34
+ return structureEditingContext(state)?.fence?.id === id
35
+ ? setMathPresentation(state, id, { fence: kind })
36
+ : state;
37
+ }
@@ -21,7 +21,7 @@ export function renderedCaretGeometry(surface) {
21
21
  ? affinity === 'forward'
22
22
  ? candidates.at(-1)
23
23
  : candidates[0]
24
- : candidates.find((item) => item.querySelector('.me-input')) ?? candidates[0];
24
+ : (candidates.find((item) => item.querySelector('.me-input')) ?? candidates[0]);
25
25
  const mirror = run?.querySelector('.me-measure');
26
26
  if (!run || !mirror)
27
27
  return;
@@ -0,0 +1,2 @@
1
+ /** Keep focus in the same document (including iframe hosts). Arrow keys only browse; Enter applies. */
2
+ export declare function focusContextAction(host: HTMLElement, key: string): boolean;
@@ -0,0 +1,22 @@
1
+ /** Keep focus in the same document (including iframe hosts). Arrow keys only browse; Enter applies. */
2
+ export function focusContextAction(host, key) {
3
+ const buttons = Array.from(host.querySelectorAll('button:not(:disabled)'));
4
+ if (!buttons.length)
5
+ return false;
6
+ const index = buttons.indexOf(host.ownerDocument.activeElement);
7
+ let next;
8
+ if (key === 'F6')
9
+ next = buttons.find((button) => button.getAttribute('aria-pressed') === 'true') ?? buttons[0];
10
+ else if (key === 'ArrowRight')
11
+ next = buttons[(index + 1) % buttons.length];
12
+ else if (key === 'ArrowLeft')
13
+ next = buttons[(index - 1 + buttons.length) % buttons.length];
14
+ else if (key === 'Home')
15
+ next = buttons[0];
16
+ else if (key === 'End')
17
+ next = buttons[buttons.length - 1];
18
+ if (!next)
19
+ return false;
20
+ next.focus({ preventScroll: true });
21
+ return true;
22
+ }
@@ -0,0 +1,5 @@
1
+ import { type MathLocale } from '../i18n.js';
2
+ /** Route a toolbar request to its owning field, including fields inside an iframe. */
3
+ export declare function requestMathHelp(control: HTMLElement): void;
4
+ /** Shared help UI. It does not execute model commands or read the clipboard. */
5
+ export declare function attachMathHelp(root: HTMLElement, locale: () => MathLocale): () => void;