[BUGFIX] Apply CKEditor5 CSS scoping client-side
Download CSS via fetch() and apply CSS scoping and URL rebasing on the client in order to avoid the need for a server side SASS wrapper that: * can not relocate relative paths * can not easily check if the resource is web accessible * had to use regex-replacements instead of straight forward replacements on a properly parsed syntax tree The composer dependency scssphp/scssphp could theoretically be removed, but is kept in the v12 backport in order to avoid breaking classic mode extensions that relied on the fact that this dependency is shipped with TYPO3 v12. Commands executed: cd Build npm install --save css-tree npm install --save-dev @types/css-tree npm run build Resolves: #101918 Resolves: #100768 Resolves: #101380 Releases: main, 12.4 Change-Id: I34dfd76c07584a482f9012de1c693f0e7f9a2cb8 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81308 Tested-by:core-ci <typo3@b13.com> Tested-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Benjamin Franzke <ben@bnf.dev>
Showing
- Build/Gruntfile.js 1 addition, 0 deletionsBuild/Gruntfile.js
- Build/Sources/TypeScript/rte_ckeditor/ckeditor5.ts 40 additions, 4 deletionsBuild/Sources/TypeScript/rte_ckeditor/ckeditor5.ts
- Build/Sources/TypeScript/rte_ckeditor/css-prefixer.ts 92 additions, 0 deletionsBuild/Sources/TypeScript/rte_ckeditor/css-prefixer.ts
- Build/Sources/TypeScript/rte_ckeditor/tests/css-prefixer-test.ts 266 additions, 0 deletions...ources/TypeScript/rte_ckeditor/tests/css-prefixer-test.ts
- Build/package-lock.json 51 additions, 9 deletionsBuild/package-lock.json
- Build/package.json 2 additions, 0 deletionsBuild/package.json
- Build/web-test-runner.config.mjs 1 addition, 0 deletionsBuild/web-test-runner.config.mjs
- typo3/sysext/core/Configuration/JavaScriptModules.php 1 addition, 0 deletionstypo3/sysext/core/Configuration/JavaScriptModules.php
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/css-tree.js 11 additions, 0 deletions...sext/core/Resources/Public/JavaScript/Contrib/css-tree.js
- typo3/sysext/core/composer.json 0 additions, 1 deletiontypo3/sysext/core/composer.json
- typo3/sysext/rte_ckeditor/Classes/Controller/ResourceController.php 0 additions, 87 deletions...xt/rte_ckeditor/Classes/Controller/ResourceController.php
- typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php 0 additions, 19 deletions...ext/rte_ckeditor/Classes/Form/Element/RichTextElement.php
- typo3/sysext/rte_ckeditor/Classes/Service/ScssProcessor.php 0 additions, 67 deletionstypo3/sysext/rte_ckeditor/Classes/Service/ScssProcessor.php
- typo3/sysext/rte_ckeditor/Configuration/Backend/Routes.php 0 additions, 5 deletionstypo3/sysext/rte_ckeditor/Configuration/Backend/Routes.php
- typo3/sysext/rte_ckeditor/Configuration/Services.yaml 0 additions, 12 deletionstypo3/sysext/rte_ckeditor/Configuration/Services.yaml
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/ckeditor5.js 2 additions, 2 deletions...ext/rte_ckeditor/Resources/Public/JavaScript/ckeditor5.js
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/css-prefixer.js 13 additions, 0 deletions.../rte_ckeditor/Resources/Public/JavaScript/css-prefixer.js
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/compiled.css 0 additions, 114 deletionstypo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/compiled.css
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/fixed.scss 0 additions, 95 deletionstypo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/fixed.scss
- typo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/origin.scss 0 additions, 92 deletionstypo3/sysext/rte_ckeditor/Tests/Unit/Fixtures/origin.scss
Please register or sign in to comment