Repository navigation
Modals are now built from an ordered stack of blocks: text, headings, lists, code, JSON, badges, icons, links, inline rows, collapsibles, tabs, markdown and Blade views. You can combine them freely in one modal.
Upgrading: apps that only use the ModalResponse PHP API usually just bump the dependency. See the upgrade guide. Using Laravel Boost? Update to v1.3.0 first, then ask your coding agent to upgrade nova-modal-response to v2.
Changed
- Breaking: the modal body is now an ordered stack of typed blocks, and the payload sent to the browser changed to
{ title, size, closeButtonText, blocks: [...] }. Code that builds the payload withAction::modal('modal-response', [...])breaks; theModalResponseAPI keeps working. See UPGRADE.md and ADR-0001 (#21) - A
console.warnis logged when a modal receives v1 payload keys (body,code,html,highlight) (#42) - Rewrote the README and the Boost skill (
nova-modal-response-development) for the v2 API (#31)
Added
ModalResponse::stack([...])to combine multiple blocks in one modal; accepts an array or a closure (#22)Blockfactory (Markwalet\NovaModalResponse\Block) with these blocks:text,heading,list,divider,code,json,html,markdown,view,badge,icon,link,inline,collapsibleandtabs(see #21)ModalResponse::markdown(),ModalResponse::view()andModalResponse::tabs()shortcuts (#58, #59, #67)- Bare strings in a stack, inline group, collapsible or tab become text blocks (#56)
- Shared
small/medium/largesizes on heading, badge, icon and link blocks, anddefault/info/success/warning/dangervariants on badge and icon blocks, backed by theSizeandVariantenums (#26, #27, #80) - Embedded icons on link and badge blocks via
->icon($name, trailing: false)(#55) - Inline group alignment:
spread(),center(),end()(#61) - Per-block syntax highlighting control with
->withoutHighlighting()on code and json blocks, and->language()on code blocks - Copy-to-clipboard button on every code and json block, including those nested in collapsibles and tabs (#77)
Removed
ModalResponse::withoutSyntaxHighlighting()(deprecated in v1.1.3). Passhighlight: falsetoModalResponse::code()/json(), or call->withoutHighlighting()on a code or json block- The v1 Boost upgrade skill (
nova-modal-response-upgrade-v2); it only applies to v1 apps, andboost:updateremoves it after upgrading
Full Changelog: v1.3.0...v2.0.0
