( rootId: string, tree: VisibleTree, ctx: RenderContext, omittedNodeIds: string[] )
| 30 | } |
| 31 | |
| 32 | export async function renderShellTree( |
| 33 | rootId: string, |
| 34 | tree: VisibleTree, |
| 35 | ctx: RenderContext, |
| 36 | omittedNodeIds: string[] |
| 37 | ): Promise<DevComponent | null> { |
| 38 | const snapshot = tree.nodes.get(rootId) |
| 39 | if (!snapshot || omittedNodeIds.length === 0) return null |
| 40 | if (ctx.svgs.has(snapshot.id)) return null |
| 41 | |
| 42 | if (snapshot.node.type === 'TEXT') return null |
| 43 | const pluginComponent = await resolveSnapshotPluginComponent(snapshot, ctx) |
| 44 | if (pluginComponent) return null |
| 45 | |
| 46 | const langHint = ctx.preferredLang ?? ctx.detectedLang |
| 47 | const rawStyle = resolveSnapshotStyle(snapshot, ctx) |
| 48 | const props = buildFallbackSnapshotProps(snapshot, ctx, rawStyle, langHint) |
| 49 | |
| 50 | return { |
| 51 | name: snapshot.tag || 'div', |
| 52 | props, |
| 53 | children: [raw(buildShellComment(langHint, omittedNodeIds))] |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | async function renderNode( |
| 58 | nodeId: string, |
no test coverage detected