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

Function findNvProps

apps/sim/lib/pptx-renderer/model/nodes/base-node.ts:57–72  ·  view source on GitHub ↗

* Try to find the non-visual properties container in the given node. * PPTX uses different wrapper names depending on the shape kind: * p:nvSpPr (shapes/connectors), p:nvPicPr (pictures), * p:nvGrpSpPr (groups), p:nvGraphicFramePr (tables/charts).

(node: SafeXmlNode)

Source from the content-addressed store, hash-verified

55 * p:nvGrpSpPr (groups), p:nvGraphicFramePr (tables/charts).
56 */
57function findNvProps(node: SafeXmlNode): { cNvPr: SafeXmlNode; nvPr: SafeXmlNode } {
58 const wrappers = ['nvSpPr', 'nvPicPr', 'nvGrpSpPr', 'nvGraphicFramePr', 'nvCxnSpPr']
59 for (const name of wrappers) {
60 const wrapper = node.child(name)
61 if (wrapper.exists()) {
62 return {
63 cNvPr: wrapper.child('cNvPr'),
64 nvPr: wrapper.child('nvPr'),
65 }
66 }
67 }
68 return {
69 cNvPr: node.child('cNvPr'),
70 nvPr: node.child('nvPr'),
71 }
72}
73
74/**
75 * Find the transform (xfrm) node. Shapes use `p:spPr > a:xfrm`,

Callers 1

parseBasePropsFunction · 0.85

Calls 2

childMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected