mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Tearing down of old Editor (Integrations panel) and other files (#31701)
* moving files from ide-redesign/components/editor-tour to features/editor-tour moving files from ide-redesign/components/integrations-panel to features/integrations-panel fixing imports Revert "moving files from ide-redesign/components/editor-tour to features/editor-tour" This reverts commit 9e4dcd4e001ffa4bfdb1053fb8824c1e8521ab10. * moving files from ide-redesign/components/help -> ide-react/components/rail * ide-redesign/components/breadcrumbs → features/source-editor/extensions * ide-redesign/components/editor.tsx → ide-react/components/layout * ide-redesign/components/full-project-search-panel.tsx → ide-react/components/rail/full-project-search-panel.tsx * removing old-editor-warning-tooltip * ide-redesign/components/tooltip-promo.tsx → shared/components/tooltip-promo.tsx make cleanup_unused_locales * extract-translations GitOrigin-RevId: b9f44c4820bb4e0a7eef4f6f9a58ff96fd007bf9
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import NoSelectionPane from '@/features/ide-react/components/editor/no-selection-pane'
|
||||
import { Editor } from '@/features/ide-redesign/components/editor'
|
||||
import { Editor } from '@/features/ide-react/components/layout/editor'
|
||||
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
|
||||
import FileView from '@/features/file-view/components/file-view'
|
||||
import { fileViewFile } from '@/features/ide-react/util/file-view'
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import { EditorLoadingPane } from '@/features/ide-react/components/editor/editor-loading-pane'
|
||||
import { useEditorOpenDocContext } from '@/features/ide-react/context/editor-open-doc-context'
|
||||
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
|
||||
import classNames from 'classnames'
|
||||
import SourceEditor from '@/features/source-editor/components/source-editor'
|
||||
import { Panel, PanelGroup } from 'react-resizable-panels'
|
||||
import { VerticalResizeHandle } from '@/features/ide-react/components/resize/vertical-resize-handle'
|
||||
import { Suspense } from 'react'
|
||||
import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner'
|
||||
import SymbolPalettePane from '@/features/ide-react/components/editor/symbol-palette-pane'
|
||||
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||
|
||||
export const Editor = () => {
|
||||
const { opening, errorState, showSymbolPalette } =
|
||||
useEditorPropertiesContext()
|
||||
const { selectedEntityCount, openEntity } = useFileTreeOpenContext()
|
||||
const { currentDocumentId, currentDocument } = useEditorOpenDocContext()
|
||||
|
||||
if (!currentDocumentId) {
|
||||
return null
|
||||
}
|
||||
|
||||
const isLoading = Boolean(
|
||||
(!currentDocument || opening) && !errorState && currentDocumentId
|
||||
)
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames('ide-redesign-editor-content', {
|
||||
hidden: openEntity?.type !== 'doc' || selectedEntityCount !== 1,
|
||||
})}
|
||||
>
|
||||
<PanelGroup
|
||||
autoSaveId="ide-redesign-editor-symbol-palette"
|
||||
direction="vertical"
|
||||
>
|
||||
<Panel
|
||||
id="ide-redesign-panel-source-editor"
|
||||
order={1}
|
||||
className="ide-redesign-editor-panel"
|
||||
>
|
||||
<SourceEditor />
|
||||
{isLoading && <EditorLoadingPane />}
|
||||
</Panel>
|
||||
{showSymbolPalette && (
|
||||
<>
|
||||
<VerticalResizeHandle id="ide-redesign-editor-symbol-palette" />
|
||||
<Panel
|
||||
id="ide-redesign-panel-symbol-palette"
|
||||
order={2}
|
||||
defaultSize={25}
|
||||
minSize={10}
|
||||
maxSize={50}
|
||||
>
|
||||
<Suspense fallback={<FullSizeLoadingSpinner delay={500} />}>
|
||||
<SymbolPalettePane />
|
||||
</Suspense>
|
||||
</Panel>
|
||||
</>
|
||||
)}
|
||||
</PanelGroup>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { FC, JSXElementConstructor, useCallback } from 'react'
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
import { useRailContext } from '../../context/rail-context'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
const [contactUsModalModules] = importOverleafModules('contactUsModal')
|
||||
const ContactUsModal: JSXElementConstructor<{
|
||||
show: boolean
|
||||
handleHide: () => void
|
||||
autofillProjectUrl: boolean
|
||||
}> = contactUsModalModules?.import.default
|
||||
|
||||
export const RailHelpContactUsModal: FC<{ show: boolean }> = ({ show }) => {
|
||||
const { setActiveModal } = useRailContext()
|
||||
const handleHide = useCallback(() => setActiveModal(null), [setActiveModal])
|
||||
if (!ContactUsModal) {
|
||||
return null
|
||||
}
|
||||
const showSupport = getMeta('ol-showSupport')
|
||||
if (!showSupport) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<ContactUsModal show={show} handleHide={handleHide} autofillProjectUrl />
|
||||
)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import { ElementType } from 'react'
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
|
||||
const componentModule = importOverleafModules('fullProjectSearchPanel')[0] as
|
||||
| {
|
||||
import: { default: ElementType }
|
||||
path: string
|
||||
}
|
||||
| undefined
|
||||
|
||||
export const FullProjectSearchPanel = () => {
|
||||
if (!componentModule) {
|
||||
return null
|
||||
}
|
||||
const FullProjectSearch = componentModule.import.default
|
||||
return <FullProjectSearch />
|
||||
}
|
||||
|
||||
export const hasFullProjectSearch = Boolean(componentModule)
|
||||
@@ -0,0 +1,19 @@
|
||||
import { FC } from 'react'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import HotkeysModal from '@/features/hotkeys-modal/components/hotkeys-modal'
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
import { useRailContext } from '../../../ide-react/context/rail-context'
|
||||
|
||||
export const RailHelpShowHotkeysModal: FC<{ show: boolean }> = ({ show }) => {
|
||||
const { features } = useProjectContext()
|
||||
const { setActiveModal } = useRailContext()
|
||||
|
||||
return (
|
||||
<HotkeysModal
|
||||
show={show}
|
||||
handleHide={() => setActiveModal(null)}
|
||||
isMac={isMac}
|
||||
trackChangesVisible={features?.trackChangesVisible}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
RailModalKey,
|
||||
useRailContext,
|
||||
} from '@/features/ide-react/context/rail-context'
|
||||
import { RailHelpContactUsModal } from '@/features/ide-redesign/components/help/contact-us'
|
||||
import { RailHelpShowHotkeysModal } from '@/features/ide-redesign/components/help/keyboard-shortcuts'
|
||||
import { RailHelpContactUsModal } from './contact-us'
|
||||
import { RailHelpShowHotkeysModal } from './keyboard-shortcuts'
|
||||
import DictionarySettingsModal from '@/features/settings/components/editor-settings/dictionary-settings-modal'
|
||||
|
||||
const RAIL_MODALS: {
|
||||
|
||||
@@ -11,13 +11,13 @@ import ChatPane from '@/features/chat/components/chat-pane'
|
||||
import ChatIndicator from '@/features/chat/components/chat-indicator'
|
||||
import getMeta from '@/utils/meta'
|
||||
import classNames from 'classnames'
|
||||
import IntegrationsPanel from '@/features/ide-redesign/components/integrations-panel/integrations-panel'
|
||||
import IntegrationsPanel from '@/features/integrations-panel/integrations-panel'
|
||||
import { useChatContext } from '@/features/chat/context/chat-context'
|
||||
import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
|
||||
import {
|
||||
FullProjectSearchPanel,
|
||||
hasFullProjectSearch,
|
||||
} from '@/features/ide-redesign/components/full-project-search-panel'
|
||||
} from '@/features/ide-react/components/rail/full-project-search-panel'
|
||||
import { sendSearchEvent } from '@/features/event-tracking/search-events'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useCommandProvider } from '@/features/ide-react/hooks/use-command-provider'
|
||||
|
||||
Reference in New Issue
Block a user