PHPackages                             veilcss/block-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. veilcss/block-framework

ActiveLibrary

veilcss/block-framework
=======================

Shared block infrastructure for the VeilCSS ecosystem.

v1.0.0(yesterday)01↑2900%GPL-2.0-or-laterPHPPHP &gt;=8.1

Since Jul 28Pushed yesterdayCompare

[ Source](https://github.com/veilcss/block-framework)[ Packagist](https://packagist.org/packages/veilcss/block-framework)[ Docs](https://github.com/veilcss/block-framework)[ RSS](/packages/veilcss-block-framework/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

VeilCSS Block Framework
=======================

[](#veilcss-block-framework)

Shared block infrastructure for the VeilCSS ecosystem.

This package is an internal integration boundary for VeilCSS ecosystem plugins. It is not a generic Gutenberg framework and is not intended as a third-party developer platform. It does not compile CSS, register product blocks, manage assets, or replace native WordPress block APIs.

Architecture
------------

[](#architecture)

Phase 1 contains two boundaries:

- A guarded global loader arbitrates between copies bundled by different plugins.
- A namespaced runtime owns the active `StyleResolverInterface`.

Blocks continue to use `block.json`, `register_block_type()`, native `render.php` files, and native WordPress asset loading.

Loader Lifecycle
----------------

[](#loader-lifecycle)

Each bundling plugin loads `loader.php` and registers its candidate:

```
veilcss_block_framework_register_version(
	'1.1.0',
	__DIR__ . '/vendor/veilcss/block-framework/bootstrap.php',
	array( 'source' => 'veilblocks' )
);
```

Registration never initializes the framework. The loader attaches one callback to `plugins_loaded` at priority `0`. At arbitration it:

1. Finds the highest manually maintained API version present.
2. Ignores candidates on lower API versions.
3. Sorts compatible candidates by package semver using `version_compare()`.
4. Loads the newest bootstrap, falling back to the next candidate if loading throws.
5. Records and exposes the selected runtime.

The bootstrap file declares `VEILCSS_BLOCK_FRAMEWORK_API_VERSION`. This integer is independent of package semver and changes only when `StyleResolverInterface`, the registration signature, or the runtime accessor breaks compatibility.

Selection is independent of plugin load order. Repeated arbitration returns the same runtime.

Style Resolution
----------------

[](#style-resolution)

`StyleResolverInterface::resolve()` receives block attributes, block context, and the block's existing class string. It always returns an immutable `ResolvedStyle`:

```
$style = veilcss_block_framework()
	->get_style_resolver()
	->resolve( $attributes, $context, $existing_classes );
```

`ResolvedStyle` contains:

- `class_string`: output-ready, space-separated classes.
- `inline_styles`: CSS property/value pairs.
- `data_attributes`: data attribute/value pairs.

The default resolver passes through the existing class string and returns empty arrays for the other fields. An integration replaces it once through `Framework::set_style_resolver()`; blocks only depend on the interface.

Public APIs
-----------

[](#public-apis)

- `veilcss_block_framework_register_version( $version, $bootstrap_path, $metadata )`
- `veilcss_block_framework_arbitrate()`
- `veilcss_block_framework()`
- `veilcss_block_framework_diagnostics()`
- `VeilCss\BlockFramework\StyleResolverInterface`
- `VeilCss\BlockFramework\ResolvedStyle`
- `VeilCss\BlockFramework\Framework`

Diagnostics include registered candidates, selected version/source/API, active resolver class, compatibility warnings, and recoverable loader failures. They are structured data only; Phase 1 emits no notices or visible output.

Compatibility
-------------

[](#compatibility)

Package releases follow semantic versioning. Loader compatibility follows the separate API version declared by each bootstrap. Within the highest API version in the registry, the newest semver wins. Changes to the resolver interface, resolved-style shape, loader registration signature, or stable runtime accessor require an API version increment.

Development
-----------

[](#development)

```
composer install
composer test
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/307026035?v=4)[VeilCSS](/maintainers/veilcss)[@veilcss](https://github.com/veilcss)

---

Top Contributors

[![damienoh](https://avatars.githubusercontent.com/u/3203756?v=4)](https://github.com/damienoh "damienoh (1 commits)")[![veilcss](https://avatars.githubusercontent.com/u/307026035?v=4)](https://github.com/veilcss "veilcss (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/veilcss-block-framework/health.svg)

```
[![Health](https://phpackages.com/badges/veilcss-block-framework/health.svg)](https://phpackages.com/packages/veilcss-block-framework)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
