@ehfuse/overlay-scrollbar 1.6.13 → 1.6.15
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 +1 -0
- package/dist/OverlayScrollbar.d.ts +1 -0
- package/dist/OverlayScrollbar.d.ts.map +1 -1
- package/dist/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/dragScrollUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayScrollbar.d.ts","sourceRoot":"","sources":["../src/OverlayScrollbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,EAMV,SAAS,EAIZ,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,E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wDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,UAAU,0BAA0B;IAChC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,qBAAqB,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAChD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,GAAI,yHAQnC,0BAA0B,SAyF5B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useRef as E,useEffect as C,useState as h,useCallback as p,useMemo as re,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"],Re=(L,_)=>{let B=L.tagName.toLowerCase(),k=["text","password","email","number","search","tel","url","checkbox","radio"];if(B==="input"){let R=L.type;return k.includes(R)}if(["textarea","select","button"].includes(B)||["svg","path","circle","rect","line","polygon","polyline"].includes(B)||L.getAttribute("contenteditable")==="true")return!0;if(_?.excludeSelectors){for(let R of _.excludeSelectors)if(L.matches(R))return!0}return wt(L,_)},wt=(L,_)=>{let B=[...xt,..._?.excludeClasses||[]],k=L,R=0,$=5;for(;k&&R<=$;){if(B.some(T=>k.classList.contains(T)))return!0;if(k.classList.contains("MuiDialogContent-root"))break;k=k.parentElement,R++}return!1};import{jsx as F,jsxs as Ie}from"react/jsx-runtime";var Et={},Ct={},Ht={},Dt={},Lt={},kt=Tt(({className:L="",style:_={},containerStyle:B={},contentStyle:k={},children:R,onScroll:$,thumb:T=Et,track:H=Ct,arrows:z=Ht,dragScroll:V=Dt,autoHide:U=Lt,showScrollbar:J=!0,detectInnerScroll:Ge=!1},Ke)=>{let Ze=E({});C(()=>{Ze.current={children:R,onScroll:$,showScrollbar:J,thumb:T,track:H,arrows:z,dragScroll:V,autoHide:U}});let me=E(null),a=E(null),q=E(null),G=E(null),je=E(null),I=E(null),[ne,y]=h(!1),[A,Ae]=h(!1),[Oe,We]=h(!1),[he,Ve]=h({y:0,scrollTop:0}),[Q,Je]=h(0),[Qe,$e]=h(0),[K,ze]=h(!1),[Pe,Ne]=h(!1),[O,Fe]=h(!1),[fe,et]=h({x:0,scrollLeft:0}),[be,tt]=h(0),[ge,ot]=h(0),[rt,ve]=h(!1),Z=E(!1),[P,_e]=h(!1),[ee,nt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=h(null),[le,ie]=h(null),[At,lt]=h(!1),[it,at]=h(0),te=E(null),[Be,Ue]=h(!1),oe=E(null),X=E(null),Y=E(null),g=re(()=>{let e=T.color??"#606060";return{width:T.width??8,minHeight:T.minHeight??50,radius:T.radius??(T.width??8)/2,color:e,opacity:T.opacity??.6,hoverColor:T.hoverColor??e,hoverOpacity:T.hoverOpacity??1}},[T]),r=re(()=>({width:H.width??16,color:H.color??"rgba(128, 128, 128, 0.1)",visible:H.visible??!0,alignment:H.alignment??"default",radius:H.radius??g.radius??4,margin:H.margin??4,overflowX:H.overflowX??!0,overflowY:H.overflowY??!0}),[H,g.radius]),D=re(()=>{let e=z.color??"#808080";return{visible:z.visible??!1,step:z.step??50,color:e,opacity:z.opacity??.6,hoverColor:z.hoverColor??e,hoverOpacity:z.hoverOpacity??1}},[z]),ye=re(()=>({enabled:V.enabled??!0,excludeClasses:V.excludeClasses??[],excludeSelectors:V.excludeSelectors??[]}),[V]),l=re(()=>({enabled:U.enabled??!0,delay:U.delay??1500,delayOnWheel:U.delayOnWheel??700,initialDelay:U.initialDelay??200}),[U]),[j,ct]=h(()=>(U.initialDelay??200)>0),f=g.width,st=r.width,xe=g.minHeight,W=D.visible,ae=D.step,M=p(()=>{if(!a.current)return;let e=document.activeElement;e&&a.current.contains(e)&&e!==a.current||a.current.focus()},[]);Mt(Ke,()=>({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 u=p(()=>{if(I.current){let t=I.current;if(document.contains(t)&&t.scrollHeight>t.clientHeight+2)return t;I.current=null}if(!a.current)return null;if(q.current&&q.current.scrollHeight>a.current.clientHeight+2)return I.current=a.current,a.current;if(!Ge)return null;let e=a.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!==a.current&&o.classList.contains("overlay-scrollbar-container"))continue;let c=o.parentElement,n=!1;for(;c&&c!==a.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==a.current){n=!0;break}c=c.parentElement}if(!n&&o.scrollHeight>o.clientHeight+2)return I.current=o,o}return null},[]),N=p(()=>u()!==null,[u]),b=p(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),ce=p(()=>{X.current&&(clearTimeout(X.current),X.current=null)},[]),qe=p(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),ut=p(()=>{ce(),!(A||O||P||Z.current)&&(b(),y(!1))},[b,ce,A,O,P]),m=p(e=>{l.enabled&&(b(),oe.current=setTimeout(()=>{y(!1),oe.current=null},e))},[b,l.enabled]),s=p(()=>{let e=u();if(!e){y(!1),ze(!1),ve(!1),b();return}if(ze(!0),!G.current)return;!l.enabled&&!j&&(y(!0),b());let t=e.clientHeight,o=e.scrollHeight,c=e.scrollTop,n=e.clientWidth,i=e.scrollWidth,x=e.scrollLeft,v=0,d=0;if(me.current){let de=window.getComputedStyle(me.current),pe=parseFloat(de.paddingTop)||0;d=parseFloat(de.paddingBottom)||0,v=pe+d,at(d)}let se=W?f*2+r.margin*4:r.margin*2,S=t-se+v,He=t/o,ue=Math.max(S*He,xe),De=o-t,Xe=S-ue,Le=De>0?c/De*Xe:0;Je(ue),$e(Le);let ke=i-n;if(ke>0){ve(!0);let de=n/i,pe=Math.max(n*de,50),vt=n-pe,yt=ke>0?x/ke*vt:0;tt(pe),ot(yt)}else ve(!1)},[u,b,W,f,xe,l.enabled,j]),dt=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Ae(!0),Ve({y:e.clientY,scrollTop:t.scrollTop}),b(),y(!0),M())},[u,b,M]),we=p(e=>{if(!A)return;let t=u();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,i=e.clientY-he.y,x=o-Q,v=i/x*n,d=Math.max(0,Math.min(n,he.scrollTop+v));t.scrollTop=d,s()},[A,he,Q,s,u]),Te=p(()=>{Ae(!1),N()&&m(l.delay)},[N,m,l.delay]),pt=p(e=>{if(!G.current)return;let o=G.current.getBoundingClientRect(),c=e.clientY-o.top,n=u();if(!n)return;let i=n.clientHeight,x=n.scrollHeight,d=c/i*(x-i);n.scrollTop=Math.max(0,Math.min(x-i,d)),s(),y(!0),m(l.delay),M()},[s,m,l.delay,u,M]),mt=p(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current)return;let t=Math.max(0,a.current.scrollTop-ae);a.current.scrollTop=t,s(),y(!0),m(l.delay),M()},[s,m,ae,l.delay,M]),ht=p(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current||!q.current)return;let t=a.current,c=q.current.scrollHeight-t.clientHeight,n=Math.min(c,t.scrollTop+ae);t.scrollTop=n,s(),y(!0),m(l.delay),M()},[s,m,ae,l.delay,M]),ft=p(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Fe(!0),et({x:e.clientX,scrollLeft:t.scrollLeft}),b(),y(!0),M())},[u,b,M]),Me=p(e=>{if(!O)return;let t=u();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,i=e.clientX-fe.x,x=o-be,v=i/x*n,d=Math.max(0,Math.min(n,fe.scrollLeft+v));t.scrollLeft=d,s()},[O,fe,be,s,u]),Se=p(()=>{Fe(!1),N()&&m(l.delay)},[N,m,l.delay]),bt=p(e=>{if(!G.current)return;let o=G.current.getBoundingClientRect(),c=e.clientX-o.left,n=u();if(!n)return;let i=n.clientWidth,x=n.scrollWidth,d=c/i*(x-i);n.scrollLeft=Math.max(0,Math.min(x-i,d)),s(),y(!0),m(l.delay),M()},[s,m,l.delay,u,M]),gt=p(e=>{if(!ye.enabled)return;let t=e.target;if(Re(t,ye)||e.button!==0)return;let o=u();o&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||(e.preventDefault(),Z.current=!0,nt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),b()))},[ye,Re,u,b]),Ee=p(e=>{if(!Z.current&&!P)return;let t=u();if(!t)return;let o=ee.x-e.clientX,c=ee.y-e.clientY;if(Math.abs(c)<5&&Math.abs(o)<5)return;Z.current&&(Z.current=!1,_e(!0)),y(!0);let n=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,ee.scrollTop+c)),i=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,ee.scrollLeft+o));t.scrollTop=n,t.scrollLeft=i,s()},[P,ee,u,s]),Ce=p(()=>{let e=P;Z.current=!1,_e(!1),e&&N()&&m(l.delay)},[P,N,m,l.delay]);C(()=>{let e=i=>{if(s(),j){$&&$(i);return}b(),y(!0),qe();let x=Be?l.delayOnWheel:l.delay;m(x),$&&$(i)},t=()=>{Ue(!0),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{Ue(!1)},300),qe(),Y.current=setTimeout(()=>{y(!0),Y.current=null,m(l.delayOnWheel)},50)},o=[],c=u();c&&o.push(c);let n=a.current;return n&&!c&&(o.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(x=>{let v=x;if(v!==n&&v.classList.contains("overlay-scrollbar-container"))return;let d=v.parentElement;for(;d&&d!==n;){if(d.classList.contains("overlay-scrollbar-container")&&d!==n)return;d=d.parentElement}o.push(v)})),o.forEach(i=>{i.addEventListener("scroll",e,{passive:!0}),i.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(i=>{i.removeEventListener("scroll",e),i.removeEventListener("wheel",t)}),te.current&&clearTimeout(te.current),Y.current&&clearTimeout(Y.current)}},[u,s,$,b,m,l,Be,j]),C(()=>{let e=o=>{let c=u();if(!c)return;let{key:n}=o,{scrollTop:i,scrollHeight:x,clientHeight:v}=c,d=x-v,se=50,S=null;switch(n){case"ArrowUp":o.preventDefault(),S=Math.max(0,i-se);break;case"ArrowDown":o.preventDefault(),S=Math.min(d,i+se);break;case"PageUp":o.preventDefault(),S=Math.max(0,i-v);break;case"PageDown":o.preventDefault(),S=Math.min(d,i+v);break;case"Home":o.preventDefault(),S=0;break;case"End":o.preventDefault(),S=d;break;default:return}if(S!==null){let He=S/d,ue=W?f*2+r.margin*4:r.margin*2,Le=(v-ue-Q)*He;$e(Le),c.scrollTop=S,b(),y(!0),m(l.delay)}},t=a.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,W,f,r.margin,Q,b,m,l.delay]),C(()=>(document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ce)}),[P,Ee,Ce]),C(()=>{if(A)return document.addEventListener("mousemove",we),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Te)}},[A,we,Te]),C(()=>{if(O)return document.addEventListener("mousemove",Me),document.addEventListener("mouseup",Se),()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",Se)}},[O,Me,Se]),C(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),St(()=>{lt(!0),s(),!l.enabled&&!j&&N()&&y(!0)},[N,s,l.enabled,j]),C(()=>{if(l.initialDelay>0){let e=setTimeout(()=>{ct(!1)},l.initialDelay);return()=>clearTimeout(e)}},[l.initialDelay]),C(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return a.current&&t.push(a.current),q.current&&t.push(q.current),I.current&&document.contains(I.current)&&t.push(I.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),C(()=>{if(!a.current)return;let e=new MutationObserver(()=>{I.current=null,s()});return e.observe(a.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let w=Math.max(st,f);return C(()=>{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 d,useMemo as se,forwardRef as wt,useImperativeHandle as Tt,useLayoutEffect as Mt}from"react";var yt=["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 xt(M,_)},xt=(M,_)=>{let U=[...yt,..._?.excludeClasses||[]],H=M,K=0,$=5;for(;H&&K<=$;){if(U.some(S=>H.classList.contains(S)))return!0;if(H.classList.contains("MuiDialogContent-root"))break;H=H.parentElement,K++}return!1};import{jsx as B,jsxs as Re}from"react/jsx-runtime";var St={},Et={},Ct={},Ht={},Lt={},Dt=wt(({className:M="",style:_={},containerStyle:U={},contentStyle:H={},children:K,onScroll:$,thumb:S=St,track:D=Et,arrows:z=Ct,dragScroll:Q=Ht,autoHide:q=Lt,showScrollbar:ee=!0,showHorizontalScrollbar:Ie=!0,detectInnerScroll:Ve=!1},Ze)=>{let je=C({});L(()=>{je.current={children:K,onScroll:$,showScrollbar:ee,showHorizontalScrollbar:Ie,thumb:S,track:D,arrows:z,dragScroll:Q,autoHide:q}});let ve=C(null),l=C(null),te=C(null),oe=C(null),Je=C(null),R=C(null),[ue,y]=h(!1),[I,We]=h(!1),[Oe,Ae]=h(!1),[ye,Qe]=h({y:0,scrollTop:0}),[re,$e]=h(0),[et,xe]=h(0),[V,ze]=h(!1),[Pe,Ne]=h(!1),[W,Fe]=h(!1),[we,tt]=h({x:0,scrollLeft:0}),[Te,Be]=h(0),[Me,_e]=h(0),[ot,Ue]=h(!1),Z=C(!1),[P,qe]=h(!1),[ne,rt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[kt,Rt]=h(null),[de,pe]=h(null),[It,nt]=h(!1),[lt,it]=h(0),le=C(null),[Xe,Ye]=h(!1),ie=C(null),X=C(null),Y=C(null),v=se(()=>{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=se(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"default",radius:D.radius??v.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,v.radius]),k=se(()=>{let e=z.color??"#808080";return{visible:z.visible??!1,step:z.step??50,color:e,opacity:z.opacity??.6,hoverColor:z.hoverColor??e,hoverOpacity:z.hoverOpacity??1}},[z]),ae=se(()=>({enabled:Q.enabled??!0,excludeClasses:Q.excludeClasses??[],excludeSelectors:Q.excludeSelectors??[]}),[Q]),i=se(()=>({enabled:q.enabled??!0,delay:q.delay??1500,delayOnWheel:q.delayOnWheel??700,initialDelay:q.initialDelay??200}),[q]),[j,at]=h(()=>(q.initialDelay??200)>0),f=v.width,ct=r.width,Se=v.minHeight,O=k.visible,me=k.step,E=d(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);Tt(Ze,()=>({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=d(()=>{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(!Ve)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},[]),N=d(()=>u()!==null,[u]),g=d(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),he=d(()=>{X.current&&(clearTimeout(X.current),X.current=null)},[]),Ge=d(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},[]),st=d(()=>{he(),!(I||W||P||Z.current)&&(g(),y(!1))},[g,he,I,W,P]),p=d(e=>{i.enabled&&(g(),ie.current=setTimeout(()=>{y(!1),ie.current=null},e))},[g,i.enabled]),s=d(()=>{let e=u();if(!e){y(!1),ze(!1),Ue(!1),g();return}!i.enabled&&!j&&(y(!0),g());let t=e.clientHeight,o=e.scrollHeight,a=e.scrollTop,n=e.clientWidth,c=e.scrollWidth,b=e.scrollLeft,x=o-t>0,m=c-n>0;ze(x),Ue(m);let G=0,J=0;if(ve.current){let F=window.getComputedStyle(ve.current),A=parseFloat(F.paddingTop)||0;J=parseFloat(F.paddingBottom)||0,G=A+J,it(J)}if(x){let F=O?f*2+r.margin*4:r.margin*2,A=t-F+G,fe=t/o,ce=Math.max(A*fe,Se),be=o-t,gt=A-ce,vt=be>0?a/be*gt:0;$e(ce),xe(vt)}else $e(0),xe(0);let T=c-n;if(T>0){let F=n/c,A=Math.max(n*F,50),fe=n-A,ce=T>0?b/T*fe:0;Be(A),_e(ce)}else Be(0),_e(0)},[u,g,O,f,Se,i.enabled,j]),ut=d(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(We(!0),Qe({y:e.clientY,scrollTop:t.scrollTop}),g(),y(!0),E())},[u,g,E]),Ee=d(e=>{if(!I)return;let t=u();if(!t)return;let o=t.clientHeight,n=t.scrollHeight-o,c=e.clientY-ye.y,b=o-re,x=c/b*n,m=Math.max(0,Math.min(n,ye.scrollTop+x));t.scrollTop=m,s()},[I,ye,re,s,u]),Ce=d(()=>{We(!1),N()&&p(i.delay)},[N,p,i.delay]),dt=d(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientY-o.top,n=u();if(!n)return;let c=n.clientHeight,b=n.scrollHeight,m=a/c*(b-c);n.scrollTop=Math.max(0,Math.min(b-c,m)),s(),y(!0),p(i.delay),E()},[s,p,i.delay,u,E]),pt=d(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let t=Math.max(0,l.current.scrollTop-me);l.current.scrollTop=t,s(),y(!0),p(i.delay),E()},[s,p,me,i.delay,E]),mt=d(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+me);t.scrollTop=n,s(),y(!0),p(i.delay),E()},[s,p,me,i.delay,E]),ht=d(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(Fe(!0),tt({x:e.clientX,scrollLeft:t.scrollLeft}),g(),y(!0),E())},[u,g,E]),He=d(e=>{if(!W)return;let t=u();if(!t)return;let o=t.clientWidth,n=t.scrollWidth-o,c=e.clientX-we.x,b=o-Te,x=c/b*n,m=Math.max(0,Math.min(n,we.scrollLeft+x));t.scrollLeft=m,s()},[W,we,Te,s,u]),Le=d(()=>{Fe(!1),N()&&p(i.delay)},[N,p,i.delay]),ft=d(e=>{if(!oe.current)return;let o=oe.current.getBoundingClientRect(),a=e.clientX-o.left,n=u();if(!n)return;let c=n.clientWidth,b=n.scrollWidth,m=a/c*(b-c);n.scrollLeft=Math.max(0,Math.min(b-c,m)),s(),y(!0),p(i.delay),E()},[s,p,i.delay,u,E]),bt=d(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(),Z.current=!0,rt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),g()))},[ae,ge,u,g]),De=d(e=>{if(!Z.current&&!P)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;Z.current&&(Z.current=!1,qe(!0)),y(!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()},[P,ne,u,s]),ke=d(()=>{let e=P;Z.current=!1,qe(!1),e&&N()&&p(i.delay)},[P,N,p,i.delay]);L(()=>{let e=c=>{if(s(),j){$&&$(c);return}g(),y(!0),Ge();let b=Xe?i.delayOnWheel:i.delay;p(b),$&&$(c)},t=()=>{Ye(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{Ye(!1)},300),Ge(),Y.current=setTimeout(()=>{y(!0),Y.current=null,p(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(b=>{let x=b;if(x!==n&&x.classList.contains("overlay-scrollbar-container"))return;let m=x.parentElement;for(;m&&m!==n;){if(m.classList.contains("overlay-scrollbar-container")&&m!==n)return;m=m.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,$,g,p,i,Xe,j]),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:b,scrollHeight:x,clientHeight:m}=n,G=x-m,J=50,T=null;switch(c){case"ArrowUp":o.preventDefault(),T=Math.max(0,b-J);break;case"ArrowDown":o.preventDefault(),T=Math.min(G,b+J);break;case"PageUp":o.preventDefault(),T=Math.max(0,b-m);break;case"PageDown":o.preventDefault(),T=Math.min(G,b+m);break;case"Home":o.preventDefault(),T=0;break;case"End":o.preventDefault(),T=G;break;default:return}if(T!==null){let F=T/G,A=O?f*2+r.margin*4:r.margin*2,be=(m-A-re)*F;xe(be),n.scrollTop=T,g(),y(!0),p(i.delay)}},t=l.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,O,f,r.margin,re,g,p,i.delay,ae]),L(()=>(document.addEventListener("mousemove",De),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",ke)}),[P,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]),Mt(()=>{nt(!0),s(),!i.enabled&&!j&&N()&&y(!0)},[N,s,i.enabled,j]),L(()=>{if(i.initialDelay>0){let e=setTimeout(()=>{at(!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(ct,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;
|
|
@@ -38,5 +38,5 @@ import{useRef as E,useEffect as C,useState as h,useCallback as p,useMemo as re,f
|
|
|
38
38
|
.overlay-scrollbar-container .ehfuse-editor-content::-webkit-scrollbar-thumb:hover {
|
|
39
39
|
background: #a1a1a1 !important;
|
|
40
40
|
}
|
|
41
|
-
`,document.head.appendChild(o),()=>{let
|
|
41
|
+
`,document.head.appendChild(o),()=>{let a=document.getElementById(e);a&&a.remove()}},[]),Re("div",{ref:ve,className:`overlay-scrollbar-wrapper ${M}`,onMouseLeave:st,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"hidden",..._},children:[B("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:bt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:P?"none":"auto",...U},children:B("div",{ref:te,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...H},children:K})}),ee&&V&&(r.overflowY??!0)&&Re("div",{ref:oe,className:"overlay-scrollbar-track",onMouseEnter:()=>{g(),X.current=setTimeout(()=>{y(!0),X.current=null},100)},onMouseLeave:()=>{he(),I||p(i.delay)},style:{position:"absolute",top:0,right:0,width:`${w}px`,height:"100%",opacity:ue?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&B("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),dt(e)},style:{position:"absolute",top:O?`${v.width+r.margin*2}px`:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(w-v.width)/2}px`,width:`${v.width}px`,height:O?`calc(100% - ${v.width*2+r.margin*4}px)`:`calc(100% - ${r.margin*2}px)`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),B("div",{ref:Je,className:"overlay-scrollbar-thumb",onMouseDown:ut,onMouseEnter:()=>Ae(!0),onMouseLeave:()=>Ae(!1),style:{position:"absolute",top:`${(O?f+r.margin*2:r.margin)+et}px`,right:r.alignment==="outside"?"0px":`${(w-f)/2}px`,width:`${f}px`,height:`${Math.max(re,Se)}px`,backgroundColor:Oe||I?v.hoverColor:v.color,opacity:Oe||I?v.hoverOpacity:v.opacity,borderRadius:`${v.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),ee&&V&&O&&B("div",{className:"overlay-scrollbar-up-arrow",onClick:pt,onMouseEnter:()=>pe("up"),onMouseLeave:()=>pe(null),style:{position:"absolute",top:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(w-f)/2}px`,width:`${f}px`,height:`${f}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(f*.75,8)}px`,color:de==="up"?k.hoverColor:k.color,userSelect:"none",zIndex:1001,opacity:ue?de==="up"?k.hoverOpacity:k.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),ee&&V&&O&&B("div",{className:"overlay-scrollbar-down-arrow",onClick:mt,onMouseEnter:()=>pe("down"),onMouseLeave:()=>pe(null),style:{position:"absolute",bottom:`${r.margin}px`,right:r.alignment==="outside"?"0px":`${(w-f)/2}px`,width:`${f}px`,height:`${f}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(f*.75,8)}px`,color:de==="down"?k.hoverColor:k.color,userSelect:"none",zIndex:1001,opacity:ue?de==="down"?k.hoverOpacity:k.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),ee&&Ie&&ot&&(r.overflowX??!0)&&Re("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{g(),X.current=setTimeout(()=>{y(!0),X.current=null},100)},onMouseLeave:()=>{he(),W||p(i.delay)},style:{position:"absolute",bottom:`${lt}px`,left:0,width:"100%",height:`${w}px`,opacity:ue?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[r.visible&&B("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),ft(e)},style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(w-f)/2}px`,left:`${r.margin}px`,right:V?r.alignment==="outside"?`${w-r.margin}px`:`${w}px`:`${r.margin}px`,height:`${f}px`,backgroundColor:r.color,borderRadius:`${r.radius}px`,cursor:"pointer"}}),B("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:ht,onMouseEnter:()=>Ne(!0),onMouseLeave:()=>Ne(!1),style:{position:"absolute",bottom:r.alignment==="outside"?"0px":`${(w-f)/2}px`,left:`${r.margin+Me}px`,right:V?r.alignment==="outside"?`${w-r.margin}px`:`${w}px`:"auto",maxWidth:V?r.alignment==="outside"?`calc(100% - ${r.margin+Me+w-r.margin}px)`:`calc(100% - ${r.margin+Me+w}px)`:"none",width:`${Math.max(Te,50)}px`,height:`${f}px`,backgroundColor:Pe||W?v.hoverColor:v.color,opacity:Pe||W?v.hoverOpacity:v.opacity,borderRadius:`${v.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Ke=Dt;export{Ke as OverlayScrollbar,Ke as default};
|
|
42
42
|
//# sourceMappingURL=index.esm.js.map
|