-<div class="pm-code astro-ehimbizw" data-id="pm-rpyoz2bui"> <div class="pm-header astro-ehimbizw"> <div class="pm-tabs astro-ehimbizw"> <button class="pm-tab active astro-ehimbizw" data-pm="npm">npm</button> <button class="pm-tab astro-ehimbizw" data-pm="pnpm">pnpm</button> <button class="pm-tab astro-ehimbizw" data-pm="yarn">yarn</button> <button class="pm-tab astro-ehimbizw" data-pm="bun">bun</button> </div> <button class="pm-copy astro-ehimbizw" aria-label="Copy to clipboard"> <span class="pm-copied astro-ehimbizw">Copied!</span> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="astro-ehimbizw"> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" class="astro-ehimbizw"></rect> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" class="astro-ehimbizw"></path> </svg> </button> </div> <div class="pm-content astro-ehimbizw"> <pre class="pm-pre astro-ehimbizw" data-pm="npm"><code class="astro-ehimbizw">npm install -g sentry</code></pre> <pre class="pm-pre astro-ehimbizw" data-pm="pnpm" hidden><code class="astro-ehimbizw">pnpm add -g sentry</code></pre> <pre class="pm-pre astro-ehimbizw" data-pm="yarn" hidden><code class="astro-ehimbizw">yarn global add sentry</code></pre> <pre class="pm-pre astro-ehimbizw" data-pm="bun" hidden><code class="astro-ehimbizw">bun add -g sentry</code></pre> </div> </div> <script type="module">document.querySelectorAll(".pm-code").forEach(t=>{const i=t.querySelectorAll(".pm-tab"),a=t.querySelectorAll(".pm-pre"),r=t.querySelector(".pm-copy");i.forEach(c=>{c.addEventListener("click",()=>{const o=c.getAttribute("data-pm");i.forEach(e=>e.classList.remove("active")),c.classList.add("active"),a.forEach(e=>{e.getAttribute("data-pm")===o?e.removeAttribute("hidden"):e.setAttribute("hidden","")})})}),r?.addEventListener("click",async()=>{const o=t.querySelector(".pm-pre:not([hidden])")?.querySelector("code")?.textContent||"";await navigator.clipboard.writeText(o),r.classList.add("copied"),setTimeout(()=>r.classList.remove("copied"),2e3)})});</script>
0 commit comments