From a12ac78d61522984e735c86cb03bc95e349c2226 Mon Sep 17 00:00:00 2001 From: Jasper Frumau Date: Fri, 3 Jul 2026 08:55:24 +0700 Subject: [PATCH 1/3] Fix theme-icon binding by adding SVG icons to Vite build Add assets: ['resources/images/**'] to the laravel() plugin so static SVG icons referenced only via Vite::asset() in the imagewize/theme-icon binding get manifest entries. Without this, Vite::asset() throws and icons render as broken images in the editor and frontend. --- vite.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vite.config.js b/vite.config.js index 131f204..bc556f3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,6 +14,11 @@ export default defineConfig({ 'resources/css/editor.css', 'resources/js/editor.js', ], + // Make static SVG icons (referenced only via Vite::asset() in the + // imagewize/theme-icon block binding) part of the build so they get + // manifest entries. Without this, Vite::asset() throws and icons render + // as broken images. See docs/nynaeve/THEME-ICON-BINDING-BROKEN.md. + assets: ['resources/images/**'], refresh: true, }), From 84d43b6af37a75eb164e709d323cb23574966635 Mon Sep 17 00:00:00 2001 From: Jasper Frumau Date: Fri, 3 Jul 2026 08:55:34 +0700 Subject: [PATCH 2/3] Document required Vite assets option for theme-icon binding Add guidance to CLAUDE.md and AGENTS.md that vite.config.js must keep the assets option for the theme-icon binding to work, and that SVGs should never be imported (Vite hashes them into stale URLs). --- AGENTS.md | 1 + CLAUDE.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index fb44816..9fc874b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,6 +21,7 @@ - `block.json`: namespace/category/textdomain `imagewize`; default align `wide`; button styles via `core/buttons` container class (not individual buttons); add `"example": {}` for an inserter preview. - Full-width (`alignfull`) blocks: set a default margin reset in `block.json` attributes (`"style":{"spacing":{"margin":{"top":"0","bottom":"0"}}}`) — NOT a CSS override — so the constrained-layout `margin-block-start` gap is removed while users keep spacing control. Applies only to newly inserted blocks; existing ones must be updated manually. - Blade views in `resources/views`; reuse via `partials/` and `sections/`. CSS is Tailwind-first, custom in `resources/css` or block `style.css`. +- SVG icons in blocks: never `import` SVGs (Vite hashes them → stale URLs). Use the `imagewize/theme-icon` binding + `window.imagewizeIcons` (both from `app/setup.php`). `vite.config.js` MUST keep `assets: ['resources/images/**']` on the `laravel()` plugin so `Vite::asset()` can resolve the icons — without it every icon renders broken in editor and frontend. See CLAUDE.md "SVG Icons in Block Templates" and `docs/nynaeve/THEME-ICON-BINDING-BROKEN.md`. ### WooCommerce Customization - Quote-based system (no cart/checkout); custom templates in `resources/views/woocommerce/`; "Request Quote" buttons replace add-to-cart. diff --git a/CLAUDE.md b/CLAUDE.md index be2160a..b5492c3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -179,6 +179,22 @@ See [docs/ACF-BLOCKS.md](docs/ACF-BLOCKS.md). 2. `app/setup.php` injects `window.imagewizeIcons` (key → current Vite URL) for editor display. 3. `editor.jsx` uses `window.imagewizeIcons[path]` for `url` + adds `metadata.bindings.url` for frontend. +**REQUIRED — `vite.config.js` must build the icons (CRITICAL):** +For `Vite::asset('resources/images/icons/*.svg')` to resolve, the icons must be +in the build manifest. They are not imported from any JS/CSS, so the `laravel()` +plugin needs the `assets` option: +```js +laravel({ + input: [ /* ... */ ], + assets: ['resources/images/**'], // emits icons into the manifest + refresh: true, +}), +``` +This is the supported mechanism for `laravel-vite-plugin` v3+ / Vite 8 (it replaced +the old `import.meta.glob` approach). Without it, `Vite::asset()` throws, the callback +returns `null`, `window.imagewizeIcons` values are empty strings, and every icon renders +broken in both the editor and the frontend. See `docs/nynaeve/THEME-ICON-BINDING-BROKEN.md`. + ### Adding a new SVG icon **1. `app/setup.php` — add to both icon_maps:** From 2451dbb813700e0eec2b5f804aefc06cc369df29 Mon Sep 17 00:00:00 2001 From: Jasper Frumau Date: Fri, 3 Jul 2026 08:55:40 +0700 Subject: [PATCH 3/3] Bump theme version to 2.15.3 --- CHANGELOG.md | 18 ++++++++++++++++++ readme.txt | 8 +++++++- style.css | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fea817..66b7bc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to the Nynaeve theme will be documented in this file. For project-wide changes (infrastructure, tooling, cross-cutting concerns), see the [project root CHANGELOG.md](../../../../../CHANGELOG.md). +## [2.15.3] - 2026-07-03 + +### Fixed - Theme icon binding broken by Vite asset hashing + +**SVG Icon Rendering:** +- Fixed all `imagewize/theme-icon` block binding icons rendering as broken images in both the block editor and on the frontend +- Root cause: the static SVG icons in `resources/images/` were not part of the Vite build manifest, so `Vite::asset()` threw, the binding callback returned `null`, and `window.imagewizeIcons` values became empty strings + +### Technical - Vite build configuration for theme icons + +**vite.config.js:** +- Added `assets: ['resources/images/**']` to the `laravel()` plugin so static SVG icons referenced only via `Vite::asset()` receive manifest entries +- This is the supported mechanism for `laravel-vite-plugin` v3+ / Vite 8, replacing the old `import.meta.glob` approach + +**Documentation:** +- Updated `CLAUDE.md`, `AGENTS.md`, and `docs/nynaeve/THEME-ICON-BINDING-BROKEN.md` to document that `vite.config.js` must keep the `assets` option for the theme-icon binding to work +- Added guidance: never `import` SVGs in blocks (Vite hashes them into stale URLs); always use the `imagewize/theme-icon` binding with `window.imagewizeIcons` + ## [2.15.2] - 2026-06-30 ### Changed diff --git a/readme.txt b/readme.txt index f2a883a..c801d12 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: jasperfrumau Requires at least: 6.6 Tested up to: 6.9 Requires PHP: 8.3 -Stable tag: 2.15.2 +Stable tag: 2.15.3 License: MIT License License URI: https://opensource.org/licenses/MIT @@ -13,6 +13,12 @@ Nynaeve is the Imagewize.com production theme built on Sage 11 (Roots.io stack) == Changelog == += 2.15.3 - 07/03/26 = +* FIXED: Theme icon binding - SVG icons no longer render as broken images in the editor and frontend. +* TECHNICAL: Added assets: ['resources/images/**'] to Vite laravel() plugin so theme-icon SVGs get manifest entries for Vite::asset() resolution. +* TECHNICAL: Documented the required vite.config.js assets option in CLAUDE.md, AGENTS.md, and THEME-ICON-BINDING-BROKEN.md; never import SVGs in blocks, use the imagewize/theme-icon binding. + + = 2.15.2 - 06/30/26 = * CHANGED: Removed redundant [session_logging] block from .vibe/config.toml — save_dir was a hardcoded absolute path that crashed Vibe on other machines. * CHANGED: Updated PHP dependencies — illuminate/* to v13.17.0, brick/math, carbon, guzzlehttp/*, and other composer.lock updates. diff --git a/style.css b/style.css index 6354dab..b9ce665 100644 --- a/style.css +++ b/style.css @@ -2,7 +2,7 @@ Theme Name: Nynaeve Theme URI: https://imagewize.com Description: Modern WordPress theme built on Sage 11 with reusable custom blocks using WordPress native tools and the Roots.io stack. -Version: 2.15.2 +Version: 2.15.3 Author: Jasper Frumau Author URI: https://magewize.com Text Domain: nynaeve