(cleanTrack: string)
| 133 | |
| 134 | /** Show the caret only while literal text is streaming into a text-bearing element. */ |
| 135 | export function shouldShowStreamingCaret(cleanTrack: string): boolean { |
| 136 | const track = cleanTrack.trim(); |
| 137 | const tailText = getTrailingTextRun(track); |
| 138 | if (!tailText) { |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | const stack = getOpenTagStack(track); |
| 143 | if (stack.length === 0) { |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | const deepest = stack[stack.length - 1]!.toLowerCase(); |
| 148 | return TEXT_STREAM_TAGS.has(deepest); |
| 149 | } |
| 150 | |
| 151 | /** Walk DOM to the innermost open element matching the track stack */ |
| 152 | function findDeepOpenElement( |
no test coverage detected