用途:为在 TYPO3 v12+(v14.3 LTS 捆绑 CKE5 v47,v13 为 41-42)中开发 CKEditor 5 自定义插件、配置 RTE 预设以及从 CKEditor 4 迁移提供技能支持。
涉及领域:架构(插件系统、schema/转换、命令、UI 组件);TYPO3 集成(YAML 配置、插件注册、内容元素);迁移(CKE4 到 CKE5 为完全重写,不存在兼容层)。
参考文件:references/ckeditor5-architecture.md(figcaption、view 与 DOM 元素等陷阱)、references/typo3-integration.md(TYPO3 特有模式)、references/plugin-development.md(TYPO3 接线、consumable API、无 jQuery 对话框)、references/migration-guide.md。
必要用法要点:插件通过 ext_localconf.php 注册,如 $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['my_preset'] = 'EXT:my_ext/Configuration/RTE/MyPreset.yaml'; 以及 $GLOBALS['TYPO3_CONF_VARS']['SYS']['ckeditor5']['plugins']['my-plugin'] 指定 entryPoint。插件结构需编辑与 UI 分离(主文件、editing、ui、command)。Schema 注册需用 allowIn/allowAttributes;转换器需 upcast 与 downcast 同时提供;命令必须实现 execute() 与 refresh()。
限制与注意:TYPO3 后端 JS 正在移除 jQuery 且无弃用期,插件仅可使用原生 API(querySelector、fetch、Promise)。后端响应属性名与前端使用不一致是最常见 Bug,需核对。迁移需完整重写插件:将 CKEDITOR.plugins.add() 转为基于类的 extends Plugin,用 schema+转换器+命令替代 editor.widgets.add(),将 PageTSConfig 转为 YAML 预设,使用 ES6 模块,移除 jQuery 并验证属性名。可用 ./scripts/verify-ckeditor5.sh /path/to/extension 验证。贡献地址为 https://github.com/netresearch/typo3-ckeditor5-skill。其他细节资料暂未提供。