/** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { observer } from 'mobx-react-lite'; import { useEditorStore, withEditorStore, } from '../editor/EditorStoreProvider.js'; import { useShowcaseViewerStore, withShowcaseViewerStore, } from './ShowcaseViewerStoreProvider.js'; import { useParams } from '@finos/legend-application/browser'; import type { ShowcaseViewerPathParams } from '../../__lib__/LegendStudioNavigation.js'; import { isNonNullable } from '@finos/legend-shared'; import { Fragment, useEffect } from 'react'; import { getCollapsiblePanelGroupProps, useResizeDetector, type ResizablePanelHandlerProps, ResizablePanel, ResizablePanelSplitter, ResizablePanelGroup, FileTrayIcon, clsx, HackerIcon, AssistantIcon, ReadMeIcon, FireIcon, HammerIcon, TerminalIcon, TrashIcon, ResizablePanelSplitterLine, } from '@finos/legend-art'; import { useApplicationStore, useCommands } from '@finos/legend-application'; import { flowResult } from 'mobx'; import { EditorGroup } from '../editor/editor-group/EditorGroup.js'; import { GrammarTextEditor } from '../editor/editor-group/GrammarTextEditor.js'; import { ProjectSearchCommand } from '../editor/command-center/ProjectSearchCommand.js'; import { EmbeddedQueryBuilder } from '../editor/EmbeddedQueryBuilder.js'; import { ACTIVITY_MODE, GRAPH_EDITOR_MODE, } from '../../stores/editor/EditorConfig.js'; import { ActivityBarMenu, ColorThemeToggle } from '../editor/ActivityBar.js'; import type { ActivityBarItemConfig } from '@finos/legend-lego/application'; import { useLegendStudioApplicationStore } from '../LegendStudioFrameworkProvider.js'; import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js'; import { Explorer } from '../editor/side-bar/Explorer.js'; import { PanelGroup } from '../editor/panel-group/PanelGroup.js'; import { QueryDataCubeViewer } from '@finos/legend-query-builder'; import { ShowcaseFeedback } from './ShowcaseFeedback.js'; import { SHOWCASE_FEEDBACK_SURFACE } from '../../__lib__/LegendStudioTelemetryHelper.js'; const ShowcaseViewerStatusBar = observer(() => { const editorStore = useEditorStore(); const showcaseStore = useShowcaseViewerStore(); const showcase = showcaseStore._showcase; const applicationStore = useLegendStudioApplicationStore(); const handleTextModeClick = applicationStore.guardUnhandledError(() => flowResult(editorStore.toggleTextMode()), ); const editable = editorStore.graphManagerState.graphBuildState.hasCompleted && editorStore.isInitialized; const togglePanel = (): void => editorStore.panelGroupDisplayState.toggle(); const compile = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphEditorMode.globalCompile()), ); const generate = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.globalGenerate()), ); const emptyGenerationEntities = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.clearGenerations()), ); const toggleAssistant = (): void => applicationStore.assistantService.toggleAssistant(); return (