@ehfuse/overlay-scrollbar 1.6.21 β†’ 1.6.23

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/README.md CHANGED
@@ -6,34 +6,34 @@ A highly customizable React component that provides a beautiful overlay scrollba
6
6
 
7
7
  ## πŸ“š Documentation
8
8
 
9
- - **[Getting Started (English)](https://github.com/ehfuse/overlay-scrollbar/blob/main/docs/getting-started-en.md)** - Complete setup and usage guide
10
- - **[μ‹œμž‘ν•˜κΈ° (ν•œκ΅­μ–΄)](https://github.com/ehfuse/overlay-scrollbar/blob/main/docs/getting-started-ko.md)** - μ„€μΉ˜ 및 μ‚¬μš©λ²• κ°€μ΄λ“œ
9
+ - **[Getting Started (English)](https://github.com/ehfuse/overlay-scrollbar/blob/main/docs/getting-started-en.md)** - Complete setup and usage guide
10
+ - **[μ‹œμž‘ν•˜κΈ° (ν•œκ΅­μ–΄)](https://github.com/ehfuse/overlay-scrollbar/blob/main/docs/getting-started-ko.md)** - μ„€μΉ˜ 및 μ‚¬μš©λ²• κ°€μ΄λ“œ
11
11
 
12
12
  ## ✨ Key Features
13
13
 
14
- - 🎨 **Fully Customizable** - Control colors, sizes, radius, and positioning
15
- - πŸ–±οΈ **Drag Scroll** - Mouse drag scrolling with smart UI library exclusion
16
- - 🏹 **Arrow Navigation** - Optional arrow buttons for precise control
17
- - ⚑ **Smooth Animations** - Fade transitions and hover effects
18
- - πŸ” **Smart Auto-hide** - Intelligent visibility management
19
- - 🧠 **Smart Input Detection** - Excludes interactive elements automatically
20
- - πŸ€– **Auto-Detection** - Automatically finds scrollable containers (Virtuoso, react-window, etc.)
21
- - πŸ”§ **TypeScript** - Complete type definitions
22
- - πŸͺΆ **Zero Dependencies** - Only requires React
23
- - β™Ώ **Accessible** - Preserves native scroll behavior
14
+ - 🎨 **Fully Customizable** - Control colors, sizes, radius, and positioning
15
+ - πŸ–±οΈ **Drag Scroll** - Mouse drag scrolling with smart UI library exclusion
16
+ - 🏹 **Arrow Navigation** - Optional arrow buttons for precise control
17
+ - ⚑ **Smooth Animations** - Fade transitions and hover effects
18
+ - πŸ” **Smart Auto-hide** - Intelligent visibility management
19
+ - 🧠 **Smart Input Detection** - Excludes interactive elements automatically
20
+ - πŸ€– **Auto-Detection** - Automatically finds scrollable containers (Virtuoso, react-window, etc.)
21
+ - πŸ”§ **TypeScript** - Complete type definitions
22
+ - πŸͺΆ **Zero Dependencies** - Only requires React
23
+ - β™Ώ **Accessible** - Preserves native scroll behavior
24
24
 
25
25
  ## ✨ μ£Όμš” κΈ°λŠ₯
26
26
 
27
- - 🎨 **μ™„μ „ν•œ μ»€μŠ€ν„°λ§ˆμ΄μ§•** - 색상, 크기, λ‘₯κ·Ό λͺ¨μ„œλ¦¬, μœ„μΉ˜ μ œμ–΄
28
- - πŸ–±οΈ **λ“œλž˜κ·Έ 슀크둀** - UI 라이브러리 슀마트 μ œμ™Έ κΈ°λŠ₯을 κ°€μ§„ 마우슀 λ“œλž˜κ·Έ 슀크둀
29
- - 🏹 **ν™”μ‚΄ν‘œ λ‚΄λΉ„κ²Œμ΄μ…˜** - μ •λ°€ν•œ μ œμ–΄λ₯Ό μœ„ν•œ 선택적 ν™”μ‚΄ν‘œ λ²„νŠΌ
30
- - ⚑ **λΆ€λ“œλŸ¬μš΄ μ• λ‹ˆλ©”μ΄μ…˜** - νŽ˜μ΄λ“œ μ „ν™˜ 및 ν˜Έλ²„ 효과
31
- - πŸ” **슀마트 μžλ™ μˆ¨κΉ€** - μ§€λŠ₯적인 ν‘œμ‹œ 관리
32
- - 🧠 **슀마트 μž…λ ₯ 감지** - μΈν„°λž™ν‹°λΈŒ μš”μ†Œ μžλ™ μ œμ™Έ
33
- - πŸ€– **μžλ™ 감지** - 슀크둀 κ°€λŠ₯ν•œ μ»¨ν…Œμ΄λ„ˆ μžλ™ 검색 (Virtuoso, react-window λ“±)
34
- - πŸ”§ **TypeScript** - μ™„μ „ν•œ νƒ€μž… μ •μ˜
35
- - πŸͺΆ **μ˜μ‘΄μ„± μ—†μŒ** - React만 ν•„μš”
36
- - β™Ώ **μ ‘κ·Όμ„±** - κΈ°λ³Έ 슀크둀 λ™μž‘ 보쑴
27
+ - 🎨 **μ™„μ „ν•œ μ»€μŠ€ν„°λ§ˆμ΄μ§•** - 색상, 크기, λ‘₯κ·Ό λͺ¨μ„œλ¦¬, μœ„μΉ˜ μ œμ–΄
28
+ - πŸ–±οΈ **λ“œλž˜κ·Έ 슀크둀** - UI 라이브러리 슀마트 μ œμ™Έ κΈ°λŠ₯을 κ°€μ§„ 마우슀 λ“œλž˜κ·Έ 슀크둀
29
+ - 🏹 **ν™”μ‚΄ν‘œ λ‚΄λΉ„κ²Œμ΄μ…˜** - μ •λ°€ν•œ μ œμ–΄λ₯Ό μœ„ν•œ 선택적 ν™”μ‚΄ν‘œ λ²„νŠΌ
30
+ - ⚑ **λΆ€λ“œλŸ¬μš΄ μ• λ‹ˆλ©”μ΄μ…˜** - νŽ˜μ΄λ“œ μ „ν™˜ 및 ν˜Έλ²„ 효과
31
+ - πŸ” **슀마트 μžλ™ μˆ¨κΉ€** - μ§€λŠ₯적인 ν‘œμ‹œ 관리
32
+ - 🧠 **슀마트 μž…λ ₯ 감지** - μΈν„°λž™ν‹°λΈŒ μš”μ†Œ μžλ™ μ œμ™Έ
33
+ - πŸ€– **μžλ™ 감지** - 슀크둀 κ°€λŠ₯ν•œ μ»¨ν…Œμ΄λ„ˆ μžλ™ 검색 (Virtuoso, react-window λ“±)
34
+ - πŸ”§ **TypeScript** - μ™„μ „ν•œ νƒ€μž… μ •μ˜
35
+ - πŸͺΆ **μ˜μ‘΄μ„± μ—†μŒ** - React만 ν•„μš”
36
+ - β™Ώ **μ ‘κ·Όμ„±** - κΈ°λ³Έ 슀크둀 λ™μž‘ 보쑴
37
37
 
38
38
  ## πŸš€ Installation
39
39
 
@@ -103,14 +103,24 @@ interface AutoHideConfig {
103
103
  delayOnWheel?: number; // Quick hide after wheel (default: 700ms)
104
104
  initialDelay?: number; // Delay before showing scrollbar on mount (default: 200ms)
105
105
  }
106
+
107
+ interface TrackConfig {
108
+ alignment?: "default" | "outside"; // Track alignment (default: "outside")
109
+ }
110
+
111
+ interface DragScrollConfig {
112
+ enabled?: boolean; // Enable mouse drag scrolling (default: true)
113
+ excludeClasses?: string[];
114
+ excludeSelectors?: string[];
115
+ }
106
116
  ```
107
117
 
108
118
  ## 🌍 Browser Support
109
119
 
110
- - Chrome/Edge: Full support
111
- - Firefox: Full support
112
- - Safari: Full support
113
- - Mobile: Touch scrolling supported
120
+ - Chrome/Edge: Full support
121
+ - Firefox: Full support
122
+ - Safari: Full support
123
+ - Mobile: Touch scrolling supported
114
124
 
115
125
  ## πŸ“„ License
116
126
 
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{useRef as C,useEffect as L,useState as h,useCallback as p,useMemo as ue,forwardRef as Tt,useImperativeHandle as Mt,useLayoutEffect as St}from"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"],ge=(M,_)=>{if(M instanceof HTMLElement&&M.isContentEditable||M.closest('[role="textbox"],[role="searchbox"]'))return!0;let U=M.tagName.toLowerCase();if(U==="input"){let H=(M.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(H)}if(["textarea","select","button"].includes(U)||["svg","path","circle","rect","line","polygon","polyline"].includes(U)||M.getAttribute("contenteditable")==="true")return!0;if(_?.excludeSelectors){for(let H of _.excludeSelectors)if(M.matches(H))return!0}return wt(M,_)},wt=(M,_)=>{let U=[...xt,..._?.excludeClasses||[]],H=M,G=0,A=5;for(;H&&G<=A;){if(U.some(S=>H.classList.contains(S)))return!0;if(H.classList.contains("MuiDialogContent-root"))break;H=H.parentElement,G++}return!1};import{jsx as B,jsxs as Re}from"react/jsx-runtime";var Et={},Ct={},Ht={},Lt={},Dt={},kt=Tt(({className:M="",style:_={},containerStyle:U={},contentStyle:H={},children:G,onScroll:A,thumb:S=Et,track:D=Ct,arrows:$=Ht,dragScroll:Q=Lt,autoHide:q=Dt,showScrollbar:ee=!0,showHorizontalScrollbar:Ie=!0,detectInnerScroll:Ze=!1},je)=>{let Je=C({});L(()=>{Je.current={children:G,onScroll:A,showScrollbar:ee,showHorizontalScrollbar:Ie,thumb:S,track:D,arrows:$,dragScroll:Q,autoHide:q}});let ve=C(null),l=C(null),te=C(null),oe=C(null),Qe=C(null),R=C(null),[de,v]=h(!1),[I,We]=h(!1),[Oe,Ae]=h(!1),[ye,et]=h({y:0,scrollTop:0}),[re,$e]=h(0),[tt,xe]=h(0),[K,ze]=h(!1),[Pe,Ne]=h(!1),[W,Fe]=h(!1),[we,ot]=h({x:0,scrollLeft:0}),[Te,Be]=h(0),[Me,_e]=h(0),[rt,Ue]=h(!1),V=C(!1),[z,qe]=h(!1),[ne,nt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=h(null),[pe,me]=h(null),[Wt,lt]=h(!1),[it,at]=h(0),le=C(null),[Xe,Ye]=h(!1),ie=C(null),X=C(null),Y=C(null),y=ue(()=>{let e=S.color??"#606060";return{width:S.width??8,minHeight:S.minHeight??50,radius:S.radius??(S.width??8)/2,color:e,opacity:S.opacity??.6,hoverColor:S.hoverColor??e,hoverOpacity:S.hoverOpacity??1}},[S]),r=ue(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"default",radius:D.radius??y.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,y.radius]),k=ue(()=>{let e=$.color??"#808080";return{visible:$.visible??!1,step:$.step??50,color:e,opacity:$.opacity??.6,hoverColor:$.hoverColor??e,hoverOpacity:$.hoverOpacity??1}},[$]),ae=ue(()=>({enabled:Q.enabled??!0,excludeClasses:Q.excludeClasses??[],excludeSelectors:Q.excludeSelectors??[]}),[Q]),i=ue(()=>({enabled:q.enabled??!0,delay:q.delay??1500,delayOnWheel:q.delayOnWheel??700,initialDelay:q.initialDelay??200}),[q]),[Z,ct]=h(()=>(q.initialDelay??200)>0),f=y.width,st=r.width,Se=y.minHeight,O=k.visible,he=k.step,E=p(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);Mt(je,()=>({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 u=p(()=>{if(R.current){let t=R.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;R.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return R.current=l.current,l.current;if(!Ze)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==l.current&&o.classList.contains("overlay-scrollbar-container"))continue;let a=o.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&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return R.current=o,o}return null},[]),P=p(()=>u()!==null,[u]),b=p(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),fe=p(()=>{X.current&&(clearTimeout(X.current),X.current=null)},[]),Ge=p(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),ut=p(()=>{fe(),!(I||W||z||V.current)&&(b(),v(!1))},[b,fe,I,W,z]),m=p(e=>{i.enabled&&(b(),ie.current=setTimeout(()=>{v(!1),ie.current=null},e))},[b,i.enabled]),s=p(()=>{let e=u()??l.current;if(!e){v(!1),ze(!1),Ue(!1),b();return}!i.enabled&&!Z&&(v(!0),b());let t=e.clientHeight,o=e.scrollHeight,a=e.scrollTop,n=e.clientWidth,c=e.scrollWidth,g=e.scrollLeft,x=o-t>0,d=c-n>0,j=x||d;ze(x),Ue(d),j||(v(!1),b());let ce=0,T=0;if(ve.current){let N=window.getComputedStyle(ve.current),F=parseFloat(N.paddingTop)||0;T=parseFloat(N.paddingBottom)||0,ce=F+T,at(T)}if(x){let N=O?f*2+r.margin*4:r.margin*2,F=t-N+ce,be=t/o,J=Math.max(F*be,Se),Ke=o-t,vt=F-J,yt=Ke>0?a/Ke*vt:0;$e(J),xe(yt)}else $e(0),xe(0);let se=c-n;if(se>0){let N=n/c,F=Math.max(n*N,50),be=n-F,J=se>0?g/se*be:0;Be(F),_e(J)}else Be(0),_e(0)},[u,b,O,f,Se,i.enabled,Z]),dt=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(We(!0),et({y:e.clientY,scrollTop:t.scrollTop}),b(),v(!0),E())},[u,b,E]),Ee=p(e=>{if(!I)return;let t=u();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,c=e.clientY-ye.y,g=o-re,x=c/g*n,d=Math.max(0,Math.min(n,ye.scrollTop+x));t.scrollTop=d,s()},[I,ye,re,s,u]),Ce=p(()=>{We(!1),P()&&m(i.delay)},[P,m,i.delay]),pt=p(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientY-o.top,n=u();if(!n)return;let c=n.clientHeight,g=n.scrollHeight,d=a/c*(g-c);n.scrollTop=Math.max(0,Math.min(g-c,d)),s(),v(!0),m(i.delay),E()},[s,m,i.delay,u,E]),mt=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let t=Math.max(0,l.current.scrollTop-he);l.current.scrollTop=t,s(),v(!0),m(i.delay),E()},[s,m,he,i.delay,E]),ht=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!te.current)return;let t=l.current,a=te.current.scrollHeight-t.clientHeight,n=Math.min(a,t.scrollTop+he);t.scrollTop=n,s(),v(!0),m(i.delay),E()},[s,m,he,i.delay,E]),ft=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Fe(!0),ot({x:e.clientX,scrollLeft:t.scrollLeft}),b(),v(!0),E())},[u,b,E]),He=p(e=>{if(!W)return;let t=u();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,c=e.clientX-we.x,g=o-Te,x=c/g*n,d=Math.max(0,Math.min(n,we.scrollLeft+x));t.scrollLeft=d,s()},[W,we,Te,s,u]),Le=p(()=>{Fe(!1),P()&&m(i.delay)},[P,m,i.delay]),bt=p(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientX-o.left,n=u();if(!n)return;let c=n.clientWidth,g=n.scrollWidth,d=a/c*(g-c);n.scrollLeft=Math.max(0,Math.min(g-c,d)),s(),v(!0),m(i.delay),E()},[s,m,i.delay,u,E]),gt=p(e=>{if(!ae.enabled)return;let t=e.target;if(ge(t,ae)||e.button!==0)return;let o=u();o&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||(e.preventDefault(),V.current=!0,nt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),b()))},[ae,ge,u,b]),De=p(e=>{if(!V.current&&!z)return;let t=u();if(!t)return;let o=ne.x-e.clientX,a=ne.y-e.clientY;if(Math.abs(a)<5&&Math.abs(o)<5)return;V.current&&(V.current=!1,qe(!0)),v(!0);let n=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,ne.scrollTop+a)),c=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,ne.scrollLeft+o));t.scrollTop=n,t.scrollLeft=c,s()},[z,ne,u,s]),ke=p(()=>{let e=z;V.current=!1,qe(!1),e&&P()&&m(i.delay)},[z,P,m,i.delay]);L(()=>{let e=c=>{if(s(),Z){A&&A(c);return}b(),v(!0),Ge();let g=Xe?i.delayOnWheel:i.delay;m(g),A&&A(c)},t=()=>{Ye(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{Ye(!1)},300),Ge(),Y.current=setTimeout(()=>{v(!0),Y.current=null,m(i.delayOnWheel)},50)},o=[],a=u();a&&o.push(a);let n=l.current;return n&&!a&&(o.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(g=>{let x=g;if(x!==n&&x.classList.contains("overlay-scrollbar-container"))return;let d=x.parentElement;for(;d&&d!==n;){if(d.classList.contains("overlay-scrollbar-container")&&d!==n)return;d=d.parentElement}o.push(x)})),o.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",t)}),le.current&&clearTimeout(le.current),Y.current&&clearTimeout(Y.current)}},[u,s,A,b,m,i,Xe,Z]),L(()=>{let e=o=>{let a=o.target;if(o.defaultPrevented||a instanceof Element&&ge(a,ae))return;let n=u();if(!n)return;let{key:c}=o,{scrollTop:g,scrollHeight:x,clientHeight:d}=n,j=x-d,ce=50,T=null;switch(c){case"ArrowUp":o.preventDefault(),T=Math.max(0,g-ce);break;case"ArrowDown":o.preventDefault(),T=Math.min(j,g+ce);break;case"PageUp":o.preventDefault(),T=Math.max(0,g-d);break;case"PageDown":o.preventDefault(),T=Math.min(j,g+d);break;case"Home":o.preventDefault(),T=0;break;case"End":o.preventDefault(),T=j;break;default:return}if(T!==null){let se=T/j,N=O?f*2+r.margin*4:r.margin*2,J=(d-N-re)*se;xe(J),n.scrollTop=T,b(),v(!0),m(i.delay)}},t=l.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,O,f,r.margin,re,b,m,i.delay,ae]),L(()=>(document.addEventListener("mousemove",De),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",ke)}),[z,De,ke]),L(()=>{if(I)return document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ce)}},[I,Ee,Ce]),L(()=>{if(W)return document.addEventListener("mousemove",He),document.addEventListener("mouseup",Le),()=>{document.removeEventListener("mousemove",He),document.removeEventListener("mouseup",Le)}},[W,He,Le]),L(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),St(()=>{lt(!0),s(),!i.enabled&&!Z&&P()&&v(!0)},[P,s,i.enabled,Z]),L(()=>{if(i.initialDelay>0){let e=setTimeout(()=>{ct(!1)},i.initialDelay);return()=>clearTimeout(e)}},[i.initialDelay]),L(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return l.current&&t.push(l.current),te.current&&t.push(te.current),R.current&&document.contains(R.current)&&t.push(R.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),L(()=>{if(!l.current)return;let e=new MutationObserver(()=>{R.current=null,s()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let w=Math.max(st,f);return L(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
1
+ import{useRef as C,useEffect as L,useState as h,useCallback as p,useMemo as ue,forwardRef as Tt,useImperativeHandle as Mt,useLayoutEffect as St}from"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"],ge=(M,_)=>{if(M instanceof HTMLElement&&M.isContentEditable||M.closest('[role="textbox"],[role="searchbox"]'))return!0;let U=M.tagName.toLowerCase();if(U==="input"){let H=(M.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(H)}if(["textarea","select","button"].includes(U)||["svg","path","circle","rect","line","polygon","polyline"].includes(U)||M.getAttribute("contenteditable")==="true")return!0;if(_?.excludeSelectors){for(let H of _.excludeSelectors)if(M.matches(H))return!0}return wt(M,_)},wt=(M,_)=>{let U=[...xt,..._?.excludeClasses||[]],H=M,G=0,A=5;for(;H&&G<=A;){if(U.some(S=>H.classList.contains(S)))return!0;if(H.classList.contains("MuiDialogContent-root"))break;H=H.parentElement,G++}return!1};import{jsx as B,jsxs as Re}from"react/jsx-runtime";var Et={},Ct={},Ht={},Lt={},Dt={},kt=Tt(({className:M="",style:_={},containerStyle:U={},contentStyle:H={},children:G,onScroll:A,thumb:S=Et,track:D=Ct,arrows:$=Ht,dragScroll:Q=Lt,autoHide:q=Dt,showScrollbar:ee=!0,showHorizontalScrollbar:Ie=!0,detectInnerScroll:Ze=!1},je)=>{let Je=C({});L(()=>{Je.current={children:G,onScroll:A,showScrollbar:ee,showHorizontalScrollbar:Ie,thumb:S,track:D,arrows:$,dragScroll:Q,autoHide:q}});let ve=C(null),l=C(null),te=C(null),oe=C(null),Qe=C(null),R=C(null),[de,v]=h(!1),[I,We]=h(!1),[Oe,Ae]=h(!1),[ye,et]=h({y:0,scrollTop:0}),[re,$e]=h(0),[tt,xe]=h(0),[K,ze]=h(!1),[Pe,Ne]=h(!1),[W,Fe]=h(!1),[we,ot]=h({x:0,scrollLeft:0}),[Te,Be]=h(0),[Me,_e]=h(0),[rt,Ue]=h(!1),V=C(!1),[z,qe]=h(!1),[ne,nt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=h(null),[pe,me]=h(null),[Wt,lt]=h(!1),[it,at]=h(0),le=C(null),[Xe,Ye]=h(!1),ie=C(null),X=C(null),Y=C(null),y=ue(()=>{let e=S.color??"#606060";return{width:S.width??8,minHeight:S.minHeight??50,radius:S.radius??(S.width??8)/2,color:e,opacity:S.opacity??.6,hoverColor:S.hoverColor??e,hoverOpacity:S.hoverOpacity??1}},[S]),r=ue(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"outside",radius:D.radius??y.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,y.radius]),k=ue(()=>{let e=$.color??"#808080";return{visible:$.visible??!1,step:$.step??50,color:e,opacity:$.opacity??.6,hoverColor:$.hoverColor??e,hoverOpacity:$.hoverOpacity??1}},[$]),ae=ue(()=>({enabled:Q.enabled??!0,excludeClasses:Q.excludeClasses??[],excludeSelectors:Q.excludeSelectors??[]}),[Q]),i=ue(()=>({enabled:q.enabled??!0,delay:q.delay??1500,delayOnWheel:q.delayOnWheel??700,initialDelay:q.initialDelay??200}),[q]),[Z,ct]=h(()=>(q.initialDelay??200)>0),f=y.width,st=r.width,Se=y.minHeight,O=k.visible,he=k.step,E=p(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);Mt(je,()=>({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 u=p(()=>{if(R.current){let t=R.current;if(document.contains(t)&&(t.scrollHeight>t.clientHeight+2||t.scrollWidth>t.clientWidth+2))return t;R.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return R.current=l.current,l.current;if(!Ze)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==l.current&&o.classList.contains("overlay-scrollbar-container"))continue;let a=o.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&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return R.current=o,o}return null},[]),P=p(()=>u()!==null,[u]),b=p(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),fe=p(()=>{X.current&&(clearTimeout(X.current),X.current=null)},[]),Ge=p(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),ut=p(()=>{fe(),!(I||W||z||V.current)&&(b(),v(!1))},[b,fe,I,W,z]),m=p(e=>{i.enabled&&(b(),ie.current=setTimeout(()=>{v(!1),ie.current=null},e))},[b,i.enabled]),s=p(()=>{let e=u()??l.current;if(!e){v(!1),ze(!1),Ue(!1),b();return}!i.enabled&&!Z&&(v(!0),b());let t=e.clientHeight,o=e.scrollHeight,a=e.scrollTop,n=e.clientWidth,c=e.scrollWidth,g=e.scrollLeft,x=o-t>0,d=c-n>0,j=x||d;ze(x),Ue(d),j||(v(!1),b());let ce=0,T=0;if(ve.current){let N=window.getComputedStyle(ve.current),F=parseFloat(N.paddingTop)||0;T=parseFloat(N.paddingBottom)||0,ce=F+T,at(T)}if(x){let N=O?f*2+r.margin*4:r.margin*2,F=t-N+ce,be=t/o,J=Math.max(F*be,Se),Ke=o-t,vt=F-J,yt=Ke>0?a/Ke*vt:0;$e(J),xe(yt)}else $e(0),xe(0);let se=c-n;if(se>0){let N=n/c,F=Math.max(n*N,50),be=n-F,J=se>0?g/se*be:0;Be(F),_e(J)}else Be(0),_e(0)},[u,b,O,f,Se,i.enabled,Z]),dt=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(We(!0),et({y:e.clientY,scrollTop:t.scrollTop}),b(),v(!0),E())},[u,b,E]),Ee=p(e=>{if(!I)return;let t=u();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,c=e.clientY-ye.y,g=o-re,x=c/g*n,d=Math.max(0,Math.min(n,ye.scrollTop+x));t.scrollTop=d,s()},[I,ye,re,s,u]),Ce=p(()=>{We(!1),P()&&m(i.delay)},[P,m,i.delay]),pt=p(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientY-o.top,n=u();if(!n)return;let c=n.clientHeight,g=n.scrollHeight,d=a/c*(g-c);n.scrollTop=Math.max(0,Math.min(g-c,d)),s(),v(!0),m(i.delay),E()},[s,m,i.delay,u,E]),mt=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let t=Math.max(0,l.current.scrollTop-he);l.current.scrollTop=t,s(),v(!0),m(i.delay),E()},[s,m,he,i.delay,E]),ht=p(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!te.current)return;let t=l.current,a=te.current.scrollHeight-t.clientHeight,n=Math.min(a,t.scrollTop+he);t.scrollTop=n,s(),v(!0),m(i.delay),E()},[s,m,he,i.delay,E]),ft=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Fe(!0),ot({x:e.clientX,scrollLeft:t.scrollLeft}),b(),v(!0),E())},[u,b,E]),He=p(e=>{if(!W)return;let t=u();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,c=e.clientX-we.x,g=o-Te,x=c/g*n,d=Math.max(0,Math.min(n,we.scrollLeft+x));t.scrollLeft=d,s()},[W,we,Te,s,u]),Le=p(()=>{Fe(!1),P()&&m(i.delay)},[P,m,i.delay]),bt=p(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientX-o.left,n=u();if(!n)return;let c=n.clientWidth,g=n.scrollWidth,d=a/c*(g-c);n.scrollLeft=Math.max(0,Math.min(g-c,d)),s(),v(!0),m(i.delay),E()},[s,m,i.delay,u,E]),gt=p(e=>{if(!ae.enabled)return;let t=e.target;if(ge(t,ae)||e.button!==0)return;let o=u();o&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||(e.preventDefault(),V.current=!0,nt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),b()))},[ae,ge,u,b]),De=p(e=>{if(!V.current&&!z)return;let t=u();if(!t)return;let o=ne.x-e.clientX,a=ne.y-e.clientY;if(Math.abs(a)<5&&Math.abs(o)<5)return;V.current&&(V.current=!1,qe(!0)),v(!0);let n=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,ne.scrollTop+a)),c=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,ne.scrollLeft+o));t.scrollTop=n,t.scrollLeft=c,s()},[z,ne,u,s]),ke=p(()=>{let e=z;V.current=!1,qe(!1),e&&P()&&m(i.delay)},[z,P,m,i.delay]);L(()=>{let e=c=>{if(s(),Z){A&&A(c);return}b(),v(!0),Ge();let g=Xe?i.delayOnWheel:i.delay;m(g),A&&A(c)},t=()=>{Ye(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{Ye(!1)},300),Ge(),Y.current=setTimeout(()=>{v(!0),Y.current=null,m(i.delayOnWheel)},50)},o=[],a=u();a&&o.push(a);let n=l.current;return n&&!a&&(o.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(g=>{let x=g;if(x!==n&&x.classList.contains("overlay-scrollbar-container"))return;let d=x.parentElement;for(;d&&d!==n;){if(d.classList.contains("overlay-scrollbar-container")&&d!==n)return;d=d.parentElement}o.push(x)})),o.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",t)}),le.current&&clearTimeout(le.current),Y.current&&clearTimeout(Y.current)}},[u,s,A,b,m,i,Xe,Z]),L(()=>{let e=o=>{let a=o.target;if(o.defaultPrevented||a instanceof Element&&ge(a,ae))return;let n=u();if(!n)return;let{key:c}=o,{scrollTop:g,scrollHeight:x,clientHeight:d}=n,j=x-d,ce=50,T=null;switch(c){case"ArrowUp":o.preventDefault(),T=Math.max(0,g-ce);break;case"ArrowDown":o.preventDefault(),T=Math.min(j,g+ce);break;case"PageUp":o.preventDefault(),T=Math.max(0,g-d);break;case"PageDown":o.preventDefault(),T=Math.min(j,g+d);break;case"Home":o.preventDefault(),T=0;break;case"End":o.preventDefault(),T=j;break;default:return}if(T!==null){let se=T/j,N=O?f*2+r.margin*4:r.margin*2,J=(d-N-re)*se;xe(J),n.scrollTop=T,b(),v(!0),m(i.delay)}},t=l.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,O,f,r.margin,re,b,m,i.delay,ae]),L(()=>(document.addEventListener("mousemove",De),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",ke)}),[z,De,ke]),L(()=>{if(I)return document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ce)}},[I,Ee,Ce]),L(()=>{if(W)return document.addEventListener("mousemove",He),document.addEventListener("mouseup",Le),()=>{document.removeEventListener("mousemove",He),document.removeEventListener("mouseup",Le)}},[W,He,Le]),L(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),St(()=>{lt(!0),s(),!i.enabled&&!Z&&P()&&v(!0)},[P,s,i.enabled,Z]),L(()=>{if(i.initialDelay>0){let e=setTimeout(()=>{ct(!1)},i.initialDelay);return()=>clearTimeout(e)}},[i.initialDelay]),L(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return l.current&&t.push(l.current),te.current&&t.push(te.current),R.current&&document.contains(R.current)&&t.push(R.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),L(()=>{if(!l.current)return;let e=new MutationObserver(()=>{R.current=null,s()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let w=Math.max(st,f);return L(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
2
2
  /* \uBAA8\uB4E0 \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uAE30 */
3
3
  .overlay-scrollbar-container {
4
4
  scrollbar-width: none !important;