pptx-vanilla-viewer 2.20.0 → 2.20.1
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.
- package/CHANGELOG.md +26 -0
- package/dist/{ai-panel-IN6E4Z5J.js → ai-panel-DXOWT5WS.js} +1 -1
- package/dist/{ai-panel-VKD2JXGJ.cjs → ai-panel-FYYTOC2Z.cjs} +1 -1
- package/dist/{chunk-AXNQDK66.js → chunk-2I2PRXFE.js} +1 -1
- package/dist/{chunk-JRTWZLGR.cjs → chunk-5RJHV5EN.cjs} +8 -8
- package/dist/{chunk-U5SRWCRQ.cjs → chunk-ASQTGNGW.cjs} +145 -145
- package/dist/{chunk-MWXGUAIV.js → chunk-HY6UC63S.js} +145 -145
- package/dist/{chunk-ILKFMBKG.cjs → chunk-L7647UXQ.cjs} +3 -3
- package/dist/{chunk-5STWBP74.js → chunk-YHZRBVGO.js} +3 -3
- package/dist/i18n/de.cjs +4 -0
- package/dist/i18n/de.mjs +4 -0
- package/dist/i18n/es.cjs +4 -0
- package/dist/i18n/es.mjs +4 -0
- package/dist/i18n/fr.cjs +4 -0
- package/dist/i18n/fr.mjs +4 -0
- package/dist/i18n/zh-CN.cjs +4 -0
- package/dist/i18n/zh-CN.mjs +4 -0
- package/dist/index.cjs +11 -11
- package/dist/index.js +2 -2
- package/dist/internals.cjs +1 -1
- package/dist/internals.js +1 -1
- package/dist/transition-overlay-CYBb6qda.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ A release listed with no entries carried no Conventional Commit in this package'
|
|
|
7
7
|
scope: scripts/release-plan.mjs re-releases a package whenever any of its files
|
|
8
8
|
change, not only on conventional ones.
|
|
9
9
|
|
|
10
|
+
## [2.20.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@2.20.0) - 2026-09-17
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **shared:** Chart quick-actions descriptor (Elements/Styles/Filters) (by @ChristopherVR) ([90ea1ff](https://github.com/ChristopherVR/pptx-viewer/commit/90ea1ffeff956f7401c6edd2123d92e5f3065e2d))
|
|
15
|
+
- **react,shared:** Chart quick-action icons (Elements/Styles/Filters) (by @ChristopherVR) ([4c9f9e7](https://github.com/ChristopherVR/pptx-viewer/commit/4c9f9e79a20f92ca77fd40208007a0b8f1ecc044))
|
|
16
|
+
- **vanilla:** Chart quick-action icons (Elements/Styles/Filters) (by @ChristopherVR) ([1195c36](https://github.com/ChristopherVR/pptx-viewer/commit/1195c36963edfe3db2fa705bcee66b279d66a4cc))
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **shared:** Scale chart auto axis bounds by plot height, not a fixed constant (by @ChristopherVR) ([fc56a8a](https://github.com/ChristopherVR/pptx-viewer/commit/fc56a8afc70f7e0109be712b19b0d7e34a3b31a1))
|
|
21
|
+
- **shared:** Cycle PowerPoint's automatic marker-symbol sequence per series idx (by @ChristopherVR) ([f55afb4](https://github.com/ChristopherVR/pptx-viewer/commit/f55afb45ad0533a5370bff27f0ba80e33e22eff2))
|
|
22
|
+
- **shared:** Honor a chart-level default legend text style (by @ChristopherVR) ([1807bd3](https://github.com/ChristopherVR/pptx-viewer/commit/1807bd30d2f1961f8ad58478cf8066cabfd11d31))
|
|
23
|
+
- **vanilla:** Retain inline focus during peer updates (by @Sudhansh6) ([a9a7548](https://github.com/ChristopherVR/pptx-viewer/commit/a9a75485c08f46dc6a5187371bafcac766cd512c))
|
|
24
|
+
- **core:** Treat a bare c:majorGridlines/minorGridlines as present (by @ChristopherVR) ([2e06cee](https://github.com/ChristopherVR/pptx-viewer/commit/2e06ceeb007873d7960c982e3454267b9e530173))
|
|
25
|
+
- **shared:** Clear per-series colour overrides when applying a chart style preset (by @ChristopherVR) ([1417f28](https://github.com/ChristopherVR/pptx-viewer/commit/1417f28060858b7a490f9bc33773fa3eb4e1e462))
|
|
26
|
+
- **react,vue,angular,svelte,vanilla:** Use opaque colours for chart quick-action buttons (by @ChristopherVR) ([9d1df11](https://github.com/ChristopherVR/pptx-viewer/commit/9d1df116b2e8959fe97ad12865f694e1c5f8316d))
|
|
27
|
+
- **shared:** Stop the Chart Filters list and series order reshuffling on toggle (by @ChristopherVR) ([4a9546f](https://github.com/ChristopherVR/pptx-viewer/commit/4a9546fa6b17a7d8952cde345ad38d67ad54f509))
|
|
28
|
+
- **core,shared:** Preserve series formatting across a Chart Filters hide/restore round trip (by @ChristopherVR) ([6555181](https://github.com/ChristopherVR/pptx-viewer/commit/6555181fea70e6c80fa079c1866c6aa8c8ec97cb))
|
|
29
|
+
- **core:** Make editor ids collision-free within a process (by @ChristopherVR) ([04a61a0](https://github.com/ChristopherVR/pptx-viewer/commit/04a61a096b48fee63c433fac5b5d6690734cbc44))
|
|
30
|
+
|
|
31
|
+
### Testing
|
|
32
|
+
|
|
33
|
+
- **core:** Register the missing chart-stacked-line-markers fixture in the corpus manifest (by @ChristopherVR) ([2d7c886](https://github.com/ChristopherVR/pptx-viewer/commit/2d7c88618042dac64e60c09c827b73b409976f1f))
|
|
34
|
+
- **core:** Register the stacked line marker fixture (by @Sudhansh6) ([87a8423](https://github.com/ChristopherVR/pptx-viewer/commit/87a8423047db0df204b8db2d8c155624bb190d26))
|
|
35
|
+
|
|
10
36
|
## [2.19.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@2.19.2) - 2026-09-17
|
|
11
37
|
|
|
12
38
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-5STWBP74.js';import'./chunk-MWXGUAIV.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
|
|
1
|
+
import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-YHZRBVGO.js';import'./chunk-HY6UC63S.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkJRTWZLGR_cjs=require('./chunk-JRTWZLGR.cjs');require('./chunk-U5SRWCRQ.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkJRTWZLGR_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkJRTWZLGR_cjs.j(p,o.getSlides())){let b=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkJRTWZLGR_cjs.k(p,o.getSlides());if(d){let r=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkJRTWZLGR_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkJRTWZLGR_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkJRTWZLGR_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkJRTWZLGR_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkJRTWZLGR_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkJRTWZLGR_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkJRTWZLGR_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkJRTWZLGR_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkJRTWZLGR_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkJRTWZLGR_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkJRTWZLGR_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkJRTWZLGR_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkJRTWZLGR_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-tool"),p=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkJRTWZLGR_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkJRTWZLGR_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkJRTWZLGR_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkJRTWZLGR_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkJRTWZLGR_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkJRTWZLGR_cjs.r(t.input);if(g){let f=chunkJRTWZLGR_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkJRTWZLGR_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkJRTWZLGR_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkJRTWZLGR_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkJRTWZLGR_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkJRTWZLGR_cjs.K(o,h?"comment":"sparkles"));let m=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkJRTWZLGR_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkJRTWZLGR_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkJRTWZLGR_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkJRTWZLGR_cjs.w(o,"li");g.textContent=chunkJRTWZLGR_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkJRTWZLGR_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkJRTWZLGR_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkJRTWZLGR_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkJRTWZLGR_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkJRTWZLGR_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-header"),h=chunkJRTWZLGR_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkJRTWZLGR_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkJRTWZLGR_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkJRTWZLGR_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkJRTWZLGR_cjs.w(t,"form","pptxv-ai-composer"),d=chunkJRTWZLGR_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkJRTWZLGR_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkJRTWZLGR_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkJRTWZLGR_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkJRTWZLGR_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkJRTWZLGR_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkJRTWZLGR_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
|
|
1
|
+
'use strict';var chunk5RJHV5EN_cjs=require('./chunk-5RJHV5EN.cjs');require('./chunk-ASQTGNGW.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunk5RJHV5EN_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunk5RJHV5EN_cjs.j(p,o.getSlides())){let b=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunk5RJHV5EN_cjs.k(p,o.getSlides());if(d){let r=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunk5RJHV5EN_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunk5RJHV5EN_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunk5RJHV5EN_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunk5RJHV5EN_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-history-head"),x=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunk5RJHV5EN_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-history-body"),m=chunk5RJHV5EN_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunk5RJHV5EN_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunk5RJHV5EN_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunk5RJHV5EN_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunk5RJHV5EN_cjs.w(t,"li","pptxv-ai-history-row"),r=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-history-text"),k=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunk5RJHV5EN_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunk5RJHV5EN_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunk5RJHV5EN_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-tool"),p=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunk5RJHV5EN_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunk5RJHV5EN_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunk5RJHV5EN_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunk5RJHV5EN_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunk5RJHV5EN_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunk5RJHV5EN_cjs.r(t.input);if(g){let f=chunk5RJHV5EN_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunk5RJHV5EN_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunk5RJHV5EN_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunk5RJHV5EN_cjs.f(a);if(x.length===0&&!h)continue;let c=chunk5RJHV5EN_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunk5RJHV5EN_cjs.K(o,h?"comment":"sparkles"));let m=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunk5RJHV5EN_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunk5RJHV5EN_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunk5RJHV5EN_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunk5RJHV5EN_cjs.w(o,"li");g.textContent=chunk5RJHV5EN_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunk5RJHV5EN_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunk5RJHV5EN_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunk5RJHV5EN_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunk5RJHV5EN_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunk5RJHV5EN_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-header"),h=chunk5RJHV5EN_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunk5RJHV5EN_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunk5RJHV5EN_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunk5RJHV5EN_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunk5RJHV5EN_cjs.w(t,"form","pptxv-ai-composer"),d=chunk5RJHV5EN_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunk5RJHV5EN_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunk5RJHV5EN_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunk5RJHV5EN_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunk5RJHV5EN_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunk5RJHV5EN_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunk5RJHV5EN_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {yc,Jh,cm,Mh,Nh,Hh,lg,kg,mg,Gr,fd,ig,jg}from'./chunk-
|
|
1
|
+
import {yc,Jh,cm,Mh,Nh,Hh,lg,kg,mg,Gr,fd,ig,jg}from'./chunk-HY6UC63S.js';var R="data-pptx-text-style-override";function z(n,o,r){Gr(n.ownerDocument,o,r?.textStyle);let a=fd(o,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let o=n.createElement("style");o.id=w,o.textContent=`${yc}
|
|
2
2
|
${Jh}
|
|
3
3
|
${cm}`,(n.head??n.documentElement).appendChild(o);}function X(n,o){let r=n.getElementById(k);if(!o){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=o;}function Z(n,o,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let i=o.get(t);e.style.animation=i?.cssAnimation??"",e.style.visibility=i?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,i);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let i=o.get(t);e.style.animation=i?.cssAnimation??"",e.style.visibility=i?.visible===false?"hidden":"";});}function M(n,o,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let i of r.fragments)t.appendChild(B(n,o,r,i));return t}function B(n,o,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,i]of Object.entries(a.vars))e.style.setProperty(t,i);return e.appendChild(o.cloneNode(true)),e}function u(n,o,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(o),t}function T(n,o){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(o),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let i=e;i&&i!==n;)a.add(i),i=i.parentElement;for(let i of e.querySelectorAll("[data-element-id]"))a.add(i);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,o,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let i=n.createElement("div");i.dataset.pptxMorphCrossfade=e.incoming.id,i.style.cssText=ig,i.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=jg,d};return i.append(m(o.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),i})}function se(n){let{doc:o,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(o);let i=Mh(t),m=Nh(t),p=Hh(t.type,m,t.direction,t.spokes,t.pattern),l=o.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?lg(n.outgoingSlide,n.incomingSlide,m,kg(t.morphOption)):void 0,y=s||i.outgoingOnTop?2:1,g=s||i.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(o,a,p.outgoing,y,"outgoing"):u(o,a,y,s?"none":i.outgoing,"outgoing"),x=!s&&p?.incoming?M(o,e,p.incoming,g,"incoming"):u(o,e,g,s?"none":i.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(o,S,3,"none","lifted"):void 0,$=q(o,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=o.createElement("style");c.textContent=[mg(s,"data-pptx-morph-incoming","incoming"),mg(s,"data-pptx-morph-outgoing","outgoing"),mg(s,"data-pptx-morph-lifted","lifted")].join(`
|
|
4
4
|
`),l.appendChild(c);}l.append(d,x),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(G),l.remove(),n.onDone());},G=setTimeout(v,Math.max(0,m)+50);return v}export{K as a,X as b,Z as c,se as d};
|