Andrey Antukh 872ff4d6c1 🐛 Guard blur-selection entity against stale text selections
Skip the PENPOT_SELECTION stamp when the selection is collapsed
or points at blocks that no longer exist: blurring the editor
rebuilds the EditorState with fresh block keys while a delayed
on-change still carries the old keys, which crashed Draft.js
reading getCharacterList of undefined and killed the workspace.

Harden the sibling helpers (removeBlurSelectionEntity,
cursorToEnd, select-all/end builders) the same way and add a
vitest suite to the draft-js package covering stale, empty,
and collapsed selections.

Closes #11667

AI-assisted-by: muse-spark-1.3-contributor
2026-11-03 11:54:42 +01:00

26 lines
699 B
JSON

{
"name": "@penpot/draft-js",
"version": "1.0.0",
"description": "Penpot Draft-JS Wrapper",
"main": "index.js",
"type": "module",
"packageManager": "pnpm@12.16.1+sha512.091d1dee7927575661b25dab3c2ae31cafc1c54d6b71ed6a6600cf0c1cb10434a447eae14015f1b23e2e6bedeed79df94a932e2164d2832280dce3fb32f656d1",
"author": "Andrey Antukh",
"license": "MPL-2.0",
"dependencies": {
"draft-js": "penpot/draft-js.git#c58ebd9429a6359d72a88cff87e078aaf6fe285d"
},
"scripts": {
"test": "vitest run"
},
"peerDependencies": {
"react": ">=0.17.0",
"react-dom": ">=0.17.0"
},
"devDependencies": {
"esbuild": "^0.28.1",
"jsdom": "^30.0.1",
"vitest": "^4.1.10"
}
}