pptx-vanilla-viewer 2.1.2 → 2.1.4

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.
@@ -1 +1 @@
1
- import'./chunk-WOT6VMZA.js';import {WebGLRenderer,Scene,Color,PerspectiveCamera,AmbientLight,DirectionalLight,Group,MeshStandardMaterial,Mesh,EdgesGeometry,LineBasicMaterial,LineSegments,PlaneGeometry,MeshBasicMaterial,Euler,Vector3,BufferGeometry,Line,Shape,ExtrudeGeometry,CanvasTexture,SRGBColorSpace,LinearFilter,RepeatWrapping}from'three';import {OrbitControls}from'three/examples/jsm/controls/OrbitControls.js';var M=4,P=.86;function Q(o,i,e){let t=i.split(/\s+/u).filter(Boolean);if(t.length===0)return [];let a=[],s=t[0];for(let r=1;r<t.length;r++){let c=`${s} ${t[r]}`;o.measureText(c).width<=e?s=c:(a.push(s),s=t[r]);}return a.push(s),a}function _(o,i,e,t,a){if(typeof document>"u"||!o.trim()||t<=0||a<=0)return null;let s=t*P,r=a*P,c=document.createElement("canvas");c.width=Math.max(8,Math.round(s*M)),c.height=Math.max(8,Math.round(r*M));let n=c.getContext("2d");if(!n)return null;let d="system-ui, -apple-system, Segoe UI, Roboto, sans-serif",p=c.width*.94,u=Math.max(6,e)*M,f=[];for(let l=0;l<12;l++){n.font=`600 ${u}px ${d}`,f=Q(n,o,p);let g=u*1.2;if(f.length*g<=c.height*.96||u<=6*M)break;u*=.88;}n.clearRect(0,0,c.width,c.height),n.fillStyle=i,n.textAlign="center",n.textBaseline="middle",n.font=`600 ${u}px ${d}`;let x=u*1.2,w=f.length*x,y=c.height/2-w/2+x/2;for(let l=0;l<f.length;l++)n.fillText(f[l],c.width/2,y+l*x);let h=new CanvasTexture(c);return h.colorSpace=SRGBColorSpace,h.minFilter=LinearFilter,h.magFilter=LinearFilter,h.flipY=false,h.premultiplyAlpha=false,h.wrapT=RepeatWrapping,h.repeat.set(1,-1),h.offset.set(0,1),h.needsUpdate=true,{texture:h,worldWidth:s,worldHeight:r}}function ee(o){let i=new Shape;o.outline.forEach((t,a)=>{a===0?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y);}),i.closePath();let e=o.bevel>0;return new ExtrudeGeometry(i,{depth:o.depth,bevelEnabled:e,bevelThickness:o.bevel,bevelSize:o.bevel,bevelSegments:2,curveSegments:o.rounded?24:1,steps:1})}function te(o,i,e){let t=ee(e),a=new MeshStandardMaterial({color:new Color(e.fill),metalness:.12,roughness:.52,transparent:e.opacity<1,opacity:e.opacity}),s=new Mesh(t,a);if(s.position.set(e.position.x,e.position.y,e.position.z),s.rotation.set(e.rotation.x,e.rotation.y,e.rotation.z),o.add(s),i.push(t,a),e.strokeWidth>0){let r=new EdgesGeometry(t,30),c=new LineBasicMaterial({color:new Color(e.stroke)}),n=new LineSegments(r,c);n.position.copy(s.position),n.rotation.copy(s.rotation),o.add(n),i.push(r,c);}return t}function ne(o,i,e){if(!e.text)return;let t=_(e.text,e.textColor,e.fontSize,e.halfWidth*2,e.halfHeight*2);if(!t)return;let a=new PlaneGeometry(t.worldWidth,t.worldHeight),s=new MeshBasicMaterial({map:t.texture,transparent:true,depthWrite:false}),r=new Mesh(a,s),c=new Euler(e.rotation.x,e.rotation.y,e.rotation.z),n=new Vector3(0,0,e.depth+e.bevel+.4).applyEuler(c);r.position.set(e.position.x+n.x,e.position.y+n.y,e.position.z+n.z),r.rotation.copy(c),o.add(r),i.push(a,s,t.texture);}function oe(o,i,e){for(let t of e.connectors){if(t.points.length<2)continue;let a=new BufferGeometry().setFromPoints(t.points.map(r=>new Vector3(r.x,r.y,r.z))),s=new LineBasicMaterial({color:new Color(t.color),transparent:true,opacity:.7});o.add(new Line(a,s)),i.push(a,s);}}function ie(o){let i=new Group,e=[];for(let t of o.meshes)te(i,e,t),ne(i,e,t);return oe(i,e,o),{group:i,dispose(){for(let t of e)t.dispose();}}}var T=42;function ae(o){let i=1/0,e=1/0,t=1/0,a=-1/0,s=-1/0,r=-1/0,c=(n,d,p,u)=>{i=Math.min(i,n-u),e=Math.min(e,d-u),t=Math.min(t,p-u),a=Math.max(a,n+u),s=Math.max(s,d+u),r=Math.max(r,p+u);};for(let n of o.meshes){let d=Math.max(n.halfWidth,n.halfHeight)+n.depth+n.bevel;c(n.position.x,n.position.y,n.position.z,d);}for(let n of o.connectors)for(let d of n.points)c(d.x,d.y,d.z,1);return Number.isFinite(i)?{cx:(i+a)/2,cy:(e+s)/2,cz:(t+r)/2,radius:.5*Math.hypot(a-i,s-e,r-t)||1}:{cx:0,cy:0,cz:0,radius:Math.max(o.bounds.width,o.bounds.height)/2||1}}function se(o,i){let e=T*Math.PI/180,t=2*Math.atan(Math.tan(e/2)*i),a=Math.min(e,t);return o/Math.sin(a/2)*1.1}function le(o,i,e,t,a={}){let s=new WebGLRenderer({canvas:o,antialias:true,alpha:!a.background});s.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,a.maxPixelRatio??2)),s.setSize(e,t,false);let r=new Scene;a.background&&(r.background=new Color(a.background));let{cx:c,cy:n,cz:d,radius:p}=ae(i),u=e/Math.max(1,t),f=se(p,u),x=new PerspectiveCamera(T,u,.1,f*8+p*4);x.position.set(c+p*.25,n+p*.3,d+f),x.lookAt(c,n,d),r.add(new AmbientLight(16777215,.62));let w=new DirectionalLight(16777215,.95);w.position.set(c+p,n+p*1.4,d+f),r.add(w);let y=new DirectionalLight(16777215,.3);y.position.set(c-p,n-p*.6,d+f*.6),r.add(y);let h=ie(i);r.add(h.group);let l=null,g=m=>{m&&!l?(l=new OrbitControls(x,o),l.enablePan=false,l.target.set(c,n,d),l.minDistance=f*.4,l.maxDistance=f*3,l.update()):!m&&l&&(l.dispose(),l=null),l&&(l.autoRotate=!!a.autoRotate,l.autoRotateSpeed=1.2);};g(!!a.interactive);let v=0,S=false,k=()=>{S||(v=requestAnimationFrame(k),l?.update(),s.render(r,x));};return v=requestAnimationFrame(k),{resize(m,z){x.aspect=m/Math.max(1,z),x.updateProjectionMatrix(),s.setSize(m,z,false);},setInteractive(m){g(m);},dispose(){S=true,cancelAnimationFrame(v),l?.dispose(),h.dispose(),s.dispose();}}}export{le as mountSmartArt3D};
1
+ import'./chunk-62D2TNHX.js';import {WebGLRenderer,Scene,Color,PerspectiveCamera,AmbientLight,DirectionalLight,Group,MeshStandardMaterial,Mesh,EdgesGeometry,LineBasicMaterial,LineSegments,PlaneGeometry,MeshBasicMaterial,Euler,Vector3,BufferGeometry,Line,Shape,ExtrudeGeometry,CanvasTexture,SRGBColorSpace,LinearFilter,RepeatWrapping}from'three';import {OrbitControls}from'three/examples/jsm/controls/OrbitControls.js';var M=4,P=.86;function Q(o,i,e){let t=i.split(/\s+/u).filter(Boolean);if(t.length===0)return [];let a=[],s=t[0];for(let r=1;r<t.length;r++){let c=`${s} ${t[r]}`;o.measureText(c).width<=e?s=c:(a.push(s),s=t[r]);}return a.push(s),a}function _(o,i,e,t,a){if(typeof document>"u"||!o.trim()||t<=0||a<=0)return null;let s=t*P,r=a*P,c=document.createElement("canvas");c.width=Math.max(8,Math.round(s*M)),c.height=Math.max(8,Math.round(r*M));let n=c.getContext("2d");if(!n)return null;let d="system-ui, -apple-system, Segoe UI, Roboto, sans-serif",p=c.width*.94,u=Math.max(6,e)*M,f=[];for(let l=0;l<12;l++){n.font=`600 ${u}px ${d}`,f=Q(n,o,p);let g=u*1.2;if(f.length*g<=c.height*.96||u<=6*M)break;u*=.88;}n.clearRect(0,0,c.width,c.height),n.fillStyle=i,n.textAlign="center",n.textBaseline="middle",n.font=`600 ${u}px ${d}`;let x=u*1.2,w=f.length*x,y=c.height/2-w/2+x/2;for(let l=0;l<f.length;l++)n.fillText(f[l],c.width/2,y+l*x);let h=new CanvasTexture(c);return h.colorSpace=SRGBColorSpace,h.minFilter=LinearFilter,h.magFilter=LinearFilter,h.flipY=false,h.premultiplyAlpha=false,h.wrapT=RepeatWrapping,h.repeat.set(1,-1),h.offset.set(0,1),h.needsUpdate=true,{texture:h,worldWidth:s,worldHeight:r}}function ee(o){let i=new Shape;o.outline.forEach((t,a)=>{a===0?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y);}),i.closePath();let e=o.bevel>0;return new ExtrudeGeometry(i,{depth:o.depth,bevelEnabled:e,bevelThickness:o.bevel,bevelSize:o.bevel,bevelSegments:2,curveSegments:o.rounded?24:1,steps:1})}function te(o,i,e){let t=ee(e),a=new MeshStandardMaterial({color:new Color(e.fill),metalness:.12,roughness:.52,transparent:e.opacity<1,opacity:e.opacity}),s=new Mesh(t,a);if(s.position.set(e.position.x,e.position.y,e.position.z),s.rotation.set(e.rotation.x,e.rotation.y,e.rotation.z),o.add(s),i.push(t,a),e.strokeWidth>0){let r=new EdgesGeometry(t,30),c=new LineBasicMaterial({color:new Color(e.stroke)}),n=new LineSegments(r,c);n.position.copy(s.position),n.rotation.copy(s.rotation),o.add(n),i.push(r,c);}return t}function ne(o,i,e){if(!e.text)return;let t=_(e.text,e.textColor,e.fontSize,e.halfWidth*2,e.halfHeight*2);if(!t)return;let a=new PlaneGeometry(t.worldWidth,t.worldHeight),s=new MeshBasicMaterial({map:t.texture,transparent:true,depthWrite:false}),r=new Mesh(a,s),c=new Euler(e.rotation.x,e.rotation.y,e.rotation.z),n=new Vector3(0,0,e.depth+e.bevel+.4).applyEuler(c);r.position.set(e.position.x+n.x,e.position.y+n.y,e.position.z+n.z),r.rotation.copy(c),o.add(r),i.push(a,s,t.texture);}function oe(o,i,e){for(let t of e.connectors){if(t.points.length<2)continue;let a=new BufferGeometry().setFromPoints(t.points.map(r=>new Vector3(r.x,r.y,r.z))),s=new LineBasicMaterial({color:new Color(t.color),transparent:true,opacity:.7});o.add(new Line(a,s)),i.push(a,s);}}function ie(o){let i=new Group,e=[];for(let t of o.meshes)te(i,e,t),ne(i,e,t);return oe(i,e,o),{group:i,dispose(){for(let t of e)t.dispose();}}}var T=42;function ae(o){let i=1/0,e=1/0,t=1/0,a=-1/0,s=-1/0,r=-1/0,c=(n,d,p,u)=>{i=Math.min(i,n-u),e=Math.min(e,d-u),t=Math.min(t,p-u),a=Math.max(a,n+u),s=Math.max(s,d+u),r=Math.max(r,p+u);};for(let n of o.meshes){let d=Math.max(n.halfWidth,n.halfHeight)+n.depth+n.bevel;c(n.position.x,n.position.y,n.position.z,d);}for(let n of o.connectors)for(let d of n.points)c(d.x,d.y,d.z,1);return Number.isFinite(i)?{cx:(i+a)/2,cy:(e+s)/2,cz:(t+r)/2,radius:.5*Math.hypot(a-i,s-e,r-t)||1}:{cx:0,cy:0,cz:0,radius:Math.max(o.bounds.width,o.bounds.height)/2||1}}function se(o,i){let e=T*Math.PI/180,t=2*Math.atan(Math.tan(e/2)*i),a=Math.min(e,t);return o/Math.sin(a/2)*1.1}function le(o,i,e,t,a={}){let s=new WebGLRenderer({canvas:o,antialias:true,alpha:!a.background});s.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,a.maxPixelRatio??2)),s.setSize(e,t,false);let r=new Scene;a.background&&(r.background=new Color(a.background));let{cx:c,cy:n,cz:d,radius:p}=ae(i),u=e/Math.max(1,t),f=se(p,u),x=new PerspectiveCamera(T,u,.1,f*8+p*4);x.position.set(c+p*.25,n+p*.3,d+f),x.lookAt(c,n,d),r.add(new AmbientLight(16777215,.62));let w=new DirectionalLight(16777215,.95);w.position.set(c+p,n+p*1.4,d+f),r.add(w);let y=new DirectionalLight(16777215,.3);y.position.set(c-p,n-p*.6,d+f*.6),r.add(y);let h=ie(i);r.add(h.group);let l=null,g=m=>{m&&!l?(l=new OrbitControls(x,o),l.enablePan=false,l.target.set(c,n,d),l.minDistance=f*.4,l.maxDistance=f*3,l.update()):!m&&l&&(l.dispose(),l=null),l&&(l.autoRotate=!!a.autoRotate,l.autoRotateSpeed=1.2);};g(!!a.interactive);let v=0,S=false,k=()=>{S||(v=requestAnimationFrame(k),l?.update(),s.render(r,x));};return v=requestAnimationFrame(k),{resize(m,z){x.aspect=m/Math.max(1,z),x.updateProjectionMatrix(),s.setSize(m,z,false);},setInteractive(m){g(m);},dispose(){S=true,cancelAnimationFrame(v),l?.dispose(),h.dispose(),s.dispose();}}}export{le as mountSmartArt3D};
@@ -1 +1 @@
1
- 'use strict';require('./chunk-4VDLQK6F.cjs');var three=require('three'),OrbitControls_js=require('three/examples/jsm/controls/OrbitControls.js');var M=4,P=.86;function Q(o,i,e){let t=i.split(/\s+/u).filter(Boolean);if(t.length===0)return [];let a=[],s=t[0];for(let r=1;r<t.length;r++){let c=`${s} ${t[r]}`;o.measureText(c).width<=e?s=c:(a.push(s),s=t[r]);}return a.push(s),a}function _(o,i,e,t,a){if(typeof document>"u"||!o.trim()||t<=0||a<=0)return null;let s=t*P,r=a*P,c=document.createElement("canvas");c.width=Math.max(8,Math.round(s*M)),c.height=Math.max(8,Math.round(r*M));let n=c.getContext("2d");if(!n)return null;let d="system-ui, -apple-system, Segoe UI, Roboto, sans-serif",p=c.width*.94,u=Math.max(6,e)*M,f=[];for(let l=0;l<12;l++){n.font=`600 ${u}px ${d}`,f=Q(n,o,p);let g=u*1.2;if(f.length*g<=c.height*.96||u<=6*M)break;u*=.88;}n.clearRect(0,0,c.width,c.height),n.fillStyle=i,n.textAlign="center",n.textBaseline="middle",n.font=`600 ${u}px ${d}`;let x=u*1.2,w=f.length*x,y=c.height/2-w/2+x/2;for(let l=0;l<f.length;l++)n.fillText(f[l],c.width/2,y+l*x);let h=new three.CanvasTexture(c);return h.colorSpace=three.SRGBColorSpace,h.minFilter=three.LinearFilter,h.magFilter=three.LinearFilter,h.flipY=false,h.premultiplyAlpha=false,h.wrapT=three.RepeatWrapping,h.repeat.set(1,-1),h.offset.set(0,1),h.needsUpdate=true,{texture:h,worldWidth:s,worldHeight:r}}function ee(o){let i=new three.Shape;o.outline.forEach((t,a)=>{a===0?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y);}),i.closePath();let e=o.bevel>0;return new three.ExtrudeGeometry(i,{depth:o.depth,bevelEnabled:e,bevelThickness:o.bevel,bevelSize:o.bevel,bevelSegments:2,curveSegments:o.rounded?24:1,steps:1})}function te(o,i,e){let t=ee(e),a=new three.MeshStandardMaterial({color:new three.Color(e.fill),metalness:.12,roughness:.52,transparent:e.opacity<1,opacity:e.opacity}),s=new three.Mesh(t,a);if(s.position.set(e.position.x,e.position.y,e.position.z),s.rotation.set(e.rotation.x,e.rotation.y,e.rotation.z),o.add(s),i.push(t,a),e.strokeWidth>0){let r=new three.EdgesGeometry(t,30),c=new three.LineBasicMaterial({color:new three.Color(e.stroke)}),n=new three.LineSegments(r,c);n.position.copy(s.position),n.rotation.copy(s.rotation),o.add(n),i.push(r,c);}return t}function ne(o,i,e){if(!e.text)return;let t=_(e.text,e.textColor,e.fontSize,e.halfWidth*2,e.halfHeight*2);if(!t)return;let a=new three.PlaneGeometry(t.worldWidth,t.worldHeight),s=new three.MeshBasicMaterial({map:t.texture,transparent:true,depthWrite:false}),r=new three.Mesh(a,s),c=new three.Euler(e.rotation.x,e.rotation.y,e.rotation.z),n=new three.Vector3(0,0,e.depth+e.bevel+.4).applyEuler(c);r.position.set(e.position.x+n.x,e.position.y+n.y,e.position.z+n.z),r.rotation.copy(c),o.add(r),i.push(a,s,t.texture);}function oe(o,i,e){for(let t of e.connectors){if(t.points.length<2)continue;let a=new three.BufferGeometry().setFromPoints(t.points.map(r=>new three.Vector3(r.x,r.y,r.z))),s=new three.LineBasicMaterial({color:new three.Color(t.color),transparent:true,opacity:.7});o.add(new three.Line(a,s)),i.push(a,s);}}function ie(o){let i=new three.Group,e=[];for(let t of o.meshes)te(i,e,t),ne(i,e,t);return oe(i,e,o),{group:i,dispose(){for(let t of e)t.dispose();}}}var T=42;function ae(o){let i=1/0,e=1/0,t=1/0,a=-1/0,s=-1/0,r=-1/0,c=(n,d,p,u)=>{i=Math.min(i,n-u),e=Math.min(e,d-u),t=Math.min(t,p-u),a=Math.max(a,n+u),s=Math.max(s,d+u),r=Math.max(r,p+u);};for(let n of o.meshes){let d=Math.max(n.halfWidth,n.halfHeight)+n.depth+n.bevel;c(n.position.x,n.position.y,n.position.z,d);}for(let n of o.connectors)for(let d of n.points)c(d.x,d.y,d.z,1);return Number.isFinite(i)?{cx:(i+a)/2,cy:(e+s)/2,cz:(t+r)/2,radius:.5*Math.hypot(a-i,s-e,r-t)||1}:{cx:0,cy:0,cz:0,radius:Math.max(o.bounds.width,o.bounds.height)/2||1}}function se(o,i){let e=T*Math.PI/180,t=2*Math.atan(Math.tan(e/2)*i),a=Math.min(e,t);return o/Math.sin(a/2)*1.1}function le(o,i,e,t,a={}){let s=new three.WebGLRenderer({canvas:o,antialias:true,alpha:!a.background});s.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,a.maxPixelRatio??2)),s.setSize(e,t,false);let r=new three.Scene;a.background&&(r.background=new three.Color(a.background));let{cx:c,cy:n,cz:d,radius:p}=ae(i),u=e/Math.max(1,t),f=se(p,u),x=new three.PerspectiveCamera(T,u,.1,f*8+p*4);x.position.set(c+p*.25,n+p*.3,d+f),x.lookAt(c,n,d),r.add(new three.AmbientLight(16777215,.62));let w=new three.DirectionalLight(16777215,.95);w.position.set(c+p,n+p*1.4,d+f),r.add(w);let y=new three.DirectionalLight(16777215,.3);y.position.set(c-p,n-p*.6,d+f*.6),r.add(y);let h=ie(i);r.add(h.group);let l=null,g=m=>{m&&!l?(l=new OrbitControls_js.OrbitControls(x,o),l.enablePan=false,l.target.set(c,n,d),l.minDistance=f*.4,l.maxDistance=f*3,l.update()):!m&&l&&(l.dispose(),l=null),l&&(l.autoRotate=!!a.autoRotate,l.autoRotateSpeed=1.2);};g(!!a.interactive);let v=0,S=false,k=()=>{S||(v=requestAnimationFrame(k),l?.update(),s.render(r,x));};return v=requestAnimationFrame(k),{resize(m,z){x.aspect=m/Math.max(1,z),x.updateProjectionMatrix(),s.setSize(m,z,false);},setInteractive(m){g(m);},dispose(){S=true,cancelAnimationFrame(v),l?.dispose(),h.dispose(),s.dispose();}}}exports.mountSmartArt3D=le;
1
+ 'use strict';require('./chunk-B5PFHICE.cjs');var three=require('three'),OrbitControls_js=require('three/examples/jsm/controls/OrbitControls.js');var M=4,P=.86;function Q(o,i,e){let t=i.split(/\s+/u).filter(Boolean);if(t.length===0)return [];let a=[],s=t[0];for(let r=1;r<t.length;r++){let c=`${s} ${t[r]}`;o.measureText(c).width<=e?s=c:(a.push(s),s=t[r]);}return a.push(s),a}function _(o,i,e,t,a){if(typeof document>"u"||!o.trim()||t<=0||a<=0)return null;let s=t*P,r=a*P,c=document.createElement("canvas");c.width=Math.max(8,Math.round(s*M)),c.height=Math.max(8,Math.round(r*M));let n=c.getContext("2d");if(!n)return null;let d="system-ui, -apple-system, Segoe UI, Roboto, sans-serif",p=c.width*.94,u=Math.max(6,e)*M,f=[];for(let l=0;l<12;l++){n.font=`600 ${u}px ${d}`,f=Q(n,o,p);let g=u*1.2;if(f.length*g<=c.height*.96||u<=6*M)break;u*=.88;}n.clearRect(0,0,c.width,c.height),n.fillStyle=i,n.textAlign="center",n.textBaseline="middle",n.font=`600 ${u}px ${d}`;let x=u*1.2,w=f.length*x,y=c.height/2-w/2+x/2;for(let l=0;l<f.length;l++)n.fillText(f[l],c.width/2,y+l*x);let h=new three.CanvasTexture(c);return h.colorSpace=three.SRGBColorSpace,h.minFilter=three.LinearFilter,h.magFilter=three.LinearFilter,h.flipY=false,h.premultiplyAlpha=false,h.wrapT=three.RepeatWrapping,h.repeat.set(1,-1),h.offset.set(0,1),h.needsUpdate=true,{texture:h,worldWidth:s,worldHeight:r}}function ee(o){let i=new three.Shape;o.outline.forEach((t,a)=>{a===0?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y);}),i.closePath();let e=o.bevel>0;return new three.ExtrudeGeometry(i,{depth:o.depth,bevelEnabled:e,bevelThickness:o.bevel,bevelSize:o.bevel,bevelSegments:2,curveSegments:o.rounded?24:1,steps:1})}function te(o,i,e){let t=ee(e),a=new three.MeshStandardMaterial({color:new three.Color(e.fill),metalness:.12,roughness:.52,transparent:e.opacity<1,opacity:e.opacity}),s=new three.Mesh(t,a);if(s.position.set(e.position.x,e.position.y,e.position.z),s.rotation.set(e.rotation.x,e.rotation.y,e.rotation.z),o.add(s),i.push(t,a),e.strokeWidth>0){let r=new three.EdgesGeometry(t,30),c=new three.LineBasicMaterial({color:new three.Color(e.stroke)}),n=new three.LineSegments(r,c);n.position.copy(s.position),n.rotation.copy(s.rotation),o.add(n),i.push(r,c);}return t}function ne(o,i,e){if(!e.text)return;let t=_(e.text,e.textColor,e.fontSize,e.halfWidth*2,e.halfHeight*2);if(!t)return;let a=new three.PlaneGeometry(t.worldWidth,t.worldHeight),s=new three.MeshBasicMaterial({map:t.texture,transparent:true,depthWrite:false}),r=new three.Mesh(a,s),c=new three.Euler(e.rotation.x,e.rotation.y,e.rotation.z),n=new three.Vector3(0,0,e.depth+e.bevel+.4).applyEuler(c);r.position.set(e.position.x+n.x,e.position.y+n.y,e.position.z+n.z),r.rotation.copy(c),o.add(r),i.push(a,s,t.texture);}function oe(o,i,e){for(let t of e.connectors){if(t.points.length<2)continue;let a=new three.BufferGeometry().setFromPoints(t.points.map(r=>new three.Vector3(r.x,r.y,r.z))),s=new three.LineBasicMaterial({color:new three.Color(t.color),transparent:true,opacity:.7});o.add(new three.Line(a,s)),i.push(a,s);}}function ie(o){let i=new three.Group,e=[];for(let t of o.meshes)te(i,e,t),ne(i,e,t);return oe(i,e,o),{group:i,dispose(){for(let t of e)t.dispose();}}}var T=42;function ae(o){let i=1/0,e=1/0,t=1/0,a=-1/0,s=-1/0,r=-1/0,c=(n,d,p,u)=>{i=Math.min(i,n-u),e=Math.min(e,d-u),t=Math.min(t,p-u),a=Math.max(a,n+u),s=Math.max(s,d+u),r=Math.max(r,p+u);};for(let n of o.meshes){let d=Math.max(n.halfWidth,n.halfHeight)+n.depth+n.bevel;c(n.position.x,n.position.y,n.position.z,d);}for(let n of o.connectors)for(let d of n.points)c(d.x,d.y,d.z,1);return Number.isFinite(i)?{cx:(i+a)/2,cy:(e+s)/2,cz:(t+r)/2,radius:.5*Math.hypot(a-i,s-e,r-t)||1}:{cx:0,cy:0,cz:0,radius:Math.max(o.bounds.width,o.bounds.height)/2||1}}function se(o,i){let e=T*Math.PI/180,t=2*Math.atan(Math.tan(e/2)*i),a=Math.min(e,t);return o/Math.sin(a/2)*1.1}function le(o,i,e,t,a={}){let s=new three.WebGLRenderer({canvas:o,antialias:true,alpha:!a.background});s.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,a.maxPixelRatio??2)),s.setSize(e,t,false);let r=new three.Scene;a.background&&(r.background=new three.Color(a.background));let{cx:c,cy:n,cz:d,radius:p}=ae(i),u=e/Math.max(1,t),f=se(p,u),x=new three.PerspectiveCamera(T,u,.1,f*8+p*4);x.position.set(c+p*.25,n+p*.3,d+f),x.lookAt(c,n,d),r.add(new three.AmbientLight(16777215,.62));let w=new three.DirectionalLight(16777215,.95);w.position.set(c+p,n+p*1.4,d+f),r.add(w);let y=new three.DirectionalLight(16777215,.3);y.position.set(c-p,n-p*.6,d+f*.6),r.add(y);let h=ie(i);r.add(h.group);let l=null,g=m=>{m&&!l?(l=new OrbitControls_js.OrbitControls(x,o),l.enablePan=false,l.target.set(c,n,d),l.minDistance=f*.4,l.maxDistance=f*3,l.update()):!m&&l&&(l.dispose(),l=null),l&&(l.autoRotate=!!a.autoRotate,l.autoRotateSpeed=1.2);};g(!!a.interactive);let v=0,S=false,k=()=>{S||(v=requestAnimationFrame(k),l?.update(),s.render(r,x));};return v=requestAnimationFrame(k),{resize(m,z){x.aspect=m/Math.max(1,z),x.updateProjectionMatrix(),s.setSize(m,z,false);},setInteractive(m){g(m);},dispose(){S=true,cancelAnimationFrame(v),l?.dispose(),h.dispose(),s.dispose();}}}exports.mountSmartArt3D=le;
package/dist/styles.css CHANGED
@@ -369,12 +369,12 @@
369
369
  overflow: auto;
370
370
  display: grid;
371
371
  /*
372
- * Centred across, TOP-aligned down, which is what React's canvas does
373
- * (mx-auto my-4). Centring both ways only looks the same while the slide
374
- * nearly fills the area: on a phone the slide floated in the middle of a
375
- * screen-tall gap while React had it just under the toolbar.
372
+ * Centred both ways, matching every other binding's canvas viewport
373
+ * (React/Vue/Angular now flex + 'margin: auto', Svelte flex + 'margin:
374
+ * auto'): the slide sits in the middle of the scroll area rather than
375
+ * pinned under the toolbar.
376
376
  */
377
- place-items: start center;
377
+ place-items: center center;
378
378
  padding: 16px;
379
379
  background: var(--pptx-muted);
380
380
  }
@@ -402,11 +402,18 @@
402
402
  .pptxv-para { margin: 0; }
403
403
 
404
404
  /* ── Selection overlay (editing) ─────────────────────────────────────── */
405
+ /* Every slide element carries an explicit numeric z-index (index-based, see
406
+ element-styles.ts), so on a slide with more than 5 elements this host used
407
+ to paint BEHIND later ones, hiding the selected element's own resize/rotate
408
+ handles behind its own fill (worst on a rotated shape, where the rotate
409
+ knob deliberately overlaps the box) and stealing their clicks. Pinned above
410
+ any realistic per-slide element count, matching the React binding's
411
+ 'SelectionHandleOverlay' (z-index 58). */
405
412
  .pptxv-editor-overlay {
406
413
  position: absolute;
407
414
  inset: 0;
408
415
  pointer-events: none;
409
- z-index: 5;
416
+ z-index: 58;
410
417
  }
411
418
  .pptxv-sel-box {
412
419
  position: absolute;
@@ -2868,11 +2875,11 @@
2868
2875
  .pptxv-mobile-toolbar-ai .pptxv-ai-toggle.is-active { color: var(--pptx-primary); background: transparent; }
2869
2876
  .pptxv-mobile-share { min-width: 44px; background: var(--pptx-primary); color: var(--pptx-primary-foreground); }
2870
2877
  .pptxv-mobile-actions { display: contents; }
2871
- .pptxv-mobile-actions > nav { position: relative; z-index: 50; display: flex; flex: none; min-height: 64px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--pptx-border); background: var(--pptx-card); }
2878
+ .pptxv-mobile-actions > nav { position: relative; z-index: 50; display: flex; flex: none; min-height: 56px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--pptx-border); background: var(--pptx-card); }
2872
2879
  .pptxv-mobile-actions > nav button { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 44px; border: 0; background: transparent; color: var(--pptx-muted-foreground); font-size: 10px; touch-action: manipulation; }
2873
2880
  .pptxv-mobile-actions > nav button svg { width: 20px; height: 20px; }
2874
2881
  .pptxv-mobile-actions > nav button[aria-pressed='true'] { color: var(--pptx-primary); }
2875
- .pptxv-mobile-sheet-host { position: absolute; z-index: 48; inset: 0 0 64px; display: flex; align-items: end; }
2882
+ .pptxv-mobile-sheet-host { position: absolute; z-index: 48; inset: 0 0 56px; display: flex; align-items: end; }
2876
2883
  .pptxv-mobile-sheet-host[hidden] { display: none; }
2877
2884
  .pptxv-mobile-sheet-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(0 0 0 / 40%); }
2878
2885
  .pptxv-mobile-sheet { position: relative; display: flex; flex-direction: column; width: 100%; max-height: min(70dvh, 620px); border: 1px solid var(--pptx-border); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--pptx-background); box-shadow: 0 -12px 36px rgb(0 0 0 / 35%); transition: transform 150ms ease-out; }
@@ -3140,13 +3147,27 @@ label.pptxv-options-row { cursor: pointer; }
3140
3147
  }
3141
3148
  /* Animations > Motion Paths: the five PowerPoint families in captioned
3142
3149
  columns, sharing the preset gallery's capped/scrollable box so the ribbon
3143
- keeps its single-row height. */
3150
+ keeps its single-row height.
3151
+
3152
+ max-width: 420px + overflow-x: auto matches the cap React applies to the
3153
+ RibbonGroup that wraps its MotionPathGallery (max-w-[420px]
3154
+ overflow-hidden). Without a width cap here, this binding's five family
3155
+ columns (each already capped individually at 150px via
3156
+ .pptxv-motion-path-gallery-items) still combine to ~800px, wide enough
3157
+ to push the Advanced Animation and Timing groups after it off the
3158
+ ribbon's visible row: reachable only via a second, easy-to-miss nested
3159
+ horizontal scrollbar (the reported Animations-tab clipping).
3160
+ overflow-x: auto (rather than React's overflow-hidden on its wrapper)
3161
+ keeps every family reachable via a small scrollbar instead of silently
3162
+ hiding whatever a hard clip would cut off. */
3144
3163
  .pptxv-motion-path-gallery {
3145
3164
  display: flex;
3146
3165
  align-items: flex-start;
3147
3166
  gap: 8px;
3167
+ max-width: 420px;
3148
3168
  max-height: 62px;
3149
3169
  padding: 2px 4px;
3170
+ overflow-x: auto;
3150
3171
  overflow-y: auto;
3151
3172
  border: 1px solid color-mix(in srgb, var(--pptx-border) 60%, transparent);
3152
3173
  border-radius: var(--pptx-radius);
@@ -3954,12 +3975,12 @@ svg[data-pptx-motion-path-overlay] [data-pptx-motion-path-handle] { pointer-even
3954
3975
  }
3955
3976
 
3956
3977
  /* ── Mobile: bottom sheet instead of a full-width drawer that hides the
3957
- canvas. Anchored above the mobile bottom-action nav (64px + safe area) so
3978
+ canvas. Anchored above the mobile bottom-action nav (56px + safe area) so
3958
3979
  the slide stage stays visible and tappable above the sheet. Uses the same
3959
3980
  breakpoint as the rest of the mobile chrome (mobile-sheet-css.ts). ────── */
3960
3981
  @media (max-width: 767px), (max-width: 1023px) and (max-height: 520px) {
3961
3982
  .pptxv-ai-panel {
3962
- inset: auto 0 calc(64px + env(safe-area-inset-bottom)) 0;
3983
+ inset: auto 0 calc(56px + env(safe-area-inset-bottom)) 0;
3963
3984
  width: auto;
3964
3985
  height: min(75dvh, 640px);
3965
3986
  z-index: 46;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-vanilla-viewer",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Zero-framework PowerPoint viewer and editor: render, edit, present, and export PPTX slides with plain DOM, no React/Vue/Angular required.",
5
5
  "keywords": [
6
6
  "javascript",
@@ -1 +0,0 @@
1
- 'use strict';var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:true});};exports.a=e;
@@ -1 +0,0 @@
1
- var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:true});};export{e as a};