9.5.0
@comet/cms-api@9.5.0
Minor Changes
-
4eadaf5: Deprecate
FilesService.calculateDominantColorComputing the dominant color of an image was the only part of
FilesServicethat used imgproxy. It moved to an internal service thatDamImagesModuleprovides, so file handling no longer depends on imgproxy.FilesService.calculateDominantColorreturns the color whenDamImagesModuleis registered, andundefinedwhen it is not. -
4eadaf5: Split
DamModuleinto composable sub-modulesDamModuleis now a facade composing four sub-modules:DamFilesModule(file and folder storage, upload and serving),DamImagesModule(image scaling via imgproxy, dominant color),DamBlocksModule(block transformers) andDamDependentsModule(thedependentsfield onDamFile).DamModule.register()keeps its signature and still composes all four.DamModuleand its sub-modules now throw when they are registered more than once in the same process. A second registration would mount the DAM routes twice and add thedependentsfield to the file type again, so it never worked as intended.Projects that only need DAM file upload and storage can register
DamFilesModuleon its own, withoutImgproxyModuleand withoutDependenciesModule:DamFilesModule.register({ damConfig, Scope: DamScope, File: DamFile, Folder: DamFolder });
In that setup,
FilesServicereceives no dominant color calculator, so uploads skip the color andFilesService.calculateDominantColorreturnsundefined.