* Parse a single child node from spTree, dispatching to the appropriate parser.
( child: SafeXmlNode, rels: Map<string, RelEntry>, slidePath: string, diagramDrawings?: Map<string, string> )
| 227 | * Parse a single child node from spTree, dispatching to the appropriate parser. |
| 228 | */ |
| 229 | function parseChildNode( |
| 230 | child: SafeXmlNode, |
| 231 | rels: Map<string, RelEntry>, |
| 232 | slidePath: string, |
| 233 | diagramDrawings?: Map<string, string> |
| 234 | ): SlideNode | undefined { |
| 235 | const tag = child.localName |
| 236 | |
| 237 | switch (tag) { |
| 238 | case 'sp': |
| 239 | case 'cxnSp': |
| 240 | return parseShapeNode(child) |
| 241 | case 'pic': |
| 242 | return parsePicNode(child) |
| 243 | case 'grpSp': |
| 244 | return parseGroupNode(child) |
| 245 | case 'graphicFrame': |
| 246 | if (isTableFrame(child)) { |
| 247 | return parseTableNode(child) |
| 248 | } |
| 249 | if (isChartFrame(child)) { |
| 250 | return parseChartNode(child, rels, slidePath) |
| 251 | } |
| 252 | // SmartArt diagram with drawing fallback |
| 253 | if (isDiagramFrame(child) && diagramDrawings) { |
| 254 | return parseDiagramFrame(child, rels, slidePath, diagramDrawings) |
| 255 | } |
| 256 | // OLE object with fallback picture (e.g. embedded PDF preview on slide 34) |
| 257 | { |
| 258 | const olePic = parseOleFrameAsPicture(child) |
| 259 | if (olePic) return olePic |
| 260 | } |
| 261 | // Non-table/chart/ole graphic frames — skip |
| 262 | return undefined |
| 263 | default: |
| 264 | return undefined |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * Find the layout relationship target from a slide's rels map. |
no test coverage detected