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

Function parseSlide

apps/sim/lib/pptx-renderer/model/slide.ts:289–329  ·  view source on GitHub ↗
(
  root: SafeXmlNode,
  index: number,
  rels: Map<string, RelEntry>,
  slidePath = '',
  diagramDrawings?: Map<string, string>
)

Source from the content-addressed store, hash-verified

287 * @param slidePath Full path to the slide file (e.g. "ppt/slides/slide1.xml")
288 */
289export function parseSlide(
290 root: SafeXmlNode,
291 index: number,
292 rels: Map<string, RelEntry>,
293 slidePath = '',
294 diagramDrawings?: Map<string, string>
295): SlideData {
296 const cSld = root.child('cSld')
297
298 // --- Background ---
299 const bg = cSld.child('bg')
300 const background = bg.exists() ? bg : undefined
301
302 // --- Parse shape tree children ---
303 const spTree = cSld.child('spTree')
304 const nodes: SlideNode[] = []
305
306 for (const child of spTree.allChildren()) {
307 const node = parseChildNode(child, rels, slidePath, diagramDrawings)
308 if (node) {
309 nodes.push(node)
310 }
311 }
312
313 // --- Layout relationship ---
314 const layoutIndex = findLayoutRel(rels)
315
316 // --- showMasterSp: if "0", layout/master shapes should not be rendered on this slide ---
317 const showMasterSpAttr = root.attr('showMasterSp')
318 const showMasterSp = showMasterSpAttr !== '0'
319
320 return {
321 index,
322 nodes,
323 background,
324 layoutIndex,
325 rels,
326 slidePath,
327 showMasterSp,
328 }
329}

Callers 1

buildPresentationFunction · 0.90

Calls 7

parseChildNodeFunction · 0.85
findLayoutRelFunction · 0.85
childMethod · 0.80
existsMethod · 0.80
allChildrenMethod · 0.80
attrMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected