chore: parse ansi

This commit is contained in:
jialin
2024-10-18 15:20:55 +08:00
parent b9c9fe7a97
commit 2fea3a4b40
8 changed files with 253 additions and 430 deletions
+17 -2
View File
@@ -14,6 +14,7 @@ export const overlaySollerOptions: UseOverlayScrollbarsParams = {
x: 'hidden'
},
scrollbars: {
theme: 'os-theme-light',
autoHide: 'scroll',
autoHideDelay: 600,
clickScroll: 'instant'
@@ -22,11 +23,25 @@ export const overlaySollerOptions: UseOverlayScrollbarsParams = {
defer: true
};
export default function useOverlayScroller() {
export default function useOverlayScroller(options?: any) {
const scrollEventElement = React.useRef<any>(null);
const instanceRef = React.useRef<any>(null);
const [initialize, instance] = useOverlayScrollbars({
...overlaySollerOptions
options: {
update: {
debounce: 0
},
overflow: {
x: 'hidden'
},
scrollbars: {
theme: options?.theme || 'os-theme-dark',
autoHide: 'scroll',
autoHideDelay: 600,
clickScroll: 'instant'
}
},
defer: true
});
instanceRef.current = instance?.();
scrollEventElement.current =