* 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)
| 55 | * p:nvGrpSpPr (groups), p:nvGraphicFramePr (tables/charts). |
| 56 | */ |
| 57 | function 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`, |
no test coverage detected