1 linha
3,4 KiB
JavaScript
1 linha
3,4 KiB
JavaScript
import{O as x,T as $,M as I,L as B,I as C,B as O,X as S}from"./theme.Ep9al9kZ.js";import{d as r,c,o as i,n as y,j as t,b as E,a as g,H as N,k as d,t as b,r as u,p as h,e as T,_ as k,F as D,G as m,w as q}from"./framework.DTpsuxmX.js";const F={class:"markdown-alert-title"},J=r({__name:"Callout",props:{type:{type:String,required:!0},title:{type:String,required:!1}},setup(n){const e=n,s={note:{label:"NOTE",icon:C},tip:{label:"TIP",icon:B},info:{label:"INFO",icon:I},warning:{label:"WARNING",icon:$},danger:{label:"DANGER",icon:x},details:{label:"Details",icon:""}},o=e.title??s[e.type].label,l=s[e.type].icon;return(f,v)=>(i(),c("div",{class:y(`${n.type} markdown-alert`)},[t("p",F,[(i(),E(N(d(l)))),g(b(d(o)),1)]),t("p",null,[u(f.$slots,"default")])],2))}}),L=["href"],Q=r({__name:"ModrinthLink",props:{slug:{type:String,required:!0},type:{type:String,default:"mod"}},setup(n){return(e,s)=>(i(),c("a",{href:`https://modrinth.com/${n.type}/${n.slug}#download`,target:"_blank",rel:"noopener noreferrer"},[u(e.$slots,"default")],8,L))}}),M={key:0},R={class:"modal-body flex flex-col justify-center rounded-2xl"},V={class:"z-[1] h-full w-full overflow-y-auto p-3 align-middle"},W=r({__name:"Modal",props:{closable:{type:Boolean,default:!0},danger:{type:Boolean,default:!1},closeOnEsc:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},warnOnClose:{type:Boolean,default:!1},header:{default:void 0},onHide:{type:Function,default:()=>{}},onShow:{type:Function,default:()=>{}}},setup(n,{expose:e}){const s=n,o=h(!1),l=h(!1);function f(){const a=window.innerWidth-document.documentElement.clientWidth;a>0?document.body.style.paddingRight=`${a}px`:document.body.style.paddingRight=""}function v(){s.onShow(),o.value=!0,f(),document.body.style.overflow="hidden",window.addEventListener("keydown",w),setTimeout(()=>{l.value=!0},50)}function p(){s.onHide(),l.value=!1,document.body.style.overflow="",document.body.style.paddingRight="",window.removeEventListener("keydown",w),setTimeout(()=>{o.value=!1},300)}e({show:v,hide:p});function w(a){s.closeOnEsc&&a.key==="Escape"&&p()}return(a,_)=>o.value?(i(),c("div",M,[t("div",{class:y([{shown:l.value},"modal-overlay"]),onClick:_[0]||(_[0]=()=>a.closeOnClickOutside&&a.closable?p():{})},null,2),t("div",{class:y(["modal-container experimental-styles-within",{shown:l.value}])},[t("div",R,[t("div",V,[u(a.$slots,"default",{},void 0,!0)])])],2)])):T("",!0)}}),z=k(W,[["__scopeId","data-v-e42d8446"]]),A={class:"flex h-full flex-col items-center gap-6 2xl:flex-row"},G={class:"relative z-[1] w-fit max-w-full shrink-0"},H=["src"],j={class:"instructions shadow 2xl:max-h-full 2xl:content-center 2xl:overflow-x-scroll"},P=r({__name:"Component",props:{src:{type:String,required:!0},title:{type:String,default:"View detailed instructions",required:!1}},setup(n){const e=h();return(s,o)=>(i(),c(D,null,[t("button",{class:"open-button transition-colors",onClick:o[0]||(o[0]=(...l)=>e.value.show&&e.value.show(...l))},[m(d(O)),g(" "+b(n.title),1)]),m(z,{ref_key:"modal",ref:e},{default:q(()=>[t("div",A,[t("div",{class:"fixed top-0 left-0 z-0 h-full w-full",onClick:o[1]||(o[1]=(...l)=>e.value.hide&&e.value.hide(...l))}),t("div",G,[t("div",{class:"close-button",onClick:o[2]||(o[2]=(...l)=>e.value.hide&&e.value.hide(...l))},[m(d(S))]),t("img",{src:n.src,alt:"Gif demonstrating the steps listed",class:"rounded-md shadow"},null,8,H)]),t("div",j,[u(s.$slots,"default",{},void 0,!0)])])]),_:3},512)],64))}}),U=k(P,[["__scopeId","data-v-97c5fa46"]]);export{U as D,Q as _,J as a};
|