diff --git a/servers/nextjs/app/api/presentation_to_pptx_model/route.ts b/servers/nextjs/app/api/presentation_to_pptx_model/route.ts index 49bdc924..4dd4524a 100644 --- a/servers/nextjs/app/api/presentation_to_pptx_model/route.ts +++ b/servers/nextjs/app/api/presentation_to_pptx_model/route.ts @@ -77,6 +77,9 @@ async function getBrowserAndPage(id: string): Promise<[Browser, Page]> { waitUntil: "networkidle0", timeout: 60000, }); + page.on('console', (msg) => { + console.log('console', msg.text()); + }); return [browser, page]; } @@ -284,14 +287,14 @@ async function getAllChildElementsAttributes({ element, rootRect = null, depth = const isCanvas = attributes.tagName === 'canvas'; const isTable = attributes.tagName === 'table'; - const isRootPosition = attributes.position && + const occupiesRoot = attributes.position && attributes.position.left === 0 && attributes.position.top === 0 && attributes.position.width === rootRect!.width && attributes.position.height === rootRect!.height; const hasOtherProperties = hasBackground || hasBorder || hasShadow || hasText || hasImage || isSvg || isCanvas || isTable; - return hasOtherProperties && !isRootPosition; + return hasOtherProperties && (!occupiesRoot || hasImage); }) : allResults; if (depth === 0) { @@ -430,6 +433,23 @@ async function getElementAttributes(element: ElementHandle): Promise): Promise): Promise): Promise): Promise = ({ data: slideData }) }} > {/* Background Image */} -
= ({ data: slideData }) {/* Main Content */}
- + {/* Heading */}

@@ -80,12 +80,12 @@ const QuoteSlideLayout: React.FC = ({ data: slideData })
{/* Quote Icon */}
- - +
diff --git a/servers/nextjs/utils/pptx_models_utils.ts b/servers/nextjs/utils/pptx_models_utils.ts index a6cc720c..7ab0eb8c 100644 --- a/servers/nextjs/utils/pptx_models_utils.ts +++ b/servers/nextjs/utils/pptx_models_utils.ts @@ -78,6 +78,7 @@ export function convertElementAttributesToPptxSlides( function convertElementToPptxShape( element: ElementAttributes ): PptxTextBoxModel | PptxAutoShapeBoxModel | PptxConnectorModel | PptxPictureBoxModel | null { + if (!element.position) { return null; }