@finos/legend-application-studio 28.8.0 → 28.9.0
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/lib/__lib__/LegendStudioNavigation.d.ts +6 -0
- package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioNavigation.js +5 -0
- package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
- package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
- package/lib/components/LegendStudioWebApplication.js +4 -1
- package/lib/components/LegendStudioWebApplication.js.map +1 -1
- package/lib/components/ShowcaseManager.d.ts.map +1 -1
- package/lib/components/ShowcaseManager.js +6 -1
- package/lib/components/ShowcaseManager.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +3 -2
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/project-view/ProjectViewer.d.ts.map +1 -1
- package/lib/components/project-view/ProjectViewer.js +37 -5
- package/lib/components/project-view/ProjectViewer.js.map +1 -1
- package/lib/components/showcase/ShowcaseViewer.d.ts +18 -0
- package/lib/components/showcase/ShowcaseViewer.d.ts.map +1 -0
- package/lib/components/showcase/ShowcaseViewer.js +147 -0
- package/lib/components/showcase/ShowcaseViewer.js.map +1 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts +23 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts.map +1 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.js +36 -0
- package/lib/components/showcase/ShowcaseViewerStoreProvider.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendStudioBaseStore.js +1 -0
- package/lib/stores/LegendStudioBaseStore.js.map +1 -1
- package/lib/stores/editor/EditorMode.d.ts +4 -0
- package/lib/stores/editor/EditorMode.d.ts.map +1 -1
- package/lib/stores/editor/EditorMode.js +9 -0
- package/lib/stores/editor/EditorMode.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +1 -3
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/StandardEditorMode.d.ts +1 -0
- package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
- package/lib/stores/editor/StandardEditorMode.js +4 -0
- package/lib/stores/editor/StandardEditorMode.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +20 -4
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts +3 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +17 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerEditorMode.d.ts +3 -0
- package/lib/stores/project-view/ProjectViewerEditorMode.d.ts.map +1 -1
- package/lib/stores/project-view/ProjectViewerEditorMode.js +10 -0
- package/lib/stores/project-view/ProjectViewerEditorMode.js.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts +28 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.js +40 -0
- package/lib/stores/showcase/ShowcaseViewerEditorMode.js.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts +32 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.js +189 -0
- package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -0
- package/package.json +7 -7
- package/src/__lib__/LegendStudioNavigation.ts +11 -0
- package/src/components/LegendStudioWebApplication.tsx +11 -1
- package/src/components/ShowcaseManager.tsx +26 -2
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +1 -1
- package/src/components/editor/side-bar/Explorer.tsx +20 -12
- package/src/components/project-view/ProjectViewer.tsx +139 -4
- package/src/components/showcase/ShowcaseViewer.tsx +418 -0
- package/src/components/showcase/ShowcaseViewerStoreProvider.tsx +56 -0
- package/src/stores/LegendStudioBaseStore.ts +1 -0
- package/src/stores/editor/EditorMode.ts +14 -0
- package/src/stores/editor/EditorStore.ts +1 -8
- package/src/stores/editor/StandardEditorMode.ts +7 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +31 -9
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +23 -0
- package/src/stores/project-view/ProjectViewerEditorMode.ts +17 -0
- package/src/stores/showcase/ShowcaseViewerEditorMode.ts +51 -0
- package/src/stores/showcase/ShowcaseViewerStore.ts +285 -0
- package/tsconfig.json +4 -0
@@ -20,7 +20,7 @@ import { EditorGroup } from '../editor/editor-group/EditorGroup.js';
|
|
20
20
|
import { GrammarTextEditor } from '../editor/editor-group/GrammarTextEditor.js';
|
21
21
|
import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
|
22
22
|
import { ACTIVITY_MODE, GRAPH_EDITOR_MODE, } from '../../stores/editor/EditorConfig.js';
|
23
|
-
import { clsx, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, getCollapsiblePanelGroupProps, RepoIcon, CodeBranchIcon, HackerIcon, WrenchIcon, FileTrayIcon, AssistantIcon, useResizeDetector, } from '@finos/legend-art';
|
23
|
+
import { clsx, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, getCollapsiblePanelGroupProps, RepoIcon, CodeBranchIcon, HackerIcon, WrenchIcon, FileTrayIcon, AssistantIcon, useResizeDetector, FireIcon, TrashIcon, HammerIcon, TerminalIcon, ResizablePanelSplitterLine, } from '@finos/legend-art';
|
24
24
|
import { isNonNullable } from '@finos/legend-shared';
|
25
25
|
import { useProjectViewerStore, withProjectViewerStore, } from './ProjectViewerStoreProvider.js';
|
26
26
|
import { generateSetupRoute, } from '../../__lib__/LegendStudioNavigation.js';
|
@@ -35,6 +35,7 @@ import { WorkflowManager } from '../editor/side-bar/WorkflowManager.js';
|
|
35
35
|
import { useLegendStudioApplicationStore, useLegendStudioBaseStore, } from '../LegendStudioFrameworkProvider.js';
|
36
36
|
import { EmbeddedQueryBuilder } from '../editor/EmbeddedQueryBuilder.js';
|
37
37
|
import { ActivityBarMenu } from '../editor/ActivityBar.js';
|
38
|
+
import { PanelGroup } from '../editor/panel-group/PanelGroup.js';
|
38
39
|
const ProjectViewerStatusBar = observer(() => {
|
39
40
|
const params = useParams();
|
40
41
|
const viewerStore = useProjectViewerStore();
|
@@ -56,9 +57,27 @@ const ProjectViewerStatusBar = observer(() => {
|
|
56
57
|
: currentRevision
|
57
58
|
? 'current'
|
58
59
|
: ''}`;
|
60
|
+
const editable = editorStore.graphManagerState.graphBuildState.hasCompleted &&
|
61
|
+
editorStore.isInitialized;
|
59
62
|
const handleTextModeClick = applicationStore.guardUnhandledError(() => flowResult(editorStore.toggleTextMode()));
|
63
|
+
const compile = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphEditorMode.globalCompile()));
|
64
|
+
const generate = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.globalGenerate()));
|
65
|
+
const emptyGenerationEntities = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.clearGenerations()));
|
60
66
|
const toggleAssistant = () => applicationStore.assistantService.toggleAssistant();
|
61
|
-
|
67
|
+
const togglePanel = () => editorStore.panelGroupDisplayState.toggle();
|
68
|
+
return (_jsxs("div", { "data-testid": LEGEND_STUDIO_TEST_ID.STATUS_BAR, className: "editor__status-bar project-view__status-bar", children: [_jsx("div", { className: "editor__status-bar__left", children: currentProject && (_jsxs("div", { className: "editor__status-bar__workspace", children: [_jsx("div", { className: "editor__status-bar__workspace__icon", children: _jsx(CodeBranchIcon, {}) }), _jsx("div", { className: "editor__status-bar__workspace__project", children: _jsx("button", { className: "editor__status-bar__workspace__project", title: "Go back to workspace setup using the specified project", tabIndex: -1, onClick: () => applicationStore.navigationService.navigator.visitAddress(applicationStore.navigationService.navigator.generateAddress(generateSetupRoute(projectId, undefined))), children: currentProject.name }) }), "/", _jsx("div", { className: "editor__status-bar__workspace__workspace", children: extraSDLCInfo }), description && (_jsxs("div", { className: "editor__status-bar__workspace__workspace", children: ["(", description, ")"] }))] })) }), _jsxs("div", { className: "editor__status-bar__right", children: [_jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__generate-btn', {
|
69
|
+
'editor__status-bar__generate-btn--wiggling': editorStore.graphState.graphGenerationState
|
70
|
+
.isRunningGlobalGenerate,
|
71
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning, onClick: generate, tabIndex: -1, title: "Generate (F10)", children: _jsx(FireIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__clear__generation-btn ', {
|
72
|
+
'editor__status-bar__action editor__status-bar__clear__generation-btn--wiggling': editorStore.graphState.graphGenerationState
|
73
|
+
.clearingGenerationEntitiesState.isInProgress,
|
74
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning ||
|
75
|
+
!editable, onClick: emptyGenerationEntities, tabIndex: -1, title: "Clear generation entities", children: _jsx(TrashIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__compile-btn', {
|
76
|
+
'editor__status-bar__compile-btn--wiggling': editorStore.graphState.isRunningGlobalCompile,
|
77
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning ||
|
78
|
+
!editable, onClick: compile, tabIndex: -1, title: "Compile (F9)", children: _jsx(HammerIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
79
|
+
'editor__status-bar__action__toggler--active': editorStore.panelGroupDisplayState.isOpen,
|
80
|
+
}), onClick: togglePanel, tabIndex: -1, title: "Toggle panel (Ctrl + `)", children: _jsx(TerminalIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
62
81
|
'editor__status-bar__action__toggler--active': editorStore.graphEditorMode.mode ===
|
63
82
|
GRAPH_EDITOR_MODE.GRAMMAR_TEXT,
|
64
83
|
}), onClick: handleTextModeClick, tabIndex: -1, title: "Toggle text mode (F8)", children: _jsx(HackerIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
@@ -129,6 +148,13 @@ export const ProjectViewer = withEditorStore(withProjectViewerStore(observer(()
|
|
129
148
|
onStopResize: resizeSideBar,
|
130
149
|
size: editorStore.sideBarDisplayState.size,
|
131
150
|
});
|
151
|
+
const resizePanel = (handleProps) => editorStore.panelGroupDisplayState.setSize(handleProps.domElement.getBoundingClientRect()
|
152
|
+
.height);
|
153
|
+
const maximizedCollapsiblePanelGroupProps = getCollapsiblePanelGroupProps(editorStore.panelGroupDisplayState.isMaximized);
|
154
|
+
const collapsiblePanelGroupProps = getCollapsiblePanelGroupProps(editorStore.panelGroupDisplayState.size === 0, {
|
155
|
+
onStopResize: resizePanel,
|
156
|
+
size: editorStore.panelGroupDisplayState.size,
|
157
|
+
});
|
132
158
|
const { ref, width, height } = useResizeDetector();
|
133
159
|
useEffect(() => {
|
134
160
|
if (ref.current) {
|
@@ -145,8 +171,14 @@ export const ProjectViewer = withEditorStore(withProjectViewerStore(observer(()
|
|
145
171
|
flowResult(viewerStore.initialize(params)).catch(applicationStore.alertUnhandledError);
|
146
172
|
}, [applicationStore, viewerStore, params]);
|
147
173
|
useCommands(editorStore);
|
148
|
-
return (_jsx("div", { className: "app__page", children: _jsxs("div", { className: "editor viewer", children: [_jsxs("div", { className: "editor__body", children: [_jsx(ProjectViewerActivityBar, {}), _jsx("div", { ref: ref, className: "editor__content-container", children: _jsx("div", { className: "editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { ...sideBarCollapsiblePanelGroupProps.collapsiblePanel, direction: 1, children: _jsx(ProjectViewerSideBar, {}) }), _jsx(ResizablePanelSplitter, {}),
|
149
|
-
|
150
|
-
|
174
|
+
return (_jsx("div", { className: "app__page", children: _jsxs("div", { className: "editor viewer", children: [_jsxs("div", { className: "editor__body", children: [_jsx(ProjectViewerActivityBar, {}), _jsx("div", { ref: ref, className: "editor__content-container", children: _jsx("div", { className: "editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { ...sideBarCollapsiblePanelGroupProps.collapsiblePanel, direction: 1, children: _jsx(ProjectViewerSideBar, {}) }), _jsx(ResizablePanelSplitter, {}), _jsx(ResizablePanel, { ...sideBarCollapsiblePanelGroupProps.remainingPanel, minSize: 300, children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsxs(ResizablePanel, { ...maximizedCollapsiblePanelGroupProps.collapsiblePanel, ...(editorStore.panelGroupDisplayState.size === 0
|
175
|
+
? collapsiblePanelGroupProps.remainingPanel
|
176
|
+
: {}), children: [editorStore.graphEditorMode.mode ===
|
177
|
+
GRAPH_EDITOR_MODE.FORM && _jsx(EditorGroup, {}), editorStore.graphEditorMode.mode ===
|
178
|
+
GRAPH_EDITOR_MODE.GRAMMAR_TEXT && (_jsx(GrammarTextEditor, {}))] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: editorStore.panelGroupDisplayState.isMaximized
|
179
|
+
? 'transparent'
|
180
|
+
: 'var(--color-dark-grey-250)' }) }), _jsx(ResizablePanel, { ...collapsiblePanelGroupProps.collapsiblePanel, ...(editorStore.panelGroupDisplayState.isMaximized
|
181
|
+
? maximizedCollapsiblePanelGroupProps.remainingPanel
|
182
|
+
: {}), direction: -1, children: _jsx(PanelGroup, {}) })] }) })] }) }) })] }), editorStore.graphManagerState.graphBuildState.hasSucceeded && (_jsx(ProjectSearchCommand, {})), _jsx(ProjectViewerStatusBar, {}), _jsx(EmbeddedQueryBuilder, {}), extraEditorExtensionComponents] }) }));
|
151
183
|
})));
|
152
184
|
//# sourceMappingURL=ProjectViewer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ProjectViewer.js","sourceRoot":"","sources":["../../../src/components/project-view/ProjectViewer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,aAAa,EACb,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,IAAI,EACJ,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,
|
1
|
+
{"version":3,"file":"ProjectViewer.js","sourceRoot":"","sources":["../../../src/components/project-view/ProjectViewer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,E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AI,CAC7D,KAAC,oBAAoB,KAAG,CACzB,EACD,KAAC,sBAAsB,KAAG,EAC1B,KAAC,oBAAoB,KAAG,EACvB,8BAA8B,IAC3B,GACF,CACP,CAAC;AACJ,CAAC,CAAC,CACH,CACF,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
export declare const ShowcaseViewer: import("react").FC<{}>;
|
18
|
+
//# sourceMappingURL=ShowcaseViewer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewer.d.ts","sourceRoot":"","sources":["../../../src/components/showcase/ShowcaseViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAqQH,eAAO,MAAM,cAAc,wBA8I1B,CAAC"}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { observer } from 'mobx-react-lite';
|
18
|
+
import { useEditorStore, withEditorStore, } from '../editor/EditorStoreProvider.js';
|
19
|
+
import { useShowcaseViewerStore, withShowcaseViewerStore, } from './ShowcaseViewerStoreProvider.js';
|
20
|
+
import { useParams } from '@finos/legend-application/browser';
|
21
|
+
import { isNonNullable } from '@finos/legend-shared';
|
22
|
+
import { Fragment, useEffect } from 'react';
|
23
|
+
import { getCollapsiblePanelGroupProps, useResizeDetector, ResizablePanel, ResizablePanelSplitter, ResizablePanelGroup, FileTrayIcon, clsx, HackerIcon, AssistantIcon, ReadMeIcon, FireIcon, HammerIcon, TerminalIcon, TrashIcon, ResizablePanelSplitterLine, } from '@finos/legend-art';
|
24
|
+
import { useApplicationStore, useCommands } from '@finos/legend-application';
|
25
|
+
import { flowResult } from 'mobx';
|
26
|
+
import { EditorGroup } from '../editor/editor-group/EditorGroup.js';
|
27
|
+
import { GrammarTextEditor } from '../editor/editor-group/GrammarTextEditor.js';
|
28
|
+
import { ProjectSearchCommand } from '../editor/command-center/ProjectSearchCommand.js';
|
29
|
+
import { EmbeddedQueryBuilder } from '../editor/EmbeddedQueryBuilder.js';
|
30
|
+
import { ACTIVITY_MODE, GRAPH_EDITOR_MODE, } from '../../stores/editor/EditorConfig.js';
|
31
|
+
import { ActivityBarMenu } from '../editor/ActivityBar.js';
|
32
|
+
import { useLegendStudioApplicationStore } from '../LegendStudioFrameworkProvider.js';
|
33
|
+
import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
|
34
|
+
import { Explorer } from '../editor/side-bar/Explorer.js';
|
35
|
+
import { PanelGroup } from '../editor/panel-group/PanelGroup.js';
|
36
|
+
const ShowcaseViewerStatusBar = observer(() => {
|
37
|
+
const editorStore = useEditorStore();
|
38
|
+
const showcaseStore = useShowcaseViewerStore();
|
39
|
+
const showcase = showcaseStore._showcase;
|
40
|
+
const applicationStore = useLegendStudioApplicationStore();
|
41
|
+
const handleTextModeClick = applicationStore.guardUnhandledError(() => flowResult(editorStore.toggleTextMode()));
|
42
|
+
const editable = editorStore.graphManagerState.graphBuildState.hasCompleted &&
|
43
|
+
editorStore.isInitialized;
|
44
|
+
const togglePanel = () => editorStore.panelGroupDisplayState.toggle();
|
45
|
+
const compile = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphEditorMode.globalCompile()));
|
46
|
+
const generate = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.globalGenerate()));
|
47
|
+
const emptyGenerationEntities = applicationStore.guardUnhandledError(() => flowResult(editorStore.graphState.graphGenerationState.clearGenerations()));
|
48
|
+
const toggleAssistant = () => applicationStore.assistantService.toggleAssistant();
|
49
|
+
return (_jsxs("div", { "data-testid": LEGEND_STUDIO_TEST_ID.STATUS_BAR, className: "editor__status-bar project-view__status-bar", children: [_jsx("div", { className: "editor__status-bar__left", children: showcase && (_jsxs("div", { className: "editor__status-bar__workspace", children: [_jsx("div", { className: "editor__status-bar__workspace__icon", children: _jsx(ReadMeIcon, {}) }), _jsx("div", { className: "editor__status-bar__workspace__project", children: _jsx("button", { className: "editor__status-bar__workspace__project", tabIndex: -1, children: `Showcase : ${showcase.title}` }) })] })) }), _jsxs("div", { className: "editor__status-bar__right", children: [_jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__generate-btn', {
|
50
|
+
'editor__status-bar__generate-btn--wiggling': editorStore.graphState.graphGenerationState
|
51
|
+
.isRunningGlobalGenerate,
|
52
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning, onClick: generate, tabIndex: -1, title: "Generate (F10)", children: _jsx(FireIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__clear__generation-btn ', {
|
53
|
+
'editor__status-bar__action editor__status-bar__clear__generation-btn--wiggling': editorStore.graphState.graphGenerationState
|
54
|
+
.clearingGenerationEntitiesState.isInProgress,
|
55
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning ||
|
56
|
+
!editable, onClick: emptyGenerationEntities, tabIndex: -1, title: "Clear generation entities", children: _jsx(TrashIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__compile-btn', {
|
57
|
+
'editor__status-bar__compile-btn--wiggling': editorStore.graphState.isRunningGlobalCompile,
|
58
|
+
}), disabled: editorStore.graphState.isApplicationUpdateOperationIsRunning ||
|
59
|
+
!editable, onClick: compile, tabIndex: -1, title: "Compile (F9)", children: _jsx(HammerIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
60
|
+
'editor__status-bar__action__toggler--active': editorStore.panelGroupDisplayState.isOpen,
|
61
|
+
}), onClick: togglePanel, tabIndex: -1, title: "Toggle panel (Ctrl + `)", children: _jsx(TerminalIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
62
|
+
'editor__status-bar__action__toggler--active': editorStore.graphEditorMode.mode ===
|
63
|
+
GRAPH_EDITOR_MODE.GRAMMAR_TEXT,
|
64
|
+
}), onClick: handleTextModeClick, tabIndex: -1, title: "Toggle text mode (F8)", children: _jsx(HackerIcon, {}) }), _jsx("button", { className: clsx('editor__status-bar__action editor__status-bar__action__toggler', {
|
65
|
+
'editor__status-bar__action__toggler--active': !applicationStore.assistantService.isHidden,
|
66
|
+
}), onClick: toggleAssistant, tabIndex: -1, title: "Toggle assistant", children: _jsx(AssistantIcon, {}) })] })] }));
|
67
|
+
});
|
68
|
+
const ShowcaseViewerActivityBar = observer(() => {
|
69
|
+
const editorStore = useEditorStore();
|
70
|
+
const changeActivity = (activity) => () => editorStore.setActiveActivity(activity);
|
71
|
+
// tabs
|
72
|
+
const activities = [
|
73
|
+
{
|
74
|
+
mode: ACTIVITY_MODE.EXPLORER,
|
75
|
+
title: 'Explorer (Ctrl + Shift + X)',
|
76
|
+
icon: _jsx(FileTrayIcon, {}),
|
77
|
+
},
|
78
|
+
].filter((activity) => Boolean(activity));
|
79
|
+
return (_jsxs("div", { className: "activity-bar", children: [_jsx(ActivityBarMenu, {}), _jsx("div", { className: "activity-bar__items", children: activities.map((activity) => (_jsx("button", { className: clsx('activity-bar__item', {
|
80
|
+
'activity-bar__item--active': editorStore.sideBarDisplayState.isOpen &&
|
81
|
+
editorStore.activeActivity === activity.mode,
|
82
|
+
}), onClick: changeActivity(activity.mode), tabIndex: -1, title: activity.title, children: activity.icon }, activity.mode))) })] }));
|
83
|
+
});
|
84
|
+
const ShowcaseViewerSideBar = observer(() => {
|
85
|
+
const editorStore = useEditorStore();
|
86
|
+
const renderSideBar = () => {
|
87
|
+
switch (editorStore.activeActivity) {
|
88
|
+
case ACTIVITY_MODE.EXPLORER:
|
89
|
+
return _jsx(Explorer, {});
|
90
|
+
default:
|
91
|
+
return null;
|
92
|
+
}
|
93
|
+
};
|
94
|
+
return (_jsx("div", { className: "side-bar", children: _jsx("div", { className: "side-bar__view", children: renderSideBar() }) }));
|
95
|
+
});
|
96
|
+
export const ShowcaseViewer = withEditorStore(withShowcaseViewerStore(observer(() => {
|
97
|
+
const params = useParams();
|
98
|
+
const showcaseStore = useShowcaseViewerStore();
|
99
|
+
const applicationStore = useApplicationStore();
|
100
|
+
const editorStore = useEditorStore();
|
101
|
+
// Extensions
|
102
|
+
const extraEditorExtensionComponents = editorStore.pluginManager
|
103
|
+
.getApplicationPlugins()
|
104
|
+
.flatMap((plugin) => plugin.getExtraEditorExtensionComponentRendererConfigurations?.() ??
|
105
|
+
[])
|
106
|
+
.filter(isNonNullable)
|
107
|
+
.map((config) => (_jsx(Fragment, { children: config.renderer(editorStore) }, config.key)));
|
108
|
+
// layout
|
109
|
+
const resizeSideBar = (handleProps) => editorStore.sideBarDisplayState.setSize(handleProps.domElement.getBoundingClientRect()
|
110
|
+
.width);
|
111
|
+
const sideBarCollapsiblePanelGroupProps = getCollapsiblePanelGroupProps(editorStore.sideBarDisplayState.size === 0, {
|
112
|
+
onStopResize: resizeSideBar,
|
113
|
+
size: editorStore.sideBarDisplayState.size,
|
114
|
+
});
|
115
|
+
const resizePanel = (handleProps) => editorStore.panelGroupDisplayState.setSize(handleProps.domElement.getBoundingClientRect()
|
116
|
+
.height);
|
117
|
+
const collapsiblePanelGroupProps = getCollapsiblePanelGroupProps(editorStore.panelGroupDisplayState.size === 0, {
|
118
|
+
onStopResize: resizePanel,
|
119
|
+
size: editorStore.panelGroupDisplayState.size,
|
120
|
+
});
|
121
|
+
const collapsibleSideBarGroupProps = getCollapsiblePanelGroupProps(editorStore.sideBarDisplayState.size === 0, {
|
122
|
+
onStopResize: resizeSideBar,
|
123
|
+
size: editorStore.sideBarDisplayState.size,
|
124
|
+
});
|
125
|
+
const maximizedCollapsiblePanelGroupProps = getCollapsiblePanelGroupProps(editorStore.panelGroupDisplayState.isMaximized);
|
126
|
+
const { ref, width, height } = useResizeDetector();
|
127
|
+
useEffect(() => {
|
128
|
+
if (ref.current) {
|
129
|
+
editorStore.panelGroupDisplayState.setMaxSize(ref.current.offsetHeight);
|
130
|
+
}
|
131
|
+
}, [ref, editorStore, width, height]);
|
132
|
+
// initialize
|
133
|
+
useEffect(() => {
|
134
|
+
flowResult(showcaseStore.initialize(params)).catch(applicationStore.alertUnhandledError);
|
135
|
+
}, [applicationStore, showcaseStore, params]);
|
136
|
+
useCommands(editorStore);
|
137
|
+
return (_jsx("div", { className: "app__page", children: _jsxs("div", { className: "editor viewer", children: [_jsxs("div", { className: "editor__body", children: [_jsx(ShowcaseViewerActivityBar, {}), _jsx("div", { ref: ref, className: "editor__content-container", children: _jsx("div", { className: "editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { ...sideBarCollapsiblePanelGroupProps.collapsiblePanel, direction: 1, children: _jsx(ShowcaseViewerSideBar, {}) }), _jsx(ResizablePanelSplitter, {}), _jsx(ResizablePanel, { ...collapsibleSideBarGroupProps.remainingPanel, minSize: 300, children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsxs(ResizablePanel, { ...maximizedCollapsiblePanelGroupProps.collapsiblePanel, ...(editorStore.panelGroupDisplayState.size === 0
|
138
|
+
? collapsiblePanelGroupProps.remainingPanel
|
139
|
+
: {}), children: [editorStore.graphEditorMode.mode ===
|
140
|
+
GRAPH_EDITOR_MODE.FORM && _jsx(EditorGroup, {}), editorStore.graphEditorMode.mode ===
|
141
|
+
GRAPH_EDITOR_MODE.GRAMMAR_TEXT && (_jsx(GrammarTextEditor, {}))] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: editorStore.panelGroupDisplayState.isMaximized
|
142
|
+
? 'transparent'
|
143
|
+
: 'var(--color-dark-grey-250)' }) }), _jsx(ResizablePanel, { ...collapsiblePanelGroupProps.collapsiblePanel, ...(editorStore.panelGroupDisplayState.isMaximized
|
144
|
+
? maximizedCollapsiblePanelGroupProps.remainingPanel
|
145
|
+
: {}), direction: -1, children: _jsx(PanelGroup, {}) })] }) })] }) }) })] }), editorStore.graphManagerState.graphBuildState.hasSucceeded && (_jsx(ProjectSearchCommand, {})), _jsx(ShowcaseViewerStatusBar, {}), _jsx(EmbeddedQueryBuilder, {}), extraEditorExtensionComponents] }) }));
|
146
|
+
})));
|
147
|
+
//# sourceMappingURL=ShowcaseViewer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewer.js","sourceRoot":"","sources":["../../../src/components/showcase/ShowcaseViewer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM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I,IAAI,KAAC,WAAW,KAAG,EAC1C,WAAW,CAAC,eAAe,CAAC,IAAI;gEAC/B,iBAAiB,CAAC,YAAY,IAAI,CAClC,KAAC,iBAAiB,KAAG,CACtB,IACc,EACjB,KAAC,sBAAsB,cACrB,KAAC,0BAA0B,IACzB,KAAK,EACH,WAAW,CAAC,sBAAsB,CAAC,WAAW;gEAC5C,CAAC,CAAC,aAAa;gEACf,CAAC,CAAC,4BAA4B,GAElC,GACqB,EACzB,KAAC,cAAc,OACT,0BAA0B,CAAC,gBAAgB,KAC3C,CAAC,WAAW,CAAC,sBAAsB,CAAC,WAAW;4DACjD,CAAC,CAAC,mCAAmC,CAAC,cAAc;4DACpD,CAAC,CAAC,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,CAAC,YAEb,KAAC,UAAU,KAAG,GACC,IACG,GACP,IACG,GAClB,GACF,IACF,EACL,WAAW,CAAC,iBAAiB,CAAC,eAAe,CAAC,YAAY,IAAI,CAC7D,KAAC,oBAAoB,KAAG,CACzB,EACD,KAAC,uBAAuB,KAAG,EAC3B,KAAC,oBAAoB,KAAG,EACvB,8BAA8B,IAC3B,GACF,CACP,CAAC;AACJ,CAAC,CAAC,CACH,CACF,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
import { ShowcaseViewerStore } from '../../stores/showcase/ShowcaseViewerStore.js';
|
18
|
+
export declare const ShowcaseViewerStoreProvider: React.FC<{
|
19
|
+
children: React.ReactNode;
|
20
|
+
}>;
|
21
|
+
export declare const useShowcaseViewerStore: () => ShowcaseViewerStore;
|
22
|
+
export declare const withShowcaseViewerStore: (WrapperComponent: React.FC) => React.FC;
|
23
|
+
//# sourceMappingURL=ShowcaseViewerStoreProvider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewerStoreProvider.d.ts","sourceRoot":"","sources":["../../../src/components/showcase/ShowcaseViewerStoreProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAWnF,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAUA,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,mBAIvC,CAAC;AAEJ,eAAO,MAAM,uBAAuB,qBAAsB,MAAM,EAAE,KAAG,MAAM,EAOxE,CAAC"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { createContext, useContext } from 'react';
|
18
|
+
import { ShowcaseViewerStore } from '../../stores/showcase/ShowcaseViewerStore.js';
|
19
|
+
import { useEditorStore } from '../editor/EditorStoreProvider.js';
|
20
|
+
import { useLocalObservable } from 'mobx-react-lite';
|
21
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
22
|
+
import { EDITOR_MODE } from '../../stores/editor/EditorConfig.js';
|
23
|
+
import { ShowcaseViewerEditorMode } from '../../stores/showcase/ShowcaseViewerEditorMode.js';
|
24
|
+
const ShowcaseViewerStoreContext = createContext(undefined);
|
25
|
+
export const ShowcaseViewerStoreProvider = ({ children }) => {
|
26
|
+
const editorStore = useEditorStore();
|
27
|
+
editorStore.setMode(EDITOR_MODE.VIEWER);
|
28
|
+
const store = useLocalObservable(() => new ShowcaseViewerStore(editorStore));
|
29
|
+
editorStore.setEditorMode(new ShowcaseViewerEditorMode(store));
|
30
|
+
return (_jsx(ShowcaseViewerStoreContext.Provider, { value: store, children: children }));
|
31
|
+
};
|
32
|
+
export const useShowcaseViewerStore = () => guaranteeNonNullable(useContext(ShowcaseViewerStoreContext), `Can't find showcase viewer store in context`);
|
33
|
+
export const withShowcaseViewerStore = (WrapperComponent) => function WithShowcaseViewerStore() {
|
34
|
+
return (_jsx(ShowcaseViewerStoreProvider, { children: _jsx(WrapperComponent, {}) }));
|
35
|
+
};
|
36
|
+
//# sourceMappingURL=ShowcaseViewerStoreProvider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ShowcaseViewerStoreProvider.js","sourceRoot":"","sources":["../../../src/components/showcase/ShowcaseViewerStoreProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE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