Files
webstudio/packages/template
Oleg Isonen 523f555cba fix: Make Content Block template JSX insertable (#6128)
## Summary

Fix MCP component discovery so Content Block template JSX can be passed
directly to `insert-fragment`.

The catalog previously advertised `<$.block-template />`. The hyphen is
invalid in a JSX member name, and the fallback `$` namespace also did
not match the canonical `ws:block-template` component.

## Implementation

- Advertise Webstudio-owned components through the `ws` JSX binding.
- Expose `ws:block-template` as the parser-safe `<ws.blockTemplate />`.
- Resolve that alias back to the unchanged canonical component ID at
runtime.
- Keep catalog formatting and runtime resolution on one shared alias
contract.
- Add regression coverage for inserting a Content Block, its required
template part, nested elements, and authored text.

Existing stored component IDs and Builder behavior remain unchanged.

## Todo

- [x] Advertise parser-compatible Content Block template JSX
- [x] Resolve the JSX alias to `ws:block-template`
- [x] Verify nested authored Content Block insertion
- [x] Verify other `ws:*` discovery entries use the correct namespace
- [x] Review documentation impact — no user-facing documentation changes
are required
- [x] Run project-build tests, typecheck, lint, formatting,
generated-doc checks, and fixtures
- [ ] Run the complete agent evaluation suite after explicit approval

## Verification

- `pnpm --filter @webstudio-is/project-build test` — 2,090 tests passed
- `pnpm --filter @webstudio-is/project-build typecheck`
- `pnpm lint`
- `pnpm exec oxfmt --check
packages/project-build/src/runtime/jsx/bindings.ts
packages/project-build/src/mcp.ts
packages/project-build/src/runtime/components.test.ts
packages/project-build/src/mcp.test.ts`
- `pnpm check:generated-docs`
- `pnpm fixtures` — completed with no fixture diff

Evaluations were not run because repository policy requires separate
explicit approval.

Closes #6127
2026-08-13 19:45:41 +02:00
..