b670b436c33fdf9784f6485e82e2c6a07082b49b
insertAtCursor's textarea-fallback branch advanced lastEmittedRef to the post-insertion value. The mount effect's dynamic import() closes over `value` as of initial render, so if CodeMirror finishes loading after a fallback-mode insertion, it mounts with the pre-insertion doc. The only repair mechanism -- the value-sync effect -- is gated on `value !== lastEmittedRef.current`, so advancing that ref made the gate see them as already equal and skip the repair, silently dropping the insertion. Also clamps caretOffset to [0, text.length] defensively, and adds coverage for a non-empty-selection replace and for the fallback-to-CodeMirror-mount transition itself (using the real @codemirror/* packages, no mocks). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Description
Visual drag-and-drop website builder using GrapesJS
3.5 MiB
Languages
TypeScript
64.8%
HTML
16.1%
JavaScript
14.9%
CSS
3.2%
PHP
0.7%
Other
0.3%