@finos/legend-application-studio 18.1.0 → 19.1.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.
Files changed (349) hide show
  1. package/lib/application/LegendStudio.d.ts.map +1 -1
  2. package/lib/application/LegendStudio.js +3 -9
  3. package/lib/application/LegendStudio.js.map +1 -1
  4. package/lib/components/Core_LegendStudioApplicationPlugin.d.ts +2 -1
  5. package/lib/components/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
  6. package/lib/components/Core_LegendStudioApplicationPlugin.js +5 -1
  7. package/lib/components/Core_LegendStudioApplicationPlugin.js.map +1 -1
  8. package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
  9. package/lib/components/EditorComponentTestUtils.js +3 -3
  10. package/lib/components/EditorComponentTestUtils.js.map +1 -1
  11. package/lib/components/LegendStudioApplication.d.ts.map +1 -1
  12. package/lib/components/LegendStudioApplication.js +11 -8
  13. package/lib/components/LegendStudioApplication.js.map +1 -1
  14. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  15. package/lib/components/editor/ActivityBar.js +13 -18
  16. package/lib/components/editor/ActivityBar.js.map +1 -1
  17. package/lib/components/editor/Editor.d.ts.map +1 -1
  18. package/lib/components/editor/Editor.js +58 -95
  19. package/lib/components/editor/Editor.js.map +1 -1
  20. package/lib/components/editor/StatusBar.d.ts.map +1 -1
  21. package/lib/components/editor/StatusBar.js +4 -6
  22. package/lib/components/editor/StatusBar.js.map +1 -1
  23. package/lib/components/editor/aux-panel/AuxiliaryPanel.js +1 -1
  24. package/lib/components/editor/aux-panel/AuxiliaryPanel.js.map +1 -1
  25. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  26. package/lib/components/editor/command-center/ProjectSearchCommand.js +1 -1
  27. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  28. package/lib/components/editor/edit-panel/EditPanel.d.ts.map +1 -1
  29. package/lib/components/editor/edit-panel/EditPanel.js +5 -5
  30. package/lib/components/editor/edit-panel/EditPanel.js.map +1 -1
  31. package/lib/components/editor/edit-panel/FileGenerationViewer.d.ts.map +1 -1
  32. package/lib/components/editor/edit-panel/FileGenerationViewer.js +2 -2
  33. package/lib/components/editor/edit-panel/FileGenerationViewer.js.map +1 -1
  34. package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
  35. package/lib/components/editor/edit-panel/FunctionEditor.js +33 -7
  36. package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
  37. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  38. package/lib/components/editor/edit-panel/GrammarTextEditor.js +4 -16
  39. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  40. package/lib/components/editor/edit-panel/ModelImporter.d.ts.map +1 -1
  41. package/lib/components/editor/edit-panel/ModelImporter.js +6 -32
  42. package/lib/components/editor/edit-panel/ModelImporter.js.map +1 -1
  43. package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js +2 -3
  44. package/lib/components/editor/edit-panel/connection-editor/DatabaseBuilder.js.map +1 -1
  45. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  46. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +14 -15
  47. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  48. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.d.ts.map +1 -1
  49. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js +12 -6
  50. package/lib/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.js.map +1 -1
  51. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
  52. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +3 -3
  53. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
  54. package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
  55. package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js +3 -4
  56. package/lib/components/editor/edit-panel/data-editor/EmbeddedDataEditor.js.map +1 -1
  57. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
  58. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +7 -8
  59. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
  60. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
  61. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js +3 -3
  62. package/lib/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.js.map +1 -1
  63. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.d.ts.map +1 -1
  64. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.js +4 -5
  65. package/lib/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.js.map +1 -1
  66. package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.js +2 -3
  67. package/lib/components/editor/edit-panel/element-generation-editor/ElementNativeView.js.map +1 -1
  68. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  69. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +2 -3
  70. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  71. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.d.ts.map +1 -1
  72. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +2 -3
  73. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
  74. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.d.ts.map +1 -1
  75. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js +2 -3
  76. package/lib/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js.map +1 -1
  77. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js +3 -3
  78. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
  79. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  80. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +5 -9
  81. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  82. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  83. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +12 -15
  84. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  85. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
  86. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +9 -12
  87. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
  88. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  89. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +4 -5
  90. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  91. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js +4 -4
  92. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
  93. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js +4 -4
  94. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
  95. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  96. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js +17 -41
  97. package/lib/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  98. package/lib/components/editor/edit-panel/service-editor/NewServiceModal.d.ts.map +1 -1
  99. package/lib/components/editor/edit-panel/service-editor/NewServiceModal.js +4 -5
  100. package/lib/components/editor/edit-panel/service-editor/NewServiceModal.js.map +1 -1
  101. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +16 -16
  102. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
  103. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  104. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +6 -7
  105. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  106. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js +9 -9
  107. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  108. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +5 -5
  109. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  110. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  111. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js +4 -2
  112. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  113. package/lib/components/editor/edit-panel/testable/TestAssertionEditor.d.ts.map +1 -1
  114. package/lib/components/editor/edit-panel/testable/TestAssertionEditor.js +2 -3
  115. package/lib/components/editor/edit-panel/testable/TestAssertionEditor.js.map +1 -1
  116. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
  117. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +7 -5
  118. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
  119. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  120. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +12 -8
  121. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  122. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
  123. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +7 -5
  124. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
  125. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  126. package/lib/components/editor/side-bar/CreateNewElementModal.js +4 -5
  127. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  128. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  129. package/lib/components/editor/side-bar/Explorer.js +21 -12
  130. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  131. package/lib/components/editor/side-bar/WorkflowManager.js +3 -5
  132. package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
  133. package/lib/components/editor/side-bar/WorkspaceReview.d.ts.map +1 -1
  134. package/lib/components/editor/side-bar/WorkspaceReview.js +5 -32
  135. package/lib/components/editor/side-bar/WorkspaceReview.js.map +1 -1
  136. package/lib/components/editor/side-bar/WorkspaceUpdater.d.ts.map +1 -1
  137. package/lib/components/editor/side-bar/WorkspaceUpdater.js +2 -26
  138. package/lib/components/editor/side-bar/WorkspaceUpdater.js.map +1 -1
  139. package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts.map +1 -1
  140. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +3 -4
  141. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
  142. package/lib/components/project-viewer/ProjectViewer.d.ts.map +1 -1
  143. package/lib/components/project-viewer/ProjectViewer.js +19 -33
  144. package/lib/components/project-viewer/ProjectViewer.js.map +1 -1
  145. package/lib/components/shared/DiffView.d.ts.map +1 -1
  146. package/lib/components/shared/DiffView.js +4 -19
  147. package/lib/components/shared/DiffView.js.map +1 -1
  148. package/lib/components/workspace-review/WorkspaceReview.d.ts.map +1 -1
  149. package/lib/components/workspace-review/WorkspaceReview.js +8 -6
  150. package/lib/components/workspace-review/WorkspaceReview.js.map +1 -1
  151. package/lib/components/workspace-review/WorkspaceReviewPanel.d.ts.map +1 -1
  152. package/lib/components/workspace-review/WorkspaceReviewPanel.js +2 -2
  153. package/lib/components/workspace-review/WorkspaceReviewPanel.js.map +1 -1
  154. package/lib/components/workspace-review/WorkspaceReviewSideBar.js +1 -1
  155. package/lib/components/workspace-review/WorkspaceReviewSideBar.js.map +1 -1
  156. package/lib/components/workspace-setup/CreateProjectModal.d.ts.map +1 -1
  157. package/lib/components/workspace-setup/CreateProjectModal.js +10 -6
  158. package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
  159. package/lib/components/workspace-setup/CreateWorkspaceModal.d.ts.map +1 -1
  160. package/lib/components/workspace-setup/CreateWorkspaceModal.js +4 -5
  161. package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
  162. package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
  163. package/lib/components/workspace-setup/WorkspaceSetup.js +4 -1
  164. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  165. package/lib/index.css +2 -2
  166. package/lib/index.css.map +1 -1
  167. package/lib/index.d.ts +0 -1
  168. package/lib/index.d.ts.map +1 -1
  169. package/lib/index.js +0 -1
  170. package/lib/index.js.map +1 -1
  171. package/lib/package.json +5 -7
  172. package/lib/stores/EditorConfig.d.ts +0 -28
  173. package/lib/stores/EditorConfig.d.ts.map +1 -1
  174. package/lib/stores/EditorConfig.js +0 -29
  175. package/lib/stores/EditorConfig.js.map +1 -1
  176. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  177. package/lib/stores/EditorGraphState.js +8 -8
  178. package/lib/stores/EditorGraphState.js.map +1 -1
  179. package/lib/stores/EditorSDLCState.d.ts.map +1 -1
  180. package/lib/stores/EditorSDLCState.js +4 -2
  181. package/lib/stores/EditorSDLCState.js.map +1 -1
  182. package/lib/stores/EditorStore.d.ts +27 -30
  183. package/lib/stores/EditorStore.d.ts.map +1 -1
  184. package/lib/stores/EditorStore.js +183 -146
  185. package/lib/stores/EditorStore.js.map +1 -1
  186. package/lib/stores/EmbeddedQueryBuilderState.d.ts +1 -1
  187. package/lib/stores/EmbeddedQueryBuilderState.d.ts.map +1 -1
  188. package/lib/stores/EmbeddedQueryBuilderState.js +7 -8
  189. package/lib/stores/EmbeddedQueryBuilderState.js.map +1 -1
  190. package/lib/stores/LegendStudioBaseStore.d.ts +1 -1
  191. package/lib/stores/LegendStudioBaseStore.d.ts.map +1 -1
  192. package/lib/stores/LegendStudioBaseStore.js +25 -17
  193. package/lib/stores/LegendStudioBaseStore.js.map +1 -1
  194. package/lib/stores/LegendStudioCommand.d.ts +32 -0
  195. package/lib/stores/LegendStudioCommand.d.ts.map +1 -0
  196. package/lib/stores/LegendStudioCommand.js +81 -0
  197. package/lib/stores/LegendStudioCommand.js.map +1 -0
  198. package/lib/stores/LegendStudioRouter.d.ts +15 -15
  199. package/lib/stores/LegendStudioRouter.d.ts.map +1 -1
  200. package/lib/stores/LegendStudioRouter.js +37 -24
  201. package/lib/stores/LegendStudioRouter.js.map +1 -1
  202. package/lib/stores/editor-state/GraphGenerationState.d.ts.map +1 -1
  203. package/lib/stores/editor-state/GraphGenerationState.js +2 -3
  204. package/lib/stores/editor-state/GraphGenerationState.js.map +1 -1
  205. package/lib/stores/editor-state/ModelImporterState.d.ts.map +1 -1
  206. package/lib/stores/editor-state/ModelImporterState.js +21 -21
  207. package/lib/stores/editor-state/ModelImporterState.js.map +1 -1
  208. package/lib/stores/editor-state/ProjectConfigurationEditorState.js +2 -2
  209. package/lib/stores/editor-state/ProjectConfigurationEditorState.js.map +1 -1
  210. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
  211. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -3
  212. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  213. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
  214. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +1 -3
  215. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
  216. package/lib/stores/editor-state/element-editor-state/testable/TestAssertionState.d.ts.map +1 -1
  217. package/lib/stores/editor-state/element-editor-state/testable/TestAssertionState.js +2 -2
  218. package/lib/stores/editor-state/element-editor-state/testable/TestAssertionState.js.map +1 -1
  219. package/lib/stores/project-viewer/ProjectViewerStore.d.ts +2 -4
  220. package/lib/stores/project-viewer/ProjectViewerStore.d.ts.map +1 -1
  221. package/lib/stores/project-viewer/ProjectViewerStore.js +45 -44
  222. package/lib/stores/project-viewer/ProjectViewerStore.js.map +1 -1
  223. package/lib/stores/shared/MockDataUtils.d.ts.map +1 -1
  224. package/lib/stores/shared/MockDataUtils.js +3 -4
  225. package/lib/stores/shared/MockDataUtils.js.map +1 -1
  226. package/lib/stores/shared/PackageTreeUtils.d.ts +1 -0
  227. package/lib/stores/shared/PackageTreeUtils.d.ts.map +1 -1
  228. package/lib/stores/shared/PackageTreeUtils.js +5 -2
  229. package/lib/stores/shared/PackageTreeUtils.js.map +1 -1
  230. package/lib/stores/shared/testable/TestableUtils.d.ts.map +1 -1
  231. package/lib/stores/shared/testable/TestableUtils.js +6 -6
  232. package/lib/stores/shared/testable/TestableUtils.js.map +1 -1
  233. package/lib/stores/sidebar-state/LocalChangesState.d.ts +1 -0
  234. package/lib/stores/sidebar-state/LocalChangesState.d.ts.map +1 -1
  235. package/lib/stores/sidebar-state/LocalChangesState.js +42 -25
  236. package/lib/stores/sidebar-state/LocalChangesState.js.map +1 -1
  237. package/lib/stores/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
  238. package/lib/stores/sidebar-state/ProjectOverviewState.js +3 -2
  239. package/lib/stores/sidebar-state/ProjectOverviewState.js.map +1 -1
  240. package/lib/stores/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
  241. package/lib/stores/sidebar-state/WorkspaceReviewState.js +10 -10
  242. package/lib/stores/sidebar-state/WorkspaceReviewState.js.map +1 -1
  243. package/lib/stores/sidebar-state/WorkspaceSyncState.d.ts.map +1 -1
  244. package/lib/stores/sidebar-state/WorkspaceSyncState.js +6 -8
  245. package/lib/stores/sidebar-state/WorkspaceSyncState.js.map +1 -1
  246. package/lib/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.d.ts.map +1 -1
  247. package/lib/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.js +20 -17
  248. package/lib/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.js.map +1 -1
  249. package/lib/stores/sidebar-state/WorkspaceUpdaterState.d.ts.map +1 -1
  250. package/lib/stores/sidebar-state/WorkspaceUpdaterState.js +8 -7
  251. package/lib/stores/sidebar-state/WorkspaceUpdaterState.js.map +1 -1
  252. package/lib/stores/workspace-setup/WorkspaceSetupStore.js +6 -6
  253. package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
  254. package/package.json +14 -16
  255. package/src/application/LegendStudio.tsx +3 -9
  256. package/src/components/Core_LegendStudioApplicationPlugin.tsx +9 -0
  257. package/src/components/EditorComponentTestUtils.tsx +8 -2
  258. package/src/components/LegendStudioApplication.tsx +28 -8
  259. package/src/components/editor/ActivityBar.tsx +35 -73
  260. package/src/components/editor/Editor.tsx +135 -172
  261. package/src/components/editor/StatusBar.tsx +16 -13
  262. package/src/components/editor/aux-panel/AuxiliaryPanel.tsx +1 -1
  263. package/src/components/editor/command-center/ProjectSearchCommand.tsx +12 -16
  264. package/src/components/editor/edit-panel/EditPanel.tsx +14 -22
  265. package/src/components/editor/edit-panel/FileGenerationViewer.tsx +9 -11
  266. package/src/components/editor/edit-panel/FunctionEditor.tsx +51 -5
  267. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +2 -18
  268. package/src/components/editor/edit-panel/ModelImporter.tsx +10 -38
  269. package/src/components/editor/edit-panel/connection-editor/DatabaseBuilder.tsx +2 -2
  270. package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +32 -33
  271. package/src/components/editor/edit-panel/connection-editor/post-processor-editor/MapperPostProcessorEditor.tsx +28 -23
  272. package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +8 -9
  273. package/src/components/editor/edit-panel/data-editor/EmbeddedDataEditor.tsx +8 -10
  274. package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +7 -8
  275. package/src/components/editor/edit-panel/diff-editor/EntityChangeConflictEditor.tsx +2 -2
  276. package/src/components/editor/edit-panel/element-generation-editor/ElementGenerationEditor.tsx +9 -5
  277. package/src/components/editor/edit-panel/element-generation-editor/ElementNativeView.tsx +2 -2
  278. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +5 -3
  279. package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +2 -3
  280. package/src/components/editor/edit-panel/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx +2 -3
  281. package/src/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.tsx +3 -3
  282. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +5 -9
  283. package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +23 -27
  284. package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +20 -24
  285. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +4 -5
  286. package/src/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.tsx +4 -4
  287. package/src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +4 -4
  288. package/src/components/editor/edit-panel/project-configuration-editor/ProjectConfigurationEditor.tsx +57 -75
  289. package/src/components/editor/edit-panel/service-editor/NewServiceModal.tsx +7 -5
  290. package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +16 -16
  291. package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +15 -14
  292. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestDataEditor.tsx +9 -9
  293. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +5 -5
  294. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.tsx +4 -2
  295. package/src/components/editor/edit-panel/testable/TestAssertionEditor.tsx +2 -3
  296. package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +12 -5
  297. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +17 -11
  298. package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +14 -5
  299. package/src/components/editor/side-bar/CreateNewElementModal.tsx +4 -5
  300. package/src/components/editor/side-bar/Explorer.tsx +60 -39
  301. package/src/components/editor/side-bar/WorkflowManager.tsx +3 -3
  302. package/src/components/editor/side-bar/WorkspaceReview.tsx +5 -35
  303. package/src/components/editor/side-bar/WorkspaceUpdater.tsx +2 -31
  304. package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +3 -4
  305. package/src/components/project-viewer/ProjectViewer.tsx +65 -78
  306. package/src/components/shared/DiffView.tsx +3 -22
  307. package/src/components/workspace-review/WorkspaceReview.tsx +26 -16
  308. package/src/components/workspace-review/WorkspaceReviewPanel.tsx +5 -9
  309. package/src/components/workspace-review/WorkspaceReviewSideBar.tsx +1 -1
  310. package/src/components/workspace-setup/CreateProjectModal.tsx +14 -10
  311. package/src/components/workspace-setup/CreateWorkspaceModal.tsx +6 -5
  312. package/src/components/workspace-setup/WorkspaceSetup.tsx +6 -1
  313. package/src/index.ts +0 -1
  314. package/src/stores/EditorConfig.ts +0 -30
  315. package/src/stores/EditorGraphState.ts +9 -8
  316. package/src/stores/EditorSDLCState.ts +4 -2
  317. package/src/stores/EditorStore.ts +231 -245
  318. package/src/stores/EmbeddedQueryBuilderState.ts +14 -9
  319. package/src/stores/LegendStudioBaseStore.ts +33 -24
  320. package/src/stores/LegendStudioCommand.ts +83 -0
  321. package/src/stores/LegendStudioRouter.ts +50 -41
  322. package/src/stores/editor-state/GraphGenerationState.ts +3 -2
  323. package/src/stores/editor-state/ModelImporterState.ts +35 -23
  324. package/src/stores/editor-state/ProjectConfigurationEditorState.ts +2 -2
  325. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -3
  326. package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +1 -3
  327. package/src/stores/editor-state/element-editor-state/testable/TestAssertionState.ts +2 -1
  328. package/src/stores/project-viewer/ProjectViewerStore.ts +65 -59
  329. package/src/stores/shared/MockDataUtils.ts +4 -3
  330. package/src/stores/shared/PackageTreeUtils.ts +10 -1
  331. package/src/stores/shared/testable/TestableUtils.ts +6 -5
  332. package/src/stores/sidebar-state/LocalChangesState.ts +50 -36
  333. package/src/stores/sidebar-state/ProjectOverviewState.ts +4 -2
  334. package/src/stores/sidebar-state/WorkspaceReviewState.ts +11 -10
  335. package/src/stores/sidebar-state/WorkspaceSyncState.ts +6 -8
  336. package/src/stores/sidebar-state/WorkspaceUpdateConflictResolutionState.ts +20 -17
  337. package/src/stores/sidebar-state/WorkspaceUpdaterState.ts +8 -7
  338. package/src/stores/workspace-setup/WorkspaceSetupStore.ts +6 -6
  339. package/tsconfig.json +1 -2
  340. package/lib/components/shared/StudioLambdaEditor.d.ts +0 -41
  341. package/lib/components/shared/StudioLambdaEditor.d.ts.map +0 -1
  342. package/lib/components/shared/StudioLambdaEditor.js +0 -53
  343. package/lib/components/shared/StudioLambdaEditor.js.map +0 -1
  344. package/lib/components/shared/StudioTextInputEditor.d.ts +0 -28
  345. package/lib/components/shared/StudioTextInputEditor.d.ts.map +0 -1
  346. package/lib/components/shared/StudioTextInputEditor.js +0 -36
  347. package/lib/components/shared/StudioTextInputEditor.js.map +0 -1
  348. package/src/components/shared/StudioLambdaEditor.tsx +0 -146
  349. package/src/components/shared/StudioTextInputEditor.tsx +0 -83
@@ -29,8 +29,6 @@ import {
29
29
  AUX_PANEL_MODE,
30
30
  GRAPH_EDITOR_MODE,
31
31
  EDITOR_MODE,
32
- LEGEND_STUDIO_HOTKEY,
33
- LEGEND_STUDIO_HOTKEY_MAP,
34
32
  } from './EditorConfig.js';
35
33
  import { ElementEditorState } from './editor-state/element-editor-state/ElementEditorState.js';
36
34
  import { MappingEditorState } from './editor-state/element-editor-state/mapping/MappingEditorState.js';
@@ -52,7 +50,6 @@ import {
52
50
  type GeneratorFn,
53
51
  type PlainObject,
54
52
  LogEvent,
55
- addUniqueEntry,
56
53
  isNonNullable,
57
54
  assertErrorThrown,
58
55
  guaranteeType,
@@ -62,6 +59,7 @@ import {
62
59
  assertTrue,
63
60
  ActionState,
64
61
  filterByType,
62
+ AssertionError,
65
63
  } from '@finos/legend-shared';
66
64
  import { UMLEditorState } from './editor-state/element-editor-state/UMLEditorState.js';
67
65
  import { ServiceEditorState } from './editor-state/element-editor-state/service/ServiceEditorState.js';
@@ -85,20 +83,18 @@ import type { GenerationFile } from './shared/FileGenerationTreeUtils.js';
85
83
  import type { ElementFileGenerationState } from './editor-state/element-editor-state/ElementFileGenerationState.js';
86
84
  import { DevToolState } from './aux-panel-state/DevToolState.js';
87
85
  import {
86
+ generateEditorRoute,
88
87
  generateSetupRoute,
89
88
  generateViewProjectRoute,
89
+ type WorkspaceEditorPathParams,
90
90
  } from './LegendStudioRouter.js';
91
- import {
92
- HotkeyConfiguration,
93
- NonBlockingDialogState,
94
- PanelDisplayState,
95
- } from '@finos/legend-art';
91
+ import { NonBlockingDialogState, PanelDisplayState } from '@finos/legend-art';
96
92
  import type { DSL_LegendStudioApplicationPlugin_Extension } from './LegendStudioApplicationPlugin.js';
97
93
  import type { Entity } from '@finos/legend-storage';
98
94
  import {
99
95
  ProjectConfiguration,
96
+ WorkspaceType,
100
97
  type SDLCServerClient,
101
- type WorkspaceType,
102
98
  } from '@finos/legend-server-sdlc';
103
99
  import {
104
100
  type PackageableElement,
@@ -126,8 +122,7 @@ import {
126
122
  import type { DepotServerClient } from '@finos/legend-server-depot';
127
123
  import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
128
124
  import {
129
- type ActionAlertInfo,
130
- type BlockingAlertInfo,
125
+ type CommandRegistrar,
131
126
  ActionAlertActionType,
132
127
  ActionAlertType,
133
128
  APPLICATION_EVENT,
@@ -147,6 +142,7 @@ import { PACKAGEABLE_ELEMENT_TYPE } from './shared/ModelClassifierUtils.js';
147
142
  import { GlobalTestRunnerState } from './sidebar-state/testable/GlobalTestRunnerState.js';
148
143
  import type { LegendStudioApplicationStore } from './LegendStudioBaseStore.js';
149
144
  import { EmbeddedQueryBuilderState } from './EmbeddedQueryBuilderState.js';
145
+ import { LEGEND_STUDIO_COMMAND_KEY } from './LegendStudioCommand.js';
150
146
 
151
147
  export abstract class EditorExtensionState {
152
148
  /**
@@ -156,31 +152,19 @@ export abstract class EditorExtensionState {
156
152
  private readonly _$nominalTypeBrand!: 'EditorExtensionState';
157
153
  }
158
154
 
159
- export class EditorStore {
155
+ export class EditorStore implements CommandRegistrar {
160
156
  applicationStore: LegendStudioApplicationStore;
161
157
  sdlcServerClient: SDLCServerClient;
162
158
  depotServerClient: DepotServerClient;
163
159
  pluginManager: LegendStudioPluginManager;
164
160
 
165
161
  editorMode: EditorMode;
166
- setEditorMode(val: EditorMode): void {
167
- this.editorMode = val;
168
- }
169
162
  // NOTE: once we clear up the editor store to make modes more separated
170
163
  // we should remove these sets of functions. They are basically hacks to
171
164
  // ensure hiding parts of the UI based on the editing mode.
172
165
  // Instead, we will gradually move these `boolean` flags into `EditorMode`
173
166
  // See https://github.com/finos/legend-studio/issues/317
174
167
  mode = EDITOR_MODE.STANDARD;
175
- setMode(val: EDITOR_MODE): void {
176
- this.mode = val;
177
- }
178
- get isInViewerMode(): boolean {
179
- return this.mode === EDITOR_MODE.VIEWER;
180
- }
181
- get isInConflictResolutionMode(): boolean {
182
- return this.mode === EDITOR_MODE.CONFLICT_RESOLUTION;
183
- }
184
168
 
185
169
  editorExtensionStates: EditorExtensionState[] = [];
186
170
  explorerTreeState: ExplorerTreeState;
@@ -202,7 +186,7 @@ export class EditorStore {
202
186
  embeddedQueryBuilderState: EmbeddedQueryBuilderState;
203
187
  newElementState: NewElementState;
204
188
 
205
- private _isDisposed = false;
189
+ initialEntityPath?: string | undefined;
206
190
  initState = ActionState.create();
207
191
  graphEditMode = GRAPH_EDITOR_MODE.FORM;
208
192
 
@@ -221,12 +205,7 @@ export class EditorStore {
221
205
  snap: 150,
222
206
  });
223
207
 
224
- // Hot keys
225
- blockGlobalHotkeys = false;
226
- readonly defaultHotkeys: HotkeyConfiguration[] = [];
227
- hotkeys: HotkeyConfiguration[] = [];
228
-
229
- // Tabs
208
+ // Editor Tabs
230
209
  currentEditorState?: EditorState | undefined;
231
210
  openedEditorStates: EditorState[] = [];
232
211
  /**
@@ -235,8 +214,6 @@ export class EditorStore {
235
214
  */
236
215
  elementGenerationStates: ElementFileGenerationState[] = [];
237
216
  searchElementCommandState = new NonBlockingDialogState();
238
- ignoreNavigationBlocking = false;
239
- isDevToolEnabled = true;
240
217
 
241
218
  constructor(
242
219
  applicationStore: LegendStudioApplicationStore,
@@ -246,20 +223,15 @@ export class EditorStore {
246
223
  ) {
247
224
  makeObservable<
248
225
  EditorStore,
249
- '_isDisposed' | 'initStandardMode' | 'initConflictResolutionMode'
226
+ 'initStandardMode' | 'initConflictResolutionMode'
250
227
  >(this, {
251
228
  editorMode: observable,
252
229
  mode: observable,
253
- _isDisposed: observable,
254
230
  graphEditMode: observable,
255
231
  activeAuxPanelMode: observable,
256
232
  activeActivity: observable,
257
- blockGlobalHotkeys: observable,
258
- hotkeys: observable,
259
233
  currentEditorState: observable,
260
234
  openedEditorStates: observable,
261
- ignoreNavigationBlocking: observable,
262
- isDevToolEnabled: observable,
263
235
 
264
236
  isInViewerMode: computed,
265
237
  isInConflictResolutionMode: computed,
@@ -274,17 +246,10 @@ export class EditorStore {
274
246
  graphManagerState: false,
275
247
  setEditorMode: action,
276
248
  setMode: action,
277
- setDevTool: action,
278
- setHotkeys: action,
279
- addHotKey: action,
280
- resetHotkeys: action,
281
- setBlockGlobalHotkeys: action,
249
+
282
250
  setCurrentEditorState: action,
283
251
  setActiveAuxPanelMode: action,
284
- setIgnoreNavigationBlocking: action,
285
252
  refreshCurrentEntityDiffEditorState: action,
286
- setBlockingAlert: action,
287
- setActionAlertInfo: action,
288
253
  cleanUp: action,
289
254
  reset: action,
290
255
  setGraphEditMode: action,
@@ -362,101 +327,6 @@ export class EditorStore {
362
327
  )
363
328
  .map((creator) => creator(this))
364
329
  .filter(isNonNullable);
365
-
366
- // hotkeys
367
- this.defaultHotkeys = [
368
- // actions that need blocking
369
- new HotkeyConfiguration(
370
- LEGEND_STUDIO_HOTKEY.COMPILE,
371
- [LEGEND_STUDIO_HOTKEY_MAP.COMPILE],
372
- this.createGlobalHotKeyAction(() => {
373
- flowResult(this.graphState.globalCompileInFormMode()).catch(
374
- applicationStore.alertUnhandledError,
375
- );
376
- }),
377
- ),
378
- new HotkeyConfiguration(
379
- LEGEND_STUDIO_HOTKEY.GENERATE,
380
- [LEGEND_STUDIO_HOTKEY_MAP.GENERATE],
381
- this.createGlobalHotKeyAction(() => {
382
- flowResult(
383
- this.graphState.graphGenerationState.globalGenerate(),
384
- ).catch(applicationStore.alertUnhandledError);
385
- }),
386
- ),
387
- new HotkeyConfiguration(
388
- LEGEND_STUDIO_HOTKEY.CREATE_ELEMENT,
389
- [LEGEND_STUDIO_HOTKEY_MAP.CREATE_ELEMENT],
390
- this.createGlobalHotKeyAction(() => this.newElementState.openModal()),
391
- ),
392
- new HotkeyConfiguration(
393
- LEGEND_STUDIO_HOTKEY.OPEN_ELEMENT,
394
- [LEGEND_STUDIO_HOTKEY_MAP.OPEN_ELEMENT],
395
- this.createGlobalHotKeyAction(() =>
396
- this.searchElementCommandState.open(),
397
- ),
398
- ),
399
- new HotkeyConfiguration(
400
- LEGEND_STUDIO_HOTKEY.TOGGLE_TEXT_MODE,
401
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_TEXT_MODE],
402
- this.createGlobalHotKeyAction(() => {
403
- flowResult(this.toggleTextMode()).catch(
404
- applicationStore.alertUnhandledError,
405
- );
406
- }),
407
- ),
408
- new HotkeyConfiguration(
409
- LEGEND_STUDIO_HOTKEY.TOGGLE_MODEL_LOADER,
410
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_MODEL_LOADER],
411
- this.createGlobalHotKeyAction(() =>
412
- this.openState(this.modelImporterState),
413
- ),
414
- ),
415
- new HotkeyConfiguration(
416
- LEGEND_STUDIO_HOTKEY.SYNC_WITH_WORKSPACE,
417
- [LEGEND_STUDIO_HOTKEY_MAP.SYNC_WITH_WORKSPACE],
418
- this.createGlobalHotKeyAction(() => {
419
- flowResult(this.localChangesState.pushLocalChanges()).catch(
420
- applicationStore.alertUnhandledError,
421
- );
422
- }),
423
- ),
424
- // simple actions (no blocking is needed)
425
- new HotkeyConfiguration(
426
- LEGEND_STUDIO_HOTKEY.TOGGLE_AUX_PANEL,
427
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_AUX_PANEL],
428
- this.createGlobalHotKeyAction(() => this.auxPanelDisplayState.toggle()),
429
- ),
430
- new HotkeyConfiguration(
431
- LEGEND_STUDIO_HOTKEY.TOGGLE_SIDEBAR_EXPLORER,
432
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_SIDEBAR_EXPLORER],
433
- this.createGlobalHotKeyAction(() =>
434
- this.setActiveActivity(ACTIVITY_MODE.EXPLORER),
435
- ),
436
- ),
437
- new HotkeyConfiguration(
438
- LEGEND_STUDIO_HOTKEY.TOGGLE_SIDEBAR_CHANGES,
439
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_SIDEBAR_CHANGES],
440
- this.createGlobalHotKeyAction(() =>
441
- this.setActiveActivity(ACTIVITY_MODE.LOCAL_CHANGES),
442
- ),
443
- ),
444
- new HotkeyConfiguration(
445
- LEGEND_STUDIO_HOTKEY.TOGGLE_SIDEBAR_WORKSPACE_REVIEW,
446
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_SIDEBAR_WORKSPACE_REVIEW],
447
- this.createGlobalHotKeyAction(() =>
448
- this.setActiveActivity(ACTIVITY_MODE.WORKSPACE_REVIEW),
449
- ),
450
- ),
451
- new HotkeyConfiguration(
452
- LEGEND_STUDIO_HOTKEY.TOGGLE_SIDEBAR_WORKSPACE_UPDATER,
453
- [LEGEND_STUDIO_HOTKEY_MAP.TOGGLE_SIDEBAR_WORKSPACE_UPDATER],
454
- this.createGlobalHotKeyAction(() =>
455
- this.setActiveActivity(ACTIVITY_MODE.WORKSPACE_UPDATER),
456
- ),
457
- ),
458
- ];
459
- this.hotkeys = this.defaultHotkeys;
460
330
  }
461
331
 
462
332
  get isInitialized(): boolean {
@@ -478,57 +348,34 @@ export class EditorStore {
478
348
  return this.graphEditMode === GRAPH_EDITOR_MODE.FORM;
479
349
  }
480
350
 
481
- setHotkeys(val: HotkeyConfiguration[]): void {
482
- this.hotkeys = val;
483
- }
484
-
485
- addHotKey(val: HotkeyConfiguration): void {
486
- addUniqueEntry(this.hotkeys, val);
487
- }
488
-
489
- resetHotkeys(): void {
490
- this.hotkeys = this.defaultHotkeys;
491
- }
492
-
493
- setBlockGlobalHotkeys(val: boolean): void {
494
- this.blockGlobalHotkeys = val;
495
- }
496
-
497
- setDevTool(val: boolean): void {
498
- this.isDevToolEnabled = val;
499
- }
500
-
501
- setCurrentEditorState(val: EditorState | undefined): void {
502
- this.currentEditorState = val;
503
- }
504
-
505
- setActiveAuxPanelMode(val: AUX_PANEL_MODE): void {
506
- this.activeAuxPanelMode = val;
351
+ get isInViewerMode(): boolean {
352
+ return this.mode === EDITOR_MODE.VIEWER;
507
353
  }
508
354
 
509
- setIgnoreNavigationBlocking(val: boolean): void {
510
- this.ignoreNavigationBlocking = val;
355
+ get isInConflictResolutionMode(): boolean {
356
+ return this.mode === EDITOR_MODE.CONFLICT_RESOLUTION;
511
357
  }
512
358
 
513
- refreshCurrentEntityDiffEditorState(): void {
514
- if (this.currentEditorState instanceof EntityDiffEditorState) {
515
- this.currentEditorState.refresh();
516
- }
359
+ /**
360
+ * TODO?: we should really think of how we could simplify the trigger condition below
361
+ * after we refactor editor modes
362
+ *
363
+ * See https://github.com/finos/legend-studio/issues/317
364
+ */
365
+ createEditorCommandTrigger(additionalChecker?: () => boolean): () => boolean {
366
+ return (): boolean =>
367
+ // we don't want to leak any hotkeys when we have embedded query builder open
368
+ // TODO?: we probably should come up with a more generic mechanism for this
369
+ !this.embeddedQueryBuilderState.queryBuilderState &&
370
+ (!additionalChecker || additionalChecker());
517
371
  }
518
372
 
519
- setBlockingAlert(alertInfo: BlockingAlertInfo | undefined): void {
520
- if (this._isDisposed) {
521
- return;
522
- }
523
- this.setBlockGlobalHotkeys(Boolean(alertInfo)); // block global hotkeys if alert is shown
524
- this.applicationStore.setBlockingAlert(alertInfo);
373
+ setEditorMode(val: EditorMode): void {
374
+ this.editorMode = val;
525
375
  }
526
376
 
527
- setActionAlertInfo(alertInfo: ActionAlertInfo | undefined): void {
528
- if (this._isDisposed) {
529
- return;
530
- }
531
- this.applicationStore.setActionAlertInfo(alertInfo);
377
+ setMode(val: EDITOR_MODE): void {
378
+ this.mode = val;
532
379
  }
533
380
 
534
381
  cleanUp(): void {
@@ -536,11 +383,129 @@ export class EditorStore {
536
383
  // end up blocking other parts of the app
537
384
  // e.g. trying going to an unknown workspace, we will be redirected to the home page
538
385
  // but the blocking alert for not-found workspace will still block the app
539
- this.setBlockingAlert(undefined);
540
- this.setActionAlertInfo(undefined);
386
+ this.applicationStore.setBlockingAlert(undefined);
387
+ this.applicationStore.setActionAlertInfo(undefined);
541
388
  // stop change detection to avoid memory-leak
542
389
  this.changeDetectionState.stop();
543
- this._isDisposed = true;
390
+ }
391
+
392
+ registerCommands(): void {
393
+ this.applicationStore.commandCenter.registerCommand({
394
+ key: LEGEND_STUDIO_COMMAND_KEY.COMPILE,
395
+ trigger: this.createEditorCommandTrigger(
396
+ () =>
397
+ this.isInitialized &&
398
+ (!this.isInConflictResolutionMode ||
399
+ this.conflictResolutionState.hasResolvedAllConflicts),
400
+ ),
401
+ action: () => {
402
+ if (this.isInFormMode) {
403
+ flowResult(this.graphState.globalCompileInFormMode()).catch(
404
+ this.applicationStore.alertUnhandledError,
405
+ );
406
+ } else if (this.isInGrammarTextMode) {
407
+ flowResult(this.graphState.globalCompileInTextMode()).catch(
408
+ this.applicationStore.alertUnhandledError,
409
+ );
410
+ }
411
+ },
412
+ });
413
+ this.applicationStore.commandCenter.registerCommand({
414
+ key: LEGEND_STUDIO_COMMAND_KEY.GENERATE,
415
+ trigger: this.createEditorCommandTrigger(
416
+ () =>
417
+ this.isInitialized &&
418
+ (!this.isInConflictResolutionMode ||
419
+ this.conflictResolutionState.hasResolvedAllConflicts),
420
+ ),
421
+ action: () => {
422
+ flowResult(this.graphState.graphGenerationState.globalGenerate()).catch(
423
+ this.applicationStore.alertUnhandledError,
424
+ );
425
+ },
426
+ });
427
+ this.applicationStore.commandCenter.registerCommand({
428
+ key: LEGEND_STUDIO_COMMAND_KEY.CREATE_ELEMENT,
429
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
430
+ action: () => this.newElementState.openModal(),
431
+ });
432
+ this.applicationStore.commandCenter.registerCommand({
433
+ key: LEGEND_STUDIO_COMMAND_KEY.SEARCH_ELEMENT,
434
+ trigger: this.createEditorCommandTrigger(),
435
+ action: () => this.searchElementCommandState.open(),
436
+ });
437
+ this.applicationStore.commandCenter.registerCommand({
438
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_TEXT_MODE,
439
+ trigger: this.createEditorCommandTrigger(
440
+ () =>
441
+ this.isInitialized &&
442
+ (!this.isInConflictResolutionMode ||
443
+ this.conflictResolutionState.hasResolvedAllConflicts),
444
+ ),
445
+ action: () => {
446
+ flowResult(this.toggleTextMode()).catch(
447
+ this.applicationStore.alertUnhandledError,
448
+ );
449
+ },
450
+ });
451
+ this.applicationStore.commandCenter.registerCommand({
452
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_MODEL_LOADER,
453
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
454
+ action: () => this.openState(this.modelImporterState),
455
+ });
456
+ this.applicationStore.commandCenter.registerCommand({
457
+ key: LEGEND_STUDIO_COMMAND_KEY.SYNC_WITH_WORKSPACE,
458
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
459
+ action: () => {
460
+ flowResult(this.localChangesState.pushLocalChanges()).catch(
461
+ this.applicationStore.alertUnhandledError,
462
+ );
463
+ },
464
+ });
465
+ this.applicationStore.commandCenter.registerCommand({
466
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_AUX_PANEL,
467
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
468
+ action: () => this.auxPanelDisplayState.toggle(),
469
+ });
470
+ this.applicationStore.commandCenter.registerCommand({
471
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_EXPLORER,
472
+ trigger: this.createEditorCommandTrigger(),
473
+ action: () => this.setActiveActivity(ACTIVITY_MODE.EXPLORER),
474
+ });
475
+ this.applicationStore.commandCenter.registerCommand({
476
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_LOCAL_CHANGES,
477
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
478
+ action: () => this.setActiveActivity(ACTIVITY_MODE.LOCAL_CHANGES),
479
+ });
480
+ this.applicationStore.commandCenter.registerCommand({
481
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_WORKSPACE_REVIEW,
482
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
483
+ action: () => this.setActiveActivity(ACTIVITY_MODE.WORKSPACE_REVIEW),
484
+ });
485
+ this.applicationStore.commandCenter.registerCommand({
486
+ key: LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_WORKSPACE_UPDATER,
487
+ trigger: this.createEditorCommandTrigger(() => !this.isInViewerMode),
488
+ action: () => this.setActiveActivity(ACTIVITY_MODE.WORKSPACE_UPDATER),
489
+ });
490
+ }
491
+
492
+ deregisterCommands(): void {
493
+ [
494
+ LEGEND_STUDIO_COMMAND_KEY.SYNC_WITH_WORKSPACE,
495
+ LEGEND_STUDIO_COMMAND_KEY.CREATE_ELEMENT,
496
+ LEGEND_STUDIO_COMMAND_KEY.SEARCH_ELEMENT,
497
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_TEXT_MODE,
498
+ LEGEND_STUDIO_COMMAND_KEY.GENERATE,
499
+ LEGEND_STUDIO_COMMAND_KEY.COMPILE,
500
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_AUX_PANEL,
501
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_MODEL_LOADER,
502
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_EXPLORER,
503
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_LOCAL_CHANGES,
504
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_WORKSPACE_REVIEW,
505
+ LEGEND_STUDIO_COMMAND_KEY.TOGGLE_SIDEBAR_WORKSPACE_UPDATER,
506
+ ].forEach((key) =>
507
+ this.applicationStore.commandCenter.deregisterCommand(key),
508
+ );
544
509
  }
545
510
 
546
511
  reset(): void {
@@ -552,6 +517,23 @@ export class EditorStore {
552
517
  this.explorerTreeState = new ExplorerTreeState(this);
553
518
  }
554
519
 
520
+ internalizeEntityPath(params: WorkspaceEditorPathParams): void {
521
+ const { projectId, entityPath } = params;
522
+ const workspaceType = params.groupWorkspaceId
523
+ ? WorkspaceType.GROUP
524
+ : WorkspaceType.USER;
525
+ const workspaceId = guaranteeNonNullable(
526
+ params.groupWorkspaceId ?? params.workspaceId,
527
+ `Workspace/group workspace ID is not provided`,
528
+ );
529
+ if (entityPath) {
530
+ this.initialEntityPath = entityPath;
531
+ this.applicationStore.navigator.updateCurrentLocation(
532
+ generateEditorRoute(projectId, workspaceId, workspaceType),
533
+ );
534
+ }
535
+ }
536
+
555
537
  /**
556
538
  * This is the entry of the app logic where the initialization of editor states happens
557
539
  * Here, we ensure the order of calls after checking existence of current project and workspace
@@ -576,7 +558,6 @@ export class EditorStore {
576
558
  `Fast-refreshing the app - undoing cleanUp() and preventing initialize() recall in editor store...`,
577
559
  );
578
560
  this.changeDetectionState.start();
579
- this._isDisposed = false;
580
561
  return;
581
562
  }
582
563
  this.applicationStore.notifyIllegalState(
@@ -602,12 +583,10 @@ export class EditorStore {
602
583
  // instead, we give them the option to:
603
584
  // - reload the page (in case they later gain access)
604
585
  // - back to the setup page
605
- this.setActionAlertInfo({
586
+ this.applicationStore.setActionAlertInfo({
606
587
  message: `Project not found or inaccessible`,
607
588
  prompt: 'Please check that the project exists and request access to it',
608
589
  type: ActionAlertType.STANDARD,
609
- onEnter: (): void => this.setBlockGlobalHotkeys(true),
610
- onClose: (): void => this.setBlockGlobalHotkeys(false),
611
590
  actions: [
612
591
  {
613
592
  label: 'Reload application',
@@ -673,12 +652,10 @@ export class EditorStore {
673
652
  this.applicationStore.notifyError(error);
674
653
  }
675
654
  };
676
- this.setActionAlertInfo({
655
+ this.applicationStore.setActionAlertInfo({
677
656
  message: 'Workspace not found',
678
657
  prompt: `Please note that you can check out the project in viewer mode. Workspace is only required if you need to work on the project.`,
679
658
  type: ActionAlertType.STANDARD,
680
- onEnter: (): void => this.setBlockGlobalHotkeys(true),
681
- onClose: (): void => this.setBlockGlobalHotkeys(false),
682
659
  actions: [
683
660
  {
684
661
  label: 'View project',
@@ -735,6 +712,7 @@ export class EditorStore {
735
712
  ),
736
713
  ]);
737
714
  yield flowResult(this.initMode());
715
+
738
716
  onLeave(true);
739
717
  }
740
718
 
@@ -767,13 +745,11 @@ export class EditorStore {
767
745
  }
768
746
 
769
747
  private *initConflictResolutionMode(): GeneratorFn<void> {
770
- this.setActionAlertInfo({
748
+ this.applicationStore.setActionAlertInfo({
771
749
  message: 'Failed to update workspace.',
772
750
  prompt:
773
751
  'You can discard all of your changes or review them, resolve all merge conflicts and fix any potential compilation issues as well as test failures',
774
752
  type: ActionAlertType.CAUTION,
775
- onEnter: (): void => this.setBlockGlobalHotkeys(true),
776
- onClose: (): void => this.setBlockGlobalHotkeys(false),
777
753
  actions: [
778
754
  {
779
755
  label: 'Discard your changes',
@@ -869,6 +845,25 @@ export class EditorStore {
869
845
  this.explorerTreeState.buildImmutableModelTrees();
870
846
  this.explorerTreeState.build();
871
847
 
848
+ // open element if provided an element path
849
+ if (
850
+ this.graphManagerState.graphBuildState.hasSucceeded &&
851
+ this.explorerTreeState.buildState.hasCompleted &&
852
+ this.initialEntityPath
853
+ ) {
854
+ try {
855
+ this.openElement(
856
+ this.graphManagerState.graph.getElement(this.initialEntityPath),
857
+ );
858
+ } catch {
859
+ const elementPath = this.initialEntityPath;
860
+ this.initialEntityPath = undefined;
861
+ throw new AssertionError(
862
+ `Can't find element with path '${elementPath}'`,
863
+ );
864
+ }
865
+ }
866
+
872
867
  // ======= (RE)START CHANGE DETECTION =======
873
868
  this.changeDetectionState.stop();
874
869
  yield flowResult(this.changeDetectionState.observeGraph());
@@ -907,6 +902,10 @@ export class EditorStore {
907
902
  }
908
903
  }
909
904
 
905
+ setCurrentEditorState(val: EditorState | undefined): void {
906
+ this.currentEditorState = val;
907
+ }
908
+
910
909
  getCurrentEditorState<T extends EditorState>(clazz: Clazz<T>): T {
911
910
  return guaranteeType(
912
911
  this.currentEditorState,
@@ -922,26 +921,6 @@ export class EditorStore {
922
921
  );
923
922
  }
924
923
 
925
- setGraphEditMode(graphEditor: GRAPH_EDITOR_MODE): void {
926
- this.graphEditMode = graphEditor;
927
- this.graphState.clearCompilationError();
928
- }
929
-
930
- setActiveActivity(
931
- activity: ACTIVITY_MODE,
932
- options?: { keepShowingIfMatchedCurrent?: boolean },
933
- ): void {
934
- if (!this.sideBarDisplayState.isOpen) {
935
- this.sideBarDisplayState.open();
936
- } else if (
937
- activity === this.activeActivity &&
938
- !options?.keepShowingIfMatchedCurrent
939
- ) {
940
- this.sideBarDisplayState.close();
941
- }
942
- this.activeActivity = activity;
943
- }
944
-
945
924
  closeState(editorState: EditorState): void {
946
925
  const elementIndex = this.openedEditorStates.findIndex(
947
926
  (e) => e === editorState,
@@ -968,7 +947,7 @@ export class EditorStore {
968
947
  this.openedEditorStates.find((e) => e === editorState),
969
948
  'Editor tab should be currently opened',
970
949
  );
971
- this.currentEditorState = editorState;
950
+ this.setCurrentEditorState(editorState);
972
951
  this.openedEditorStates = [editorState];
973
952
  this.explorerTreeState.reprocess();
974
953
  }
@@ -1000,6 +979,12 @@ export class EditorStore {
1000
979
  this.explorerTreeState.reprocess();
1001
980
  }
1002
981
 
982
+ refreshCurrentEntityDiffEditorState(): void {
983
+ if (this.currentEditorState instanceof EntityDiffEditorState) {
984
+ this.currentEditorState.refresh();
985
+ }
986
+ }
987
+
1003
988
  openEntityDiff(entityDiffEditorState: EntityDiffViewState): void {
1004
989
  const existingEditorState = this.openedEditorStates.find(
1005
990
  (editorState) =>
@@ -1048,6 +1033,30 @@ export class EditorStore {
1048
1033
  this.setCurrentEditorState(editorState);
1049
1034
  }
1050
1035
 
1036
+ setGraphEditMode(graphEditor: GRAPH_EDITOR_MODE): void {
1037
+ this.graphEditMode = graphEditor;
1038
+ this.graphState.clearCompilationError();
1039
+ }
1040
+
1041
+ setActiveActivity(
1042
+ activity: ACTIVITY_MODE,
1043
+ options?: { keepShowingIfMatchedCurrent?: boolean },
1044
+ ): void {
1045
+ if (!this.sideBarDisplayState.isOpen) {
1046
+ this.sideBarDisplayState.open();
1047
+ } else if (
1048
+ activity === this.activeActivity &&
1049
+ !options?.keepShowingIfMatchedCurrent
1050
+ ) {
1051
+ this.sideBarDisplayState.close();
1052
+ }
1053
+ this.activeActivity = activity;
1054
+ }
1055
+
1056
+ setActiveAuxPanelMode(val: AUX_PANEL_MODE): void {
1057
+ this.activeAuxPanelMode = val;
1058
+ }
1059
+
1051
1060
  createElementState(
1052
1061
  element: PackageableElement,
1053
1062
  ): ElementEditorState | undefined {
@@ -1304,29 +1313,6 @@ export class EditorStore {
1304
1313
  this.setCurrentEditorState(generatedFileState);
1305
1314
  }
1306
1315
 
1307
- createGlobalHotKeyAction =
1308
- (
1309
- handler: (event?: KeyboardEvent) => void,
1310
- preventDefault = true,
1311
- ): ((event?: KeyboardEvent) => void) =>
1312
- (event?: KeyboardEvent): void => {
1313
- if (preventDefault) {
1314
- event?.preventDefault();
1315
- }
1316
- // TODO: maybe we should come up with a better way to block global hot keys, this seems highly restrictive.
1317
- const isResolvingConflicts =
1318
- this.isInConflictResolutionMode &&
1319
- !this.conflictResolutionState.hasResolvedAllConflicts;
1320
- if (
1321
- (this.isInitialized &&
1322
- !isResolvingConflicts &&
1323
- !this.blockGlobalHotkeys) ||
1324
- this.isInViewerMode
1325
- ) {
1326
- handler(event);
1327
- }
1328
- };
1329
-
1330
1316
  closeAllEditorTabs(): void {
1331
1317
  this.setCurrentEditorState(undefined);
1332
1318
  this.openedEditorStates = [];
@@ -1337,7 +1323,7 @@ export class EditorStore {
1337
1323
  if (this.graphState.checkIfApplicationUpdateOperationIsRunning()) {
1338
1324
  return;
1339
1325
  }
1340
- this.setBlockingAlert({
1326
+ this.applicationStore.setBlockingAlert({
1341
1327
  message: 'Switching to text mode...',
1342
1328
  showLoading: true,
1343
1329
  });
@@ -1354,10 +1340,10 @@ export class EditorStore {
1354
1340
  this.applicationStore.notifyWarning(
1355
1341
  `Can't enter text mode: transformation to grammar text failed. Error: ${error.message}`,
1356
1342
  );
1357
- this.setBlockingAlert(undefined);
1343
+ this.applicationStore.setBlockingAlert(undefined);
1358
1344
  return;
1359
1345
  }
1360
- this.setBlockingAlert(undefined);
1346
+ this.applicationStore.setBlockingAlert(undefined);
1361
1347
  this.setGraphEditMode(GRAPH_EDITOR_MODE.GRAMMAR_TEXT);
1362
1348
  // navigate to the currently opened element immediately after entering text mode editor
1363
1349
  if (this.currentEditorState instanceof ElementEditorState) {