alengo/sulu-preview-block-focus-bundle
postMessage) to decouple the preview iframe from the admin panel, ensuring minimal coupling with existing Sulu systems.ReactDOM.findDOMNode) to locate and manipulate blocks in the admin UI. This assumes Sulu’s admin panel is React-based (confirmed by Sulu 3.x docs), but may require adaptation if Sulu’s internals change.sulu_user_loggedin_and_preview to isolate preview-specific behavior, preventing leaks to production.data-block-id on preview blocks, which must be backward-compatible with existing Sulu templates (minimal template changes needed).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| React DOM Introspection | Medium | Test with Sulu’s latest React version; fallback to querySelector if fiber API changes. |
| Cross-Window Messaging | Low | Standard postMessage with origin validation. |
| Admin JS Build Process | Medium | Ensure npm install and build steps are automated in CI/CD. |
| Block ID Consistency | High | Validate content._id exists in all block types; add fallback logic. |
| Performance Impact | Low | Minimal overhead (event listeners only active in preview). |
ReactDOM.findDOMNode still locate blocks reliably?postMessage origin validation implemented? (Assume yes, but verify.)post-install scripts.)content._id).>=3.0), PHP (8.2+), and Symfony (7.0+).composer require alengo/sulu-preview-block-focus-bundle
Update config/bundles.php with the bundle class.assets/admin/package.json.app.js and rebuild (npm run build).webpack.config.js).sulu_user_loggedin_and_preview).data-block-id to all preview-rendered blocks (use Twig’s sulu_user_loggedin_and_preview guard).postMessage handling.data-block-id logic if block types store IDs differently.postMessage, classList); test in target browsers.data-block-id to templates.sulu-preview-block-focus-bundle assets require rebuilding admin JS (npm run build).data-block-id must be consistently applied across all preview-rendered blocks.postMessage events and React DOM nodes.assets/admin/index.js for debugging.data-block-id exists and matches admin-side IDs.sulu_user_loggedin_and_preview) is correct.| Failure Scenario | Impact | Mitigation |
|---|---|---|
postMessage blocked |
Focus button clicks fail | Verify iframe srcdoc or sandbox attributes. |
Missing data-block-id |
Block not found in admin | Add fallback: log error + highlight missing IDs. |
| React DOM structure changes | findDOMNode fails |
Use querySelector as fallback. |
| Admin JS build fails | Feature disabled | Add post-install script to rebuild assets. |
| Nested block ID resolution | Parent/child mapping fails | Extend bundle to handle custom ID paths. |
data-block-id requirements and template adjustments.data-block-id for custom block types.content._id").data-block-id usage.How can I help you explore Laravel packages today?