MCPcopy Index your code
hub / github.com/simstudioai/sim / parseGroupChild

Function parseGroupChild

apps/sim/lib/pptx-renderer/renderer/group-renderer.ts:191–218  ·  view source on GitHub ↗

* Parse a raw XML child node from a group's spTree into a typed node object. * Returns undefined for unrecognized or unsupported elements.

(childXml: SafeXmlNode, ctx: RenderContext)

Source from the content-addressed store, hash-verified

189 * Returns undefined for unrecognized or unsupported elements.
190 */
191function parseGroupChild(childXml: SafeXmlNode, ctx: RenderContext): BaseNodeData | undefined {
192 const tag = childXml.localName
193
194 switch (tag) {
195 case 'sp':
196 case 'cxnSp':
197 return parseShapeNode(childXml)
198 case 'pic':
199 return parsePicNode(childXml)
200 case 'grpSp':
201 return parseGroupNode(childXml)
202 case 'graphicFrame': {
203 const graphic = childXml.child('graphic')
204 const graphicData = graphic.child('graphicData')
205 if (graphicData.child('tbl').exists()) {
206 return parseTableNode(childXml)
207 }
208 if ((graphicData.attr('uri') || '').includes('chart')) {
209 return parseChartNode(childXml, ctx.slide.rels, ctx.slide.slidePath)
210 }
211 const olePic = parseOleFrameAsPicture(childXml)
212 if (olePic) return olePic
213 return undefined
214 }
215 default:
216 return undefined
217 }
218}

Callers 1

parseByIndexFunction · 0.85

Calls 9

parseShapeNodeFunction · 0.90
parsePicNodeFunction · 0.90
parseGroupNodeFunction · 0.90
parseTableNodeFunction · 0.90
parseChartNodeFunction · 0.90
parseOleFrameAsPictureFunction · 0.90
childMethod · 0.80
existsMethod · 0.80
attrMethod · 0.80

Tested by

no test coverage detected