@openmaic/renderer 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ function BaseVideoElement({ elementInfo, renderVideo, interactive = true, }) {
21
21
  // of falling through to the gray play-icon placeholder — slide 34).
22
22
  // Snapshot capture of the poster frame is handled in slideToPng
23
23
  // (html2canvas can't draw <video> directly).
24
- jsx("video", { style: { width: '100%', height: '100%', objectFit: 'contain' }, ...(elementInfo.src ? { src: elementInfo.src } : {}), poster: elementInfo.poster, preload: "metadata", controls: !!elementInfo.src })) : (jsx("div", { style: {
24
+ jsx("video", { style: { width: '100%', height: '100%', objectFit: 'contain' }, ...(elementInfo.src ? { src: elementInfo.src } : {}), poster: elementInfo.poster, preload: "metadata", controls: !!elementInfo.src, playsInline: true })) : (jsx("div", { style: {
25
25
  width: '100%',
26
26
  height: '100%',
27
27
  display: 'flex',
@@ -1 +1 @@
1
- {"version":3,"file":"BaseVideoElement.js","sources":["../../../src/elements/video/BaseVideoElement.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport type { PPTVideoElement } from '@openmaic/dsl';\n\nexport interface BaseVideoElementProps {\n elementInfo: PPTVideoElement;\n /**\n * Optional render slot: replace the default <video> with custom content.\n * Lets consumers inject placeholders, retry UI, lazy media resolvers, or\n * controlled playback bound to their own orchestration state.\n * When omitted, the package renders a plain <video src controls preload=\"metadata\">.\n */\n renderVideo?: (element: PPTVideoElement) => ReactNode;\n /** Enable pointer interaction for native controls or host-provided video UI. */\n interactive?: boolean;\n}\n\nexport function BaseVideoElement({\n elementInfo,\n renderVideo,\n interactive = true,\n}: BaseVideoElementProps) {\n return (\n <div\n className=\"base-element-video element-content\"\n data-video-element\n style={{\n position: 'absolute',\n top: `${elementInfo.top}px`,\n left: `${elementInfo.left}px`,\n width: `${elementInfo.width}px`,\n height: `${elementInfo.height}px`,\n pointerEvents: interactive ? 'auto' : 'none',\n }}\n onClick={interactive ? (e) => e.stopPropagation() : undefined}\n onPointerDown={interactive ? (e) => e.stopPropagation() : undefined}\n >\n <div\n style={{\n width: '100%',\n height: '100%',\n transform: `rotate(${elementInfo.rotate}deg)`,\n }}\n >\n {renderVideo ? (\n renderVideo(elementInfo)\n ) : elementInfo.src || elementInfo.poster ? (\n // Render <video> when we have either a playable src OR just a\n // poster/preview frame. A PPTX「视频」often has no decodable src in\n // this pipeline but does carry a preview image; rendering\n // <video poster> still shows that frame on the live canvas (instead\n // of falling through to the gray play-icon placeholder — slide 34).\n // Snapshot capture of the poster frame is handled in slideToPng\n // (html2canvas can't draw <video> directly).\n <video\n style={{ width: '100%', height: '100%', objectFit: 'contain' }}\n {...(elementInfo.src ? { src: elementInfo.src } : {})}\n poster={elementInfo.poster}\n preload=\"metadata\"\n controls={!!elementInfo.src}\n />\n ) : (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.1)',\n borderRadius: '4px',\n }}\n >\n <svg\n style={{ width: '48px', height: '48px', color: '#9ca3af' }}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polygon points=\"5 3 19 12 5 21 5 3\" />\n </svg>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;AAkBM;AAKJ;AAKM;AACA;AACA;AACA;AACA;;AAED;AAMG;AACA;AACA;;;;;;;;;AAaA;AAUI;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBd;;"}
1
+ {"version":3,"file":"BaseVideoElement.js","sources":["../../../src/elements/video/BaseVideoElement.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport type { PPTVideoElement } from '@openmaic/dsl';\n\nexport interface BaseVideoElementProps {\n elementInfo: PPTVideoElement;\n /**\n * Optional render slot: replace the default <video> with custom content.\n * Lets consumers inject placeholders, retry UI, lazy media resolvers, or\n * controlled playback bound to their own orchestration state.\n * When omitted, the package renders a plain <video src controls preload=\"metadata\">.\n */\n renderVideo?: (element: PPTVideoElement) => ReactNode;\n /** Enable pointer interaction for native controls or host-provided video UI. */\n interactive?: boolean;\n}\n\nexport function BaseVideoElement({\n elementInfo,\n renderVideo,\n interactive = true,\n}: BaseVideoElementProps) {\n return (\n <div\n className=\"base-element-video element-content\"\n data-video-element\n style={{\n position: 'absolute',\n top: `${elementInfo.top}px`,\n left: `${elementInfo.left}px`,\n width: `${elementInfo.width}px`,\n height: `${elementInfo.height}px`,\n pointerEvents: interactive ? 'auto' : 'none',\n }}\n onClick={interactive ? (e) => e.stopPropagation() : undefined}\n onPointerDown={interactive ? (e) => e.stopPropagation() : undefined}\n >\n <div\n style={{\n width: '100%',\n height: '100%',\n transform: `rotate(${elementInfo.rotate}deg)`,\n }}\n >\n {renderVideo ? (\n renderVideo(elementInfo)\n ) : elementInfo.src || elementInfo.poster ? (\n // Render <video> when we have either a playable src OR just a\n // poster/preview frame. A PPTX「视频」often has no decodable src in\n // this pipeline but does carry a preview image; rendering\n // <video poster> still shows that frame on the live canvas (instead\n // of falling through to the gray play-icon placeholder — slide 34).\n // Snapshot capture of the poster frame is handled in slideToPng\n // (html2canvas can't draw <video> directly).\n <video\n style={{ width: '100%', height: '100%', objectFit: 'contain' }}\n {...(elementInfo.src ? { src: elementInfo.src } : {})}\n poster={elementInfo.poster}\n preload=\"metadata\"\n controls={!!elementInfo.src}\n playsInline\n />\n ) : (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.1)',\n borderRadius: '4px',\n }}\n >\n <svg\n style={{ width: '48px', height: '48px', color: '#9ca3af' }}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polygon points=\"5 3 19 12 5 21 5 3\" />\n </svg>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;AAkBM;AAKJ;AAKM;AACA;AACA;AACA;AACA;;AAED;AAMG;AACA;AACA;;;;;;;;;AAaA;AAWI;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBd;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmaic/renderer",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "React component for rendering PPTist-style Slide JSON, extracted from OpenMAIC.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",