fuc-new/doc/node_modules/@vuepress/plugin-photo-swipe/lib/client/index.js
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

3 lines
1018 B
JavaScript

import{useEventListener as a}from"@vueuse/core";import{s as p,L as c,r as m}from"./usePhotoSwipe-w7wkUXvx.js";import{d as L,i as O,u as x,a as D}from"./usePhotoSwipe-w7wkUXvx.js";import"@vuepress/helper/client";import"vue";import"vuepress/client";import"photoswipe/dist/photoswipe.css";import"./styles/photo-swipe.css";const u=(t,i=null)=>{const r=t.map(o=>({html:c,msrc:o}));return t.forEach((o,s)=>{m(o).then(n=>{r.splice(s,1,n),i?.refreshSlideContent(s)})}),r},d=async(t,{scrollToClose:i=!0,download:r=!0,fullscreen:o=!0,...s})=>{const{default:n}=await import("photoswipe");let e=null;return{open:l=>{e=new n({preloaderDelay:0,showHideAnimationType:"zoom",...s,index:l,...i?{closeOnVerticalDrag:!0,wheelToZoom:!1}:{}}),p(e,{download:r,fullscreen:o}),e.options.dataSource=u(t,e),e.init()},close:()=>{e?.close()},destroy:a("wheel",()=>{e?.close()})}};export{d as createPhotoSwipe,L as definePhotoSwipeConfig,O as injectPhotoSwipeConfig,x as usePhotoSwipe,D as usePhotoSwipeOptions};
//# sourceMappingURL=index.js.map