继续 P1-Txtflowy 独立仓纯逻辑抽离,把高亮和加粗的目标区间/包裹计划也做成可测试逻辑。
/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/src/editor/txtflowyInlineStylePrimitives.tsplanTxtflowyTextWrap/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/src/editor/TxtflowyEditorExtension.tswrapSelectedTxtflowyText 不再直接在 view 层插前后缀planTxtflowyTextWrap==...== 与加粗 **...** 都复用这条 planner 链路/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/tests/editor-inline-style.test.mjs/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/GTD-TxtFlowy.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/docs/implementation-log.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/CHANGELOG.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/README.md执行目录:
/Users/ar/Projects/ExcalidrawX/P1-Txtflowy
执行命令:
npx --yes pnpm@10.10.0 test
npx --yes pnpm@10.10.0 build
结果:
test 通过:34 / 34build 通过:产出 main.js/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/src/editor/txtflowyInlineStylePrimitives.ts/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/src/editor/TxtflowyEditorExtension.ts/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/tests/editor-inline-style.test.mjs/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/main.js/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/GTD-TxtFlowy.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/docs/implementation-log.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/CHANGELOG.md/Users/ar/Projects/ExcalidrawX/P1-Txtflowy/README.md下一步如果继续同一路线,最顺的是把:
Enter / Ctrl+Enter 的 guard 也收成一层更明确的 planner