Commit ff46ed8
committed
refactor: centralize key-path resolution in operation-to-patches
Extracts a `resolveKeyPath` function that converts positional Slate paths
to key-based PT paths using the tree. Uses it in operation-to-patches.ts
to replace scattered inline key lookups.
This is the foundation for making operations and patches isomorphic —
when containers land, resolveKeyPath generalizes to walk nested container
fields, and the patch functions don't need to change.
- New: resolve-key-path.ts with resolveKeyPath() + KeyPath type
- Refactored: operation-to-patches.ts uses resolveKeyPath + path helpers
- New: 11 tests for resolveKeyPath covering blocks, children, objects, edge cases
- All 255 existing unit tests pass1 parent d312abd commit ff46ed8
3 files changed
Lines changed: 388 additions & 232 deletions
File tree
- packages/editor/src/internal-utils
0 commit comments