@vtbag/inspection-chamber 1.0.12 → 1.0.13
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/README.md +6 -8
- package/lib/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,22 +11,20 @@ The @vtbag website can be found at https://vtbag.pages.dev/
|
|
|
11
11
|
|
|
12
12
|
## !!! News !!!
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
The Chamber now also includes improved error reporting for missing animations or corrupted keyframe definitions.
|
|
14
|
+
Names in the Animation Groups panel are now shown in the order in which the transition groups appear as children of the `::view-transition` pseudo-element. This makes it easier to understand how the individual groups overlap during rendering.
|
|
17
15
|
|
|
18
16
|
For details, see the [CHANGELOG](https://github.com/vtbag/inspection-chamber/blob/main/CHANGELOG.md)
|
|
19
17
|
|
|
20
18
|
## What happened so far:
|
|
21
19
|
|
|
22
|
-
Continuous smaller improvements, moving the Chamber closer to becoming a stable product rather than just a prototype.
|
|
23
|
-
|
|
24
|
-
Added ability to switch single animations on and off as you navigate through the timeline of view transitions. For example, you can temporarily disable fades while investigating a morph animation or disable morphing to focus on other features of your transition.
|
|
25
20
|
|
|
21
|
+
> You can now observe in real-time how CSS properties are updated by animations and easily see which other properties are applied to the pseudo-elements created by the View Transition API.
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
> Added ability to switch single animations on and off as you navigate through the timeline of view transitions. For example, you can temporarily disable fades while investigating a morph animation or disable morphing to focus on other features of your transition.
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
* Improved error reporting for missing animations or corrupted keyframe definitions.
|
|
26
|
+
* Improved opening the Chamber on mobiles.
|
|
27
|
+
* Explicit close button to the inner panel and fixes some styling issues.
|
|
30
28
|
* Better integration into same-document and cross-document transitions.
|
|
31
29
|
* Further optimizations for identifying transition elements on the screen.
|
|
32
30
|
|
package/lib/index.js
CHANGED
|
@@ -647,6 +647,7 @@
|
|
|
647
647
|
#vtbag-ui-panel {
|
|
648
648
|
flex-direction: column;
|
|
649
649
|
height: 100vh;
|
|
650
|
+
min-height: unset;
|
|
650
651
|
width: var(--vtbag-panel-width, 216px);
|
|
651
652
|
}
|
|
652
653
|
.horizontal {
|
|
@@ -898,7 +899,7 @@
|
|
|
898
899
|
[data-vtbag-transition-name] {
|
|
899
900
|
cursor: help;
|
|
900
901
|
}
|
|
901
|
-
`)}function dt(){pt(),mt()}function mt(){let t=1/Math.max(1e-6,parseFloat(top.document.querySelector("#vtbag-ui-tsf")?.innerText??"1.0"));top.__vtbag.inspectionChamber.animations?.forEach(e=>{e.playbackRate=t,e.playState==="paused"&&e.play()})}function It(){let t=top.document.querySelector("#vtbag-ui-slo-mo"),e=top.document.querySelector("#vtbag-ui-tsf");t.addEventListener("input",n=>{if(n.target instanceof HTMLInputElement){let i=(Math.exp(parseInt(n.target.value,10)/100)-100)/100+1-.14;e.innerText=`${i.toFixed(1)}`,mt()}})}function pt(){let t=top.__vtbag.inspectionChamber,e=t.longestAnimation;e&&(top.document.querySelector("#vtbag-ui-slo-mo-progress").innerText=` ${~~(e.currentTime??0)} / ${t.animationEndTime} ms`,v()&&top.setTimeout(pt,20))}var vt=[],ne=["top","left","right","bottom"];var At;function Ct(t){At??=ie();let e=[];return e.push("inset"),vt.forEach(n=>{t.getPropertyValue(n)!==At[n]&&e.push(n)}),e.filter(n=>!(n.startsWith("inset-")||n.startsWith("animation-")||ne.includes(n)))}function ie(){let t=top.document.createElement("div");top.document.body.appendChild(t);let e=top.getComputedStyle(t),n={};for(let i=0;i<e.length;i++){let o=e.item(i);vt.push(o),n[o]=e.getPropertyValue(o)}return top.document.body.removeChild(t),n}function bt(t,e,n,i,o){let a=e.createElement("vtbag-pseudo-twin");d(a,t,"::view-transition","");let l=top.__vtbag.inspectionChamber.twin=a.firstElementChild;n.forEach(s=>{let c=d(l,t,"group",s),u=d(c,t,"image-pair",s);d(u,t,"old",s)&&i.add(s),d(u,t,"new",s)&&o.add(s)}),e.body.insertAdjacentElement("beforeend",l);function d(s,c,u,g){if(!s){console.error("[inspection chamber] Works not as expected ;-)");return}let I=top.__vtbag.inspectionChamber,r=s.ownerDocument,p=c.defaultView,A=g?`::view-transition-${u}(${g})`:u,b=p.getComputedStyle(c.documentElement,A);if(!b.height.endsWith("px"))return;I?.styleMap.set(g?`${u}-${g}`:u,b);let C=r.createElement("vtbag-pseudo-twin");return C.id=oe(g,u),C.dataset.vtbagTransitionName=g,C.dataset.vtbagTransitionPseudo=u,s.insertAdjacentElement("beforeend",C),yt(b,C.style),C.style.visibility="hidden",C}}function oe(t,e){return t?`vtbag-twin--view-transition-${e}-${t}`:"vtbag-twin--view-transition"}async function Mt(t){top.document.documentElement.classList.add("vtbag-twin-sync");let e=top.__vtbag.inspectionChamber,n=e.frameDocument.documentElement;for(let i of[...e.twin.children]){let o=i.dataset.vtbagTransitionName;t.has(o)||(W(i,o),W(i.children[0],o),W(i.children[0].children[0],o),W(i.children[0].children[1],o),await new Promise(a=>self.setTimeout(a)))}top.document.documentElement.classList.remove("vtbag-twin-sync")}function W(t,e){if(!t)return;let n=t.dataset.vtbagTransitionPseudo,i=top.__vtbag.inspectionChamber.styleMap.get(`${n}-${e}`),o=t.style;yt(i,o)}function yt(t,e){e.position=t.position,e.inset=t.inset,e.height=t.height,e.width=t.width,e.transform=t.transform,e.zIndex=t.zIndex,e.transformOrigin=t.transformOrigin,e.perspective=t.perspective}function ht(t){if(v()){let e,n=1/0;top.__vtbag.inspectionChamber.twin.querySelectorAll("vtbag-pseudo-twin > vtbag-pseudo-twin > vtbag-pseudo-twin > vtbag-pseudo-twin").forEach(i=>{let{clientX:o,clientY:a}=t,{top:l,bottom:d,left:s,right:c,width:u,height:g}=i.getBoundingClientRect(),I=i.dataset.vtbagTransitionName,r=i.dataset.vtbagTransitionPseudo;if(u&&g&&u*g<n&&l<=a&&a<=d&&s<=o&&o<=c){let p=!0,A;window.top.document.querySelectorAll("#vtbag-ui-names li").forEach(b=>{b.innerText===I&&(A=b,b.classList.contains(`${r}-hidden`)&&(p=!1))}),p&&(n=u*g,e=A)}}),e?.click()}}function P(){top.document.querySelector('#vtbag-ui-filter input[type="text"]').value="",top.document.querySelector("#vtbag-ui-filter ul input").click(),Z()}function ft(){top.document.querySelectorAll("#vtbag-ui-names li").forEach(t=>t.classList.remove("selected","old-hidden","new-hidden")),S(),wt(),O()}function Lt(){top.document.querySelector("#vtbag-ui-filter ul").addEventListener("change",Z),top.document.querySelector('#vtbag-ui-filter input[type="text"]').addEventListener("input",Z),top.document.querySelector("#vtbag-ui-filter button").addEventListener("click",P)}var Et=500;function Y(t,e,n){return h(()=>{top.document.querySelector("#vtbag-ui-info").innerHTML="",top.document.querySelectorAll("#vtbag-ui-names li").forEach(o=>o.remove()),top.document.querySelector("#vtbag-ui-names h4").innerText=
|
|
902
|
+
`)}function dt(){pt(),mt()}function mt(){let t=1/Math.max(1e-6,parseFloat(top.document.querySelector("#vtbag-ui-tsf")?.innerText??"1.0"));top.__vtbag.inspectionChamber.animations?.forEach(e=>{e.playbackRate=t,e.playState==="paused"&&e.play()})}function It(){let t=top.document.querySelector("#vtbag-ui-slo-mo"),e=top.document.querySelector("#vtbag-ui-tsf");t.addEventListener("input",n=>{if(n.target instanceof HTMLInputElement){let i=(Math.exp(parseInt(n.target.value,10)/100)-100)/100+1-.14;e.innerText=`${i.toFixed(1)}`,mt()}})}function pt(){let t=top.__vtbag.inspectionChamber,e=t.longestAnimation;e&&(top.document.querySelector("#vtbag-ui-slo-mo-progress").innerText=` ${~~(e.currentTime??0)} / ${t.animationEndTime} ms`,v()&&top.setTimeout(pt,20))}var vt=[],ne=["top","left","right","bottom"];var At;function Ct(t){At??=ie();let e=[];return e.push("inset"),vt.forEach(n=>{t.getPropertyValue(n)!==At[n]&&e.push(n)}),e.filter(n=>!(n.startsWith("inset-")||n.startsWith("animation-")||ne.includes(n)))}function ie(){let t=top.document.createElement("div");top.document.body.appendChild(t);let e=top.getComputedStyle(t),n={};for(let i=0;i<e.length;i++){let o=e.item(i);vt.push(o),n[o]=e.getPropertyValue(o)}return top.document.body.removeChild(t),n}function bt(t,e,n,i,o){let a=e.createElement("vtbag-pseudo-twin");d(a,t,"::view-transition","");let l=top.__vtbag.inspectionChamber.twin=a.firstElementChild;n.forEach(s=>{let c=d(l,t,"group",s),u=d(c,t,"image-pair",s);d(u,t,"old",s)&&i.add(s),d(u,t,"new",s)&&o.add(s)}),e.body.insertAdjacentElement("beforeend",l);function d(s,c,u,g){if(!s){console.error("[inspection chamber] Works not as expected ;-)");return}let I=top.__vtbag.inspectionChamber,r=s.ownerDocument,p=c.defaultView,A=g?`::view-transition-${u}(${g})`:u,b=p.getComputedStyle(c.documentElement,A);if(!b.height.endsWith("px"))return;I?.styleMap.set(g?`${u}-${g}`:u,b);let C=r.createElement("vtbag-pseudo-twin");return C.id=oe(g,u),C.dataset.vtbagTransitionName=g,C.dataset.vtbagTransitionPseudo=u,s.insertAdjacentElement("beforeend",C),yt(b,C.style),C.style.visibility="hidden",C}}function oe(t,e){return t?`vtbag-twin--view-transition-${e}-${t}`:"vtbag-twin--view-transition"}async function Mt(t){top.document.documentElement.classList.add("vtbag-twin-sync");let e=top.__vtbag.inspectionChamber,n=e.frameDocument.documentElement;for(let i of[...e.twin.children]){let o=i.dataset.vtbagTransitionName;t.has(o)||(W(i,o),W(i.children[0],o),W(i.children[0].children[0],o),W(i.children[0].children[1],o),await new Promise(a=>self.setTimeout(a)))}top.document.documentElement.classList.remove("vtbag-twin-sync")}function W(t,e){if(!t)return;let n=t.dataset.vtbagTransitionPseudo,i=top.__vtbag.inspectionChamber.styleMap.get(`${n}-${e}`),o=t.style;yt(i,o)}function yt(t,e){e.position=t.position,e.inset=t.inset,e.height=t.height,e.width=t.width,e.transform=t.transform,e.zIndex=t.zIndex,e.transformOrigin=t.transformOrigin,e.perspective=t.perspective}function ht(t){if(v()){let e,n=1/0;top.__vtbag.inspectionChamber.twin.querySelectorAll("vtbag-pseudo-twin > vtbag-pseudo-twin > vtbag-pseudo-twin > vtbag-pseudo-twin").forEach(i=>{let{clientX:o,clientY:a}=t,{top:l,bottom:d,left:s,right:c,width:u,height:g}=i.getBoundingClientRect(),I=i.dataset.vtbagTransitionName,r=i.dataset.vtbagTransitionPseudo;if(u&&g&&u*g<n&&l<=a&&a<=d&&s<=o&&o<=c){let p=!0,A;window.top.document.querySelectorAll("#vtbag-ui-names li").forEach(b=>{b.innerText===I&&(A=b,b.classList.contains(`${r}-hidden`)&&(p=!1))}),p&&(n=u*g,e=A)}}),e?.click()}}function P(){top.document.querySelector('#vtbag-ui-filter input[type="text"]').value="",top.document.querySelector("#vtbag-ui-filter ul input").click(),Z()}function ft(){top.document.querySelectorAll("#vtbag-ui-names li").forEach(t=>t.classList.remove("selected","old-hidden","new-hidden")),S(),wt(),O()}function Lt(){top.document.querySelector("#vtbag-ui-filter ul").addEventListener("change",Z),top.document.querySelector('#vtbag-ui-filter input[type="text"]').addEventListener("input",Z),top.document.querySelector("#vtbag-ui-filter button").addEventListener("click",P)}var Et=500;function Y(t,e,n){return h(()=>{top.document.querySelector("#vtbag-ui-info").innerHTML="",top.document.querySelectorAll("#vtbag-ui-names li").forEach(o=>o.remove()),top.document.querySelector("#vtbag-ui-names h4").innerText=e?"Animation Groups":"Elements w/ View Transition Names",top.document.querySelector("#vtbag-ui-names div").style.display=e?"flex":"none";let i=top.document.querySelector("#vtbag-ui-names > ol");(e?n:[...t].sort()).forEach((o,a)=>{let l=top.document.createElement("li");l.innerText=o,e&&t.has(o)&&l.classList.add("old"),e?.has(o)&&l.classList.add("new"),l.style.viewTransitionName=`vtbag-name-${a}`,i.appendChild(l)}),top.document.querySelector("#vtbag-ui-filter ul").style.display=e?"block":"none",Z()},"update names"),n}function Z(){let t=top.document.querySelectorAll("#vtbag-ui-names li"),e=top.document.querySelector("#vtbag-ui-filter ul input:checked").id.replace("vtbag-c-",""),n=top.document.querySelector('#vtbag-ui-filter input[type="text"]').value;h(()=>{t.forEach(i=>{let o=i.style,a=i.classList,l=i.innerText;o.display=(n===""||l.includes(n))&&(e==="all"||e==="both"&&a.contains("new")&&a.contains("old")||e==="old-only"&&a.contains("old")&&!a.contains("new")||e==="new-only"&&a.contains("new")&&!a.contains("old")||e==="old"&&a.contains("old")||e==="new"&&a.contains("new"))?"list-item":"none"})},"refresh names")}async function G(){if(!v())return;let e=top.__vtbag.inspectionChamber.twin.ownerDocument,n=top.document,i=top.getComputedStyle(n.documentElement),o=n.documentElement.classList.contains("vtbag-ui-column"),a=o?parseFloat(i.getPropertyValue("--vtbag-panel-width")||"0"):0,l=o?0:parseFloat(i.getPropertyValue("--vtbag-panel-height")||"0"),d=n.querySelectorAll("#vtbag-ui-names li"),s=new Set;d.forEach(c=>{c.classList.contains("old-hidden")&&c.classList.contains("new-hidden")&&s.add(c.innerText)}),await Mt(s),d.forEach(c=>{let u=c.innerText,g=c.classList;g[g.contains("old")&&Tt(e.querySelector(`#vtbag-twin--view-transition-old-${u}`),a,l)===!1?"add":"remove"]("old-invisible"),g[g.contains("new")&&Tt(e.querySelector(`#vtbag-twin--view-transition-new-${u}`),a,l)===!1?"add":"remove"]("new-invisible"),g[(!g.contains("old")||g.contains("old-invisible"))&&(!g.contains("new")||g.contains("new-invisible"))?"add":"remove"]("invisible")})}function Tt(t,e=0,n=0){if(!t)return;let{top:i,right:o,bottom:a,left:l,width:d,height:s}=t.getBoundingClientRect();return!1,d>0&&s>0&&i<window.top.innerHeight-n&&a>0&&l<window.top.innerWidth-e&&o>0}function S(){let t=[];top.document.querySelectorAll("#vtbag-ui-names li").forEach(e=>{let n=e.innerText,i=e.classList,o=!1;i.contains("old-hidden")&&(o=!0,t.push(`::view-transition-old(${n}) { visibility: hidden; }`)),i.contains("new-hidden")&&(t.push(`::view-transition-new(${n}) { visibility: hidden; }`),o&&t.push(`::view-transition-group(${n}) { visibility: hidden; }`))}),L(t.join(`
|
|
902
903
|
`),"image-visibility"),f()}function ae(t){let e=y()==="full-control"&&v(),n=top.document.querySelectorAll("#vtbag-ui-names li"),i,o=top.document.querySelector("#vtbag-ui-controller"),a=top.document.querySelector("#vtbag-ui-progress"),l=top.document.querySelector("#vtbag-ui-controller2"),d=top.document.querySelector("#vtbag-ui-progress2");n.forEach(s=>{s.innerText===t?(s.classList.contains("selected")?(l.value=o.value,d.innerText=a.innerText):(o.value=l.value,a.innerText=d.innerText),s.classList[e?"toggle":"add"]("selected"),i=s,s.style.display==="none"&&P()):e||s.classList.remove("selected")}),i&&i.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})}function ge(t){let e=top.document.querySelector("#vtbag-ui-info");if(t&&!v())navigator.clipboard.writeText(`inspect(top.document.querySelector("#vtbag-main-frame").contentDocument.querySelector("${St(t)}"))`),e.innerHTML=`<h4>Info</h4>
|
|
903
904
|
<p>DevTools selector '<b><code>${St(t)}</code></b>' copied to clipboard. Paste to DevTools console to further inspect the element.</p>`;else{navigator.clipboard.writeText('inspect(top.document.querySelector("#vtbag-main-frame").contentDocument.querySelector(":root"))');let n=t&&t.dataset.vtbagTransitionName;e.innerHTML=`<h4>Info</h4>
|
|
904
905
|
<p>DevTools selector '<b><code>:root</code></b>' copied to clipboard. Paste to DevTools console, then expand the <code><html></code> element and its <code>::view-transition</code> pseudo element.</p>${n&&"<p>Look for the <code>::view-transition-group("+n+")</code> pseudo element and its children.</p>"}`}T(e)}function St(t,e=!0){let n=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;){let i=t.nodeName.toLowerCase();if(e&&t.id){i="#"+t.id,n.unshift(i);break}else{let o=t,a=1;for(;o=o.previousElementSibling;)o.nodeName.toLowerCase()===i&&a++;a!==1&&(i+=":nth-of-type("+a+")")}n.unshift(i),t=t.parentNode}return n.join(" > ")}function Nt(){let t=e=>{let n=e+"-hidden",o=[...top.document.querySelectorAll("#vtbag-ui-names li")].filter(l=>l.classList.contains(e)),a=o.length>0&&o[0].classList.contains(n)?"remove":"add";o.forEach(l=>l.classList[a](n)),S()};top.document.querySelector("#vtbag-ui-names button").addEventListener("click",()=>ft()),top.document.querySelector("#vtbag-ui-names-old").addEventListener("click",()=>t("old")),top.document.querySelector("#vtbag-ui-names-new").addEventListener("click",()=>t("new")),top.document.querySelector("#vtbag-ui-names ol").addEventListener("click",e=>{let n=!e.isTrusted;if(e.target instanceof HTMLElement){let i=e.target.closest("li");if(i&&e instanceof PointerEvent){i.style.display==="none"&&P();let o=y();h(()=>{let{left:a,width:l}=i.getBoundingClientRect(),d=e.clientX-a,s=!n&&d>=0&&d<=20,c=!n&&d>=l-20&&d<=l,u=i.classList;if(s&&u.contains("old")){u.toggle("old-hidden"),S();return}if(c&&u.contains("new")){u.toggle("new-hidden"),S();return}let g=i.innerText;!n&&re(g),ae(g);let I=window.top.__vtbag.inspectionChamber?.frameDocument.querySelector(`[data-vtbag-transition-name="${g}"]`);o&&o!=="bypass"&&ge(I),v()&&B(g)},"names",!0)}}O()})}var xt=[{boxShadow:"inset 0 0 50px darkslateblue"},{boxShadow:"inset 0 0 0px darkslateblue"},{boxShadow:"0 0 50px darkslateblue"},{boxShadow:"0 0 100px darkslateblue",display:"inline-block",minWidth:"20px",minHeight:"20px",backgroundColor:"darkslateblue",opacity:"0.5"},{boxShadow:"0 0 50px darkslateblue"},{boxShadow:"0 0 0px darkslateblue"},{boxShadow:"inset 0 0 50px darkslateblue"}];function re(t){if(v())le(t);else{let e=top.__vtbag.inspectionChamber,n=e.frameDocument.querySelector(`[data-vtbag-transition-name="${t}"]`);if(n){n.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"});let i=self.getComputedStyle(n).display;xt[3].display=i.includes("block")?i:"inline-block",e.glow=n.animate(xt,{duration:500,iterations:1}),self.setTimeout(()=>e.glow=void 0,500)}}}function le(t){L(`
|
|
@@ -925,7 +926,7 @@
|
|
|
925
926
|
::view-transition-image-pair(*) {
|
|
926
927
|
animation: vtbag-twin-noop forwards;
|
|
927
928
|
animation-duration: inherit;
|
|
928
|
-
}`,"catch",void 0,!0)}async function zt(){let t=top.__vtbag.inspectionChamber,e=t.frameDocument,n=t.animations=[],i=t.keyframesMap=new Map,o=new Set;t.styleMap=new Map;let a=new WeakSet,l=!0,d=!1;for(;l;)l=!1,e.getAnimations().forEach(g=>{if(g.effect?.pseudoElement?.startsWith("::view-transition")){let{pseudoName:I,viewTransitionName:r}=J(g);if(!a.has(g)){let p=g instanceof CSSAnimation?g.animationName:void 0,A=g instanceof CSSTransition?g.transitionProperty:void 0;A?console.warn("[inspection-chamber] Unhandled transition:",r,I,A):p?(g.pause(),g.currentTime=0,r&&I==="image-pair"&&o.add(r),!r&&I==="::view-transition"&&(d=!0),p==="vtbag-twin-noop"?g.cancel():(n.push(g),i.set(p,g.effect?.getKeyframes()))):console.warn("[inspection-chamber] Unhandled animation:",r,I,g.constructor.name),l=!0}a.add(g)}}),l&&await new Promise(g=>e.defaultView.setTimeout(g)),d&&console.warn("[inspection-chamber] Root root animation detected");let s=g=>g.effect?.getComputedTiming().endTime?.valueOf()??0;n.length>0?(t.longestAnimation=n.reduce((g,I)=>s(I)>s(g)?I:g),t.animationEndTime=~~s(t.longestAnimation)):(t.longestAnimation=void 0,t.animationEndTime=0);let c=new Set,u=new Set;bt(e,e,o,c,u),Y(
|
|
929
|
+
}`,"catch",void 0,!0)}async function zt(){let t=top.__vtbag.inspectionChamber,e=t.frameDocument,n=t.animations=[],i=t.keyframesMap=new Map,o=new Set;t.styleMap=new Map;let a=new WeakSet,l=!0,d=!1;for(;l;)l=!1,e.getAnimations().forEach(g=>{if(g.effect?.pseudoElement?.startsWith("::view-transition")){let{pseudoName:I,viewTransitionName:r}=J(g);if(!a.has(g)){let p=g instanceof CSSAnimation?g.animationName:void 0,A=g instanceof CSSTransition?g.transitionProperty:void 0;A?console.warn("[inspection-chamber] Unhandled transition:",r,I,A):p?(g.pause(),g.currentTime=0,r&&I==="image-pair"&&o.add(r),!r&&I==="::view-transition"&&(d=!0),p==="vtbag-twin-noop"?g.cancel():(n.push(g),i.set(p,g.effect?.getKeyframes()))):console.warn("[inspection-chamber] Unhandled animation:",r,I,g.constructor.name),l=!0}a.add(g)}}),l&&await new Promise(g=>e.defaultView.setTimeout(g)),d&&console.warn("[inspection-chamber] Root root animation detected");let s=g=>g.effect?.getComputedTiming().endTime?.valueOf()??0;n.length>0?(t.longestAnimation=n.reduce((g,I)=>s(I)>s(g)?I:g),t.animationEndTime=~~s(t.longestAnimation)):(t.longestAnimation=void 0,t.animationEndTime=0);let c=new Set,u=new Set;bt(e,e,o,c,u),Y(c,u,o)}function kt(){let t=top.__vtbag.inspectionChamber;t.frameDocument.querySelector("#vtbag-adopted-sheet")?.remove(),t.animations?.forEach(n=>{try{n.finish()}catch(i){console.error(i,n,n.effect?.getComputedTiming())}})}var H=(t,e)=>e?`<tr><td style="text-align:right">${t}</td><td><tt><b>${e}</b></tt></td><tr>`:"";function B(t){let e=new Set,n=["offset","computedOffset","easing","composite"],i=top.__vtbag.inspectionChamber,o=i.styleMap,a=top.document.querySelector("#vtbag-ui-animations");a.innerHTML=v()?`<h4 data-vtbag-name=${t}>Animations of ${t}:</h4>`+l("group")+l("image-pair")+l("old")+l("new"):"",a.querySelectorAll('input[type="checkbox"]').forEach(c=>{let u=JSON.parse(c.dataset.vtbagContext);c.removeAttribute("data-vtbag-context"),c.checked=Zt(t,u.pseudo,u.idx)?.playState==="paused",c.addEventListener("change",()=>{se(t,u.pseudo,u.idx,c.checked)||(c.checked=!c.checked)})}),a.querySelectorAll("[data-vtbag-snapshot]").forEach(c=>c.addEventListener("toggle",Dt)),q(),Dt(),T(a);function l(c){let u=[],g=o.get(`${c}-${t}`),I=g?.animation,r=g?.animationName;if(e.clear(),r&&r!=="vtbag-twin-noop"&&r!=="none"){let A=r.split(", "),b=0;I.split(/,(?![^(]*\))/).forEach((C,D)=>{i.keyframesMap?.get(A[D])?u.push(`<details><summary><input type="checkbox" data-vtbag-context='{"pseudo":"${c}","idx":${D-b}}'/> ${c}: <tt>${A[D]}</tt></summary>${p(A[D],C.endsWith(r)?C.slice(0,-r.length):C)}</details>`):(u.push(`<span style="padding-right: 0.25ex; width: 4.75ex; display: inline-block; text-align:right">\u26A0\uFE0F</span> ${c}: keyframes <tt>${A[D]}</tt> not found.<br>`),++b)}),e.size>0&&u.push(`<details data-vtbag-live-values="${c+","+[...e].sort().join(",")}"><summary> \u{1F300}  ${c}: live values</summary></details>`)}return g&&u.push(`<details data-vtbag-snapshot="${c}"><summary> \u{1F4F8} ${c}: CSS snapshot</summary></details>`),u.length>0?u.join("")+"<hr>":"";function p(A,b){let C=d(A)||"\u26A0\uFE0F no properties? ";return`
|
|
929
930
|
<table>
|
|
930
931
|
${H("animation:",b)}
|
|
931
932
|
${H("animates:",C)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtbag/inspection-chamber",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "The Inspection Chamber is an in-browser development tool that gives you all the knobs and dials to interactively put your view transitions through their paces.",
|
|
6
6
|
"files": [
|