Conversation
Introduce the v2 block-stack architecture for the PHP layer: - Block abstract base with toArray() contract and Block::text() static factory - TextBlock concrete leaf - ModalResponse rewritten to own its stack and chrome locally - stack(array|Closure) primary entry point - title/size/closeButton chrome setters (wire keys: title, size, closeButtonText) - text() legacy sugar over stack([Block::text(...)]) - PayloadBuilder as a pure stateless serializer; withoutHighlight is a no-op placeholder until slice #9 - Legacy code/json/html factories temporarily removed (slices #2/#3/#4 will restore them on the new wire format) - Workbench: ViewTextStackAction exercises the new API; legacy demo actions removed alongside the factories References #22
- ModalActionResponse.vue iterates data.blocks through an explicit
{ type → component } map; single render path, no v-if branching
on data.code / data.html / data.body
- BlockText.vue leaf component renders a text block from its typed
block prop
- asset.js registers both components
- highlight.js dependency drops out for this slice (returns when the
code/json blocks land in slices #2/#3)
References #22
Rename BlockText.vue → TextBlock.vue (matches the PHP class name) and register it globally as `modal-response-text-block`. The `modal-response-` prefix namespaces this package's components in Nova's global registry to prevent collisions with the host app or other plugins. Future block slices (code, json, html, heading, …) follow the same pattern. Closes #22
v2 #28: divider block
v2 #25: html block + ModalResponse::html() sugar
v2 #26: heading block with visual sizes
v2 #29: list block (ordered / unordered, strings only)
v2 #27: badge block with five variants
v2 #23: code block + restore ModalResponse::code() sugar
v2 #24: json block + restore ModalResponse::json() sugar
Single ViewTextStackAction now exercises every block type (text, heading × 3 sizes, html, list ordered + unordered, badge × 5 variants, code autodetect + language + plaintext, json, divider) so manual verification covers the v2 release in one click. Recompiled dist/ to pull in CodeBlock, JsonBlock, HeadingBlock, ListBlock, BadgeBlock, HtmlBlock, DividerBlock.
Adds a chainable instance method that flips highlight: false on every code/json block in the final stack at serialize time. The PayloadBuilder walk is what enforces the cascade — order between stack() and the helper is therefore irrelevant. Non-code/json blocks are untouched. No top-level highlight field ever lands on the wire. Restores BC for v1 callers using ModalResponse::code($s)->withoutSyntaxHighlighting(). Closes #30
v2 #30: ModalResponse::withoutSyntaxHighlighting() bulk helper
Adds ViewWithoutHighlightingAction alongside the existing ViewTextStackAction so manual verification covers the modal-level bulk helper from #30 — same code/json content, plaintext rendering, non-code/json blocks unaffected.
Covers the three consumer paths: PHP-API-only (no changes), removed raw Action::modal() payload pattern with a v1→v2 mapping table, and a Vue-override pointer to the new data.blocks dispatch. References the legacy-payload console warning tracked in #42.
490b424 to
8de894d
Compare
Split block factory from contract; per-block syntax highlighting
Closes #55 Also fix two workbench actions still importing the pre-refactor Blocks\Block namespace.
Add embedded icons to link and badge blocks
# Conflicts: # resources/css/asset.css # resources/js/components/ModalActionResponse.vue
Wire copy button into code & json blocks
Back block size and variant with string enums
Add tabs block
Widen collapsible to accept a single block or an array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.