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