@@ -113,6 +113,7 @@ import {
113
113
} from '@heroicons/react/24/outline'
114
114
import { useOnClickOutside } from '@/hooks/useOnClickOutside'
115
115
import RunAllV2 from '../RunAllV2'
116
+ import SimpleBar from 'simplebar-react'
116
117
117
118
// The react-dnd package does not export this...
118
119
type Identifier = string | symbol
@@ -1700,62 +1701,65 @@ const Editor = (props: Props) => {
1700
1701
/>
1701
1702
) }
1702
1703
1703
- < div
1704
+ < SimpleBar
1704
1705
id = "editor-scrollview"
1705
- ref = { props . scrollViewRef }
1706
- className = { clsx (
1707
- 'flex h-full justify-center' ,
1708
- props . isFullScreen ? 'px-20' : 'sm:px-0 px-4' ,
1709
- {
1710
- 'overflow-y-auto overflow-x-hidden' : ! props . isPDF ,
1711
- }
1712
- ) }
1706
+ scrollableNodeProps = { { ref : props . scrollViewRef } }
1707
+ className = { clsx ( 'h-full w-full' , {
1708
+ 'overflow-y-auto overflow-x-hidden' : ! props . isPDF ,
1709
+ } ) }
1713
1710
>
1714
1711
< div
1715
- id = "editor-wrapper"
1716
- ref = { editorWrapperRef }
1717
1712
className = { clsx (
1718
- 'flex-grow h-full py-2 ' ,
1719
- props . isFullScreen ? 'w-full ' : widthClasses
1713
+ 'flex justify-center w-full ' ,
1714
+ props . isFullScreen ? 'px-20 ' : 'sm:px-0 px-4'
1720
1715
) }
1721
1716
>
1722
- < div className = { ! props . isPDF ? 'pt-12' : '' } >
1723
- < Title
1724
- content = { props . yDoc . getXmlFragment ( 'title' ) }
1725
- isLoading = { props . isSyncing }
1726
- isEditable = {
1727
- props . isEditable && ! props . isApp && props . role !== 'viewer'
1728
- }
1729
- isPDF = { props . isPDF }
1730
- />
1731
- </ div >
1732
-
1733
- < ContentSkeleton visible = { props . isSyncing } />
1734
-
1735
- < HotkeysProvider initiallyActiveScopes = { [ 'editor' ] } >
1736
- { ! props . isSyncing && (
1737
- < >
1738
- { domBlocks }
1739
-
1740
- { domBlocks . length === 0 && (
1741
- < div className = "w-full" >
1742
- < PlusButton
1743
- workspaceId = { props . document . workspaceId }
1744
- isLast
1745
- alwaysOpen
1746
- onAddBlock = { addBlockToBottom }
1747
- isEditable = { props . isEditable }
1748
- writebackEnabled = { hasWriteback }
1749
- />
1750
- </ div >
1751
- ) }
1752
- </ >
1717
+ < div
1718
+ id = "editor-wrapper"
1719
+ ref = { editorWrapperRef }
1720
+ className = { clsx (
1721
+ 'flex-grow h-full py-2' ,
1722
+ props . isFullScreen ? 'w-full' : widthClasses
1753
1723
) }
1754
- </ HotkeysProvider >
1724
+ >
1725
+ < div className = { ! props . isPDF ? 'pt-12' : '' } >
1726
+ < Title
1727
+ content = { props . yDoc . getXmlFragment ( 'title' ) }
1728
+ isLoading = { props . isSyncing }
1729
+ isEditable = {
1730
+ props . isEditable && ! props . isApp && props . role !== 'viewer'
1731
+ }
1732
+ isPDF = { props . isPDF }
1733
+ />
1734
+ </ div >
1755
1735
1756
- { ! props . isPDF && < div className = "pb-72" /> }
1736
+ < ContentSkeleton visible = { props . isSyncing } />
1737
+
1738
+ < HotkeysProvider initiallyActiveScopes = { [ 'editor' ] } >
1739
+ { ! props . isSyncing && (
1740
+ < >
1741
+ { domBlocks }
1742
+
1743
+ { domBlocks . length === 0 && (
1744
+ < div className = "w-full" >
1745
+ < PlusButton
1746
+ workspaceId = { props . document . workspaceId }
1747
+ isLast
1748
+ alwaysOpen
1749
+ onAddBlock = { addBlockToBottom }
1750
+ isEditable = { props . isEditable }
1751
+ writebackEnabled = { hasWriteback }
1752
+ />
1753
+ </ div >
1754
+ ) }
1755
+ </ >
1756
+ ) }
1757
+ </ HotkeysProvider >
1758
+
1759
+ { ! props . isPDF && < div className = "pb-72" /> }
1760
+ </ div >
1757
1761
</ div >
1758
- </ div >
1762
+ </ SimpleBar >
1759
1763
{ ! props . isPublicViewer && ! props . isPDF && (
1760
1764
< EnvBar
1761
1765
onOpenFiles = { props . onOpenFiles }
0 commit comments