diff --git a/package.json b/package.json index db72c031..1bb6825a 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dependencies": {}, "devDependencies": { "@ibexa/eslint-config": "https://github.com/ibexa/eslint-config-ibexa.git#~v2.0.0", + "@ibexa/frontend-config": "https://github.com/ibexa/frontend-config#^v5.0.0-beta1", "@ibexa/ts-config": "https://github.com/ibexa/ts-config-ibexa#~v1.1.0", "@types/react": "^19.1.2", "@types/react-dom": "^19.1.2" diff --git a/src/bundle/Resources/encore/ibexa.webpack.custom.config.js b/src/bundle/Resources/encore/ibexa.webpack.custom.config.js index 098cfd2e..aa3f3665 100644 --- a/src/bundle/Resources/encore/ibexa.webpack.custom.config.js +++ b/src/bundle/Resources/encore/ibexa.webpack.custom.config.js @@ -1,37 +1,46 @@ -const Encore = require('@symfony/webpack-encore'); const path = require('path'); -const ibexaConfigManager = require(path.resolve('./ibexa.webpack.config.manager.js')); + +const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager'); + const configManagers = require(path.resolve('./var/encore/ibexa.richtext.config.manager.js')); -Encore.reset(); -Encore.setOutputPath('public/assets/richtext/build').setPublicPath('/assets/richtext/build').enableSassLoader().disableSingleRuntimeChunk(); +const getCustomConfig = (Encore) => { + Encore.reset(); + Encore.setOutputPath('public/assets/richtext/build') + .setPublicPath('/assets/richtext/build') + .enableSassLoader() + .disableSingleRuntimeChunk(); -Encore.addEntry('ibexa-richtext-onlineeditor-js', [path.resolve(__dirname, '../public/js/CKEditor/core/base-ckeditor.js')]).addStyleEntry( - 'ibexa-richtext-onlineeditor-css', - [ + Encore.addEntry('ibexa-richtext-onlineeditor-js', [ + path.resolve(__dirname, '../public/js/CKEditor/core/base-ckeditor.js'), + ]).addStyleEntry('ibexa-richtext-onlineeditor-css', [ path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5/dist/ckeditor5.css'), path.resolve(__dirname, '../public/scss/ckeditor.scss'), - ], -); + ]); + + Encore.addAliases({ + '@ckeditor': path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor'), + ckeditor5: path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5'), + '@fieldtype-richtext': path.resolve('./vendor/ibexa/fieldtype-richtext'), + '@ibexa-admin-ui': path.resolve('./vendor/ibexa/admin-ui'), + }); + + const customConfig = Encore.getWebpackConfig(); -Encore.addAliases({ - '@ckeditor': path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor'), - ckeditor5: path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5'), - '@fieldtype-richtext': path.resolve('./vendor/ibexa/fieldtype-richtext'), - '@ibexa-admin-ui': path.resolve('./vendor/ibexa/admin-ui'), -}); + customConfig.name = 'richtext'; -const customConfig = Encore.getWebpackConfig(); + customConfig.module.rules[4].oneOf[1].use[1].options.url = false; + customConfig.module.rules[1].oneOf[1].use[1].options.url = false; -customConfig.name = 'richtext'; + configManagers.forEach((configManagerPath) => { + const configManager = require(path.resolve(configManagerPath)); -customConfig.module.rules[4].oneOf[1].use[1].options.url = false; -customConfig.module.rules[1].oneOf[1].use[1].options.url = false; + configManager(customConfig, ibexaConfigManager); + }); -configManagers.forEach((configManagerPath) => { - const configManager = require(path.resolve(configManagerPath)); + Encore.reset(); - configManager(customConfig, ibexaConfigManager); -}); + return customConfig; +}; -module.exports = customConfig; +module.exports = getCustomConfig; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js index 34d7b16a..06027286 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js @@ -151,7 +151,7 @@ class IbexaEmbedImageEditing extends Plugin { const domElement = this.toDomElement(domDocument); // note: do not reformat - configuration value for image embeds cannot contain whitespaces - // eslint-disable-next-line + domElement.innerHTML = `${modelElement.getAttribute('size')}`; // prettier-ignore return domElement;