Skip to content

v1.2.0

Choose a tag to compare

@bob-moore bob-moore released this 21 May 16:53
· 7 commits to main since this release

Architecture refactor — foundry-se alignment

This release is a significant internal refactor that aligns the plugin with the foundry-se theme architecture. No changes to block functionality, filters, or external APIs.

What changed

New classes

  • Main — owns the DI container, handles compiled-container caching, exposes getInstance()/setInstance(), fires button_block_enhancements_loaded action
  • Module — abstract base class; all providers, processors, and services extend it to receive $package via #[Inject]
  • definitions.php — DI definitions extracted from Controller into a dedicated file
  • Services\AssetLoader — abstract base injecting FilePathResolver and UrlResolver so loaders work whether the package is loaded as a plugin or composer-embedded in a theme
  • Services\ScriptLoader / Services\StyleLoader — mirror foundry-se's loader pattern; StyleLoader gains enqueueBlockStyle()

Refactored classes

  • Controller — stripped to a pure hook registrar using #[Inject] method injection; no container awareness
  • Providers\Assets — extends Module, delegates asset enqueueing to ScriptLoader/StyleLoader
  • Providers\Icons, Processors\Colors, Processors\Icons — extend Module
  • Utilities — expanded with slugify, hyphenate, arrayMerge, classUses, isList, truthyFalsy, isPluginActive, and reflection helpers
  • Resolver inject keys updated: config.path/config.url → path/url