@pptkit/svg-renderer 0.1.3 → 0.1.5

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
- !function(t,e,i){"use strict";function n(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function o(t){const e=t.replace(/[^A-Za-z0-9_.:-]/g,"-");let i=2166136261;for(let e=0;e<t.length;e+=1)i^=t.charCodeAt(e),i=Math.imul(i,16777619);return`${/^[A-Za-z_]/.test(e)?e:`id-${e}`}-${(i>>>0).toString(36)}`}function r(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","mailto:"].includes(e.protocol))return t}catch{return}}function s(t,e){const i="string"==typeof t?t:e.colors[t.theme];return i.startsWith("#")?i:`#${i}`}function a(t,e,i){return"none"===t.type?`${i}="none"`:`${i}="${s(t.color,e)}" ${i}-opacity="${t.opacity}"`}function l(t,e){const i=function(t){const e=Math.max(t.width,1);return"dash"===t.dash?`${4*e} ${3*e}`:"dot"===t.dash?`${e} ${2*e}`:"dashDot"===t.dash?`${4*e} ${2*e} ${e} ${2*e}`:void 0}(t);return`${a(t.paint,e,"stroke")} stroke-width="${t.width}"${void 0===i?"":` stroke-dasharray="${i}"`} stroke-linecap="round" stroke-linejoin="round"`}function d(t,e){if(0===e.rotation&&!e.flipH&&!e.flipV)return"";const i=t.x+t.width/2,n=t.y+t.height/2;return` transform="translate(${i} ${n}) rotate(${e.rotation}) scale(${e.flipH?-1:1} ${e.flipV?-1:1}) translate(${-i} ${-n})"`}function c(t){const e=t.codePointAt(0)??0;return e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=127744&&e<=129791}function h(t,e){return t.style.fontSize*e}function p(t){return Math.round(1e3*t)/1e3}function $(t,e,i){return h(e,i)*(/\s/u.test(t)?.28:c(t)?1:/[,.;:!?()[\]{}'"`-]/u.test(t)?.32:/[fijltIr|]/u.test(t)?.3:/[mMwWOQ%@]/u.test(t)?.72:/\d/u.test(t)?.55:/[A-Z]/u.test(t)?.6:.52)*1.06*(e.style.bold&&!c(t)?1.03:1)*(e.style.italic?1.02:1)}function u(t,e,i){let n=0;for(const o of t)n+=$(o,e,i);return n}function g(t,e,i){if(""===i)return;const n=t.at(-1);n?.run===e?n.text+=i:t.push({run:e,text:i})}function f(t,e,i){const n=t.runs[0];if(void 0===n)return[];const o=w(t),r=Math.max(1,e+t.style.hanging),s=Math.max(1,e),a=[];let l,d=!0,c=[],p=0;const f=()=>{c=[],p=0,d&&""!==o&&(g(c,n,o),p=u(o,n,i))},m=()=>{const e=c.reduce((t,e)=>Math.max(t,h(e.run,i)),h(n,i));a.push({first:d,fontSize:e,lineHeight:e*t.style.lineSpacing,paragraph:t,segments:c}),d=!1,l=void 0,f()},y=(t,e)=>{const n=void 0===l||0===c.length?"":" ",a=d?r:s,h=p+u(n,l??e,i)+u(t,e,i);c.length>(d&&""!==o?1:0)&&h>a&&m(),void 0!==l&&c.length>0&&(g(c,l," "),p+=u(" ",l,i));for(const n of t){const t=$(n,e,i),a=d?r:s;c.length>(d&&""!==o?1:0)&&p+t>a&&m(),g(c,e,n),p+=t}l=void 0};f();for(const e of t.runs)for(const t of e.text.split(/(\s+)/u))""!==t&&(/\s/u.test(t)?t.includes("\n")?m():l=e:y(t,e));return(c.length>0||0===a.length)&&m(),a}function m(t,e,i,o){"resize"===e.autoFit.mode&&o.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:o.slideId,elementId:o.elementId});const r="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=Math.max(1,i.width-e.margin.left-e.margin.right),l=[];let d=0;for(const e of t){d+=e.style.spaceBefore;const t=Math.max(1,a-e.style.indent);for(const i of f(e,t,r))l.push({...i,y:d}),d+=i.lineHeight;d+=e.style.spaceAfter}const c=Math.max(0,i.height-e.margin.top-e.margin.bottom),$="middle"===e.verticalAlign?Math.max(0,(c-d)/2):"bottom"===e.verticalAlign?Math.max(0,c-d):0;return l.map((t,a)=>{const l=t.paragraph.style,d=i.x+e.margin.left+l.indent-(t.first?l.hanging:0),c=i.x+i.width-e.margin.right,u="center"===(g=l.align)?"middle":"right"===g?"end":"start";var g;const f="middle"===u?(d+c)/2:"end"===u?c:d,m=i.y+e.margin.top+$+t.y+.8*t.fontSize,w=t.segments.map(t=>`<tspan ${function(t,e,i){const o=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" ");return[`font-family="${n(y(t.style.fontFamily,i))}"`,`font-size="${p(h(t,e))}"`,`font-weight="${t.style.bold?700:400}"`,`font-style="${t.style.italic?"italic":"normal"}"`,`text-decoration="${o||"none"}"`,`fill="${s(t.style.color,i)}"`,`lang="${n(t.style.language)}"`].join(" ")}(t.run,r,o.theme)}>${n(t.text)}</tspan>`).join("");return`<text x="${f}" y="${m}" text-anchor="${u}" data-pptkit-text-line="${a}">${w}</text>`}).join("")}function y(t,e){return"string"==typeof t?t:e.fonts[t.theme]}function w(t){const e=t.style.bullet;if("none"===e.type)return"";if("bullet"===e.type)return`${e.character} `;const i=e.startAt;return"arabicParen"===e.style?`${i}) `:"alphaLowerPeriod"===e.style?`${String.fromCharCode(96+Math.min(26,i))}. `:"alphaUpperPeriod"===e.style?`${String.fromCharCode(64+Math.min(26,i))}. `:`${i}. `}function x(t,e,i){"resize"===e.autoFit.mode&&i.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:i.slideId,elementId:i.elementId});const o="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=["width:100%","height:100%","box-sizing:border-box","display:flex","flex-direction:column",`justify-content:${"middle"===e.verticalAlign?"center":"bottom"===e.verticalAlign?"flex-end":"flex-start"}`,`padding:${e.margin.top}px ${e.margin.right}px ${e.margin.bottom}px ${e.margin.left}px`,"overflow:visible",e.wrap?"overflow-wrap:anywhere":"white-space:pre"].join(";"),l=t.map(t=>{const a=t.style,l=["margin:0",`padding-left:${a.indent}px`,`text-indent:${-a.hanging}px`,`line-height:${a.lineSpacing}`,`padding-top:${a.spaceBefore}px`,`padding-bottom:${a.spaceAfter}px`,`text-align:${a.align}`,e.wrap?"white-space:pre-wrap":"white-space:pre"].join(";"),d=t.runs.map(t=>{const e=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" "),a=["font-family:"+(l=y(t.style.fontFamily,i.theme),`&quot;${n(l.replace(/\\/g,"\\\\").replace(/"/g,'\\"'))}&quot;`),`font-size:${p(t.style.fontSize*o)}px`,"font-weight:"+(t.style.bold?700:400),"font-style:"+(t.style.italic?"italic":"normal"),`text-decoration:${e||"none"}`,`color:${s(t.style.color,i.theme)}`].join(";");var l;const d=function(t,e){if(void 0===t)return{open:"",close:""};if("slide"===t.type)return e.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${t.slideId} is metadata-only in standalone SVG output.`,slideId:e.slideId,elementId:e.elementId}),{open:`<span data-pptkit-slide-target="${n(t.slideId)}">`,close:"</span>"};const i=r(t.url);return void 0===i?(e.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:e.elementId}),{open:"",close:""}):{open:`<a href="${n(i)}" rel="noopener noreferrer"${void 0===t.tooltip?"":` title="${n(t.tooltip)}"`}>`,close:"</a>"}}(t.action,i);return`${d.open}<span lang="${n(t.style.language)}" style="${a}">${n(t.text)}</span>${d.close}`}).join(""),c=w(t);return`<div style="${l}">${""===c?"":`<span aria-hidden="true">${n(c)}</span>`}${d}</div>`}).join("");return`<div xmlns="http://www.w3.org/1999/xhtml" style="${a}">${l}</div>`}function v(t){const e=` data-pptkit-element-id="${n(t.id)}"`;return t.accessibility.decorative?`${e} aria-hidden="true"`:`${e} role="img" aria-label="${n(t.accessibility.description??t.name)}"`}function I(t,e,i){const o=t.action;if(void 0===o)return e;if("slide"===o.type)return i.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${o.slideId} is metadata-only in standalone SVG output.`,slideId:i.slideId,elementId:t.id}),`<g data-pptkit-slide-target="${n(o.slideId)}">${e}</g>`;const s=r(o.url);return void 0===s?(i.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:i.slideId,elementId:t.id}),e):`<a href="${n(s)}" rel="noopener noreferrer"${void 0===o.tooltip?"":` aria-label="${n(o.tooltip)}"`}>${e}</a>`}function b(t,e,i,n,o,r=!1){return`<foreignObject x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}"${r?' overflow="visible"':""}${i} opacity="${n}"${o}>${e}</foreignObject>`}function k(t,e,i,n,r){if("none"===t||"none"===n.paint.type)return;const s=o(`${r.slideId}-${i}-${e}-${t}`),a="solid"===n.paint.type?"string"==typeof n.paint.color?n.paint.color:r.theme.colors[n.paint.color.theme]:"000000",l=a.startsWith("#")?a:`#${a}`;return r.defs.push(`<marker id="${s}" markerWidth="10" markerHeight="10" refX="${"end"===e?9:1}" refY="5" orient="auto-start-reverse" markerUnits="strokeWidth" viewBox="0 0 10 10">${function(t,e){return"oval"===t?`<circle cx="5" cy="5" r="3.5" fill="${e}"/>`:"diamond"===t?`<path d="M1 5 L5 1 L9 5 L5 9 Z" fill="${e}"/>`:"stealth"===t?`<path d="M1 1 L9 5 L1 9 L4 5 Z" fill="${e}"/>`:"arrow"===t?`<path d="M1 1 L9 5 L1 9" fill="none" stroke="${e}" stroke-width="1.5"/>`:`<path d="M1 1 L9 5 L1 9 Z" fill="${e}"/>`}(t,l)}</marker>`),s}function A(t,e){const{x:i,y:n,width:o,height:r}=t.box;return`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}><rect x="${i}" y="${n}" width="${o}" height="${r}" fill="#F3F4F6" stroke="#9CA3AF" stroke-dasharray="6 4"/><path d="M${i+.15*o} ${n+.75*r} L${i+.42*o} ${n+.45*r} L${i+.6*o} ${n+.62*r} L${i+.78*o} ${n+.35*r} L${i+.9*o} ${n+.75*r}" fill="none" stroke="#9CA3AF" stroke-width="2"/></g>`}async function z(t,e){const i=e.assets.get(t.assetId);if(void 0===i)return e.warnings.push({code:"asset-missing",message:`Image asset ${t.assetId} was not found.`,slideId:e.slideId,elementId:t.id,assetId:t.assetId}),A(t);const r=await async function(t,e){let i=e.assetCache.get(t.id);return void 0===i&&(i=(async()=>{if(void 0!==e.resolveAsset)try{const i=await e.resolveAsset(t);return void 0===i&&e.warnings.push({code:"asset-unresolved",message:"The asset resolver did not return an image URL.",slideId:e.slideId,assetId:t.id}),i}catch(i){return void e.warnings.push({code:"asset-resolver-failed",message:`The asset resolver failed: ${i instanceof Error?i.message:String(i)}`,slideId:e.slideId,assetId:t.id})}if("url"===t.source.type)return t.source.value;e.warnings.push({code:"asset-path-unsupported",message:"Local path assets require a custom SvgAssetResolver.",slideId:e.slideId,assetId:t.id})})(),e.assetCache.set(t.id,i)),i}(i,e);if(void 0===r||void 0===function(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","blob:"].includes(e.protocol))return t;if("data:"===e.protocol&&/^data:image\//i.test(t))return t}catch{return}}(r))return void 0!==r&&e.warnings.push({code:"unsafe-asset-url",message:"An image URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:t.id,assetId:i.id}),A(t);const s=o(`${e.slideId}-${t.id}-clip`),a=t.box;let l;if(e.defs.push(`<clipPath id="${s}"><rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}"/></clipPath>`),"crop"===t.fit&&void 0!==i.width&&void 0!==i.height){const e=Math.max(1e-4,1-t.crop.left-t.crop.right),i=Math.max(1e-4,1-t.crop.top-t.crop.bottom),o=a.width/e,s=a.height/i;l=`<image href="${n(r)}" x="${a.x-o*t.crop.left}" y="${a.y-s*t.crop.top}" width="${o}" height="${s}" preserveAspectRatio="none"/>`}else"crop"===t.fit&&e.warnings.push({code:"image-crop-degraded",message:"Image crop requires intrinsic asset dimensions; preview fell back to centered cover.",slideId:e.slideId,elementId:t.id,assetId:i.id}),l=`<image href="${n(r)}" x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" preserveAspectRatio="${"stretch"===t.fit?"none":"xMidYMid slice"}"/>`;return I(t,`<g${d(a,t.transform)} opacity="${t.opacity}" clip-path="url(#${s})"${v(t)}>${l}</g>`,e)}async function M(t,e){if(t.hidden)return"";if("image"===t.type)return z(t,e);if("group"===t.type)return function(t,e){return(async()=>{const i=[];for(const n of t.children)i.push(await M(n,e));const n=i.join(""),o=t.box,r=o.x+o.width/2,s=o.y+o.height/2,a=`translate(${r} ${s}) rotate(${t.transform.rotation}) scale(${t.transform.flipH?-1:1} ${t.transform.flipV?-1:1}) translate(${-r} ${-s}) translate(${o.x} ${o.y}) scale(${o.width/t.coordinateSize.width} ${o.height/t.coordinateSize.height})`;return I(t,`<g transform="${a}" opacity="${t.opacity}"${v(t)}>${n}</g>`,e)})()}(t,e);if("text"===t.type){const i={theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id};if(t.content.every(t=>1===t.runs.length&&void 0===t.runs[0]?.action)){const n=m(t.content,t.frame,t.box,i);return I(t,`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}>${n}</g>`,e)}const n=x(t.content,t.frame,i);return I(t,b(t.box,n,d(t.box,t.transform),t.opacity,v(t),!0),e)}if("shape"===t.type){const i=d(t.box,t.transform),n=function(t,e){const{x:i,y:n,width:o,height:r}=t.box,s=`${a(t.style.fill,e.theme,"fill")} ${l(t.style.stroke,e.theme)}`;return"rect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" ${s}/>`:"roundRect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" rx="${.08*Math.min(o,r)}" ${s}/>`:"ellipse"===t.shape?`<ellipse cx="${i+o/2}" cy="${n+r/2}" rx="${o/2}" ry="${r/2}" ${s}/>`:`<polygon points="${("triangle"===t.shape?[[i+o/2,n],[i+o,n+r],[i,n+r]]:"diamond"===t.shape?[[i+o/2,n],[i+o,n+r/2],[i+o/2,n+r],[i,n+r/2]]:"arrow"===t.shape?[[i,n+.25*r],[i+.62*o,n+.25*r],[i+.62*o,n],[i+o,n+r/2],[i+.62*o,n+r],[i+.62*o,n+.75*r],[i,n+.75*r]]:[[i,n],[i+.65*o,n],[i+o,n+r/2],[i+.65*o,n+r],[i,n+r],[i+.35*o,n+r/2]]).map(t=>t.join(",")).join(" ")}" ${s}/>`}(t,e),o=void 0===t.text?"":b(t.box,x(t.text.content,t.text.frame,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id}),"",1,"",!0);return I(t,`<g${i} opacity="${t.opacity}"${v(t)}>${n}${o}</g>`,e)}if("connector"===t.type){const i=[t.start,...t.route,t.end],n=k(t.style.beginArrow,"start",t.id,t.style,e),o=k(t.style.endArrow,"end",t.id,t.style,e),r=`${void 0===n?"":` marker-start="url(#${n})"`}${void 0===o?"":` marker-end="url(#${o})"`}`,s=`<polyline points="${i.map(t=>`${t.x},${t.y}`).join(" ")}" fill="none" ${l(t.style,e.theme)}${r}/>`;return I(t,`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}>${s}</g>`,e)}return"table"===t.type?I(t,b(t.box,function(t,e){return`<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden"><table style="width:100%;height:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0"><colgroup>${t.columns.map(t=>`<col style="width:${t}px"/>`).join("")}</colgroup><tbody>${t.rows.map(i=>{const n=i.cells.map(i=>{const n="none"===i.style.fill.type?"transparent":"string"==typeof i.style.fill.color?i.style.fill.color:e.theme.colors[i.style.fill.color.theme],o="transparent"===n||n.startsWith("#")?n:`#${n}`,r="none"===i.style.stroke.paint.type?"transparent":"string"==typeof i.style.stroke.paint.color?i.style.stroke.paint.color:e.theme.colors[i.style.stroke.paint.color.theme],s="transparent"===r||r.startsWith("#")?r:`#${r}`,a=`box-sizing:border-box;background:${o};border:${i.style.stroke.width}px solid ${s};padding:${i.style.margin.top}px ${i.style.margin.right}px ${i.style.margin.bottom}px ${i.style.margin.left}px;vertical-align:${i.style.verticalAlign};overflow:hidden`,l={margin:{top:0,right:0,bottom:0,left:0},verticalAlign:i.style.verticalAlign,wrap:!0,autoFit:{mode:"none"}};return`<td rowspan="${i.rowSpan}" colspan="${i.colSpan}" style="${a}">${x(i.content,l,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id})}</td>`}).join("");return`<tr style="height:${i.height}px">${n}</tr>`}).join("")}</tbody></table></div>`}(t,e),d(t.box,t.transform),t.opacity,v(t)),e):""}function S(t,e,i){return`<rect x="0" y="0" width="${t.width}" height="${t.height}" ${a(e,i,"fill")}/>`}async function j(t,e={}){const i=[],r=new Map(t.assets.map(t=>[t.id,t])),s=new Map(t.layouts.map(t=>[t.id,t])),a=[];for(let l=0;l<t.slides.length;l+=1){const d=t.slides[l],c=[],h={slideId:d.id,theme:t.theme,assets:r,...void 0===e.resolveAsset?{}:{resolveAsset:e.resolveAsset},assetCache:new Map,warnings:i,defs:c},p=s.get(d.layoutId),$=[...p?.elements??[],...d.elements],u=[];for(const t of $)u.push(await M(t,h));const g=u.join(""),f=`${t.metadata.title||"PPTKit presentation"} — slide ${l+1}`,m=o(`pptkit-slide-${d.id}`),y=`<svg id="${m}" xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" viewBox="0 0 ${t.size.width} ${t.size.height}" width="${t.size.width}" height="${t.size.height}" role="img" aria-labelledby="${m}-title" data-pptkit-slide-id="${n(d.id)}"><title id="${m}-title">${n(f)}</title><defs>${c.join("")}</defs>${S({width:t.size.width,height:t.size.height},d.background,t.theme)}${g}</svg>`;a.push({slideId:d.id,index:l,hidden:d.hidden,svg:y})}return{width:t.size.width,height:t.size.height,slides:a,warnings:i,status:0===i.length?"rendered":"rendered-with-warnings"}}t.renderLayoutToSvg=async function(t,e){return j(t,e)},t.renderPresentationToSvg=async function(t,n){return j(i.resolveNormalizedLayout(e.normalizePresentation(t)),n)}}(this.PPTKit=this.PPTKit||{},PPTKit,PPTKit);
1
+ !function(t,e,i){"use strict";function n(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function o(t){const e=t.replace(/[^A-Za-z0-9_.:-]/g,"-");let i=2166136261;for(let e=0;e<t.length;e+=1)i^=t.charCodeAt(e),i=Math.imul(i,16777619);return`${/^[A-Za-z_]/.test(e)?e:`id-${e}`}-${(i>>>0).toString(36)}`}function r(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","mailto:"].includes(e.protocol))return t}catch{return}}function s(t,e){const i="string"==typeof t?t:e.colors[t.theme];return i.startsWith("#")?i:`#${i}`}function a(t,e,i){return"none"===t.type?`${i}="none"`:`${i}="${s(t.color,e)}" ${i}-opacity="${t.opacity}"`}function l(t,e){const i=function(t){const e=Math.max(t.width,1);return"dash"===t.dash?`${4*e} ${3*e}`:"dot"===t.dash?`${e} ${2*e}`:"dashDot"===t.dash?`${4*e} ${2*e} ${e} ${2*e}`:void 0}(t);return`${a(t.paint,e,"stroke")} stroke-width="${t.width}"${void 0===i?"":` stroke-dasharray="${i}"`} stroke-linecap="round" stroke-linejoin="round"`}function d(t,e){if(0===e.rotation&&!e.flipH&&!e.flipV)return"";const i=t.x+t.width/2,n=t.y+t.height/2;return` transform="translate(${i} ${n}) rotate(${e.rotation}) scale(${e.flipH?-1:1} ${e.flipV?-1:1}) translate(${-i} ${-n})"`}function c(t){const e=t.codePointAt(0)??0;return e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=127744&&e<=129791}function h(t,e){return t.style.fontSize*e}function p(t){return Math.round(1e3*t)/1e3}function $(t,e,i){return h(e,i)*(/\s/u.test(t)?.28:c(t)?1:/[,.;:!?()[\]{}'"`-]/u.test(t)?.32:/[fijltIr|]/u.test(t)?.3:/[mMwWOQ%@]/u.test(t)?.72:/\d/u.test(t)?.55:/[A-Z]/u.test(t)?.6:.52)*1.06*(e.style.bold&&!c(t)?1.03:1)*(e.style.italic?1.02:1)}function u(t,e,i){let n=0;for(const o of t)n+=$(o,e,i);return n}function g(t,e,i){if(""===i)return;const n=t.at(-1);n?.run===e?n.text+=i:t.push({run:e,text:i})}function f(t,e,i){const n=t.runs[0];if(void 0===n)return[];const o=w(t),r=Math.max(1,e+t.style.hanging),s=Math.max(1,e),a=[];let l,d=!0,c=[],p=0,f=!1;const m=()=>{c=[],p=0,f=!1,d&&""!==o&&(g(c,n,o),p=u(o,n,i))},y=()=>{const e=c.reduce((t,e)=>Math.max(t,h(e.run,i)),h(n,i));a.push({first:d,fontSize:e,lineHeight:e*t.style.lineSpacing,paragraph:t,segments:c}),d=!1,l=void 0,m()},x=(t,e)=>{const n=void 0===l||0===c.length?"":" ",o=d?r:s,a=p+u(n,l??e,i)+u(t,e,i);f&&a>o&&y(),void 0!==l&&c.length>0&&(g(c,l," "),p+=u(" ",l,i));for(const n of t){const t=$(n,e,i);f&&p+t>(d?r:s)&&y(),g(c,e,n),p+=t,f=!0}l=void 0};m();for(const e of t.runs)for(const t of e.text.split(/(\s+)/u))""!==t&&(/\s/u.test(t)?t.includes("\n")?y():l=e:x(t,e));return(c.length>0||0===a.length)&&y(),a}function m(t,e,i,o){"resize"===e.autoFit.mode&&o.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:o.slideId,elementId:o.elementId});const r="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=Math.max(1,i.width-e.margin.left-e.margin.right),l=[];let d=0;for(const e of t){d+=e.style.spaceBefore;const t=Math.max(1,a-e.style.indent);for(const i of f(e,t,r))l.push({...i,y:d}),d+=i.lineHeight;d+=e.style.spaceAfter}const c=Math.max(0,i.height-e.margin.top-e.margin.bottom),$="middle"===e.verticalAlign?Math.max(0,(c-d)/2):"bottom"===e.verticalAlign?Math.max(0,c-d):0;return l.map((t,a)=>{const l=t.paragraph.style,d=i.x+e.margin.left+l.indent-(t.first?l.hanging:0),c=i.x+i.width-e.margin.right,u="center"===(g=l.align)?"middle":"right"===g?"end":"start";var g;const f="middle"===u?(d+c)/2:"end"===u?c:d,m=i.y+e.margin.top+$+t.y+.8*t.fontSize,w=t.segments.map(t=>`<tspan ${function(t,e,i){const o=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" ");return[`font-family="${n(y(t.style.fontFamily,i))}"`,`font-size="${p(h(t,e))}"`,`font-weight="${t.style.bold?700:400}"`,`font-style="${t.style.italic?"italic":"normal"}"`,`text-decoration="${o||"none"}"`,`fill="${s(t.style.color,i)}"`,`lang="${n(t.style.language)}"`].join(" ")}(t.run,r,o.theme)}>${n(t.text)}</tspan>`).join("");return`<text x="${f}" y="${m}" text-anchor="${u}" data-pptkit-text-line="${a}">${w}</text>`}).join("")}function y(t,e){return"string"==typeof t?t:e.fonts[t.theme]}function w(t){const e=t.style.bullet;if("none"===e.type)return"";if("bullet"===e.type)return`${e.character} `;const i=e.startAt;return"arabicParen"===e.style?`${i}) `:"alphaLowerPeriod"===e.style?`${String.fromCharCode(96+Math.min(26,i))}. `:"alphaUpperPeriod"===e.style?`${String.fromCharCode(64+Math.min(26,i))}. `:`${i}. `}function x(t,e,i){"resize"===e.autoFit.mode&&i.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:i.slideId,elementId:i.elementId});const o="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=["width:100%","height:100%","box-sizing:border-box","display:flex","flex-direction:column",`justify-content:${"middle"===e.verticalAlign?"center":"bottom"===e.verticalAlign?"flex-end":"flex-start"}`,`padding:${e.margin.top}px ${e.margin.right}px ${e.margin.bottom}px ${e.margin.left}px`,"overflow:visible",e.wrap?"overflow-wrap:anywhere":"white-space:pre"].join(";"),l=t.map(t=>{const a=t.style,l=["margin:0",`padding-left:${a.indent}px`,`text-indent:${-a.hanging}px`,`line-height:${a.lineSpacing}`,`padding-top:${a.spaceBefore}px`,`padding-bottom:${a.spaceAfter}px`,`text-align:${a.align}`,e.wrap?"white-space:pre-wrap":"white-space:pre"].join(";"),d=t.runs.map(t=>{const e=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" "),a=["font-family:"+(l=y(t.style.fontFamily,i.theme),`&quot;${n(l.replace(/\\/g,"\\\\").replace(/"/g,'\\"'))}&quot;`),`font-size:${p(t.style.fontSize*o)}px`,"font-weight:"+(t.style.bold?700:400),"font-style:"+(t.style.italic?"italic":"normal"),`text-decoration:${e||"none"}`,`color:${s(t.style.color,i.theme)}`].join(";");var l;const d=function(t,e){if(void 0===t)return{open:"",close:""};if("slide"===t.type)return e.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${t.slideId} is metadata-only in standalone SVG output.`,slideId:e.slideId,elementId:e.elementId}),{open:`<span data-pptkit-slide-target="${n(t.slideId)}">`,close:"</span>"};const i=r(t.url);return void 0===i?(e.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:e.elementId}),{open:"",close:""}):{open:`<a href="${n(i)}" rel="noopener noreferrer"${void 0===t.tooltip?"":` title="${n(t.tooltip)}"`}>`,close:"</a>"}}(t.action,i);return`${d.open}<span lang="${n(t.style.language)}" style="${a}">${n(t.text)}</span>${d.close}`}).join(""),c=w(t);return`<div style="${l}">${""===c?"":`<span aria-hidden="true">${n(c)}</span>`}${d}</div>`}).join("");return`<div xmlns="http://www.w3.org/1999/xhtml" style="${a}">${l}</div>`}function v(t){const e=` data-pptkit-element-id="${n(t.id)}"`;return t.accessibility.decorative?`${e} aria-hidden="true"`:`${e} role="img" aria-label="${n(t.accessibility.description??t.name)}"`}function I(t,e,i){const o=t.action;if(void 0===o)return e;if("slide"===o.type)return i.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${o.slideId} is metadata-only in standalone SVG output.`,slideId:i.slideId,elementId:t.id}),`<g data-pptkit-slide-target="${n(o.slideId)}">${e}</g>`;const s=r(o.url);return void 0===s?(i.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:i.slideId,elementId:t.id}),e):`<a href="${n(s)}" rel="noopener noreferrer"${void 0===o.tooltip?"":` aria-label="${n(o.tooltip)}"`}>${e}</a>`}function b(t,e,i,n,o,r=!1){return`<foreignObject x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}"${r?' overflow="visible"':""}${i} opacity="${n}"${o}>${e}</foreignObject>`}function k(t,e,i,n,r){if("none"===t||"none"===n.paint.type)return;const s=o(`${r.slideId}-${i}-${e}-${t}`),a="solid"===n.paint.type?"string"==typeof n.paint.color?n.paint.color:r.theme.colors[n.paint.color.theme]:"000000",l=a.startsWith("#")?a:`#${a}`;return r.defs.push(`<marker id="${s}" markerWidth="10" markerHeight="10" refX="${"end"===e?9:1}" refY="5" orient="auto-start-reverse" markerUnits="strokeWidth" viewBox="0 0 10 10">${function(t,e){return"oval"===t?`<circle cx="5" cy="5" r="3.5" fill="${e}"/>`:"diamond"===t?`<path d="M1 5 L5 1 L9 5 L5 9 Z" fill="${e}"/>`:"stealth"===t?`<path d="M1 1 L9 5 L1 9 L4 5 Z" fill="${e}"/>`:"arrow"===t?`<path d="M1 1 L9 5 L1 9" fill="none" stroke="${e}" stroke-width="1.5"/>`:`<path d="M1 1 L9 5 L1 9 Z" fill="${e}"/>`}(t,l)}</marker>`),s}function A(t,e){const{x:i,y:n,width:o,height:r}=t.box;return`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}><rect x="${i}" y="${n}" width="${o}" height="${r}" fill="#F3F4F6" stroke="#9CA3AF" stroke-dasharray="6 4"/><path d="M${i+.15*o} ${n+.75*r} L${i+.42*o} ${n+.45*r} L${i+.6*o} ${n+.62*r} L${i+.78*o} ${n+.35*r} L${i+.9*o} ${n+.75*r}" fill="none" stroke="#9CA3AF" stroke-width="2"/></g>`}async function z(t,e){const i=e.assets.get(t.assetId);if(void 0===i)return e.warnings.push({code:"asset-missing",message:`Image asset ${t.assetId} was not found.`,slideId:e.slideId,elementId:t.id,assetId:t.assetId}),A(t);const r=await async function(t,e){let i=e.assetCache.get(t.id);return void 0===i&&(i=(async()=>{if(void 0!==e.resolveAsset)try{const i=await e.resolveAsset(t);return void 0===i&&e.warnings.push({code:"asset-unresolved",message:"The asset resolver did not return an image URL.",slideId:e.slideId,assetId:t.id}),i}catch(i){return void e.warnings.push({code:"asset-resolver-failed",message:`The asset resolver failed: ${i instanceof Error?i.message:String(i)}`,slideId:e.slideId,assetId:t.id})}if("url"===t.source.type)return t.source.value;e.warnings.push({code:"asset-path-unsupported",message:"Local path assets require a custom SvgAssetResolver.",slideId:e.slideId,assetId:t.id})})(),e.assetCache.set(t.id,i)),i}(i,e);if(void 0===r||void 0===function(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","blob:"].includes(e.protocol))return t;if("data:"===e.protocol&&/^data:image\//i.test(t))return t}catch{return}}(r))return void 0!==r&&e.warnings.push({code:"unsafe-asset-url",message:"An image URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:t.id,assetId:i.id}),A(t);const s=o(`${e.slideId}-${t.id}-clip`),a=t.box;let l;if(e.defs.push(`<clipPath id="${s}"><rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}"/></clipPath>`),"crop"===t.fit&&void 0!==i.width&&void 0!==i.height){const e=Math.max(1e-4,1-t.crop.left-t.crop.right),i=Math.max(1e-4,1-t.crop.top-t.crop.bottom),o=a.width/e,s=a.height/i;l=`<image href="${n(r)}" x="${a.x-o*t.crop.left}" y="${a.y-s*t.crop.top}" width="${o}" height="${s}" preserveAspectRatio="none"/>`}else"crop"===t.fit&&e.warnings.push({code:"image-crop-degraded",message:"Image crop requires intrinsic asset dimensions; preview fell back to centered cover.",slideId:e.slideId,elementId:t.id,assetId:i.id}),l=`<image href="${n(r)}" x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" preserveAspectRatio="${"stretch"===t.fit?"none":"xMidYMid slice"}"/>`;return I(t,`<g${d(a,t.transform)} opacity="${t.opacity}" clip-path="url(#${s})"${v(t)}>${l}</g>`,e)}async function M(t,e){if(t.hidden)return"";if("image"===t.type)return z(t,e);if("group"===t.type)return function(t,e){return(async()=>{const i=[];for(const n of t.children)i.push(await M(n,e));const n=i.join(""),o=t.box,r=o.x+o.width/2,s=o.y+o.height/2,a=`translate(${r} ${s}) rotate(${t.transform.rotation}) scale(${t.transform.flipH?-1:1} ${t.transform.flipV?-1:1}) translate(${-r} ${-s}) translate(${o.x} ${o.y}) scale(${o.width/t.coordinateSize.width} ${o.height/t.coordinateSize.height})`;return I(t,`<g transform="${a}" opacity="${t.opacity}"${v(t)}>${n}</g>`,e)})()}(t,e);if("text"===t.type){const i={theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id};if(t.content.every(t=>1===t.runs.length&&void 0===t.runs[0]?.action)){const n=m(t.content,t.frame,t.box,i);return I(t,`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}>${n}</g>`,e)}const n=x(t.content,t.frame,i);return I(t,b(t.box,n,d(t.box,t.transform),t.opacity,v(t),!0),e)}if("shape"===t.type){const i=d(t.box,t.transform),n=function(t,e){const{x:i,y:n,width:o,height:r}=t.box,s=`${a(t.style.fill,e.theme,"fill")} ${l(t.style.stroke,e.theme)}`;return"rect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" ${s}/>`:"roundRect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" rx="${.08*Math.min(o,r)}" ${s}/>`:"ellipse"===t.shape?`<ellipse cx="${i+o/2}" cy="${n+r/2}" rx="${o/2}" ry="${r/2}" ${s}/>`:`<polygon points="${("triangle"===t.shape?[[i+o/2,n],[i+o,n+r],[i,n+r]]:"diamond"===t.shape?[[i+o/2,n],[i+o,n+r/2],[i+o/2,n+r],[i,n+r/2]]:"arrow"===t.shape?[[i,n+.25*r],[i+.62*o,n+.25*r],[i+.62*o,n],[i+o,n+r/2],[i+.62*o,n+r],[i+.62*o,n+.75*r],[i,n+.75*r]]:[[i,n],[i+.65*o,n],[i+o,n+r/2],[i+.65*o,n+r],[i,n+r],[i+.35*o,n+r/2]]).map(t=>t.join(",")).join(" ")}" ${s}/>`}(t,e),o=void 0===t.text?"":b(t.box,x(t.text.content,t.text.frame,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id}),"",1,"",!0);return I(t,`<g${i} opacity="${t.opacity}"${v(t)}>${n}${o}</g>`,e)}if("connector"===t.type){const i=[t.start,...t.route,t.end],n=k(t.style.beginArrow,"start",t.id,t.style,e),o=k(t.style.endArrow,"end",t.id,t.style,e),r=`${void 0===n?"":` marker-start="url(#${n})"`}${void 0===o?"":` marker-end="url(#${o})"`}`,s=`<polyline points="${i.map(t=>`${t.x},${t.y}`).join(" ")}" fill="none" ${l(t.style,e.theme)}${r}/>`;return I(t,`<g${d(t.box,t.transform)} opacity="${t.opacity}"${v(t)}>${s}</g>`,e)}return"table"===t.type?I(t,b(t.box,function(t,e){return`<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden"><table style="width:100%;height:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0"><colgroup>${t.columns.map(t=>`<col style="width:${t}px"/>`).join("")}</colgroup><tbody>${t.rows.map(i=>{const n=i.cells.map(i=>{const n="none"===i.style.fill.type?"transparent":"string"==typeof i.style.fill.color?i.style.fill.color:e.theme.colors[i.style.fill.color.theme],o="transparent"===n||n.startsWith("#")?n:`#${n}`,r="none"===i.style.stroke.paint.type?"transparent":"string"==typeof i.style.stroke.paint.color?i.style.stroke.paint.color:e.theme.colors[i.style.stroke.paint.color.theme],s="transparent"===r||r.startsWith("#")?r:`#${r}`,a=`box-sizing:border-box;background:${o};border:${i.style.stroke.width}px solid ${s};padding:${i.style.margin.top}px ${i.style.margin.right}px ${i.style.margin.bottom}px ${i.style.margin.left}px;vertical-align:${i.style.verticalAlign};overflow:hidden`,l={margin:{top:0,right:0,bottom:0,left:0},verticalAlign:i.style.verticalAlign,wrap:!0,autoFit:{mode:"none"}};return`<td rowspan="${i.rowSpan}" colspan="${i.colSpan}" style="${a}">${x(i.content,l,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id})}</td>`}).join("");return`<tr style="height:${i.height}px">${n}</tr>`}).join("")}</tbody></table></div>`}(t,e),d(t.box,t.transform),t.opacity,v(t)),e):""}function S(t,e,i){return`<rect x="0" y="0" width="${t.width}" height="${t.height}" ${a(e,i,"fill")}/>`}async function j(t,e={}){const i=[],r=new Map(t.assets.map(t=>[t.id,t])),s=new Map(t.layouts.map(t=>[t.id,t])),a=[];for(let l=0;l<t.slides.length;l+=1){const d=t.slides[l],c=[],h={slideId:d.id,theme:t.theme,assets:r,...void 0===e.resolveAsset?{}:{resolveAsset:e.resolveAsset},assetCache:new Map,warnings:i,defs:c},p=s.get(d.layoutId),$=[...p?.elements??[],...d.elements],u=[];for(const t of $)u.push(await M(t,h));const g=u.join(""),f=`${t.metadata.title||"PPTKit presentation"} — slide ${l+1}`,m=o(`pptkit-slide-${d.id}`),y=`<svg id="${m}" xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" viewBox="0 0 ${t.size.width} ${t.size.height}" width="${t.size.width}" height="${t.size.height}" role="img" aria-labelledby="${m}-title" data-pptkit-slide-id="${n(d.id)}"><title id="${m}-title">${n(f)}</title><defs>${c.join("")}</defs>${S({width:t.size.width,height:t.size.height},d.background,t.theme)}${g}</svg>`;a.push({slideId:d.id,index:l,hidden:d.hidden,svg:y})}return{width:t.size.width,height:t.size.height,slides:a,warnings:i,status:0===i.length?"rendered":"rendered-with-warnings"}}t.renderLayoutToSvg=async function(t,e){return j(t,e)},t.renderPresentationToSvg=async function(t,n){return j(i.resolveNormalizedLayout(e.normalizePresentation(t)),n)}}(this.PPTKit=this.PPTKit||{},PPTKit,PPTKit);
@@ -1 +1 @@
1
- import{normalizePresentation as t}from"@pptkit/core";import{resolveNormalizedLayout as e}from"@pptkit/layout";function i(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function n(t){const e=t.replace(/[^A-Za-z0-9_.:-]/g,"-");let i=2166136261;for(let e=0;e<t.length;e+=1)i^=t.charCodeAt(e),i=Math.imul(i,16777619);return`${/^[A-Za-z_]/.test(e)?e:`id-${e}`}-${(i>>>0).toString(36)}`}function o(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","mailto:"].includes(e.protocol))return t}catch{return}}function r(t,e){const i="string"==typeof t?t:e.colors[t.theme];return i.startsWith("#")?i:`#${i}`}function s(t,e,i){return"none"===t.type?`${i}="none"`:`${i}="${r(t.color,e)}" ${i}-opacity="${t.opacity}"`}function a(t,e){const i=function(t){const e=Math.max(t.width,1);return"dash"===t.dash?`${4*e} ${3*e}`:"dot"===t.dash?`${e} ${2*e}`:"dashDot"===t.dash?`${4*e} ${2*e} ${e} ${2*e}`:void 0}(t);return`${s(t.paint,e,"stroke")} stroke-width="${t.width}"${void 0===i?"":` stroke-dasharray="${i}"`} stroke-linecap="round" stroke-linejoin="round"`}function l(t,e){if(0===e.rotation&&!e.flipH&&!e.flipV)return"";const i=t.x+t.width/2,n=t.y+t.height/2;return` transform="translate(${i} ${n}) rotate(${e.rotation}) scale(${e.flipH?-1:1} ${e.flipV?-1:1}) translate(${-i} ${-n})"`}function d(t){const e=t.codePointAt(0)??0;return e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=127744&&e<=129791}function c(t,e){return t.style.fontSize*e}function h(t){return Math.round(1e3*t)/1e3}function p(t,e,i){return c(e,i)*(/\s/u.test(t)?.28:d(t)?1:/[,.;:!?()[\]{}'"`-]/u.test(t)?.32:/[fijltIr|]/u.test(t)?.3:/[mMwWOQ%@]/u.test(t)?.72:/\d/u.test(t)?.55:/[A-Z]/u.test(t)?.6:.52)*1.06*(e.style.bold&&!d(t)?1.03:1)*(e.style.italic?1.02:1)}function $(t,e,i){let n=0;for(const o of t)n+=p(o,e,i);return n}function u(t,e,i){if(""===i)return;const n=t.at(-1);n?.run===e?n.text+=i:t.push({run:e,text:i})}function g(t,e,i){const n=t.runs[0];if(void 0===n)return[];const o=y(t),r=Math.max(1,e+t.style.hanging),s=Math.max(1,e),a=[];let l,d=!0,h=[],g=0;const f=()=>{h=[],g=0,d&&""!==o&&(u(h,n,o),g=$(o,n,i))},m=()=>{const e=h.reduce((t,e)=>Math.max(t,c(e.run,i)),c(n,i));a.push({first:d,fontSize:e,lineHeight:e*t.style.lineSpacing,paragraph:t,segments:h}),d=!1,l=void 0,f()},w=(t,e)=>{const n=void 0===l||0===h.length?"":" ",a=d?r:s,c=g+$(n,l??e,i)+$(t,e,i);h.length>(d&&""!==o?1:0)&&c>a&&m(),void 0!==l&&h.length>0&&(u(h,l," "),g+=$(" ",l,i));for(const n of t){const t=p(n,e,i),a=d?r:s;h.length>(d&&""!==o?1:0)&&g+t>a&&m(),u(h,e,n),g+=t}l=void 0};f();for(const e of t.runs)for(const t of e.text.split(/(\s+)/u))""!==t&&(/\s/u.test(t)?t.includes("\n")?m():l=e:w(t,e));return(h.length>0||0===a.length)&&m(),a}function f(t,e,n,o){"resize"===e.autoFit.mode&&o.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:o.slideId,elementId:o.elementId});const s="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=Math.max(1,n.width-e.margin.left-e.margin.right),l=[];let d=0;for(const e of t){d+=e.style.spaceBefore;const t=Math.max(1,a-e.style.indent);for(const i of g(e,t,s))l.push({...i,y:d}),d+=i.lineHeight;d+=e.style.spaceAfter}const p=Math.max(0,n.height-e.margin.top-e.margin.bottom),$="middle"===e.verticalAlign?Math.max(0,(p-d)/2):"bottom"===e.verticalAlign?Math.max(0,p-d):0;return l.map((t,a)=>{const l=t.paragraph.style,d=n.x+e.margin.left+l.indent-(t.first?l.hanging:0),p=n.x+n.width-e.margin.right,u="center"===(g=l.align)?"middle":"right"===g?"end":"start";var g;const f="middle"===u?(d+p)/2:"end"===u?p:d,y=n.y+e.margin.top+$+t.y+.8*t.fontSize,w=t.segments.map(t=>`<tspan ${function(t,e,n){const o=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" ");return[`font-family="${i(m(t.style.fontFamily,n))}"`,`font-size="${h(c(t,e))}"`,`font-weight="${t.style.bold?700:400}"`,`font-style="${t.style.italic?"italic":"normal"}"`,`text-decoration="${o||"none"}"`,`fill="${r(t.style.color,n)}"`,`lang="${i(t.style.language)}"`].join(" ")}(t.run,s,o.theme)}>${i(t.text)}</tspan>`).join("");return`<text x="${f}" y="${y}" text-anchor="${u}" data-pptkit-text-line="${a}">${w}</text>`}).join("")}function m(t,e){return"string"==typeof t?t:e.fonts[t.theme]}function y(t){const e=t.style.bullet;if("none"===e.type)return"";if("bullet"===e.type)return`${e.character} `;const i=e.startAt;return"arabicParen"===e.style?`${i}) `:"alphaLowerPeriod"===e.style?`${String.fromCharCode(96+Math.min(26,i))}. `:"alphaUpperPeriod"===e.style?`${String.fromCharCode(64+Math.min(26,i))}. `:`${i}. `}function w(t,e,n){"resize"===e.autoFit.mode&&n.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:n.slideId,elementId:n.elementId});const s="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=["width:100%","height:100%","box-sizing:border-box","display:flex","flex-direction:column",`justify-content:${"middle"===e.verticalAlign?"center":"bottom"===e.verticalAlign?"flex-end":"flex-start"}`,`padding:${e.margin.top}px ${e.margin.right}px ${e.margin.bottom}px ${e.margin.left}px`,"overflow:visible",e.wrap?"overflow-wrap:anywhere":"white-space:pre"].join(";"),l=t.map(t=>{const a=t.style,l=["margin:0",`padding-left:${a.indent}px`,`text-indent:${-a.hanging}px`,`line-height:${a.lineSpacing}`,`padding-top:${a.spaceBefore}px`,`padding-bottom:${a.spaceAfter}px`,`text-align:${a.align}`,e.wrap?"white-space:pre-wrap":"white-space:pre"].join(";"),d=t.runs.map(t=>{const e=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" "),a=["font-family:"+(l=m(t.style.fontFamily,n.theme),`&quot;${i(l.replace(/\\/g,"\\\\").replace(/"/g,'\\"'))}&quot;`),`font-size:${h(t.style.fontSize*s)}px`,"font-weight:"+(t.style.bold?700:400),"font-style:"+(t.style.italic?"italic":"normal"),`text-decoration:${e||"none"}`,`color:${r(t.style.color,n.theme)}`].join(";");var l;const d=function(t,e){if(void 0===t)return{open:"",close:""};if("slide"===t.type)return e.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${t.slideId} is metadata-only in standalone SVG output.`,slideId:e.slideId,elementId:e.elementId}),{open:`<span data-pptkit-slide-target="${i(t.slideId)}">`,close:"</span>"};const n=o(t.url);return void 0===n?(e.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:e.elementId}),{open:"",close:""}):{open:`<a href="${i(n)}" rel="noopener noreferrer"${void 0===t.tooltip?"":` title="${i(t.tooltip)}"`}>`,close:"</a>"}}(t.action,n);return`${d.open}<span lang="${i(t.style.language)}" style="${a}">${i(t.text)}</span>${d.close}`}).join(""),c=y(t);return`<div style="${l}">${""===c?"":`<span aria-hidden="true">${i(c)}</span>`}${d}</div>`}).join("");return`<div xmlns="http://www.w3.org/1999/xhtml" style="${a}">${l}</div>`}function x(t){const e=` data-pptkit-element-id="${i(t.id)}"`;return t.accessibility.decorative?`${e} aria-hidden="true"`:`${e} role="img" aria-label="${i(t.accessibility.description??t.name)}"`}function v(t,e,n){const r=t.action;if(void 0===r)return e;if("slide"===r.type)return n.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${r.slideId} is metadata-only in standalone SVG output.`,slideId:n.slideId,elementId:t.id}),`<g data-pptkit-slide-target="${i(r.slideId)}">${e}</g>`;const s=o(r.url);return void 0===s?(n.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:n.slideId,elementId:t.id}),e):`<a href="${i(s)}" rel="noopener noreferrer"${void 0===r.tooltip?"":` aria-label="${i(r.tooltip)}"`}>${e}</a>`}function I(t,e,i,n,o,r=!1){return`<foreignObject x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}"${r?' overflow="visible"':""}${i} opacity="${n}"${o}>${e}</foreignObject>`}function b(t,e,i,o,r){if("none"===t||"none"===o.paint.type)return;const s=n(`${r.slideId}-${i}-${e}-${t}`),a="solid"===o.paint.type?"string"==typeof o.paint.color?o.paint.color:r.theme.colors[o.paint.color.theme]:"000000",l=a.startsWith("#")?a:`#${a}`;return r.defs.push(`<marker id="${s}" markerWidth="10" markerHeight="10" refX="${"end"===e?9:1}" refY="5" orient="auto-start-reverse" markerUnits="strokeWidth" viewBox="0 0 10 10">${function(t,e){return"oval"===t?`<circle cx="5" cy="5" r="3.5" fill="${e}"/>`:"diamond"===t?`<path d="M1 5 L5 1 L9 5 L5 9 Z" fill="${e}"/>`:"stealth"===t?`<path d="M1 1 L9 5 L1 9 L4 5 Z" fill="${e}"/>`:"arrow"===t?`<path d="M1 1 L9 5 L1 9" fill="none" stroke="${e}" stroke-width="1.5"/>`:`<path d="M1 1 L9 5 L1 9 Z" fill="${e}"/>`}(t,l)}</marker>`),s}function k(t,e){const{x:i,y:n,width:o,height:r}=t.box;return`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}><rect x="${i}" y="${n}" width="${o}" height="${r}" fill="#F3F4F6" stroke="#9CA3AF" stroke-dasharray="6 4"/><path d="M${i+.15*o} ${n+.75*r} L${i+.42*o} ${n+.45*r} L${i+.6*o} ${n+.62*r} L${i+.78*o} ${n+.35*r} L${i+.9*o} ${n+.75*r}" fill="none" stroke="#9CA3AF" stroke-width="2"/></g>`}async function A(t,e){const o=e.assets.get(t.assetId);if(void 0===o)return e.warnings.push({code:"asset-missing",message:`Image asset ${t.assetId} was not found.`,slideId:e.slideId,elementId:t.id,assetId:t.assetId}),k(t);const r=await async function(t,e){let i=e.assetCache.get(t.id);return void 0===i&&(i=(async()=>{if(void 0!==e.resolveAsset)try{const i=await e.resolveAsset(t);return void 0===i&&e.warnings.push({code:"asset-unresolved",message:"The asset resolver did not return an image URL.",slideId:e.slideId,assetId:t.id}),i}catch(i){return void e.warnings.push({code:"asset-resolver-failed",message:`The asset resolver failed: ${i instanceof Error?i.message:String(i)}`,slideId:e.slideId,assetId:t.id})}if("url"===t.source.type)return t.source.value;e.warnings.push({code:"asset-path-unsupported",message:"Local path assets require a custom SvgAssetResolver.",slideId:e.slideId,assetId:t.id})})(),e.assetCache.set(t.id,i)),i}(o,e);if(void 0===r||void 0===function(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","blob:"].includes(e.protocol))return t;if("data:"===e.protocol&&/^data:image\//i.test(t))return t}catch{return}}(r))return void 0!==r&&e.warnings.push({code:"unsafe-asset-url",message:"An image URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:t.id,assetId:o.id}),k(t);const s=n(`${e.slideId}-${t.id}-clip`),a=t.box;let d;if(e.defs.push(`<clipPath id="${s}"><rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}"/></clipPath>`),"crop"===t.fit&&void 0!==o.width&&void 0!==o.height){const e=Math.max(1e-4,1-t.crop.left-t.crop.right),n=Math.max(1e-4,1-t.crop.top-t.crop.bottom),o=a.width/e,s=a.height/n;d=`<image href="${i(r)}" x="${a.x-o*t.crop.left}" y="${a.y-s*t.crop.top}" width="${o}" height="${s}" preserveAspectRatio="none"/>`}else"crop"===t.fit&&e.warnings.push({code:"image-crop-degraded",message:"Image crop requires intrinsic asset dimensions; preview fell back to centered cover.",slideId:e.slideId,elementId:t.id,assetId:o.id}),d=`<image href="${i(r)}" x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" preserveAspectRatio="${"stretch"===t.fit?"none":"xMidYMid slice"}"/>`;return v(t,`<g${l(a,t.transform)} opacity="${t.opacity}" clip-path="url(#${s})"${x(t)}>${d}</g>`,e)}async function M(t,e){if(t.hidden)return"";if("image"===t.type)return A(t,e);if("group"===t.type)return function(t,e){return(async()=>{const i=[];for(const n of t.children)i.push(await M(n,e));const n=i.join(""),o=t.box,r=o.x+o.width/2,s=o.y+o.height/2,a=`translate(${r} ${s}) rotate(${t.transform.rotation}) scale(${t.transform.flipH?-1:1} ${t.transform.flipV?-1:1}) translate(${-r} ${-s}) translate(${o.x} ${o.y}) scale(${o.width/t.coordinateSize.width} ${o.height/t.coordinateSize.height})`;return v(t,`<g transform="${a}" opacity="${t.opacity}"${x(t)}>${n}</g>`,e)})()}(t,e);if("text"===t.type){const i={theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id};if(t.content.every(t=>1===t.runs.length&&void 0===t.runs[0]?.action)){const n=f(t.content,t.frame,t.box,i);return v(t,`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}>${n}</g>`,e)}const n=w(t.content,t.frame,i);return v(t,I(t.box,n,l(t.box,t.transform),t.opacity,x(t),!0),e)}if("shape"===t.type){const i=l(t.box,t.transform),n=function(t,e){const{x:i,y:n,width:o,height:r}=t.box,l=`${s(t.style.fill,e.theme,"fill")} ${a(t.style.stroke,e.theme)}`;return"rect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" ${l}/>`:"roundRect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" rx="${.08*Math.min(o,r)}" ${l}/>`:"ellipse"===t.shape?`<ellipse cx="${i+o/2}" cy="${n+r/2}" rx="${o/2}" ry="${r/2}" ${l}/>`:`<polygon points="${("triangle"===t.shape?[[i+o/2,n],[i+o,n+r],[i,n+r]]:"diamond"===t.shape?[[i+o/2,n],[i+o,n+r/2],[i+o/2,n+r],[i,n+r/2]]:"arrow"===t.shape?[[i,n+.25*r],[i+.62*o,n+.25*r],[i+.62*o,n],[i+o,n+r/2],[i+.62*o,n+r],[i+.62*o,n+.75*r],[i,n+.75*r]]:[[i,n],[i+.65*o,n],[i+o,n+r/2],[i+.65*o,n+r],[i,n+r],[i+.35*o,n+r/2]]).map(t=>t.join(",")).join(" ")}" ${l}/>`}(t,e),o=void 0===t.text?"":I(t.box,w(t.text.content,t.text.frame,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id}),"",1,"",!0);return v(t,`<g${i} opacity="${t.opacity}"${x(t)}>${n}${o}</g>`,e)}if("connector"===t.type){const i=[t.start,...t.route,t.end],n=b(t.style.beginArrow,"start",t.id,t.style,e),o=b(t.style.endArrow,"end",t.id,t.style,e),r=`${void 0===n?"":` marker-start="url(#${n})"`}${void 0===o?"":` marker-end="url(#${o})"`}`,s=`<polyline points="${i.map(t=>`${t.x},${t.y}`).join(" ")}" fill="none" ${a(t.style,e.theme)}${r}/>`;return v(t,`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}>${s}</g>`,e)}return"table"===t.type?v(t,I(t.box,function(t,e){return`<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden"><table style="width:100%;height:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0"><colgroup>${t.columns.map(t=>`<col style="width:${t}px"/>`).join("")}</colgroup><tbody>${t.rows.map(i=>{const n=i.cells.map(i=>{const n="none"===i.style.fill.type?"transparent":"string"==typeof i.style.fill.color?i.style.fill.color:e.theme.colors[i.style.fill.color.theme],o="transparent"===n||n.startsWith("#")?n:`#${n}`,r="none"===i.style.stroke.paint.type?"transparent":"string"==typeof i.style.stroke.paint.color?i.style.stroke.paint.color:e.theme.colors[i.style.stroke.paint.color.theme],s="transparent"===r||r.startsWith("#")?r:`#${r}`,a=`box-sizing:border-box;background:${o};border:${i.style.stroke.width}px solid ${s};padding:${i.style.margin.top}px ${i.style.margin.right}px ${i.style.margin.bottom}px ${i.style.margin.left}px;vertical-align:${i.style.verticalAlign};overflow:hidden`,l={margin:{top:0,right:0,bottom:0,left:0},verticalAlign:i.style.verticalAlign,wrap:!0,autoFit:{mode:"none"}};return`<td rowspan="${i.rowSpan}" colspan="${i.colSpan}" style="${a}">${w(i.content,l,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id})}</td>`}).join("");return`<tr style="height:${i.height}px">${n}</tr>`}).join("")}</tbody></table></div>`}(t,e),l(t.box,t.transform),t.opacity,x(t)),e):""}function z(t,e,i){return`<rect x="0" y="0" width="${t.width}" height="${t.height}" ${s(e,i,"fill")}/>`}async function j(t,e={}){const o=[],r=new Map(t.assets.map(t=>[t.id,t])),s=new Map(t.layouts.map(t=>[t.id,t])),a=[];for(let l=0;l<t.slides.length;l+=1){const d=t.slides[l],c=[],h={slideId:d.id,theme:t.theme,assets:r,...void 0===e.resolveAsset?{}:{resolveAsset:e.resolveAsset},assetCache:new Map,warnings:o,defs:c},p=s.get(d.layoutId),$=[...p?.elements??[],...d.elements],u=[];for(const t of $)u.push(await M(t,h));const g=u.join(""),f=`${t.metadata.title||"PPTKit presentation"} — slide ${l+1}`,m=n(`pptkit-slide-${d.id}`),y=`<svg id="${m}" xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" viewBox="0 0 ${t.size.width} ${t.size.height}" width="${t.size.width}" height="${t.size.height}" role="img" aria-labelledby="${m}-title" data-pptkit-slide-id="${i(d.id)}"><title id="${m}-title">${i(f)}</title><defs>${c.join("")}</defs>${z({width:t.size.width,height:t.size.height},d.background,t.theme)}${g}</svg>`;a.push({slideId:d.id,index:l,hidden:d.hidden,svg:y})}return{width:t.size.width,height:t.size.height,slides:a,warnings:o,status:0===o.length?"rendered":"rendered-with-warnings"}}async function S(i,n){return j(e(t(i)),n)}async function L(t,e){return j(t,e)}export{L as renderLayoutToSvg,S as renderPresentationToSvg};
1
+ import{normalizePresentation as t}from"@pptkit/core";import{resolveNormalizedLayout as e}from"@pptkit/layout";function i(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function n(t){const e=t.replace(/[^A-Za-z0-9_.:-]/g,"-");let i=2166136261;for(let e=0;e<t.length;e+=1)i^=t.charCodeAt(e),i=Math.imul(i,16777619);return`${/^[A-Za-z_]/.test(e)?e:`id-${e}`}-${(i>>>0).toString(36)}`}function o(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","mailto:"].includes(e.protocol))return t}catch{return}}function r(t,e){const i="string"==typeof t?t:e.colors[t.theme];return i.startsWith("#")?i:`#${i}`}function s(t,e,i){return"none"===t.type?`${i}="none"`:`${i}="${r(t.color,e)}" ${i}-opacity="${t.opacity}"`}function a(t,e){const i=function(t){const e=Math.max(t.width,1);return"dash"===t.dash?`${4*e} ${3*e}`:"dot"===t.dash?`${e} ${2*e}`:"dashDot"===t.dash?`${4*e} ${2*e} ${e} ${2*e}`:void 0}(t);return`${s(t.paint,e,"stroke")} stroke-width="${t.width}"${void 0===i?"":` stroke-dasharray="${i}"`} stroke-linecap="round" stroke-linejoin="round"`}function l(t,e){if(0===e.rotation&&!e.flipH&&!e.flipV)return"";const i=t.x+t.width/2,n=t.y+t.height/2;return` transform="translate(${i} ${n}) rotate(${e.rotation}) scale(${e.flipH?-1:1} ${e.flipV?-1:1}) translate(${-i} ${-n})"`}function d(t){const e=t.codePointAt(0)??0;return e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=127744&&e<=129791}function c(t,e){return t.style.fontSize*e}function h(t){return Math.round(1e3*t)/1e3}function p(t,e,i){return c(e,i)*(/\s/u.test(t)?.28:d(t)?1:/[,.;:!?()[\]{}'"`-]/u.test(t)?.32:/[fijltIr|]/u.test(t)?.3:/[mMwWOQ%@]/u.test(t)?.72:/\d/u.test(t)?.55:/[A-Z]/u.test(t)?.6:.52)*1.06*(e.style.bold&&!d(t)?1.03:1)*(e.style.italic?1.02:1)}function $(t,e,i){let n=0;for(const o of t)n+=p(o,e,i);return n}function u(t,e,i){if(""===i)return;const n=t.at(-1);n?.run===e?n.text+=i:t.push({run:e,text:i})}function g(t,e,i){const n=t.runs[0];if(void 0===n)return[];const o=y(t),r=Math.max(1,e+t.style.hanging),s=Math.max(1,e),a=[];let l,d=!0,h=[],g=0,f=!1;const m=()=>{h=[],g=0,f=!1,d&&""!==o&&(u(h,n,o),g=$(o,n,i))},w=()=>{const e=h.reduce((t,e)=>Math.max(t,c(e.run,i)),c(n,i));a.push({first:d,fontSize:e,lineHeight:e*t.style.lineSpacing,paragraph:t,segments:h}),d=!1,l=void 0,m()},x=(t,e)=>{const n=void 0===l||0===h.length?"":" ",o=d?r:s,a=g+$(n,l??e,i)+$(t,e,i);f&&a>o&&w(),void 0!==l&&h.length>0&&(u(h,l," "),g+=$(" ",l,i));for(const n of t){const t=p(n,e,i);f&&g+t>(d?r:s)&&w(),u(h,e,n),g+=t,f=!0}l=void 0};m();for(const e of t.runs)for(const t of e.text.split(/(\s+)/u))""!==t&&(/\s/u.test(t)?t.includes("\n")?w():l=e:x(t,e));return(h.length>0||0===a.length)&&w(),a}function f(t,e,n,o){"resize"===e.autoFit.mode&&o.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:o.slideId,elementId:o.elementId});const s="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=Math.max(1,n.width-e.margin.left-e.margin.right),l=[];let d=0;for(const e of t){d+=e.style.spaceBefore;const t=Math.max(1,a-e.style.indent);for(const i of g(e,t,s))l.push({...i,y:d}),d+=i.lineHeight;d+=e.style.spaceAfter}const p=Math.max(0,n.height-e.margin.top-e.margin.bottom),$="middle"===e.verticalAlign?Math.max(0,(p-d)/2):"bottom"===e.verticalAlign?Math.max(0,p-d):0;return l.map((t,a)=>{const l=t.paragraph.style,d=n.x+e.margin.left+l.indent-(t.first?l.hanging:0),p=n.x+n.width-e.margin.right,u="center"===(g=l.align)?"middle":"right"===g?"end":"start";var g;const f="middle"===u?(d+p)/2:"end"===u?p:d,y=n.y+e.margin.top+$+t.y+.8*t.fontSize,w=t.segments.map(t=>`<tspan ${function(t,e,n){const o=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" ");return[`font-family="${i(m(t.style.fontFamily,n))}"`,`font-size="${h(c(t,e))}"`,`font-weight="${t.style.bold?700:400}"`,`font-style="${t.style.italic?"italic":"normal"}"`,`text-decoration="${o||"none"}"`,`fill="${r(t.style.color,n)}"`,`lang="${i(t.style.language)}"`].join(" ")}(t.run,s,o.theme)}>${i(t.text)}</tspan>`).join("");return`<text x="${f}" y="${y}" text-anchor="${u}" data-pptkit-text-line="${a}">${w}</text>`}).join("")}function m(t,e){return"string"==typeof t?t:e.fonts[t.theme]}function y(t){const e=t.style.bullet;if("none"===e.type)return"";if("bullet"===e.type)return`${e.character} `;const i=e.startAt;return"arabicParen"===e.style?`${i}) `:"alphaLowerPeriod"===e.style?`${String.fromCharCode(96+Math.min(26,i))}. `:"alphaUpperPeriod"===e.style?`${String.fromCharCode(64+Math.min(26,i))}. `:`${i}. `}function w(t,e,n){"resize"===e.autoFit.mode&&n.warnings.push({code:"text-autofit-resize-unsupported",message:"Text autoFit resize cannot change SVG element geometry and was rendered inside the authored box.",slideId:n.slideId,elementId:n.elementId});const s="shrink"===e.autoFit.mode?e.autoFit.fontScale:1,a=["width:100%","height:100%","box-sizing:border-box","display:flex","flex-direction:column",`justify-content:${"middle"===e.verticalAlign?"center":"bottom"===e.verticalAlign?"flex-end":"flex-start"}`,`padding:${e.margin.top}px ${e.margin.right}px ${e.margin.bottom}px ${e.margin.left}px`,"overflow:visible",e.wrap?"overflow-wrap:anywhere":"white-space:pre"].join(";"),l=t.map(t=>{const a=t.style,l=["margin:0",`padding-left:${a.indent}px`,`text-indent:${-a.hanging}px`,`line-height:${a.lineSpacing}`,`padding-top:${a.spaceBefore}px`,`padding-bottom:${a.spaceAfter}px`,`text-align:${a.align}`,e.wrap?"white-space:pre-wrap":"white-space:pre"].join(";"),d=t.runs.map(t=>{const e=[t.style.underline?"underline":"",t.style.strike?"line-through":""].filter(Boolean).join(" "),a=["font-family:"+(l=m(t.style.fontFamily,n.theme),`&quot;${i(l.replace(/\\/g,"\\\\").replace(/"/g,'\\"'))}&quot;`),`font-size:${h(t.style.fontSize*s)}px`,"font-weight:"+(t.style.bold?700:400),"font-style:"+(t.style.italic?"italic":"normal"),`text-decoration:${e||"none"}`,`color:${r(t.style.color,n.theme)}`].join(";");var l;const d=function(t,e){if(void 0===t)return{open:"",close:""};if("slide"===t.type)return e.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${t.slideId} is metadata-only in standalone SVG output.`,slideId:e.slideId,elementId:e.elementId}),{open:`<span data-pptkit-slide-target="${i(t.slideId)}">`,close:"</span>"};const n=o(t.url);return void 0===n?(e.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:e.elementId}),{open:"",close:""}):{open:`<a href="${i(n)}" rel="noopener noreferrer"${void 0===t.tooltip?"":` title="${i(t.tooltip)}"`}>`,close:"</a>"}}(t.action,n);return`${d.open}<span lang="${i(t.style.language)}" style="${a}">${i(t.text)}</span>${d.close}`}).join(""),c=y(t);return`<div style="${l}">${""===c?"":`<span aria-hidden="true">${i(c)}</span>`}${d}</div>`}).join("");return`<div xmlns="http://www.w3.org/1999/xhtml" style="${a}">${l}</div>`}function x(t){const e=` data-pptkit-element-id="${i(t.id)}"`;return t.accessibility.decorative?`${e} aria-hidden="true"`:`${e} role="img" aria-label="${i(t.accessibility.description??t.name)}"`}function v(t,e,n){const r=t.action;if(void 0===r)return e;if("slide"===r.type)return n.warnings.push({code:"slide-action-not-linked",message:`Slide action targeting ${r.slideId} is metadata-only in standalone SVG output.`,slideId:n.slideId,elementId:t.id}),`<g data-pptkit-slide-target="${i(r.slideId)}">${e}</g>`;const s=o(r.url);return void 0===s?(n.warnings.push({code:"unsafe-action-url",message:"An action URL with an unsupported protocol was omitted.",slideId:n.slideId,elementId:t.id}),e):`<a href="${i(s)}" rel="noopener noreferrer"${void 0===r.tooltip?"":` aria-label="${i(r.tooltip)}"`}>${e}</a>`}function I(t,e,i,n,o,r=!1){return`<foreignObject x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}"${r?' overflow="visible"':""}${i} opacity="${n}"${o}>${e}</foreignObject>`}function b(t,e,i,o,r){if("none"===t||"none"===o.paint.type)return;const s=n(`${r.slideId}-${i}-${e}-${t}`),a="solid"===o.paint.type?"string"==typeof o.paint.color?o.paint.color:r.theme.colors[o.paint.color.theme]:"000000",l=a.startsWith("#")?a:`#${a}`;return r.defs.push(`<marker id="${s}" markerWidth="10" markerHeight="10" refX="${"end"===e?9:1}" refY="5" orient="auto-start-reverse" markerUnits="strokeWidth" viewBox="0 0 10 10">${function(t,e){return"oval"===t?`<circle cx="5" cy="5" r="3.5" fill="${e}"/>`:"diamond"===t?`<path d="M1 5 L5 1 L9 5 L5 9 Z" fill="${e}"/>`:"stealth"===t?`<path d="M1 1 L9 5 L1 9 L4 5 Z" fill="${e}"/>`:"arrow"===t?`<path d="M1 1 L9 5 L1 9" fill="none" stroke="${e}" stroke-width="1.5"/>`:`<path d="M1 1 L9 5 L1 9 Z" fill="${e}"/>`}(t,l)}</marker>`),s}function k(t,e){const{x:i,y:n,width:o,height:r}=t.box;return`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}><rect x="${i}" y="${n}" width="${o}" height="${r}" fill="#F3F4F6" stroke="#9CA3AF" stroke-dasharray="6 4"/><path d="M${i+.15*o} ${n+.75*r} L${i+.42*o} ${n+.45*r} L${i+.6*o} ${n+.62*r} L${i+.78*o} ${n+.35*r} L${i+.9*o} ${n+.75*r}" fill="none" stroke="#9CA3AF" stroke-width="2"/></g>`}async function A(t,e){const o=e.assets.get(t.assetId);if(void 0===o)return e.warnings.push({code:"asset-missing",message:`Image asset ${t.assetId} was not found.`,slideId:e.slideId,elementId:t.id,assetId:t.assetId}),k(t);const r=await async function(t,e){let i=e.assetCache.get(t.id);return void 0===i&&(i=(async()=>{if(void 0!==e.resolveAsset)try{const i=await e.resolveAsset(t);return void 0===i&&e.warnings.push({code:"asset-unresolved",message:"The asset resolver did not return an image URL.",slideId:e.slideId,assetId:t.id}),i}catch(i){return void e.warnings.push({code:"asset-resolver-failed",message:`The asset resolver failed: ${i instanceof Error?i.message:String(i)}`,slideId:e.slideId,assetId:t.id})}if("url"===t.source.type)return t.source.value;e.warnings.push({code:"asset-path-unsupported",message:"Local path assets require a custom SvgAssetResolver.",slideId:e.slideId,assetId:t.id})})(),e.assetCache.set(t.id,i)),i}(o,e);if(void 0===r||void 0===function(t){try{const e=new URL(t,"https://pptkit.invalid");if(["http:","https:","blob:"].includes(e.protocol))return t;if("data:"===e.protocol&&/^data:image\//i.test(t))return t}catch{return}}(r))return void 0!==r&&e.warnings.push({code:"unsafe-asset-url",message:"An image URL with an unsupported protocol was omitted.",slideId:e.slideId,elementId:t.id,assetId:o.id}),k(t);const s=n(`${e.slideId}-${t.id}-clip`),a=t.box;let d;if(e.defs.push(`<clipPath id="${s}"><rect x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}"/></clipPath>`),"crop"===t.fit&&void 0!==o.width&&void 0!==o.height){const e=Math.max(1e-4,1-t.crop.left-t.crop.right),n=Math.max(1e-4,1-t.crop.top-t.crop.bottom),o=a.width/e,s=a.height/n;d=`<image href="${i(r)}" x="${a.x-o*t.crop.left}" y="${a.y-s*t.crop.top}" width="${o}" height="${s}" preserveAspectRatio="none"/>`}else"crop"===t.fit&&e.warnings.push({code:"image-crop-degraded",message:"Image crop requires intrinsic asset dimensions; preview fell back to centered cover.",slideId:e.slideId,elementId:t.id,assetId:o.id}),d=`<image href="${i(r)}" x="${a.x}" y="${a.y}" width="${a.width}" height="${a.height}" preserveAspectRatio="${"stretch"===t.fit?"none":"xMidYMid slice"}"/>`;return v(t,`<g${l(a,t.transform)} opacity="${t.opacity}" clip-path="url(#${s})"${x(t)}>${d}</g>`,e)}async function M(t,e){if(t.hidden)return"";if("image"===t.type)return A(t,e);if("group"===t.type)return function(t,e){return(async()=>{const i=[];for(const n of t.children)i.push(await M(n,e));const n=i.join(""),o=t.box,r=o.x+o.width/2,s=o.y+o.height/2,a=`translate(${r} ${s}) rotate(${t.transform.rotation}) scale(${t.transform.flipH?-1:1} ${t.transform.flipV?-1:1}) translate(${-r} ${-s}) translate(${o.x} ${o.y}) scale(${o.width/t.coordinateSize.width} ${o.height/t.coordinateSize.height})`;return v(t,`<g transform="${a}" opacity="${t.opacity}"${x(t)}>${n}</g>`,e)})()}(t,e);if("text"===t.type){const i={theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id};if(t.content.every(t=>1===t.runs.length&&void 0===t.runs[0]?.action)){const n=f(t.content,t.frame,t.box,i);return v(t,`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}>${n}</g>`,e)}const n=w(t.content,t.frame,i);return v(t,I(t.box,n,l(t.box,t.transform),t.opacity,x(t),!0),e)}if("shape"===t.type){const i=l(t.box,t.transform),n=function(t,e){const{x:i,y:n,width:o,height:r}=t.box,l=`${s(t.style.fill,e.theme,"fill")} ${a(t.style.stroke,e.theme)}`;return"rect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" ${l}/>`:"roundRect"===t.shape?`<rect x="${i}" y="${n}" width="${o}" height="${r}" rx="${.08*Math.min(o,r)}" ${l}/>`:"ellipse"===t.shape?`<ellipse cx="${i+o/2}" cy="${n+r/2}" rx="${o/2}" ry="${r/2}" ${l}/>`:`<polygon points="${("triangle"===t.shape?[[i+o/2,n],[i+o,n+r],[i,n+r]]:"diamond"===t.shape?[[i+o/2,n],[i+o,n+r/2],[i+o/2,n+r],[i,n+r/2]]:"arrow"===t.shape?[[i,n+.25*r],[i+.62*o,n+.25*r],[i+.62*o,n],[i+o,n+r/2],[i+.62*o,n+r],[i+.62*o,n+.75*r],[i,n+.75*r]]:[[i,n],[i+.65*o,n],[i+o,n+r/2],[i+.65*o,n+r],[i,n+r],[i+.35*o,n+r/2]]).map(t=>t.join(",")).join(" ")}" ${l}/>`}(t,e),o=void 0===t.text?"":I(t.box,w(t.text.content,t.text.frame,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id}),"",1,"",!0);return v(t,`<g${i} opacity="${t.opacity}"${x(t)}>${n}${o}</g>`,e)}if("connector"===t.type){const i=[t.start,...t.route,t.end],n=b(t.style.beginArrow,"start",t.id,t.style,e),o=b(t.style.endArrow,"end",t.id,t.style,e),r=`${void 0===n?"":` marker-start="url(#${n})"`}${void 0===o?"":` marker-end="url(#${o})"`}`,s=`<polyline points="${i.map(t=>`${t.x},${t.y}`).join(" ")}" fill="none" ${a(t.style,e.theme)}${r}/>`;return v(t,`<g${l(t.box,t.transform)} opacity="${t.opacity}"${x(t)}>${s}</g>`,e)}return"table"===t.type?v(t,I(t.box,function(t,e){return`<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden"><table style="width:100%;height:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0"><colgroup>${t.columns.map(t=>`<col style="width:${t}px"/>`).join("")}</colgroup><tbody>${t.rows.map(i=>{const n=i.cells.map(i=>{const n="none"===i.style.fill.type?"transparent":"string"==typeof i.style.fill.color?i.style.fill.color:e.theme.colors[i.style.fill.color.theme],o="transparent"===n||n.startsWith("#")?n:`#${n}`,r="none"===i.style.stroke.paint.type?"transparent":"string"==typeof i.style.stroke.paint.color?i.style.stroke.paint.color:e.theme.colors[i.style.stroke.paint.color.theme],s="transparent"===r||r.startsWith("#")?r:`#${r}`,a=`box-sizing:border-box;background:${o};border:${i.style.stroke.width}px solid ${s};padding:${i.style.margin.top}px ${i.style.margin.right}px ${i.style.margin.bottom}px ${i.style.margin.left}px;vertical-align:${i.style.verticalAlign};overflow:hidden`,l={margin:{top:0,right:0,bottom:0,left:0},verticalAlign:i.style.verticalAlign,wrap:!0,autoFit:{mode:"none"}};return`<td rowspan="${i.rowSpan}" colspan="${i.colSpan}" style="${a}">${w(i.content,l,{theme:e.theme,warnings:e.warnings,slideId:e.slideId,elementId:t.id})}</td>`}).join("");return`<tr style="height:${i.height}px">${n}</tr>`}).join("")}</tbody></table></div>`}(t,e),l(t.box,t.transform),t.opacity,x(t)),e):""}function z(t,e,i){return`<rect x="0" y="0" width="${t.width}" height="${t.height}" ${s(e,i,"fill")}/>`}async function j(t,e={}){const o=[],r=new Map(t.assets.map(t=>[t.id,t])),s=new Map(t.layouts.map(t=>[t.id,t])),a=[];for(let l=0;l<t.slides.length;l+=1){const d=t.slides[l],c=[],h={slideId:d.id,theme:t.theme,assets:r,...void 0===e.resolveAsset?{}:{resolveAsset:e.resolveAsset},assetCache:new Map,warnings:o,defs:c},p=s.get(d.layoutId),$=[...p?.elements??[],...d.elements],u=[];for(const t of $)u.push(await M(t,h));const g=u.join(""),f=`${t.metadata.title||"PPTKit presentation"} — slide ${l+1}`,m=n(`pptkit-slide-${d.id}`),y=`<svg id="${m}" xmlns="http://www.w3.org/2000/svg" xmlns:xhtml="http://www.w3.org/1999/xhtml" viewBox="0 0 ${t.size.width} ${t.size.height}" width="${t.size.width}" height="${t.size.height}" role="img" aria-labelledby="${m}-title" data-pptkit-slide-id="${i(d.id)}"><title id="${m}-title">${i(f)}</title><defs>${c.join("")}</defs>${z({width:t.size.width,height:t.size.height},d.background,t.theme)}${g}</svg>`;a.push({slideId:d.id,index:l,hidden:d.hidden,svg:y})}return{width:t.size.width,height:t.size.height,slides:a,warnings:o,status:0===o.length?"rendered":"rendered-with-warnings"}}async function S(i,n){return j(e(t(i)),n)}async function L(t,e){return j(t,e)}export{L as renderLayoutToSvg,S as renderPresentationToSvg};
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/rendering/text.ts"],"names":[],"mappings":"AAAA,OAAO,KA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O,EAAE,WAAW,GACnB,MAAM,CAuCR;AAgDD,wBAAgB,QAAQ,CACtB,UAAU,EAAE,uBAAuB,EAAE,EACrC,KAAK,EAAE,wBAAwB,EAC/B,OAAO,EAAE,WAAW,GACnB,MAAM,CAmDR"}
@@ -75,10 +75,12 @@ function paragraphLines(paragraph, availableWidth, scale) {
75
75
  let first = true;
76
76
  let segments = [];
77
77
  let width = 0;
78
+ let hasContent = false;
78
79
  let pendingSpace;
79
80
  const startLine = () => {
80
81
  segments = [];
81
82
  width = 0;
83
+ hasContent = false;
82
84
  if (first && bullet !== "") {
83
85
  appendSegment(segments, firstRun, bullet);
84
86
  width = textWidth(bullet, firstRun, scale);
@@ -95,8 +97,7 @@ function paragraphLines(paragraph, availableWidth, scale) {
95
97
  const space = pendingSpace === undefined || segments.length === 0 ? "" : " ";
96
98
  const maximum = first ? firstWidth : laterWidth;
97
99
  const candidateWidth = width + textWidth(space, pendingSpace ?? run, scale) + textWidth(word, run, scale);
98
- const hasText = segments.length > (first && bullet !== "" ? 1 : 0);
99
- if (hasText && candidateWidth > maximum)
100
+ if (hasContent && candidateWidth > maximum)
100
101
  finishLine();
101
102
  if (pendingSpace !== undefined && segments.length > 0) {
102
103
  appendSegment(segments, pendingSpace, " ");
@@ -105,11 +106,11 @@ function paragraphLines(paragraph, availableWidth, scale) {
105
106
  for (const character of word) {
106
107
  const characterMeasure = characterWidth(character, run, scale);
107
108
  const activeMaximum = first ? firstWidth : laterWidth;
108
- const activeHasText = segments.length > (first && bullet !== "" ? 1 : 0);
109
- if (activeHasText && width + characterMeasure > activeMaximum)
109
+ if (hasContent && width + characterMeasure > activeMaximum)
110
110
  finishLine();
111
111
  appendSegment(segments, run, character);
112
112
  width += characterMeasure;
113
+ hasContent = true;
113
114
  }
114
115
  pendingSpace = undefined;
115
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/rendering/text.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EA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C,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,eAAe,cAAc,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,4BAA4B,SAAS,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,QAAQ,CAAC;IACtI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,oDAAoD,SAAS,KAAK,OAAO,QAAQ,CAAC;AAC3F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptkit/svg-renderer",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Browser-oriented SVG preview rendering for PPTKit presentations.",
@@ -23,8 +23,8 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@pptkit/core": "0.1.3",
27
- "@pptkit/layout": "0.1.3"
26
+ "@pptkit/core": "0.1.5",
27
+ "@pptkit/layout": "0.1.5"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tsc -p tsconfig.json && node ../../scripts/build-browser-bundle.mjs @pptkit/svg-renderer",