Skip to content

V2#32

Open
markwalet wants to merge 82 commits into
mainfrom
v2
Open

V2#32
markwalet wants to merge 82 commits into
mainfrom
v2

Conversation

@markwalet

Copy link
Copy Markdown
Owner

No description provided.

markwalet added 22 commits May 26, 2026 19:58
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 #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.
@markwalet markwalet force-pushed the v2 branch 2 times, most recently from 490b424 to 8de894d Compare May 26, 2026 20:17
markwalet added 29 commits May 27, 2026 15:06
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
Widen collapsible to accept a single block or an array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant