@ehfuse/overlay-scrollbar 1.7.9 → 1.7.11

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/dist/index.js CHANGED
@@ -1,20 +1,4 @@
1
- "use strict";var _e=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var kt=Object.prototype.hasOwnProperty;var It=(d,f)=>{for(var m in f)_e(d,m,{get:f[m],enumerable:!0})},Pt=(d,f,m,u)=>{if(f&&typeof f=="object"||typeof f=="function")for(let C of Rt(f))!kt.call(d,C)&&C!==m&&_e(d,C,{get:()=>f[C],enumerable:!(u=Dt(f,C))||u.enumerable});return d};var Wt=d=>Pt(_e({},"__esModule",{value:!0}),d);var Xt={};It(Xt,{OverlayScrollbar:()=>Be,default:()=>Be});module.exports=Wt(Xt);var t=require("react");var Ot=["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"],Ee=(d,f)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let m=d.tagName.toLowerCase();if(m==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||d.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let u of f.excludeSelectors)if(d.matches(u))return!0}return At(d,f)},At=(d,f)=>{let m=[...Ot,...f?.excludeClasses||[]],u=d,C=0,W=5;for(;u&&C<=W;){if(m.some(L=>u.classList.contains(L)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,C++}return!1};var I=require("react"),it=({containerRef:d,config:f})=>{let m=f.enabled??!0,u=f.threshold??80,C=f.maxDistance??u*2,W=f.onRefresh,[L,D]=(0,I.useState)(0),[O,q]=(0,I.useState)(!1),N=(0,I.useRef)(0),ce=(0,I.useRef)(0),Y=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),ee=(0,I.useRef)(!1),se=(0,I.useRef)(0),A=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{A.current=O},[O]),(0,I.useEffect)(()=>{let T=d.current;if(!T||!(m&&typeof W=="function"))return;let He=g=>{let R=g instanceof Element?g:null;for(;R&&R!==T;){if(R instanceof HTMLElement&&R.scrollHeight>R.clientHeight+1&&R.scrollTop>0)return!1;R=R.parentElement}return!0},te=g=>{Y.current=!1,Z.current=!1,ee.current=!1,!A.current&&g.touches.length===1&&T.scrollTop===0&&He(g.target)&&(Y.current=!0,N.current=g.touches[0].clientY,ce.current=g.touches[0].clientX)},l=g=>{if(!Y.current||A.current||g.touches.length!==1)return;let R=g.touches[0].clientY-N.current,z=g.touches[0].clientX-ce.current;if(!Z.current){if(R<=0||T.scrollTop>0){Y.current=!1;return}if(R>8&&R>Math.abs(z))Z.current=!0,ee.current=T.scrollTop<0;else return}!ee.current&&g.cancelable&&g.preventDefault();let oe=Math.min(Math.max(R,0)*.5,C);se.current=oe,D(oe)},F=()=>{if(!Y.current||(Y.current=!1,!Z.current))return;Z.current=!1,ee.current=!1;let g=se.current;se.current=0,g>=u&&!A.current?(q(!0),D(u),Promise.resolve().then(()=>W()).catch(()=>{}).finally(()=>{q(!1),D(0)})):D(0)};return T.addEventListener("touchstart",te,{passive:!0}),T.addEventListener("touchmove",l,{passive:!1}),T.addEventListener("touchend",F,{passive:!0}),T.addEventListener("touchcancel",F,{passive:!0}),()=>{T.removeEventListener("touchstart",te),T.removeEventListener("touchmove",l),T.removeEventListener("touchend",F),T.removeEventListener("touchcancel",F)}},[d,m,W,u,C]),{pullDistance:L,isRefreshing:O,pullProgress:Math.min(L/u,1),pullThreshold:u}};var Se=require("react");function at(){let[d,f]=(0,Se.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,Se.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let m=window.matchMedia("(pointer: coarse)"),u=C=>f(C.matches);return f(m.matches),typeof m.addEventListener=="function"?(m.addEventListener("change",u),()=>m.removeEventListener("change",u)):(m.addListener(u),()=>m.removeListener(u))},[]),d}var S=require("react/jsx-runtime"),$t={},zt={},Nt={},Ft={},_t={},Bt={},Ut=(0,t.forwardRef)(({className:d="",style:f={},containerStyle:m={},contentStyle:u={},children:C,onScroll:W,thumb:L=$t,track:D=zt,arrows:O=Nt,dragScroll:q=Ft,autoHide:N=_t,pullToRefresh:ce=Bt,showScrollbar:Y=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:ee=!1},se)=>{let A=at(),T=A?!1:Y,Ce=A?!1:Z,He=(0,t.useRef)({});(0,t.useEffect)(()=>{He.current={children:C,onScroll:W,showScrollbar:T,showHorizontalScrollbar:Ce,thumb:L,track:D,arrows:O,dragScroll:q,autoHide:N}});let te=(0,t.useRef)(null),l=(0,t.useRef)(null),F=(0,t.useRef)(null),g=(0,t.useRef)(null),R=(0,t.useRef)(null),z=(0,t.useRef)(null),{pullDistance:oe,isRefreshing:ge,pullProgress:Le}=it({containerRef:l,config:ce}),Ue=ce.indicatorColor??"#1976d2",ct=oe>0||ge,[ve,M]=(0,t.useState)(!1),[B,Xe]=(0,t.useState)(!1),[qe,Ye]=(0,t.useState)(!1),[De,st]=(0,t.useState)({y:0,scrollTop:0}),[ue,Ge]=(0,t.useState)(0),[ut,Re]=(0,t.useState)(0),[re,je]=(0,t.useState)(!1),[Ke,Ve]=(0,t.useState)(!1),[U,Ze]=(0,t.useState)(!1),[ke,dt]=(0,t.useState)({x:0,scrollLeft:0}),[Ie,Qe]=(0,t.useState)(0),[Pe,Je]=(0,t.useState)(0),[ft,et]=(0,t.useState)(!1),ne=(0,t.useRef)(!1),[G,tt]=(0,t.useState)(!1),[de,pt]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[qt,Yt]=(0,t.useState)(null),[ye,xe]=(0,t.useState)(null),[Gt,ht]=(0,t.useState)(!1),[mt,bt]=(0,t.useState)(0),fe=(0,t.useRef)(null),[ot,rt]=(0,t.useState)(!1),pe=(0,t.useRef)(null),Q=(0,t.useRef)(null),J=(0,t.useRef)(null),E=(0,t.useMemo)(()=>{let e=L.color??"#606060";return{width:L.width??8,minHeight:L.minHeight??50,radius:L.radius??(L.width??8)/2,color:e,opacity:L.opacity??.6,hoverColor:L.hoverColor??e,hoverOpacity:L.hoverOpacity??1}},[L]),i=(0,t.useMemo)(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"outside",radius:D.radius??E.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,E.radius]),_=(0,t.useMemo)(()=>{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]),he=(0,t.useMemo)(()=>({enabled:A?!1:q.enabled??!0,excludeClasses:q.excludeClasses??[],excludeSelectors:q.excludeSelectors??[]}),[q,A]),c=(0,t.useMemo)(()=>({enabled:N.enabled??!0,delay:N.delay??1500,delayOnWheel:N.delayOnWheel??700,initialDelay:N.initialDelay??200}),[N]),[le,gt]=(0,t.useState)(()=>(N.initialDelay??200)>0),y=E.width,vt=i.width,We=E.minHeight,X=_.visible,we=_.step,$=(0,t.useCallback)(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);(0,t.useImperativeHandle)(se,()=>({getScrollContainer:()=>l.current,scrollTo:e=>{l.current&&l.current.scrollTo(e)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let h=(0,t.useCallback)(()=>{if(z.current){let o=z.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;z.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return z.current=l.current,l.current;if(!ee)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==l.current&&r.classList.contains("overlay-scrollbar-container"))continue;let a=r.parentElement,n=!1;for(;a&&a!==l.current;){if(a.classList.contains("overlay-scrollbar-container")&&a!==l.current){n=!0;break}a=a.parentElement}if(!n&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return z.current=r,r}return null},[]),j=(0,t.useCallback)(()=>h()!==null,[h]),x=(0,t.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Te=(0,t.useCallback)(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),nt=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),yt=(0,t.useCallback)(()=>{Te(),!(B||U||G||ne.current)&&(x(),M(!1))},[x,Te,B,U,G]),v=(0,t.useCallback)(e=>{c.enabled&&(x(),pe.current=setTimeout(()=>{M(!1),pe.current=null},e))},[x,c.enabled]),p=(0,t.useCallback)(()=>{let e=h()??l.current;if(!e){M(!1),je(!1),et(!1),x();return}!c.enabled&&!le&&(M(!0),x());let o=e.clientHeight,r=e.scrollHeight,a=e.scrollTop,n=e.clientWidth,s=e.scrollWidth,w=e.scrollLeft,H=r-o>0,b=s-n>0,ie=H||b;je(H),et(b),ie||(M(!1),x());let me=0,P=0;if(te.current){let K=window.getComputedStyle(te.current),V=parseFloat(K.paddingTop)||0;P=parseFloat(K.paddingBottom)||0,me=V+P,bt(P)}if(H){let K=X?y*2+i.margin*4:i.margin*2,V=o-K+me,Me=o/r,ae=Math.max(V*Me,We),lt=r-o,Ht=V-ae,Lt=lt>0?a/lt*Ht:0;Ge(ae),Re(Lt)}else Ge(0),Re(0);let be=s-n;if(be>0){let K=n/s,V=Math.max(n*K,50),Me=n-V,ae=be>0?w/be*Me:0;Qe(V),Je(ae)}else Qe(0),Je(0)},[h,x,X,y,We,c.enabled,le]),xt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Xe(!0),st({y:e.clientY,scrollTop:o.scrollTop}),x(),M(!0),$())},[h,x,$]),Oe=(0,t.useCallback)(e=>{if(!B)return;let o=h();if(!o)return;let r=o.clientHeight,n=o.scrollHeight-r,s=e.clientY-De.y,w=r-ue,H=s/w*n,b=Math.max(0,Math.min(n,De.scrollTop+H));o.scrollTop=b,p()},[B,De,ue,p,h]),Ae=(0,t.useCallback)(()=>{Xe(!1),j()&&v(c.delay)},[j,v,c.delay]),wt=(0,t.useCallback)(e=>{if(!g.current)return;let r=g.current.getBoundingClientRect(),a=e.clientY-r.top,n=h();if(!n)return;let s=n.clientHeight,w=n.scrollHeight,b=a/s*(w-s);n.scrollTop=Math.max(0,Math.min(w-s,b)),p(),M(!0),v(c.delay),$()},[p,v,c.delay,h,$]),Tt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let o=Math.max(0,l.current.scrollTop-we);l.current.scrollTop=o,p(),M(!0),v(c.delay),$()},[p,v,we,c.delay,$]),Mt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!F.current)return;let o=l.current,a=F.current.scrollHeight-o.clientHeight,n=Math.min(a,o.scrollTop+we);o.scrollTop=n,p(),M(!0),v(c.delay),$()},[p,v,we,c.delay,$]),Et=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Ze(!0),dt({x:e.clientX,scrollLeft:o.scrollLeft}),x(),M(!0),$())},[h,x,$]),$e=(0,t.useCallback)(e=>{if(!U)return;let o=h();if(!o)return;let r=o.clientWidth,n=o.scrollWidth-r,s=e.clientX-ke.x,w=r-Ie,H=s/w*n,b=Math.max(0,Math.min(n,ke.scrollLeft+H));o.scrollLeft=b,p()},[U,ke,Ie,p,h]),ze=(0,t.useCallback)(()=>{Ze(!1),j()&&v(c.delay)},[j,v,c.delay]),St=(0,t.useCallback)(e=>{if(!g.current)return;let r=g.current.getBoundingClientRect(),a=e.clientX-r.left,n=h();if(!n)return;let s=n.clientWidth,w=n.scrollWidth,b=a/s*(w-s);n.scrollLeft=Math.max(0,Math.min(w-s,b)),p(),M(!0),v(c.delay),$()},[p,v,c.delay,h,$]),Ct=(0,t.useCallback)(e=>{if(!he.enabled||e.defaultPrevented)return;let o=e.target,r=l.current;if(!r||!r.contains(o)||Ee(o,he)||e.button!==0)return;let a=h();a&&(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth||(e.preventDefault(),ne.current=!0,pt({x:e.clientX,y:e.clientY,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft||0}),x()))},[he,Ee,h,x]),Ne=(0,t.useCallback)(e=>{if(!ne.current&&!G)return;let o=h();if(!o)return;let r=de.x-e.clientX,a=de.y-e.clientY;if(Math.abs(a)<5&&Math.abs(r)<5)return;ne.current&&(ne.current=!1,tt(!0)),M(!0);let n=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,de.scrollTop+a)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,de.scrollLeft+r));o.scrollTop=n,o.scrollLeft=s,p()},[G,de,h,p]),Fe=(0,t.useCallback)(()=>{let e=G;ne.current=!1,tt(!1),e&&j()&&v(c.delay)},[G,j,v,c.delay]);(0,t.useEffect)(()=>{let e=s=>{if(p(),le){W&&W(s);return}x(),M(!0),nt();let w=ot?c.delayOnWheel:c.delay;v(w),W&&W(s)},o=()=>{rt(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>{rt(!1)},300),nt(),J.current=setTimeout(()=>{M(!0),J.current=null,v(c.delayOnWheel)},50)},r=[],a=h();a&&r.push(a);let n=l.current;return n&&!a&&(r.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let H=w;if(H!==n&&H.classList.contains("overlay-scrollbar-container"))return;let b=H.parentElement;for(;b&&b!==n;){if(b.classList.contains("overlay-scrollbar-container")&&b!==n)return;b=b.parentElement}r.push(H)})),r.forEach(s=>{s.addEventListener("scroll",e,{passive:!0}),s.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(s=>{s.removeEventListener("scroll",e),s.removeEventListener("wheel",o)}),fe.current&&clearTimeout(fe.current),J.current&&clearTimeout(J.current)}},[h,p,W,x,v,c,ot,le]),(0,t.useEffect)(()=>{let e=r=>{let a=r.target;if(r.defaultPrevented||a instanceof Element&&Ee(a,he))return;let n=h();if(!n)return;let{key:s}=r,{scrollTop:w,scrollHeight:H,clientHeight:b}=n,ie=H-b,me=50,P=null;switch(s){case"ArrowUp":r.preventDefault(),P=Math.max(0,w-me);break;case"ArrowDown":r.preventDefault(),P=Math.min(ie,w+me);break;case"PageUp":r.preventDefault(),P=Math.max(0,w-b);break;case"PageDown":r.preventDefault(),P=Math.min(ie,w+b);break;case"Home":r.preventDefault(),P=0;break;case"End":r.preventDefault(),P=ie;break;default:return}if(P!==null){let be=P/ie,K=X?y*2+i.margin*4:i.margin*2,ae=(b-K-ue)*be;Re(ae),n.scrollTop=P,x(),M(!0),v(c.delay)}},o=l.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[h,X,y,i.margin,ue,x,v,c.delay,he]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ne),document.addEventListener("mouseup",Fe),()=>{document.removeEventListener("mousemove",Ne),document.removeEventListener("mouseup",Fe)}),[G,Ne,Fe]),(0,t.useEffect)(()=>{if(B)return document.addEventListener("mousemove",Oe),document.addEventListener("mouseup",Ae),()=>{document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",Ae)}},[B,Oe,Ae]),(0,t.useEffect)(()=>{if(U)return document.addEventListener("mousemove",$e),document.addEventListener("mouseup",ze),()=>{document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",ze)}},[U,$e,ze]),(0,t.useEffect)(()=>{p();let e=setTimeout(()=>{p()},100);return()=>clearTimeout(e)},[p]),(0,t.useLayoutEffect)(()=>{ht(!0),p(),!c.enabled&&!le&&j()&&M(!0)},[j,p,c.enabled,le]),(0,t.useEffect)(()=>{if(c.initialDelay>0){let e=setTimeout(()=>{gt(!1)},c.initialDelay);return()=>clearTimeout(e)}},[c.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{p()}),o=[];return l.current&&o.push(l.current),F.current&&o.push(F.current),z.current&&document.contains(z.current)&&o.push(z.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[p]),(0,t.useEffect)(()=>{if(!l.current)return;let e=new MutationObserver(()=>{z.current=null,p()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[p]);let k=Math.max(vt,y);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");r.id=e;let a=A?"":`
2
- /* \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 */
3
- .overlay-scrollbar-container {
4
- scrollbar-width: none !important;
5
- -ms-overflow-style: none !important;
6
- }
7
- .overlay-scrollbar-container::-webkit-scrollbar {
8
- display: none !important;
9
- width: 0 !important;
10
- height: 0 !important;
11
- }
12
- .overlay-scrollbar-container::-webkit-scrollbar-track {
13
- display: none !important;
14
- }
15
- .overlay-scrollbar-container::-webkit-scrollbar-thumb {
16
- display: none !important;
17
- }`;return r.textContent=`${a}
1
+ "use strict";var Ge=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var Bt=Object.prototype.hasOwnProperty;var _t=(d,f)=>{for(var m in f)Ge(d,m,{get:f[m],enumerable:!0})},Ut=(d,f,m,u)=>{if(f&&typeof f=="object"||typeof f=="function")for(let H of Nt(f))!Bt.call(d,H)&&H!==m&&Ge(d,H,{get:()=>f[H],enumerable:!(u=Ft(f,H))||u.enumerable});return d};var Yt=d=>Ut(Ge({},"__esModule",{value:!0}),d);var eo={};_t(eo,{OverlayScrollbar:()=>Ke,default:()=>Ke});module.exports=Yt(eo);var t=require("react");var Xt=["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=(d,f)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let m=d.tagName.toLowerCase();if(m==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||d.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let u of f.excludeSelectors)if(d.matches(u))return!0}return qt(d,f)},qt=(d,f)=>{let m=[...Xt,...f?.excludeClasses||[]],u=d,H=0,P=5;for(;u&&H<=P;){if(m.some(k=>u.classList.contains(k)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,H++}return!1};var I=require("react"),pt=({containerRef:d,config:f})=>{let m=f.enabled??!0,u=f.threshold??80,H=f.maxDistance??u*2,P=f.onRefresh,[k,D]=(0,I.useState)(0),[W,U]=(0,I.useState)(!1),A=(0,I.useRef)(0),ce=(0,I.useRef)(0),Y=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),te=(0,I.useRef)(!1),X=(0,I.useRef)(0),oe=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{oe.current=W},[W]),(0,I.useEffect)(()=>{let y=d.current;if(!y||!(m&&typeof P=="function"))return;let xe=E=>{let L=E instanceof Element?E:null;for(;L&&L!==y;){if(L instanceof HTMLElement&&L.scrollHeight>L.clientHeight+1&&L.scrollTop>0)return!1;L=L.parentElement}return!0},De=E=>{Y.current=!1,Z.current=!1,te.current=!1,!oe.current&&E.touches.length===1&&y.scrollTop===0&&xe(E.target)&&(Y.current=!0,A.current=E.touches[0].clientY,ce.current=E.touches[0].clientX)},Q=E=>{if(!Y.current||oe.current||E.touches.length!==1)return;let L=E.touches[0].clientY-A.current,Re=E.touches[0].clientX-ce.current;if(!Z.current){if(L<=0||y.scrollTop>0){Y.current=!1;return}if(L>8&&L>Math.abs(Re))Z.current=!0,te.current=y.scrollTop<0;else return}!te.current&&E.cancelable&&E.preventDefault();let ue=Math.min(Math.max(L,0)*.5,H);X.current=ue,D(ue)},q=()=>{if(!Y.current||(Y.current=!1,!Z.current))return;Z.current=!1,te.current=!1;let E=X.current;X.current=0,E>=u&&!oe.current?(U(!0),D(u),Promise.resolve().then(()=>P()).catch(()=>{}).finally(()=>{U(!1),D(0)})):D(0)};return y.addEventListener("touchstart",De,{passive:!0}),y.addEventListener("touchmove",Q,{passive:!1}),y.addEventListener("touchend",q,{passive:!0}),y.addEventListener("touchcancel",q,{passive:!0}),()=>{y.removeEventListener("touchstart",De),y.removeEventListener("touchmove",Q),y.removeEventListener("touchend",q),y.removeEventListener("touchcancel",q)}},[d,m,P,u,H]),{pullDistance:k,isRefreshing:W,pullProgress:Math.min(k/u,1),pullThreshold:u}};var ke=require("react");function ht(){let[d,f]=(0,ke.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,ke.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let m=window.matchMedia("(pointer: coarse)"),u=H=>f(H.matches);return f(m.matches),typeof m.addEventListener=="function"?(m.addEventListener("change",u),()=>m.removeEventListener("change",u)):(m.addListener(u),()=>m.removeListener(u))},[]),d}var v=require("react/jsx-runtime"),jt={},Gt={},Kt={},Vt={},Zt={},Qt={},Jt=(0,t.forwardRef)(({className:d="",style:f={},containerStyle:m={},contentStyle:u={},children:H,onScroll:P,thumb:k=jt,track:D=Gt,arrows:W=Kt,dragScroll:U=Vt,autoHide:A=Zt,pullToRefresh:ce=Qt,showScrollbar:Y=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:te=!1,scrollTopFab:X=!1},oe)=>{let y=ht(),re=y?!1:Y,xe=y?!1:Z,Q=`os-${(0,t.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,q=X!==!1&&X!=null,E=typeof X=="object"?X:{},L=E.threshold??200,Re=E.position??"left",ue=E.offset??16,[Ie,mt]=(0,t.useState)(!1),bt=(0,t.useRef)({});(0,t.useEffect)(()=>{bt.current={children:H,onScroll:P,showScrollbar:re,showHorizontalScrollbar:xe,thumb:k,track:D,arrows:W,dragScroll:U,autoHide:A}});let $e=(0,t.useRef)(null),a=(0,t.useRef)(null),de=(0,t.useRef)(null),fe=(0,t.useRef)(null),gt=(0,t.useRef)(null),F=(0,t.useRef)(null),{pullDistance:Pe,isRefreshing:we,pullProgress:We}=pt({containerRef:a,config:ce}),Ve=ce.indicatorColor??"#1976d2",vt=Pe>0||we,[Te,M]=(0,t.useState)(!1),[N,Ze]=(0,t.useState)(!1),[Qe,Je]=(0,t.useState)(!1),[Oe,yt]=(0,t.useState)({y:0,scrollTop:0}),[pe,et]=(0,t.useState)(0),[xt,Ae]=(0,t.useState)(0),[ne,tt]=(0,t.useState)(!1),[ot,rt]=(0,t.useState)(!1),[B,nt]=(0,t.useState)(!1),[ze,wt]=(0,t.useState)({x:0,scrollLeft:0}),[Fe,lt]=(0,t.useState)(0),[Ne,it]=(0,t.useState)(0),[Tt,at]=(0,t.useState)(!1),le=(0,t.useRef)(!1),[j,st]=(0,t.useState)(!1),[he,Et]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[to,oo]=(0,t.useState)(null),[Ee,Me]=(0,t.useState)(null),[ro,Mt]=(0,t.useState)(!1),[St,Ct]=(0,t.useState)(0),me=(0,t.useRef)(null),[ct,ut]=(0,t.useState)(!1),be=(0,t.useRef)(null),J=(0,t.useRef)(null),ee=(0,t.useRef)(null),S=(0,t.useMemo)(()=>{let e=k.color??"#606060";return{width:k.width??8,minHeight:k.minHeight??50,radius:k.radius??(k.width??8)/2,color:e,opacity:k.opacity??.6,hoverColor:k.hoverColor??e,hoverOpacity:k.hoverOpacity??1}},[k]),l=(0,t.useMemo)(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"outside",radius:D.radius??S.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,S.radius]),z=(0,t.useMemo)(()=>{let e=W.color??"#808080";return{visible:W.visible??!1,step:W.step??50,color:e,opacity:W.opacity??.6,hoverColor:W.hoverColor??e,hoverOpacity:W.hoverOpacity??1}},[W]),ge=(0,t.useMemo)(()=>({enabled:y?!1:U.enabled??!0,excludeClasses:U.excludeClasses??[],excludeSelectors:U.excludeSelectors??[]}),[U,y]),s=(0,t.useMemo)(()=>({enabled:A.enabled??!0,delay:A.delay??1500,delayOnWheel:A.delayOnWheel??700,initialDelay:A.initialDelay??200}),[A]),[ie,Ht]=(0,t.useState)(()=>(A.initialDelay??200)>0),x=S.width,Lt=l.width,Be=S.minHeight,_=z.visible,Se=z.step,O=(0,t.useCallback)(()=>{if(!a.current)return;let e=document.activeElement;e&&a.current.contains(e)&&e!==a.current||a.current.focus()},[]);(0,t.useImperativeHandle)(oe,()=>({getScrollContainer:()=>a.current,scrollTo:e=>{a.current&&a.current.scrollTo(e)},get scrollTop(){return a.current?.scrollTop||0},get scrollHeight(){return a.current?.scrollHeight||0},get clientHeight(){return a.current?.clientHeight||0}}),[]);let h=(0,t.useCallback)(()=>{if(F.current){let o=F.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;F.current=null}if(!a.current)return null;if(a.current.scrollHeight>a.current.clientHeight+2||a.current.scrollWidth>a.current.clientWidth+2)return F.current=a.current,a.current;if(!te)return null;let e=a.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==a.current&&r.classList.contains("overlay-scrollbar-container"))continue;let n=r.parentElement,i=!1;for(;n&&n!==a.current;){if(n.classList.contains("overlay-scrollbar-container")&&n!==a.current){i=!0;break}n=n.parentElement}if(!i&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return F.current=r,r}return null},[]),G=(0,t.useCallback)(()=>h()!==null,[h]),w=(0,t.useCallback)(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Ce=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),dt=(0,t.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),kt=(0,t.useCallback)(()=>{Ce(),!(N||B||j||le.current)&&(w(),M(!1))},[w,Ce,N,B,j]),g=(0,t.useCallback)(e=>{s.enabled&&(w(),be.current=setTimeout(()=>{M(!1),be.current=null},e))},[w,s.enabled]),p=(0,t.useCallback)(()=>{let e=h()??a.current;if(!e){M(!1),tt(!1),at(!1),w();return}!s.enabled&&!ie&&(M(!0),w());let o=e.clientHeight,r=e.scrollHeight,n=e.scrollTop,i=e.clientWidth,c=e.scrollWidth,T=e.scrollLeft,C=r-o>0,b=c-i>0,ae=C||b;tt(C),at(b),ae||(M(!1),w());let ve=0,$=0;if($e.current){let K=window.getComputedStyle($e.current),V=parseFloat(K.paddingTop)||0;$=parseFloat(K.paddingBottom)||0,ve=V+$,Ct($)}if(C){let K=_?x*2+l.margin*4:l.margin*2,V=o-K+ve,He=o/r,se=Math.max(V*He,Be),ft=r-o,At=V-se,zt=ft>0?n/ft*At:0;et(se),Ae(zt)}else et(0),Ae(0);let ye=c-i;if(ye>0){let K=i/c,V=Math.max(i*K,50),He=i-V,se=ye>0?T/ye*He:0;lt(V),it(se)}else lt(0),it(0)},[h,w,_,x,Be,s.enabled,ie]),Dt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Ze(!0),yt({y:e.clientY,scrollTop:o.scrollTop}),w(),M(!0),O())},[h,w,O]),_e=(0,t.useCallback)(e=>{if(!N)return;let o=h();if(!o)return;let r=o.clientHeight,i=o.scrollHeight-r,c=e.clientY-Oe.y,T=r-pe,C=c/T*i,b=Math.max(0,Math.min(i,Oe.scrollTop+C));o.scrollTop=b,p()},[N,Oe,pe,p,h]),Ue=(0,t.useCallback)(()=>{Ze(!1),G()&&g(s.delay)},[G,g,s.delay]),Rt=(0,t.useCallback)(e=>{if(!fe.current)return;let r=fe.current.getBoundingClientRect(),n=e.clientY-r.top,i=h();if(!i)return;let c=i.clientHeight,T=i.scrollHeight,b=n/c*(T-c);i.scrollTop=Math.max(0,Math.min(T-c,b)),p(),M(!0),g(s.delay),O()},[p,g,s.delay,h,O]),It=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current)return;let o=Math.max(0,a.current.scrollTop-Se);a.current.scrollTop=o,p(),M(!0),g(s.delay),O()},[p,g,Se,s.delay,O]),$t=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current||!de.current)return;let o=a.current,n=de.current.scrollHeight-o.clientHeight,i=Math.min(n,o.scrollTop+Se);o.scrollTop=i,p(),M(!0),g(s.delay),O()},[p,g,Se,s.delay,O]),Pt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(nt(!0),wt({x:e.clientX,scrollLeft:o.scrollLeft}),w(),M(!0),O())},[h,w,O]),Ye=(0,t.useCallback)(e=>{if(!B)return;let o=h();if(!o)return;let r=o.clientWidth,i=o.scrollWidth-r,c=e.clientX-ze.x,T=r-Fe,C=c/T*i,b=Math.max(0,Math.min(i,ze.scrollLeft+C));o.scrollLeft=b,p()},[B,ze,Fe,p,h]),Xe=(0,t.useCallback)(()=>{nt(!1),G()&&g(s.delay)},[G,g,s.delay]),Wt=(0,t.useCallback)(e=>{if(!fe.current)return;let r=fe.current.getBoundingClientRect(),n=e.clientX-r.left,i=h();if(!i)return;let c=i.clientWidth,T=i.scrollWidth,b=n/c*(T-c);i.scrollLeft=Math.max(0,Math.min(T-c,b)),p(),M(!0),g(s.delay),O()},[p,g,s.delay,h,O]),Ot=(0,t.useCallback)(e=>{if(!ge.enabled||e.defaultPrevented)return;let o=e.target,r=a.current;if(!r||!r.contains(o)||Le(o,ge)||e.button!==0)return;let n=h();n&&(n.scrollHeight<=n.clientHeight&&n.scrollWidth<=n.clientWidth||(e.preventDefault(),le.current=!0,Et({x:e.clientX,y:e.clientY,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft||0}),w()))},[ge,Le,h,w]),qe=(0,t.useCallback)(e=>{if(!le.current&&!j)return;let o=h();if(!o)return;let r=he.x-e.clientX,n=he.y-e.clientY;if(Math.abs(n)<5&&Math.abs(r)<5)return;le.current&&(le.current=!1,st(!0)),M(!0);let i=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,he.scrollTop+n)),c=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,he.scrollLeft+r));o.scrollTop=i,o.scrollLeft=c,p()},[j,he,h,p]),je=(0,t.useCallback)(()=>{let e=j;le.current=!1,st(!1),e&&G()&&g(s.delay)},[j,G,g,s.delay]);(0,t.useEffect)(()=>{let e=c=>{if(p(),q){let C=c.target?.scrollTop??0;mt(C>L)}if(ie){P&&P(c);return}w(),M(!0),dt();let T=ct?s.delayOnWheel:s.delay;g(T),P&&P(c)},o=()=>{ut(!0),me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{ut(!1)},300),dt(),ee.current=setTimeout(()=>{M(!0),ee.current=null,g(s.delayOnWheel)},50)},r=[],n=h();n&&r.push(n);let i=a.current;return i&&!n&&(r.push(i),i.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(T=>{let C=T;if(C!==i&&C.classList.contains("overlay-scrollbar-container"))return;let b=C.parentElement;for(;b&&b!==i;){if(b.classList.contains("overlay-scrollbar-container")&&b!==i)return;b=b.parentElement}r.push(C)})),r.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",o)}),me.current&&clearTimeout(me.current),ee.current&&clearTimeout(ee.current)}},[h,p,P,w,g,s,ct,ie,q,L]),(0,t.useEffect)(()=>{let e=r=>{let n=r.target;if(r.defaultPrevented||n instanceof Element&&Le(n,ge))return;let i=h();if(!i)return;let{key:c}=r,{scrollTop:T,scrollHeight:C,clientHeight:b}=i,ae=C-b,ve=50,$=null;switch(c){case"ArrowUp":r.preventDefault(),$=Math.max(0,T-ve);break;case"ArrowDown":r.preventDefault(),$=Math.min(ae,T+ve);break;case"PageUp":r.preventDefault(),$=Math.max(0,T-b);break;case"PageDown":r.preventDefault(),$=Math.min(ae,T+b);break;case"Home":r.preventDefault(),$=0;break;case"End":r.preventDefault(),$=ae;break;default:return}if($!==null){let ye=$/ae,K=_?x*2+l.margin*4:l.margin*2,se=(b-K-pe)*ye;Ae(se),i.scrollTop=$,w(),M(!0),g(s.delay)}},o=a.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[h,_,x,l.margin,pe,w,g,s.delay,ge]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",qe),document.addEventListener("mouseup",je),()=>{document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",je)}),[j,qe,je]),(0,t.useEffect)(()=>{if(N)return document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ue),()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ue)}},[N,_e,Ue]),(0,t.useEffect)(()=>{if(B)return document.addEventListener("mousemove",Ye),document.addEventListener("mouseup",Xe),()=>{document.removeEventListener("mousemove",Ye),document.removeEventListener("mouseup",Xe)}},[B,Ye,Xe]),(0,t.useEffect)(()=>{p();let e=setTimeout(()=>{p()},100);return()=>clearTimeout(e)},[p]),(0,t.useLayoutEffect)(()=>{Mt(!0),p(),!s.enabled&&!ie&&G()&&M(!0)},[G,p,s.enabled,ie]),(0,t.useEffect)(()=>{if(s.initialDelay>0){let e=setTimeout(()=>{Ht(!1)},s.initialDelay);return()=>clearTimeout(e)}},[s.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{p()}),o=[];return a.current&&o.push(a.current),de.current&&o.push(de.current),F.current&&document.contains(F.current)&&o.push(F.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[p]),(0,t.useEffect)(()=>{if(!a.current)return;let e=new MutationObserver(()=>{F.current=null,p()});return e.observe(a.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[p]);let R=Math.max(Lt,x);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-shared";if(document.getElementById(e))return;let o=document.createElement("style");o.id=e,o.textContent=`
18
2
  /* ehfuse-editor-content\uB294 \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0 */
19
3
  .overlay-scrollbar-container .ehfuse-editor-content {
20
4
  scrollbar-width: thin !important;
@@ -43,5 +27,31 @@
43
27
  from { transform: rotate(0deg); }
44
28
  to { transform: rotate(360deg); }
45
29
  }
46
- `,document.head.appendChild(r),()=>{let n=document.getElementById(e);n&&n.remove()}},[A]),(0,S.jsxs)("div",{ref:te,className:`overlay-scrollbar-wrapper ${d}`,onMouseLeave:yt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...f},children:[ct&&(0,S.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${oe-56}px)`,transition:ge?"transform 0.15s ease-out":oe===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:ge?1:Math.min(Le*1.5,1)},children:ge?(0,S.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,S.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ue,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,S.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${Le*270}deg)`,opacity:Le>=1?1:.6},children:(0,S.jsx)("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:Ue})})}),(0,S.jsx)("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Ct,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",...A?{}:{scrollbarWidth:"none",msOverflowStyle:"none"},outline:"none",userSelect:G?"none":"auto",...m},children:(0,S.jsx)("div",{ref:F,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...u},children:C})}),T&&re&&(i.overflowY??!0)&&(0,S.jsxs)("div",{ref:g,className:"overlay-scrollbar-track",onMouseEnter:()=>{x(),Q.current=setTimeout(()=>{M(!0),Q.current=null},100)},onMouseLeave:()=>{Te(),B||v(c.delay)},style:{position:"absolute",top:0,right:0,width:`${k}px`,height:"100%",opacity:ve?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),wt(e)},style:{position:"absolute",top:X?`${E.width+i.margin*2}px`:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-E.width)/2}px`,width:`${E.width}px`,height:X?`calc(100% - ${E.width*2+i.margin*4}px)`:`calc(100% - ${i.margin*2}px)`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{ref:R,className:"overlay-scrollbar-thumb",onMouseDown:xt,onMouseEnter:()=>Ye(!0),onMouseLeave:()=>Ye(!1),style:{position:"absolute",top:`${(X?y+i.margin*2:i.margin)+ut}px`,right:i.alignment==="outside"?"0px":`${(k-y)/2}px`,width:`${y}px`,height:`${Math.max(ue,We)}px`,backgroundColor:qe||B?E.hoverColor:E.color,opacity:qe||B?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),T&&re&&X&&(0,S.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:Tt,onMouseEnter:()=>xe("up"),onMouseLeave:()=>xe(null),style:{position:"absolute",top:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-y)/2}px`,width:`${y}px`,height:`${y}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(y*.75,8)}px`,color:ye==="up"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:ve?ye==="up"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),T&&re&&X&&(0,S.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:Mt,onMouseEnter:()=>xe("down"),onMouseLeave:()=>xe(null),style:{position:"absolute",bottom:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-y)/2}px`,width:`${y}px`,height:`${y}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(y*.75,8)}px`,color:ye==="down"?_.hoverColor:_.color,userSelect:"none",zIndex:1001,opacity:ve?ye==="down"?_.hoverOpacity:_.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),T&&Ce&&ft&&(i.overflowX??!0)&&(0,S.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{x(),Q.current=setTimeout(()=>{M(!0),Q.current=null},100)},onMouseLeave:()=>{Te(),U||v(c.delay)},style:{position:"absolute",bottom:`${mt}px`,left:0,width:"100%",height:`${k}px`,opacity:ve?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),St(e)},style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(k-y)/2}px`,left:`${i.margin}px`,right:re?i.alignment==="outside"?`${k-i.margin}px`:`${k}px`:`${i.margin}px`,height:`${y}px`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Et,onMouseEnter:()=>Ve(!0),onMouseLeave:()=>Ve(!1),style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(k-y)/2}px`,left:`${i.margin+Pe}px`,right:re?i.alignment==="outside"?`${k-i.margin}px`:`${k}px`:"auto",maxWidth:re?i.alignment==="outside"?`calc(100% - ${i.margin+Pe+k-i.margin}px)`:`calc(100% - ${i.margin+Pe+k}px)`:"none",width:`${Math.max(Ie,50)}px`,height:`${y}px`,backgroundColor:Ke||U?E.hoverColor:E.color,opacity:Ke||U?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Be=Ut;
30
+ `,document.head.appendChild(o)},[]),(0,t.useEffect)(()=>{let e=`overlay-scrollbar-instance-${Q}`,o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");r.id=e;let n=`.${Q}`;return r.textContent=y?`
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()}},[y,Q]),(0,v.jsxs)("div",{ref:$e,className:`overlay-scrollbar-wrapper ${d}`,onMouseLeave:kt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...f},children:[vt&&(0,v.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${Pe-56}px)`,transition:we?"transform 0.15s ease-out":Pe===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:we?1:Math.min(We*1.5,1)},children:we?(0,v.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ve,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,v.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${We*270}deg)`,opacity:We>=1?1:.6},children:(0,v.jsx)("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:Ve})})}),(0,v.jsx)("div",{ref:a,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:Ot,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...m},children:(0,v.jsx)("div",{ref:de,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...u},children:H})}),re&&ne&&(l.overflowY??!0)&&(0,v.jsxs)("div",{ref:fe,className:"overlay-scrollbar-track",onMouseEnter:()=>{w(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{Ce(),N||g(s.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&&(0,v.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Rt(e)},style:{position:"absolute",top:_?`${S.width+l.margin*2}px`:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-S.width)/2}px`,width:`${S.width}px`,height:_?`calc(100% - ${S.width*2+l.margin*4}px)`:`calc(100% - ${l.margin*2}px)`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),(0,v.jsx)("div",{ref:gt,className:"overlay-scrollbar-thumb",onMouseDown:Dt,onMouseEnter:()=>Je(!0),onMouseLeave:()=>Je(!1),style:{position:"absolute",top:`${(_?x+l.margin*2:l.margin)+xt}px`,right:l.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${Math.max(pe,Be)}px`,backgroundColor:Qe||N?S.hoverColor:S.color,opacity:Qe||N?S.hoverOpacity:S.opacity,borderRadius:`${S.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),re&&ne&&_&&(0,v.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:It,onMouseEnter:()=>Me("up"),onMouseLeave:()=>Me(null),style:{position:"absolute",top:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:Ee==="up"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Te?Ee==="up"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),re&&ne&&_&&(0,v.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:$t,onMouseEnter:()=>Me("down"),onMouseLeave:()=>Me(null),style:{position:"absolute",bottom:`${l.margin}px`,right:l.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:Ee==="down"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Te?Ee==="down"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),re&&xe&&Tt&&(l.overflowX??!0)&&(0,v.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{w(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{Ce(),B||g(s.delay)},style:{position:"absolute",bottom:`${St}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&&(0,v.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Wt(e)},style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${l.margin}px`,right:ne?l.alignment==="outside"?`${R-l.margin}px`:`${R}px`:`${l.margin}px`,height:`${x}px`,backgroundColor:l.color,borderRadius:`${l.radius}px`,cursor:"pointer"}}),(0,v.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Pt,onMouseEnter:()=>rt(!0),onMouseLeave:()=>rt(!1),style:{position:"absolute",bottom:l.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${l.margin+Ne}px`,right:ne?l.alignment==="outside"?`${R-l.margin}px`:`${R}px`:"auto",maxWidth:ne?l.alignment==="outside"?`calc(100% - ${l.margin+Ne+R-l.margin}px)`:`calc(100% - ${l.margin+Ne+R}px)`:"none",width:`${Math.max(Fe,50)}px`,height:`${x}px`,backgroundColor:ot||B?S.hoverColor:S.color,opacity:ot||B?S.hoverOpacity:S.opacity,borderRadius:`${S.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),q&&(0,v.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>a.current?.scrollTo({top:0,behavior:"smooth"}),style:{position:"absolute",[Re]:ue,bottom:ue,zIndex:1200,width:40,height:40,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:"#ffffff",color:"#334155",boxShadow:"0 2px 8px rgba(15, 23, 42, 0.24)",cursor:"pointer",opacity:Ie?1:0,transform:Ie?"translateY(0) scale(1)":"translateY(8px) scale(0.9)",pointerEvents:Ie?"auto":"none",transition:"opacity 0.2s ease, transform 0.2s ease"},children:(0,v.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,v.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})}),Ke=Jt;
47
57
  //# sourceMappingURL=index.js.map