Focused, task-oriented documentation for extending a Phaser Editor v5 plugin.
These docs are written to be useful to both humans and AI assistants — they
explain which extension point to use and the pattern to follow, which the
bundled types/*.d.ts cannot convey on their own.
AI agents: start with
../AGENTS.md, then come here.
- Architecture & build — how plugins load, how the build works, and how the bundled types fit in.
- Extension points catalog — the map: which extension point does what, its base class, and a one-line example.
Each recipe is a copy-this-pattern guide tied to the working
myplugin.example code:
- Add a command — toolbar/menu/shortcut actions.
- Add a custom editor — open your own file type with a rich editor, Outline, and Inspector.
- Add a content type & New File wizard — recognize a file extension and let users create new files.
- Add Inspector properties — edit the selected object's fields in the Inspector view.
- Add styles (theme-correct) — CSS that works in every editor theme.
- Everything is registered in
registerExtensions(reg)viareg.addExtension(new SomeExtension(...)). - Files in a plugin share one namespace — no
import/exportbetween them. - The
.d.tsfiles intypes/are the API source of truth. Grep them. - A change isn't done until
npm run buildpasses.