@ehfuse/overlay-scrollbar 1.7.8 → 1.7.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayScrollbar.d.ts","sourceRoot":"","sources":["../src/OverlayScrollbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,EAMV,SAAS,EAIZ,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AA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F,eAAe,gBAAgB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,25 +1,4 @@
1
- import{useRef as $,useEffect as F,useState as b,useCallback as p,useMemo as we,forwardRef as zt,useImperativeHandle as Nt,useLayoutEffect as Ft}from"react";var Wt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Le=(M,C)=>{if(M instanceof HTMLElement&&M.isContentEditable||M.closest('[role="textbox"],[role="searchbox"]'))return!0;let E=M.tagName.toLowerCase();if(E==="input"){let d=(M.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(d)}if(["textarea","select","button"].includes(E)||["svg","path","circle","rect","line","polygon","polyline"].includes(E)||M.getAttribute("contenteditable")==="true")return!0;if(C?.excludeSelectors){for(let d of C.excludeSelectors)if(M.matches(d))return!0}return Ot(M,C)},Ot=(M,C)=>{let E=[...Wt,...C?.excludeClasses||[]],d=M,z=0,W=5;for(;d&&z<=W;){if(E.some(H=>d.classList.contains(H)))return!0;if(d.classList.contains("MuiDialogContent-root"))break;d=d.parentElement,z++}return!1};import{useEffect as ct,useRef as oe,useState as st}from"react";var ut=({containerRef:M,config:C})=>{let E=C.enabled??!0,d=C.threshold??80,z=C.maxDistance??d*2,W=C.onRefresh,[H,L]=st(0),[O,G]=st(!1),_=oe(0),de=oe(0),j=oe(!1),J=oe(!1),re=oe(!1),fe=oe(0),k=oe(!1);return ct(()=>{k.current=O},[O]),ct(()=>{let w=M.current;if(!w||!(E&&typeof W=="function"))return;let Re=h=>{let D=h instanceof Element?h:null;for(;D&&D!==w;){if(D instanceof HTMLElement&&D.scrollHeight>D.clientHeight+1&&D.scrollTop>0)return!1;D=D.parentElement}return!0},ne=h=>{j.current=!1,J.current=!1,re.current=!1,!k.current&&h.touches.length===1&&w.scrollTop===0&&Re(h.target)&&(j.current=!0,_.current=h.touches[0].clientY,de.current=h.touches[0].clientX)},n=h=>{if(!j.current||k.current||h.touches.length!==1)return;let D=h.touches[0].clientY-_.current,N=h.touches[0].clientX-de.current;if(!J.current){if(D<=0||w.scrollTop>0){j.current=!1;return}if(D>8&&D>Math.abs(N))J.current=!0,re.current=w.scrollTop<0;else return}!re.current&&h.cancelable&&h.preventDefault();let le=Math.min(Math.max(D,0)*.5,z);fe.current=le,L(le)},B=()=>{if(!j.current||(j.current=!1,!J.current))return;J.current=!1,re.current=!1;let h=fe.current;fe.current=0,h>=d&&!k.current?(G(!0),L(d),Promise.resolve().then(()=>W()).catch(()=>{}).finally(()=>{G(!1),L(0)})):L(0)};return w.addEventListener("touchstart",ne,{passive:!0}),w.addEventListener("touchmove",n,{passive:!1}),w.addEventListener("touchend",B,{passive:!0}),w.addEventListener("touchcancel",B,{passive:!0}),()=>{w.removeEventListener("touchstart",ne),w.removeEventListener("touchmove",n),w.removeEventListener("touchend",B),w.removeEventListener("touchcancel",B)}},[M,E,W,d,z]),{pullDistance:H,isRefreshing:O,pullProgress:Math.min(H/d,1),pullThreshold:d}};import{useEffect as At,useState as $t}from"react";function dt(){let[M,C]=$t(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return At(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let E=window.matchMedia("(pointer: coarse)"),d=z=>C(z.matches);return C(E.matches),typeof E.addEventListener=="function"?(E.addEventListener("change",d),()=>E.removeEventListener("change",d)):(E.addListener(d),()=>E.removeListener(d))},[]),M}import{jsx as P,jsxs as Xe}from"react/jsx-runtime";var _t={},Bt={},Ut={},Xt={},qt={},Yt={},Gt=zt(({className:M="",style:C={},containerStyle:E={},contentStyle:d={},children:z,onScroll:W,thumb:H=_t,track:L=Bt,arrows:O=Ut,dragScroll:G=Xt,autoHide:_=qt,pullToRefresh:de=Yt,showScrollbar:j=!0,showHorizontalScrollbar:J=!0,detectInnerScroll:re=!1},fe)=>{let k=dt(),w=k?!1:j,De=k?!1:J,Re=$({});F(()=>{Re.current={children:z,onScroll:W,showScrollbar:w,showHorizontalScrollbar:De,thumb:H,track:L,arrows:O,dragScroll:G,autoHide:_}});let ne=$(null),n=$(null),B=$(null),h=$(null),D=$(null),N=$(null),{pullDistance:le,isRefreshing:xe,pullProgress:ke}=ut({containerRef:n,config:de}),qe=de.indicatorColor??"#1976d2",pt=le>0||xe,[Te,x]=b(!1),[X,Ye]=b(!1),[Ge,je]=b(!1),[Ie,ht]=b({y:0,scrollTop:0}),[pe,Ke]=b(0),[mt,Pe]=b(0),[ie,Ve]=b(!1),[Ze,Qe]=b(!1),[q,Je]=b(!1),[We,bt]=b({x:0,scrollLeft:0}),[Oe,et]=b(0),[Ae,tt]=b(0),[gt,ot]=b(!1),ae=$(!1),[K,rt]=b(!1),[he,vt]=b({x:0,y:0,scrollTop:0,scrollLeft:0}),[jt,Kt]=b(null),[Me,Ee]=b(null),[Vt,yt]=b(!1),[wt,xt]=b(0),me=$(null),[nt,lt]=b(!1),be=$(null),ee=$(null),te=$(null),T=we(()=>{let e=H.color??"#606060";return{width:H.width??8,minHeight:H.minHeight??50,radius:H.radius??(H.width??8)/2,color:e,opacity:H.opacity??.6,hoverColor:H.hoverColor??e,hoverOpacity:H.hoverOpacity??1}},[H]),l=we(()=>({width:L.width??16,color:L.color??"rgba(128, 128, 128, 0.1)",visible:L.visible??!0,alignment:L.alignment??"outside",radius:L.radius??T.radius??4,margin:L.margin??4,overflowX:L.overflowX??!0,overflowY:L.overflowY??!0}),[L,T.radius]),U=we(()=>{let e=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:e,opacity:O.opacity??.6,hoverColor:O.hoverColor??e,hoverOpacity:O.hoverOpacity??1}},[O]),ge=we(()=>({enabled:k?!1:G.enabled??!0,excludeClasses:G.excludeClasses??[],excludeSelectors:G.excludeSelectors??[]}),[G,k]),a=we(()=>({enabled:_.enabled??!0,delay:_.delay??1500,delayOnWheel:_.delayOnWheel??700,initialDelay:_.initialDelay??200}),[_]),[ce,Tt]=b(()=>(_.initialDelay??200)>0),g=T.width,Mt=l.width,$e=T.minHeight,Y=U.visible,Se=U.step,A=p(()=>{if(!n.current)return;let e=document.activeElement;e&&n.current.contains(e)&&e!==n.current||n.current.focus()},[]);Nt(fe,()=>({getScrollContainer:()=>n.current,scrollTo:e=>{n.current&&n.current.scrollTo(e)},get scrollTop(){return n.current?.scrollTop||0},get scrollHeight(){return n.current?.scrollHeight||0},get clientHeight(){return n.current?.clientHeight||0}}),[]);let u=p(()=>{if(N.current){let t=N.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;N.current=null}if(!n.current)return null;if(n.current.scrollHeight>n.current.clientHeight+2||n.current.scrollWidth>n.current.clientWidth+2)return N.current=n.current,n.current;if(!re)return null;let e=n.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==n.current&&o.classList.contains("overlay-scrollbar-container"))continue;let i=o.parentElement,r=!1;for(;i&&i!==n.current;){if(i.classList.contains("overlay-scrollbar-container")&&i!==n.current){r=!0;break}i=i.parentElement}if(!r&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return N.current=o,o}return null},[]),V=p(()=>u()!==null,[u]),v=p(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Ce=p(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),it=p(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),Et=p(()=>{Ce(),!(X||q||K||ae.current)&&(v(),x(!1))},[v,Ce,X,q,K]),m=p(e=>{a.enabled&&(v(),be.current=setTimeout(()=>{x(!1),be.current=null},e))},[v,a.enabled]),s=p(()=>{let e=u()??n.current;if(!e){x(!1),Ve(!1),ot(!1),v();return}!a.enabled&&!ce&&(x(!0),v());let t=e.clientHeight,o=e.scrollHeight,i=e.scrollTop,r=e.clientWidth,c=e.scrollWidth,y=e.scrollLeft,S=o-t>0,f=c-r>0,se=S||f;Ve(S),ot(f),se||(x(!1),v());let ve=0,I=0;if(ne.current){let Z=window.getComputedStyle(ne.current),Q=parseFloat(Z.paddingTop)||0;I=parseFloat(Z.paddingBottom)||0,ve=Q+I,xt(I)}if(S){let Z=Y?g*2+l.margin*4:l.margin*2,Q=t-Z+ve,He=t/o,ue=Math.max(Q*He,$e),at=o-t,It=Q-ue,Pt=at>0?i/at*It:0;Ke(ue),Pe(Pt)}else Ke(0),Pe(0);let ye=c-r;if(ye>0){let Z=r/c,Q=Math.max(r*Z,50),He=r-Q,ue=ye>0?y/ye*He:0;et(Q),tt(ue)}else et(0),tt(0)},[u,v,Y,g,$e,a.enabled,ce]),St=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Ye(!0),ht({y:e.clientY,scrollTop:t.scrollTop}),v(),x(!0),A())},[u,v,A]),ze=p(e=>{if(!X)return;let t=u();if(!t)return;let o=t.clientHeight,r=t.scrollHeight-o,c=e.clientY-Ie.y,y=o-pe,S=c/y*r,f=Math.max(0,Math.min(r,Ie.scrollTop+S));t.scrollTop=f,s()},[X,Ie,pe,s,u]),Ne=p(()=>{Ye(!1),V()&&m(a.delay)},[V,m,a.delay]),Ct=p(e=>{if(!h.current)return;let o=h.current.getBoundingClientRect(),i=e.clientY-o.top,r=u();if(!r)return;let c=r.clientHeight,y=r.scrollHeight,f=i/c*(y-c);r.scrollTop=Math.max(0,Math.min(y-c,f)),s(),x(!0),m(a.delay),A()},[s,m,a.delay,u,A]),Ht=p(e=>{if(e.preventDefault(),e.stopPropagation(),!n.current)return;let t=Math.max(0,n.current.scrollTop-Se);n.current.scrollTop=t,s(),x(!0),m(a.delay),A()},[s,m,Se,a.delay,A]),Lt=p(e=>{if(e.preventDefault(),e.stopPropagation(),!n.current||!B.current)return;let t=n.current,i=B.current.scrollHeight-t.clientHeight,r=Math.min(i,t.scrollTop+Se);t.scrollTop=r,s(),x(!0),m(a.delay),A()},[s,m,Se,a.delay,A]),Dt=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Je(!0),bt({x:e.clientX,scrollLeft:t.scrollLeft}),v(),x(!0),A())},[u,v,A]),Fe=p(e=>{if(!q)return;let t=u();if(!t)return;let o=t.clientWidth,r=t.scrollWidth-o,c=e.clientX-We.x,y=o-Oe,S=c/y*r,f=Math.max(0,Math.min(r,We.scrollLeft+S));t.scrollLeft=f,s()},[q,We,Oe,s,u]),_e=p(()=>{Je(!1),V()&&m(a.delay)},[V,m,a.delay]),Rt=p(e=>{if(!h.current)return;let o=h.current.getBoundingClientRect(),i=e.clientX-o.left,r=u();if(!r)return;let c=r.clientWidth,y=r.scrollWidth,f=i/c*(y-c);r.scrollLeft=Math.max(0,Math.min(y-c,f)),s(),x(!0),m(a.delay),A()},[s,m,a.delay,u,A]),kt=p(e=>{if(!ge.enabled||e.defaultPrevented)return;let t=e.target,o=n.current;if(!o||!o.contains(t)||Le(t,ge)||e.button!==0)return;let i=u();i&&(i.scrollHeight<=i.clientHeight&&i.scrollWidth<=i.clientWidth||(e.preventDefault(),ae.current=!0,vt({x:e.clientX,y:e.clientY,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft||0}),v()))},[ge,Le,u,v]),Be=p(e=>{if(!ae.current&&!K)return;let t=u();if(!t)return;let o=he.x-e.clientX,i=he.y-e.clientY;if(Math.abs(i)<5&&Math.abs(o)<5)return;ae.current&&(ae.current=!1,rt(!0)),x(!0);let r=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,he.scrollTop+i)),c=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,he.scrollLeft+o));t.scrollTop=r,t.scrollLeft=c,s()},[K,he,u,s]),Ue=p(()=>{let e=K;ae.current=!1,rt(!1),e&&V()&&m(a.delay)},[K,V,m,a.delay]);F(()=>{let e=c=>{if(s(),ce){W&&W(c);return}v(),x(!0),it();let y=nt?a.delayOnWheel:a.delay;m(y),W&&W(c)},t=()=>{lt(!0),me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{lt(!1)},300),it(),te.current=setTimeout(()=>{x(!0),te.current=null,m(a.delayOnWheel)},50)},o=[],i=u();i&&o.push(i);let r=n.current;return r&&!i&&(o.push(r),r.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(y=>{let S=y;if(S!==r&&S.classList.contains("overlay-scrollbar-container"))return;let f=S.parentElement;for(;f&&f!==r;){if(f.classList.contains("overlay-scrollbar-container")&&f!==r)return;f=f.parentElement}o.push(S)})),o.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",t)}),me.current&&clearTimeout(me.current),te.current&&clearTimeout(te.current)}},[u,s,W,v,m,a,nt,ce]),F(()=>{let e=o=>{let i=o.target;if(o.defaultPrevented||i instanceof Element&&Le(i,ge))return;let r=u();if(!r)return;let{key:c}=o,{scrollTop:y,scrollHeight:S,clientHeight:f}=r,se=S-f,ve=50,I=null;switch(c){case"ArrowUp":o.preventDefault(),I=Math.max(0,y-ve);break;case"ArrowDown":o.preventDefault(),I=Math.min(se,y+ve);break;case"PageUp":o.preventDefault(),I=Math.max(0,y-f);break;case"PageDown":o.preventDefault(),I=Math.min(se,y+f);break;case"Home":o.preventDefault(),I=0;break;case"End":o.preventDefault(),I=se;break;default:return}if(I!==null){let ye=I/se,Z=Y?g*2+l.margin*4:l.margin*2,ue=(f-Z-pe)*ye;Pe(ue),r.scrollTop=I,v(),x(!0),m(a.delay)}},t=n.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,Y,g,l.margin,pe,v,m,a.delay,ge]),F(()=>(document.addEventListener("mousemove",Be),document.addEventListener("mouseup",Ue),()=>{document.removeEventListener("mousemove",Be),document.removeEventListener("mouseup",Ue)}),[K,Be,Ue]),F(()=>{if(X)return document.addEventListener("mousemove",ze),document.addEventListener("mouseup",Ne),()=>{document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",Ne)}},[X,ze,Ne]),F(()=>{if(q)return document.addEventListener("mousemove",Fe),document.addEventListener("mouseup",_e),()=>{document.removeEventListener("mousemove",Fe),document.removeEventListener("mouseup",_e)}},[q,Fe,_e]),F(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),Ft(()=>{yt(!0),s(),!a.enabled&&!ce&&V()&&x(!0)},[V,s,a.enabled,ce]),F(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{Tt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),F(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return n.current&&t.push(n.current),B.current&&t.push(B.current),N.current&&document.contains(N.current)&&t.push(N.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),F(()=>{if(!n.current)return;let e=new MutationObserver(()=>{N.current=null,s()});return e.observe(n.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let R=Math.max(Mt,g);return F(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");o.id=e;let i=k?`
2
- /* \uD130\uCE58 \uAE30\uAE30: \uB124\uC774\uD2F0\uBE0C \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0(\uC228\uAE30\uC9C0 \uC54A\uC74C) */
3
- .overlay-scrollbar-container {
4
- scrollbar-width: thin;
5
- -ms-overflow-style: auto;
6
- }`:`
7
- /* \uB9C8\uC6B0\uC2A4 \uAE30\uAE30: \uB124\uC774\uD2F0\uBE0C \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uACE0 \uCEE4\uC2A4\uD140 \uC624\uBC84\uB808\uC774\uB9CC \uD45C\uC2DC */
8
- .overlay-scrollbar-container {
9
- scrollbar-width: none !important;
10
- -ms-overflow-style: none !important;
11
- }
12
- .overlay-scrollbar-container::-webkit-scrollbar {
13
- display: none !important;
14
- width: 0 !important;
15
- height: 0 !important;
16
- }
17
- .overlay-scrollbar-container::-webkit-scrollbar-track {
18
- display: none !important;
19
- }
20
- .overlay-scrollbar-container::-webkit-scrollbar-thumb {
21
- display: none !important;
22
- }`;return o.textContent=`${i}
1
+ import{useRef as W,useEffect as A,useState as m,useCallback as f,useMemo as ye,forwardRef as _t,useImperativeHandle as Bt,useLayoutEffect as Ft,useId as Ut}from"react";var At=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],De=(M,C)=>{if(M instanceof HTMLElement&&M.isContentEditable||M.closest('[role="textbox"],[role="searchbox"]'))return!0;let E=M.tagName.toLowerCase();if(E==="input"){let d=(M.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(d)}if(["textarea","select","button"].includes(E)||["svg","path","circle","rect","line","polygon","polyline"].includes(E)||M.getAttribute("contenteditable")==="true")return!0;if(C?.excludeSelectors){for(let d of C.excludeSelectors)if(M.matches(d))return!0}return Ot(M,C)},Ot=(M,C)=>{let E=[...At,...C?.excludeClasses||[]],d=M,O=0,I=5;for(;d&&O<=I;){if(E.some(H=>d.classList.contains(H)))return!0;if(d.classList.contains("MuiDialogContent-root"))break;d=d.parentElement,O++}return!1};import{useEffect as ut,useRef as re,useState as dt}from"react";var pt=({containerRef:M,config:C})=>{let E=C.enabled??!0,d=C.threshold??80,O=C.maxDistance??d*2,I=C.onRefresh,[H,L]=dt(0),[$,q]=dt(!1),N=re(0),ue=re(0),Y=re(!1),Q=re(!1),ne=re(!1),de=re(0),z=re(!1);return ut(()=>{z.current=$},[$]),ut(()=>{let y=M.current;if(!y||!(E&&typeof I=="function"))return;let Ye=o=>{let x=o instanceof Element?o:null;for(;x&&x!==y;){if(x instanceof HTMLElement&&x.scrollHeight>x.clientHeight+1&&x.scrollTop>0)return!1;x=x.parentElement}return!0},J=o=>{Y.current=!1,Q.current=!1,ne.current=!1,!z.current&&o.touches.length===1&&y.scrollTop===0&&Ye(o.target)&&(Y.current=!0,N.current=o.touches[0].clientY,ue.current=o.touches[0].clientX)},xe=o=>{if(!Y.current||z.current||o.touches.length!==1)return;let x=o.touches[0].clientY-N.current,ee=o.touches[0].clientX-ue.current;if(!Q.current){if(x<=0||y.scrollTop>0){Y.current=!1;return}if(x>8&&x>Math.abs(ee))Q.current=!0,ne.current=y.scrollTop<0;else return}!ne.current&&o.cancelable&&o.preventDefault();let we=Math.min(Math.max(x,0)*.5,O);de.current=we,L(we)},G=()=>{if(!Y.current||(Y.current=!1,!Q.current))return;Q.current=!1,ne.current=!1;let o=de.current;de.current=0,o>=d&&!z.current?(q(!0),L(d),Promise.resolve().then(()=>I()).catch(()=>{}).finally(()=>{q(!1),L(0)})):L(0)};return y.addEventListener("touchstart",J,{passive:!0}),y.addEventListener("touchmove",xe,{passive:!1}),y.addEventListener("touchend",G,{passive:!0}),y.addEventListener("touchcancel",G,{passive:!0}),()=>{y.removeEventListener("touchstart",J),y.removeEventListener("touchmove",xe),y.removeEventListener("touchend",G),y.removeEventListener("touchcancel",G)}},[M,E,I,d,O]),{pullDistance:H,isRefreshing:$,pullProgress:Math.min(H/d,1),pullThreshold:d}};import{useEffect as zt,useState as Nt}from"react";function ft(){let[M,C]=Nt(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return zt(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let E=window.matchMedia("(pointer: coarse)"),d=O=>C(O.matches);return C(E.matches),typeof E.addEventListener=="function"?(E.addEventListener("change",d),()=>E.removeEventListener("change",d)):(E.addListener(d),()=>E.removeListener(d))},[]),M}import{jsx as R,jsxs as qe}from"react/jsx-runtime";var Xt={},qt={},Yt={},Gt={},jt={},Kt={},Vt=_t(({className:M="",style:C={},containerStyle:E={},contentStyle:d={},children:O,onScroll:I,thumb:H=Xt,track:L=qt,arrows:$=Yt,dragScroll:q=Gt,autoHide:N=jt,pullToRefresh:ue=Kt,showScrollbar:Y=!0,showHorizontalScrollbar:Q=!0,detectInnerScroll:ne=!1},de)=>{let z=ft(),y=z?!1:Y,ke=z?!1:Q,J=`os-${Ut().replace(/[^a-zA-Z0-9_-]/g,"")}`,xe=W({});A(()=>{xe.current={children:O,onScroll:I,showScrollbar:y,showHorizontalScrollbar:ke,thumb:H,track:L,arrows:$,dragScroll:q,autoHide:N}});let G=W(null),o=W(null),x=W(null),ee=W(null),we=W(null),B=W(null),{pullDistance:Re,isRefreshing:Te,pullProgress:Ie}=pt({containerRef:o,config:ue}),Ge=ue.indicatorColor??"#1976d2",mt=Re>0||Te,[Me,w]=m(!1),[F,je]=m(!1),[Ke,Ve]=m(!1),[$e,bt]=m({y:0,scrollTop:0}),[pe,Ze]=m(0),[gt,Pe]=m(0),[le,Qe]=m(!1),[Je,et]=m(!1),[U,tt]=m(!1),[We,vt]=m({x:0,scrollLeft:0}),[Ae,ot]=m(0),[Oe,rt]=m(0),[yt,nt]=m(!1),ie=W(!1),[j,lt]=m(!1),[fe,xt]=m({x:0,y:0,scrollTop:0,scrollLeft:0}),[Zt,Qt]=m(null),[Ee,Se]=m(null),[Jt,wt]=m(!1),[Tt,Mt]=m(0),he=W(null),[it,at]=m(!1),me=W(null),te=W(null),oe=W(null),T=ye(()=>{let e=H.color??"#606060";return{width:H.width??8,minHeight:H.minHeight??50,radius:H.radius??(H.width??8)/2,color:e,opacity:H.opacity??.6,hoverColor:H.hoverColor??e,hoverOpacity:H.hoverOpacity??1}},[H]),l=ye(()=>({width:L.width??16,color:L.color??"rgba(128, 128, 128, 0.1)",visible:L.visible??!0,alignment:L.alignment??"outside",radius:L.radius??T.radius??4,margin:L.margin??4,overflowX:L.overflowX??!0,overflowY:L.overflowY??!0}),[L,T.radius]),_=ye(()=>{let e=$.color??"#808080";return{visible:$.visible??!1,step:$.step??50,color:e,opacity:$.opacity??.6,hoverColor:$.hoverColor??e,hoverOpacity:$.hoverOpacity??1}},[$]),be=ye(()=>({enabled:z?!1:q.enabled??!0,excludeClasses:q.excludeClasses??[],excludeSelectors:q.excludeSelectors??[]}),[q,z]),a=ye(()=>({enabled:N.enabled??!0,delay:N.delay??1500,delayOnWheel:N.delayOnWheel??700,initialDelay:N.initialDelay??200}),[N]),[ae,Et]=m(()=>(N.initialDelay??200)>0),b=T.width,St=l.width,ze=T.minHeight,X=_.visible,Ce=_.step,P=f(()=>{if(!o.current)return;let e=document.activeElement;e&&o.current.contains(e)&&e!==o.current||o.current.focus()},[]);Bt(de,()=>({getScrollContainer:()=>o.current,scrollTo:e=>{o.current&&o.current.scrollTo(e)},get scrollTop(){return o.current?.scrollTop||0},get scrollHeight(){return o.current?.scrollHeight||0},get clientHeight(){return o.current?.clientHeight||0}}),[]);let u=f(()=>{if(B.current){let t=B.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;B.current=null}if(!o.current)return null;if(o.current.scrollHeight>o.current.clientHeight+2||o.current.scrollWidth>o.current.clientWidth+2)return B.current=o.current,o.current;if(!ne)return null;let e=o.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let r=t;if(r!==o.current&&r.classList.contains("overlay-scrollbar-container"))continue;let n=r.parentElement,i=!1;for(;n&&n!==o.current;){if(n.classList.contains("overlay-scrollbar-container")&&n!==o.current){i=!0;break}n=n.parentElement}if(!i&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return B.current=r,r}return null},[]),K=f(()=>u()!==null,[u]),g=f(()=>{me.current&&(clearTimeout(me.current),me.current=null)},[]),He=f(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),st=f(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),Ct=f(()=>{He(),!(F||U||j||ie.current)&&(g(),w(!1))},[g,He,F,U,j]),h=f(e=>{a.enabled&&(g(),me.current=setTimeout(()=>{w(!1),me.current=null},e))},[g,a.enabled]),c=f(()=>{let e=u()??o.current;if(!e){w(!1),Qe(!1),nt(!1),g();return}!a.enabled&&!ae&&(w(!0),g());let t=e.clientHeight,r=e.scrollHeight,n=e.scrollTop,i=e.clientWidth,s=e.scrollWidth,v=e.scrollLeft,S=r-t>0,p=s-i>0,se=S||p;Qe(S),nt(p),se||(w(!1),g());let ge=0,k=0;if(G.current){let V=window.getComputedStyle(G.current),Z=parseFloat(V.paddingTop)||0;k=parseFloat(V.paddingBottom)||0,ge=Z+k,Mt(k)}if(S){let V=X?b*2+l.margin*4:l.margin*2,Z=t-V+ge,Le=t/r,ce=Math.max(Z*Le,ze),ct=r-t,Pt=Z-ce,Wt=ct>0?n/ct*Pt:0;Ze(ce),Pe(Wt)}else Ze(0),Pe(0);let ve=s-i;if(ve>0){let V=i/s,Z=Math.max(i*V,50),Le=i-Z,ce=ve>0?v/ve*Le:0;ot(Z),rt(ce)}else ot(0),rt(0)},[u,g,X,b,ze,a.enabled,ae]),Ht=f(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(je(!0),bt({y:e.clientY,scrollTop:t.scrollTop}),g(),w(!0),P())},[u,g,P]),Ne=f(e=>{if(!F)return;let t=u();if(!t)return;let r=t.clientHeight,i=t.scrollHeight-r,s=e.clientY-$e.y,v=r-pe,S=s/v*i,p=Math.max(0,Math.min(i,$e.scrollTop+S));t.scrollTop=p,c()},[F,$e,pe,c,u]),_e=f(()=>{je(!1),K()&&h(a.delay)},[K,h,a.delay]),Lt=f(e=>{if(!ee.current)return;let r=ee.current.getBoundingClientRect(),n=e.clientY-r.top,i=u();if(!i)return;let s=i.clientHeight,v=i.scrollHeight,p=n/s*(v-s);i.scrollTop=Math.max(0,Math.min(v-s,p)),c(),w(!0),h(a.delay),P()},[c,h,a.delay,u,P]),Dt=f(e=>{if(e.preventDefault(),e.stopPropagation(),!o.current)return;let t=Math.max(0,o.current.scrollTop-Ce);o.current.scrollTop=t,c(),w(!0),h(a.delay),P()},[c,h,Ce,a.delay,P]),kt=f(e=>{if(e.preventDefault(),e.stopPropagation(),!o.current||!x.current)return;let t=o.current,n=x.current.scrollHeight-t.clientHeight,i=Math.min(n,t.scrollTop+Ce);t.scrollTop=i,c(),w(!0),h(a.delay),P()},[c,h,Ce,a.delay,P]),Rt=f(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(tt(!0),vt({x:e.clientX,scrollLeft:t.scrollLeft}),g(),w(!0),P())},[u,g,P]),Be=f(e=>{if(!U)return;let t=u();if(!t)return;let r=t.clientWidth,i=t.scrollWidth-r,s=e.clientX-We.x,v=r-Ae,S=s/v*i,p=Math.max(0,Math.min(i,We.scrollLeft+S));t.scrollLeft=p,c()},[U,We,Ae,c,u]),Fe=f(()=>{tt(!1),K()&&h(a.delay)},[K,h,a.delay]),It=f(e=>{if(!ee.current)return;let r=ee.current.getBoundingClientRect(),n=e.clientX-r.left,i=u();if(!i)return;let s=i.clientWidth,v=i.scrollWidth,p=n/s*(v-s);i.scrollLeft=Math.max(0,Math.min(v-s,p)),c(),w(!0),h(a.delay),P()},[c,h,a.delay,u,P]),$t=f(e=>{if(!be.enabled||e.defaultPrevented)return;let t=e.target,r=o.current;if(!r||!r.contains(t)||De(t,be)||e.button!==0)return;let n=u();n&&(n.scrollHeight<=n.clientHeight&&n.scrollWidth<=n.clientWidth||(e.preventDefault(),ie.current=!0,xt({x:e.clientX,y:e.clientY,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft||0}),g()))},[be,De,u,g]),Ue=f(e=>{if(!ie.current&&!j)return;let t=u();if(!t)return;let r=fe.x-e.clientX,n=fe.y-e.clientY;if(Math.abs(n)<5&&Math.abs(r)<5)return;ie.current&&(ie.current=!1,lt(!0)),w(!0);let i=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,fe.scrollTop+n)),s=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,fe.scrollLeft+r));t.scrollTop=i,t.scrollLeft=s,c()},[j,fe,u,c]),Xe=f(()=>{let e=j;ie.current=!1,lt(!1),e&&K()&&h(a.delay)},[j,K,h,a.delay]);A(()=>{let e=s=>{if(c(),ae){I&&I(s);return}g(),w(!0),st();let v=it?a.delayOnWheel:a.delay;h(v),I&&I(s)},t=()=>{at(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(()=>{at(!1)},300),st(),oe.current=setTimeout(()=>{w(!0),oe.current=null,h(a.delayOnWheel)},50)},r=[],n=u();n&&r.push(n);let i=o.current;return i&&!n&&(r.push(i),i.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(v=>{let S=v;if(S!==i&&S.classList.contains("overlay-scrollbar-container"))return;let p=S.parentElement;for(;p&&p!==i;){if(p.classList.contains("overlay-scrollbar-container")&&p!==i)return;p=p.parentElement}r.push(S)})),r.forEach(s=>{s.addEventListener("scroll",e,{passive:!0}),s.addEventListener("wheel",t,{passive:!0})}),()=>{r.forEach(s=>{s.removeEventListener("scroll",e),s.removeEventListener("wheel",t)}),he.current&&clearTimeout(he.current),oe.current&&clearTimeout(oe.current)}},[u,c,I,g,h,a,it,ae]),A(()=>{let e=r=>{let n=r.target;if(r.defaultPrevented||n instanceof Element&&De(n,be))return;let i=u();if(!i)return;let{key:s}=r,{scrollTop:v,scrollHeight:S,clientHeight:p}=i,se=S-p,ge=50,k=null;switch(s){case"ArrowUp":r.preventDefault(),k=Math.max(0,v-ge);break;case"ArrowDown":r.preventDefault(),k=Math.min(se,v+ge);break;case"PageUp":r.preventDefault(),k=Math.max(0,v-p);break;case"PageDown":r.preventDefault(),k=Math.min(se,v+p);break;case"Home":r.preventDefault(),k=0;break;case"End":r.preventDefault(),k=se;break;default:return}if(k!==null){let ve=k/se,V=X?b*2+l.margin*4:l.margin*2,ce=(p-V-pe)*ve;Pe(ce),i.scrollTop=k,g(),w(!0),h(a.delay)}},t=o.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,X,b,l.margin,pe,g,h,a.delay,be]),A(()=>(document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",Xe),()=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",Xe)}),[j,Ue,Xe]),A(()=>{if(F)return document.addEventListener("mousemove",Ne),document.addEventListener("mouseup",_e),()=>{document.removeEventListener("mousemove",Ne),document.removeEventListener("mouseup",_e)}},[F,Ne,_e]),A(()=>{if(U)return document.addEventListener("mousemove",Be),document.addEventListener("mouseup",Fe),()=>{document.removeEventListener("mousemove",Be),document.removeEventListener("mouseup",Fe)}},[U,Be,Fe]),A(()=>{c();let e=setTimeout(()=>{c()},100);return()=>clearTimeout(e)},[c]),Ft(()=>{wt(!0),c(),!a.enabled&&!ae&&K()&&w(!0)},[K,c,a.enabled,ae]),A(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{Et(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),A(()=>{let e=new ResizeObserver(()=>{c()}),t=[];return o.current&&t.push(o.current),x.current&&t.push(x.current),B.current&&document.contains(B.current)&&t.push(B.current),t.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[c]),A(()=>{if(!o.current)return;let e=new MutationObserver(()=>{B.current=null,c()});return e.observe(o.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[c]);let D=Math.max(St,b);return A(()=>{let e="overlay-scrollbar-shared";if(document.getElementById(e))return;let t=document.createElement("style");t.id=e,t.textContent=`
23
2
  /* ehfuse-editor-content\uB294 \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0 */
24
3
  .overlay-scrollbar-container .ehfuse-editor-content {
25
4
  scrollbar-width: thin !important;
@@ -48,5 +27,31 @@ import{useRef as $,useEffect as F,useState as b,useCallback as p,useMemo as we,f
48
27
  from { transform: rotate(0deg); }
49
28
  to { transform: rotate(360deg); }
50
29
  }
51
- `,document.head.appendChild(o),()=>{let r=document.getElementById(e);r&&r.remove()}},[k]),Xe("div",{ref:ne,className:`overlay-scrollbar-wrapper ${M}`,onMouseLeave:Et,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...C},children:[pt&&P("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${le-56}px)`,transition:xe?"transform 0.15s ease-out":le===0?"transform 0.2s ease-out":"none",width:48,height:48,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:xe?1:Math.min(ke*1.5,1)},children:xe?P("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:P("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:qe,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):P("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${ke*270}deg)`,opacity:ke>=1?1:.6},children:P("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:qe})})}),P("div",{ref:n,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:kt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:k?"thin":"none",msOverflowStyle:k?"auto":"none",outline:"none",userSelect:K?"none":"auto",...E},children:P("div",{ref:B,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...d},children:z})}),w&&ie&&(l.overflowY??!0)&&Xe("div",{ref:h,className:"overlay-scrollbar-track",onMouseEnter:()=>{v(),ee.current=setTimeout(()=>{x(!0),ee.current=null},100)},onMouseLeave:()=>{Ce(),X||m(a.delay)},style:{position:"absolute",top:0,right:0,width:`${R}px`,height:"100%",opacity:Te?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[l.visible&&P("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ct(e)},style:{position:"absolute",top:Y?`${T.width+l.margin*2}px`:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-T.width)/2}px`,width:`${T.width}px`,height:Y?`calc(100% - ${T.width*2+l.margin*4}px)`:`calc(100% - ${l.margin*2}px)`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),P("div",{ref:D,className:"overlay-scrollbar-thumb",onMouseDown:St,onMouseEnter:()=>je(!0),onMouseLeave:()=>je(!1),style:{position:"absolute",top:`${(Y?g+l.margin*2:l.margin)+mt}px`,right:l.alignment==="outside"?"0px":`${(R-g)/2}px`,width:`${g}px`,height:`${Math.max(pe,$e)}px`,backgroundColor:Ge||X?T.hoverColor:T.color,opacity:Ge||X?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),w&&ie&&Y&&P("div",{className:"overlay-scrollbar-up-arrow",onClick:Ht,onMouseEnter:()=>Ee("up"),onMouseLeave:()=>Ee(null),style:{position:"absolute",top:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-g)/2}px`,width:`${g}px`,height:`${g}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(g*.75,8)}px`,color:Me==="up"?U.hoverColor:U.color,userSelect:"none",zIndex:1001,opacity:Te?Me==="up"?U.hoverOpacity:U.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),w&&ie&&Y&&P("div",{className:"overlay-scrollbar-down-arrow",onClick:Lt,onMouseEnter:()=>Ee("down"),onMouseLeave:()=>Ee(null),style:{position:"absolute",bottom:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-g)/2}px`,width:`${g}px`,height:`${g}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(g*.75,8)}px`,color:Me==="down"?U.hoverColor:U.color,userSelect:"none",zIndex:1001,opacity:Te?Me==="down"?U.hoverOpacity:U.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),w&&De&&gt&&(l.overflowX??!0)&&Xe("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{v(),ee.current=setTimeout(()=>{x(!0),ee.current=null},100)},onMouseLeave:()=>{Ce(),q||m(a.delay)},style:{position:"absolute",bottom:`${wt}px`,left:0,width:"100%",height:`${R}px`,opacity:Te?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[l.visible&&P("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Rt(e)},style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(R-g)/2}px`,left:`${l.margin}px`,right:ie?l.alignment==="outside"?`${R-l.margin}px`:`${R}px`:`${l.margin}px`,height:`${g}px`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),P("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Dt,onMouseEnter:()=>Qe(!0),onMouseLeave:()=>Qe(!1),style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(R-g)/2}px`,left:`${l.margin+Ae}px`,right:ie?l.alignment==="outside"?`${R-l.margin}px`:`${R}px`:"auto",maxWidth:ie?l.alignment==="outside"?`calc(100% - ${l.margin+Ae+R-l.margin}px)`:`calc(100% - ${l.margin+Ae+R}px)`:"none",width:`${Math.max(Oe,50)}px`,height:`${g}px`,backgroundColor:Ze||q?T.hoverColor:T.color,opacity:Ze||q?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ft=Gt;export{ft as OverlayScrollbar,ft as default};
30
+ `,document.head.appendChild(t)},[]),A(()=>{let e=`overlay-scrollbar-instance-${J}`,t=document.getElementById(e);t&&t.remove();let r=document.createElement("style");r.id=e;let n=`.${J}`;return r.textContent=z?`
31
+ ${n} {
32
+ scrollbar-width: thin;
33
+ scrollbar-color: rgba(100, 116, 139, 0.55) transparent;
34
+ }
35
+ ${n}::-webkit-scrollbar {
36
+ width: 6px;
37
+ height: 6px;
38
+ }
39
+ ${n}::-webkit-scrollbar-track {
40
+ background: transparent;
41
+ }
42
+ ${n}::-webkit-scrollbar-thumb {
43
+ background: rgba(100, 116, 139, 0.55);
44
+ border-radius: 3px;
45
+ }`:`
46
+ ${n} {
47
+ scrollbar-width: none !important;
48
+ -ms-overflow-style: none !important;
49
+ }
50
+ ${n}::-webkit-scrollbar {
51
+ display: none !important;
52
+ width: 0 !important;
53
+ height: 0 !important;
54
+ }
55
+ ${n}::-webkit-scrollbar-track { display: none !important; }
56
+ ${n}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(r),()=>{document.getElementById(e)?.remove()}},[z,J]),qe("div",{ref:G,className:`overlay-scrollbar-wrapper ${M}`,onMouseLeave:Ct,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...C},children:[mt&&R("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${Re-56}px)`,transition:Te?"transform 0.15s ease-out":Re===0?"transform 0.2s ease-out":"none",width:48,height:48,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:Te?1:Math.min(Ie*1.5,1)},children:Te?R("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:R("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ge,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):R("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${Ie*270}deg)`,opacity:Ie>=1?1:.6},children:R("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:Ge})})}),R("div",{ref:o,className:`overlay-scrollbar-container ${J}`,tabIndex:-1,onMouseDown:$t,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...E},children:R("div",{ref:x,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...d},children:O})}),y&&le&&(l.overflowY??!0)&&qe("div",{ref:ee,className:"overlay-scrollbar-track",onMouseEnter:()=>{g(),te.current=setTimeout(()=>{w(!0),te.current=null},100)},onMouseLeave:()=>{He(),F||h(a.delay)},style:{position:"absolute",top:0,right:0,width:`${D}px`,height:"100%",opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[l.visible&&R("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Lt(e)},style:{position:"absolute",top:X?`${T.width+l.margin*2}px`:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(D-T.width)/2}px`,width:`${T.width}px`,height:X?`calc(100% - ${T.width*2+l.margin*4}px)`:`calc(100% - ${l.margin*2}px)`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),R("div",{ref:we,className:"overlay-scrollbar-thumb",onMouseDown:Ht,onMouseEnter:()=>Ve(!0),onMouseLeave:()=>Ve(!1),style:{position:"absolute",top:`${(X?b+l.margin*2:l.margin)+gt}px`,right:l.alignment==="outside"?"0px":`${(D-b)/2}px`,width:`${b}px`,height:`${Math.max(pe,ze)}px`,backgroundColor:Ke||F?T.hoverColor:T.color,opacity:Ke||F?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),y&&le&&X&&R("div",{className:"overlay-scrollbar-up-arrow",onClick:Dt,onMouseEnter:()=>Se("up"),onMouseLeave:()=>Se(null),style:{position:"absolute",top:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(D-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:Ee==="up"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:Me?Ee==="up"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),y&&le&&X&&R("div",{className:"overlay-scrollbar-down-arrow",onClick:kt,onMouseEnter:()=>Se("down"),onMouseLeave:()=>Se(null),style:{position:"absolute",bottom:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(D-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:Ee==="down"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:Me?Ee==="down"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),y&&ke&&yt&&(l.overflowX??!0)&&qe("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{g(),te.current=setTimeout(()=>{w(!0),te.current=null},100)},onMouseLeave:()=>{He(),U||h(a.delay)},style:{position:"absolute",bottom:`${Tt}px`,left:0,width:"100%",height:`${D}px`,opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[l.visible&&R("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),It(e)},style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(D-b)/2}px`,left:`${l.margin}px`,right:le?l.alignment==="outside"?`${D-l.margin}px`:`${D}px`:`${l.margin}px`,height:`${b}px`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),R("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Rt,onMouseEnter:()=>et(!0),onMouseLeave:()=>et(!1),style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(D-b)/2}px`,left:`${l.margin+Oe}px`,right:le?l.alignment==="outside"?`${D-l.margin}px`:`${D}px`:"auto",maxWidth:le?l.alignment==="outside"?`calc(100% - ${l.margin+Oe+D-l.margin}px)`:`calc(100% - ${l.margin+Oe+D}px)`:"none",width:`${Math.max(Ae,50)}px`,height:`${b}px`,backgroundColor:Je||U?T.hoverColor:T.color,opacity:Je||U?T.hoverOpacity:T.opacity,borderRadius:`${T.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ht=Vt;export{ht as OverlayScrollbar,ht as default};
52
57
  //# sourceMappingURL=index.esm.js.map