feat(block-editor): inline contentlet reference (@-mention) end-to-end#36262
feat(block-editor): inline contentlet reference (@-mention) end-to-end#36262rjvelazco wants to merge 5 commits into
Conversation
#35473) Add a new inline atom node `dotInlineContent` that references a contentlet inline inside a paragraph (Notion-style @-mention). Only the reference ({identifier, languageId}) is stored; the title and front-end URL are resolved at render time, so renames/moves propagate automatically. Editor (new-block-editor): - New inline node extension + Angular node view (compact inline token, broken-reference fallback), modeled on the block `dotContent` node with the same skinny-ref serialization. - New `@`-mention Suggestion extension (separate plugin key) with a per-editor `InlineContentSuggestionService` doing debounced live title search via DotContentSearchService, plus a floating results component. - `buildContentletByTitleQuery` scopes the search to the content types allowed by the existing `contentTypes` field variable (empty => all). - Gated by the `dotInlineContent` allowed-block key; i18n + inline CSS. Backend (StoryBlock + VTL): - Add `dotInlineContent` to StoryBlockAPI.allowedTypes; existing recursive hydration reaches inline nodes nested in paragraphs unchanged. - render.vtl branch + new dotInlineContent.vtl emitting an inline <a> (urlMap/url resolved via the $dotcontent viewtool) with a <span> fallback. - Integration test for nested inline-content hydration. Headless SDKs: - Shared type: BlockEditorDefaultBlocks.DOT_INLINE_CONTENT. - React + Angular (legacy + semantic) renderers dispatch the new inline node to a default <a>/<span> component; customRenderers[node.type] override works with zero new API. README docs updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BUPpA53ghoRZ6AskMFbcVo
|
Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR. Last updated for commit |
❌ Linked Issue Needs Team LabelThis PR is linked to issue #35473, but that issue has no How to fix this:Apply a This comment was automatically generated by the issue linking workflow |
…entlet-references-inside-paragraphs
🤖 Bedrock Review —
|
|
Claude finished @rjvelazco's task in 2m 0s —— View job Rollback Safety Analysis
Result: ✅ Safe To RollbackAfter analyzing the full diff against all rollback-unsafe categories from Categories Checked
What this PR changes
H-8 VTL NoteThe new The label |
…uggestion error handling
…rences-inside-paragraphs' of https://github.com/dotCMS/core into issue-35473-block-editor-support-inline-contentlet-references-inside-paragraphs
Proposed Changes
Adds a new inline contentlet reference to the new Block Editor (#35473). Authors can reference a contentlet inline inside a paragraph (Notion-style
@-mention) so the contentlet's title renders as a live, linked reference within a sentence.The reference is a live single source of truth: only
{ identifier, languageId }is stored, and the current title + front-end URL are resolved at render time, so renames/moves propagate automatically (unlike a static link). It is modeled as an inline atom node (dotInlineContent), structurally identical to the existing blockdotContent, so the backend's existing Story Block hydration machinery applies unchanged.Editor (
new-block-editor)renderHTMLstrips to{ identifier, languageId }).@-mentionSuggestionextension on its own plugin key (coexists with the slash command), backed by a per-editorInlineContentSuggestionServicethat does a debounced live title search viaDotContentSearchService, plus a floating results popup.buildContentletByTitleQueryscopes the search to the content types allowed by the existingcontentTypesfield variable (empty/unset ⇒ all types) — reusingstore.allowedContentTypes, no new field variable.dotInlineContentallowed-block key; i18n keys + inline-token CSS.Backend (Story Block hydration + VTL)
dotInlineContenttoStoryBlockAPI.allowedTypes. The already-recursive traversal (isRefreshed/processBlocksRecursively) reaches inline nodes nested inside paragraphs and hydrates them with no further change.render.vtlbranch + newdotInlineContent.vtlemitting an inline<a>(front-end URL resolved lazily via the$dotcontentviewtool:urlMapfor URL-mapped content,urlfor pages) with a<span>fallback when no URL resolves.StoryBlockAPITestasserting a nested inline node'sattrs.data.titlere-hydrates to the live title after a rename.Headless SDKs
BlockEditorDefaultBlocks.DOT_INLINE_CONTENT.<a>/<span>component;customRenderers[node.type]override works with zero new API. READMEs updated.Checklist
new-block-editor,sdk-react,sdk-angular,sdk-types)tsc --noEmitpasses for the editor libsdk-angular+sdk-reactunit tests pass (existing dispatch tests included)Additional Info / Verification notes
Two items need live verification (require a running stack / browser):
display: inline-flexon the node-view host).StoryBlockAPITestcase against a real DB + Elasticsearch.Manual end-to-end check: content type with a Block Editor field → type
@→ confirm debounced live title search, insert, inline token in a paragraph; render via VTL and confirm the inline<a>; rename the source contentlet → re-render → title updates; render via the React/Angular SDK renderers and confirm the default<a>and acustomRenderers={{ dotInlineContent: … }}override.Video
video.mov
🤖 Generated with Claude Code
Generated by Claude Code