@finos/legend-application-studio 13.1.2 → 15.0.1

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 (85) hide show
  1. package/lib/components/EditorComponentTestUtils.d.ts +3 -13
  2. package/lib/components/EditorComponentTestUtils.d.ts.map +1 -1
  3. package/lib/components/EditorComponentTestUtils.js +3 -22
  4. package/lib/components/EditorComponentTestUtils.js.map +1 -1
  5. package/lib/components/editor/edit-panel/EditPanel.js +4 -4
  6. package/lib/components/editor/edit-panel/EditPanel.js.map +1 -1
  7. package/lib/components/editor/edit-panel/{ModelLoader.d.ts → ModelImporter.d.ts} +2 -2
  8. package/lib/components/editor/edit-panel/ModelImporter.d.ts.map +1 -0
  9. package/lib/components/editor/edit-panel/ModelImporter.js +127 -0
  10. package/lib/components/editor/edit-panel/ModelImporter.js.map +1 -0
  11. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.d.ts +7 -0
  12. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.d.ts.map +1 -1
  13. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js +18 -42
  14. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js.map +1 -1
  15. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.d.ts +24 -0
  16. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.d.ts.map +1 -0
  17. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.js +75 -0
  18. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.js.map +1 -0
  19. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  20. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +1 -2
  21. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  22. package/lib/components/editor/side-bar/Explorer.js +4 -4
  23. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  24. package/lib/index.css +1 -1
  25. package/lib/index.d.ts +1 -0
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js +1 -0
  28. package/lib/index.js.map +1 -1
  29. package/lib/package.json +7 -7
  30. package/lib/stores/EditorGraphState.d.ts +1 -1
  31. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  32. package/lib/stores/EditorGraphState.js +10 -10
  33. package/lib/stores/EditorGraphState.js.map +1 -1
  34. package/lib/stores/EditorStore.d.ts +3 -3
  35. package/lib/stores/EditorStore.d.ts.map +1 -1
  36. package/lib/stores/EditorStore.js +6 -8
  37. package/lib/stores/EditorStore.js.map +1 -1
  38. package/lib/stores/LegendStudioApplicationPlugin.d.ts +7 -5
  39. package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
  40. package/lib/stores/LegendStudioApplicationPlugin.js.map +1 -1
  41. package/lib/stores/editor-state/ExternalFormatState.d.ts +3 -2
  42. package/lib/stores/editor-state/ExternalFormatState.d.ts.map +1 -1
  43. package/lib/stores/editor-state/ExternalFormatState.js +11 -8
  44. package/lib/stores/editor-state/ExternalFormatState.js.map +1 -1
  45. package/lib/stores/editor-state/ModelImporterState.d.ts +100 -0
  46. package/lib/stores/editor-state/ModelImporterState.d.ts.map +1 -0
  47. package/lib/stores/editor-state/ModelImporterState.js +358 -0
  48. package/lib/stores/editor-state/ModelImporterState.js.map +1 -0
  49. package/lib/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.d.ts +35 -12
  50. package/lib/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.d.ts.map +1 -1
  51. package/lib/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.js +141 -34
  52. package/lib/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.js.map +1 -1
  53. package/lib/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js +1 -1
  54. package/lib/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js.map +1 -1
  55. package/lib/stores/graphModifier/DSLExternalFormat_GraphModifierHelper.d.ts +1 -0
  56. package/lib/stores/graphModifier/DSLExternalFormat_GraphModifierHelper.d.ts.map +1 -1
  57. package/lib/stores/graphModifier/DSLExternalFormat_GraphModifierHelper.js +3 -0
  58. package/lib/stores/graphModifier/DSLExternalFormat_GraphModifierHelper.js.map +1 -1
  59. package/package.json +15 -15
  60. package/src/components/EditorComponentTestUtils.tsx +2 -29
  61. package/src/components/editor/edit-panel/EditPanel.tsx +4 -4
  62. package/src/components/editor/edit-panel/ModelImporter.tsx +372 -0
  63. package/src/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.tsx +47 -163
  64. package/src/components/editor/edit-panel/external-format-editor/SchemaSetModelGenerationEditor.tsx +226 -0
  65. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +1 -2
  66. package/src/components/editor/side-bar/Explorer.tsx +8 -8
  67. package/src/index.ts +1 -0
  68. package/src/stores/EditorGraphState.ts +13 -12
  69. package/src/stores/EditorStore.ts +7 -9
  70. package/src/stores/LegendStudioApplicationPlugin.ts +16 -7
  71. package/src/stores/editor-state/ExternalFormatState.ts +15 -12
  72. package/src/stores/editor-state/ModelImporterState.ts +514 -0
  73. package/src/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.ts +203 -46
  74. package/src/stores/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.ts +1 -1
  75. package/src/stores/graphModifier/DSLExternalFormat_GraphModifierHelper.ts +5 -0
  76. package/tsconfig.json +3 -2
  77. package/lib/components/editor/edit-panel/ModelLoader.d.ts.map +0 -1
  78. package/lib/components/editor/edit-panel/ModelLoader.js +0 -95
  79. package/lib/components/editor/edit-panel/ModelLoader.js.map +0 -1
  80. package/lib/stores/editor-state/ModelLoaderState.d.ts +0 -52
  81. package/lib/stores/editor-state/ModelLoaderState.d.ts.map +0 -1
  82. package/lib/stores/editor-state/ModelLoaderState.js +0 -199
  83. package/lib/stores/editor-state/ModelLoaderState.js.map +0 -1
  84. package/src/components/editor/edit-panel/ModelLoader.tsx +0 -259
  85. package/src/stores/editor-state/ModelLoaderState.ts +0 -280
@@ -0,0 +1,358 @@
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
+ import { observable, action, flow, makeObservable, computed, flowResult, } from 'mobx';
17
+ import { EditorState } from './EditorState.js';
18
+ import { assertErrorThrown, LogEvent, UnsupportedOperationError, isNonNullable, ActionState, assertTrue, } from '@finos/legend-shared';
19
+ import { LEGEND_STUDIO_APP_EVENT } from '../LegendStudioAppEvent.js';
20
+ import { TAB_SIZE } from '@finos/legend-application';
21
+ import { SchemaSet, observe_SchemaSet, } from '@finos/legend-graph';
22
+ import { externalFormat_schemaSet_setFormat, externalFormat_schemaSet_setSchemas, } from '../graphModifier/DSLExternalFormat_GraphModifierHelper.js';
23
+ import { InnerSchemaSetEditorState } from './element-editor-state/external-format/SchemaSetEditorState.js';
24
+ export var MODEL_IMPORT_NATIVE_INPUT_TYPE;
25
+ (function (MODEL_IMPORT_NATIVE_INPUT_TYPE) {
26
+ MODEL_IMPORT_NATIVE_INPUT_TYPE["ENTITIES"] = "ENTITIES";
27
+ MODEL_IMPORT_NATIVE_INPUT_TYPE["PURE_PROTOCOL"] = "PURE_PROTOCOL";
28
+ MODEL_IMPORT_NATIVE_INPUT_TYPE["PURE_GRAMMAR"] = "PURE_GRAMMAR";
29
+ })(MODEL_IMPORT_NATIVE_INPUT_TYPE = MODEL_IMPORT_NATIVE_INPUT_TYPE || (MODEL_IMPORT_NATIVE_INPUT_TYPE = {}));
30
+ export var MODEL_IMPORT_TYPE;
31
+ (function (MODEL_IMPORT_TYPE) {
32
+ MODEL_IMPORT_TYPE["NATIVE"] = "NATIVE";
33
+ MODEL_IMPORT_TYPE["EXTERNAL_FORMAT"] = "EXTERNAL_FORMAT";
34
+ MODEL_IMPORT_TYPE["EXTENSIONS"] = "EXTENSIONS";
35
+ })(MODEL_IMPORT_TYPE = MODEL_IMPORT_TYPE || (MODEL_IMPORT_TYPE = {}));
36
+ export class ModelImporterEditorState {
37
+ editorStore;
38
+ modelImporterState;
39
+ loadModelActionState = ActionState.create();
40
+ constructor(modelImporterState) {
41
+ this.editorStore = modelImporterState.editorStore;
42
+ this.modelImporterState = modelImporterState;
43
+ }
44
+ }
45
+ export class NativeModelImporterEditorState extends ModelImporterEditorState {
46
+ nativeType = MODEL_IMPORT_NATIVE_INPUT_TYPE.ENTITIES;
47
+ modelText;
48
+ loadCurrentProjectActionState = ActionState.create();
49
+ constructor(modelImporterState) {
50
+ super(modelImporterState);
51
+ this.modelText = this.getExampleEntitiesInputText();
52
+ makeObservable(this, {
53
+ nativeType: observable,
54
+ modelText: observable,
55
+ loadModelActionState: observable,
56
+ setModelText: action,
57
+ setNativeImportType: action,
58
+ isLoadingDisabled: computed,
59
+ loadModel: flow,
60
+ loadCurrentProjectEntities: flow,
61
+ });
62
+ }
63
+ get label() {
64
+ return this.nativeType;
65
+ }
66
+ get allowHardReplace() {
67
+ return true;
68
+ }
69
+ get isLoadingDisabled() {
70
+ return this.loadCurrentProjectActionState.isInProgress;
71
+ }
72
+ setModelText(val) {
73
+ this.modelText = val;
74
+ }
75
+ setNativeImportType(nativeImportType) {
76
+ if (this.nativeType !== nativeImportType) {
77
+ this.nativeType = nativeImportType;
78
+ this.modelText = this.getNativeImportExampleText(nativeImportType);
79
+ }
80
+ }
81
+ getNativeImportExampleText(inputType) {
82
+ switch (inputType) {
83
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_PROTOCOL:
84
+ return this.getExamplePureProtocolInputText();
85
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.ENTITIES:
86
+ return this.getExampleEntitiesInputText();
87
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_GRAMMAR:
88
+ return this.getExamplePureGrammarText();
89
+ default:
90
+ return '';
91
+ }
92
+ }
93
+ async loadEntites() {
94
+ switch (this.nativeType) {
95
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_PROTOCOL: {
96
+ return this.editorStore.graphManagerState.graphManager.pureProtocolTextToEntities(this.modelText);
97
+ }
98
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.ENTITIES: {
99
+ return JSON.parse(this.modelText);
100
+ }
101
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_GRAMMAR: {
102
+ return await this.editorStore.graphManagerState.graphManager.pureCodeToEntities(this.modelText);
103
+ }
104
+ default:
105
+ throw new UnsupportedOperationError(`Can't load model for input of type '${this.nativeType}'`);
106
+ }
107
+ }
108
+ *loadCurrentProjectEntities() {
109
+ this.loadCurrentProjectActionState.inProgress();
110
+ switch (this.nativeType) {
111
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_PROTOCOL: {
112
+ const graphEntities = this.editorStore.graphManagerState.graphBuildState
113
+ .hasSucceeded
114
+ ? this.editorStore.graphManagerState.graph.allOwnElements.map((element) => this.editorStore.graphManagerState.graphManager.elementToEntity(element))
115
+ : this.editorStore.changeDetectionState
116
+ .workspaceLocalLatestRevisionState.entities;
117
+ this.modelText =
118
+ (yield this.editorStore.graphManagerState.graphManager.entitiesToPureProtocolText(graphEntities));
119
+ break;
120
+ }
121
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.ENTITIES: {
122
+ const graphEntities = this.editorStore.graphManagerState.graphBuildState
123
+ .hasSucceeded
124
+ ? this.editorStore.graphManagerState.graph.allOwnElements.map((element) => this.editorStore.graphManagerState.graphManager.elementToEntity(element))
125
+ : this.editorStore.changeDetectionState
126
+ .workspaceLocalLatestRevisionState.entities;
127
+ this.modelText = JSON.stringify(graphEntities, undefined, TAB_SIZE);
128
+ break;
129
+ }
130
+ case MODEL_IMPORT_NATIVE_INPUT_TYPE.PURE_GRAMMAR: {
131
+ this.modelText =
132
+ (yield this.editorStore.graphManagerState.graphManager.graphToPureCode(this.editorStore.graphManagerState.graph));
133
+ break;
134
+ }
135
+ default:
136
+ this.loadCurrentProjectActionState.fail();
137
+ throw new UnsupportedOperationError(`Can't load current project entities for input type of type '${this.nativeType}'`);
138
+ }
139
+ this.loadCurrentProjectActionState.complete();
140
+ }
141
+ getExampleEntitiesInputText() {
142
+ return `${JSON.stringify([
143
+ {
144
+ classifierPath: 'string',
145
+ content: {},
146
+ path: 'string',
147
+ },
148
+ ], undefined, TAB_SIZE)}`;
149
+ }
150
+ getExamplePureProtocolInputText() {
151
+ return `${this.editorStore.graphManagerState.graphManager.getExamplePureProtocolText()}`;
152
+ }
153
+ getExamplePureGrammarText() {
154
+ return `###Pure\n Class model::A\n {\n\n}`;
155
+ }
156
+ *loadModel() {
157
+ try {
158
+ this.loadModelActionState.inProgress();
159
+ this.editorStore.setBlockingAlert({
160
+ message: 'Loading model...',
161
+ prompt: 'Please do not close the application',
162
+ showLoading: true,
163
+ });
164
+ const entities = (yield this.loadEntites());
165
+ const message = `loading entities from ${this.editorStore.applicationStore.config.appName} [${this.modelImporterState.replace ? `potentially affected ` : ''} ${entities.length} entities]`;
166
+ yield this.editorStore.sdlcServerClient.updateEntities(this.editorStore.sdlcState.activeProject.projectId, this.editorStore.sdlcState.activeWorkspace, { replace: this.modelImporterState.replace, entities, message });
167
+ this.editorStore.applicationStore.navigator.reload();
168
+ }
169
+ catch (error) {
170
+ assertErrorThrown(error);
171
+ this.editorStore.applicationStore.log.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.MODEL_LOADER_FAILURE), error);
172
+ this.editorStore.applicationStore.notifyError(error);
173
+ }
174
+ finally {
175
+ this.loadModelActionState.complete();
176
+ this.editorStore.setBlockingAlert(undefined);
177
+ }
178
+ }
179
+ }
180
+ export class ExtensionModelImportRendererState {
181
+ importerState;
182
+ constructor(importerState) {
183
+ this.importerState = importerState;
184
+ }
185
+ }
186
+ export class ExtensionModelImporterEditorState extends ModelImporterEditorState {
187
+ config;
188
+ rendererState;
189
+ constructor(config, rendererState, modelImporterState) {
190
+ super(modelImporterState);
191
+ this.config = config;
192
+ this.rendererState = rendererState;
193
+ makeObservable(this, {
194
+ config: observable,
195
+ modelImporterState: observable,
196
+ loadModelActionState: observable,
197
+ rendererState: observable,
198
+ isLoadingDisabled: computed,
199
+ setExtension: action,
200
+ loadModel: flow,
201
+ });
202
+ }
203
+ get label() {
204
+ return this.config.label ?? this.config.key;
205
+ }
206
+ get allowHardReplace() {
207
+ return Boolean(this.config.allowHardReplace);
208
+ }
209
+ get isLoadingDisabled() {
210
+ return false;
211
+ }
212
+ setExtension(extensionConfiguration) {
213
+ this.config = extensionConfiguration;
214
+ }
215
+ *loadModel() {
216
+ flowResult(this.config.loadModel(this.rendererState));
217
+ }
218
+ }
219
+ const DEFAULT_SCHEMA_PACKAGE = '__internal__';
220
+ const DEFAULT_SCHEMA_NAME = 'MyShemaSet';
221
+ export class ExternalFormatModelImporterState extends ModelImporterEditorState {
222
+ schemaSet;
223
+ schemaSetEditorState;
224
+ description;
225
+ isolatedSchemaGraph;
226
+ constructor(description, modelImporterState) {
227
+ super(modelImporterState);
228
+ this.description = description;
229
+ this.schemaSet = new SchemaSet(DEFAULT_SCHEMA_NAME);
230
+ this.schemaSet.format = description.name;
231
+ observe_SchemaSet(this.schemaSet);
232
+ const emptyGraph = this.editorStore.graphManagerState.createEmptyGraph();
233
+ emptyGraph.addElement(this.schemaSet, DEFAULT_SCHEMA_PACKAGE);
234
+ this.isolatedSchemaGraph = emptyGraph;
235
+ this.schemaSetEditorState = new InnerSchemaSetEditorState(false, this.schemaSet, this.editorStore, this.isolatedSchemaGraph);
236
+ makeObservable(this, {
237
+ schemaSet: observable,
238
+ schemaSetEditorState: observable,
239
+ loadModelActionState: observable,
240
+ description: observable,
241
+ isolatedSchemaGraph: observable,
242
+ setExternalFormat: action,
243
+ setDescription: action,
244
+ isLoadingDisabled: computed,
245
+ loadModel: flow,
246
+ });
247
+ }
248
+ get allowHardReplace() {
249
+ return true;
250
+ }
251
+ get label() {
252
+ return this.schemaSet.format;
253
+ }
254
+ get isLoadingDisabled() {
255
+ return (!this.schemaSetEditorState.schemaSetModelGenerationState.canGenerate ||
256
+ this.schemaSetEditorState.schemaSetModelGenerationState
257
+ .generatingModelsState.isInProgress ||
258
+ this.schemaSetEditorState.schemaSetModelGenerationState
259
+ .importGeneratedElementsState.isInProgress);
260
+ }
261
+ setDescription(val) {
262
+ this.description = val;
263
+ }
264
+ setExternalFormat(description) {
265
+ if (description !== this.description) {
266
+ this.setDescription(description);
267
+ externalFormat_schemaSet_setFormat(this.schemaSet, this.description.name);
268
+ externalFormat_schemaSet_setSchemas(this.schemaSet, []);
269
+ this.schemaSetEditorState.reset();
270
+ }
271
+ }
272
+ *loadModel() {
273
+ this.loadModelActionState.inProgress();
274
+ try {
275
+ this.loadModelActionState.inProgress();
276
+ this.editorStore.setBlockingAlert({
277
+ message: 'Loading model...',
278
+ prompt: 'Please do not close the application',
279
+ showLoading: true,
280
+ });
281
+ const modelgenerationstate = this.schemaSetEditorState.schemaSetModelGenerationState;
282
+ const entities = (yield flowResult(modelgenerationstate.getImportEntities()));
283
+ if (modelgenerationstate.targetBinding) {
284
+ const schemaEntity = (yield flowResult(this.editorStore.graphManagerState.graphManager.elementToEntity(this.schemaSet)));
285
+ entities.push(schemaEntity);
286
+ }
287
+ assertTrue(Boolean(entities.length), 'No entities to load');
288
+ const message = `loading entities from ${this.editorStore.applicationStore.config.appName} [${this.modelImporterState.replace ? `potentially affected ` : ''} ${entities.length} entities]`;
289
+ yield this.editorStore.sdlcServerClient.updateEntities(this.editorStore.sdlcState.activeProject.projectId, this.editorStore.sdlcState.activeWorkspace, { replace: this.modelImporterState.replace, entities, message });
290
+ this.editorStore.applicationStore.navigator.reload();
291
+ }
292
+ catch (error) {
293
+ assertErrorThrown(error);
294
+ this.editorStore.applicationStore.notifyError(error);
295
+ }
296
+ finally {
297
+ this.loadModelActionState.complete();
298
+ this.editorStore.setBlockingAlert(undefined);
299
+ }
300
+ }
301
+ }
302
+ export class ModelImporterState extends EditorState {
303
+ replace = true;
304
+ modelImportEditorState;
305
+ extensionConfigs = [];
306
+ constructor(editorStore) {
307
+ super(editorStore);
308
+ makeObservable(this, {
309
+ replace: observable,
310
+ modelImportEditorState: observable,
311
+ extensionConfigs: observable,
312
+ setReplaceFlag: action,
313
+ setModelImporterExtension: action,
314
+ setNativeImportType: action,
315
+ setExternalFormatImportFormat: action,
316
+ setImportEditorState: action,
317
+ });
318
+ this.modelImportEditorState = new NativeModelImporterEditorState(this);
319
+ this.extensionConfigs = this.editorStore.pluginManager
320
+ .getApplicationPlugins()
321
+ .flatMap((plugin) => plugin.getExtraModelImporterExtensionConfigurations?.() ?? [])
322
+ .filter(isNonNullable);
323
+ }
324
+ get headerName() {
325
+ return 'Model Importer';
326
+ }
327
+ setReplaceFlag(val) {
328
+ this.replace = val;
329
+ }
330
+ setImportEditorState(val) {
331
+ this.modelImportEditorState = val;
332
+ }
333
+ setNativeImportType(nativeImportType) {
334
+ const nativeEditorState = this.modelImportEditorState instanceof NativeModelImporterEditorState
335
+ ? this.modelImportEditorState
336
+ : new NativeModelImporterEditorState(this);
337
+ nativeEditorState.setNativeImportType(nativeImportType);
338
+ this.setImportEditorState(nativeEditorState);
339
+ return nativeEditorState;
340
+ }
341
+ setExternalFormatImportFormat(externalFormat) {
342
+ const extensionEditorState = this.modelImportEditorState instanceof ExternalFormatModelImporterState
343
+ ? this.modelImportEditorState
344
+ : new ExternalFormatModelImporterState(externalFormat, this);
345
+ extensionEditorState.setExternalFormat(externalFormat);
346
+ this.setImportEditorState(extensionEditorState);
347
+ return extensionEditorState;
348
+ }
349
+ setModelImporterExtension(extension) {
350
+ const externalEditorState = this.modelImportEditorState instanceof ExtensionModelImporterEditorState
351
+ ? this.modelImportEditorState
352
+ : new ExtensionModelImporterEditorState(extension, extension.getExtensionModelImportRendererStateCreator(this), this);
353
+ externalEditorState.setExtension(extension);
354
+ this.setImportEditorState(externalEditorState);
355
+ return externalEditorState;
356
+ }
357
+ }
358
+ //# sourceMappingURL=ModelImporterState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelImporterState.js","sourceRoot":"","sources":["../../../src/stores/editor-state/ModelImporterState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAEL,iBAAiB,EACjB,QAAQ,EACR,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAKrD,OAAO,EAGL,SAAS,EACT,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAE3G,MAAM,CAAN,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,uDAAqB,CAAA;IACrB,iEAA+B,CAAA;IAC/B,+DAA6B,CAAA;AAC/B,CAAC,EAJW,8BAA8B,GAA9B,8BAA8B,KAA9B,8BAA8B,QAIzC;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wDAAmC,CAAA;IACnC,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
15
  */
16
16
  import { type GeneratorFn, ActionState } from '@finos/legend-shared';
17
- import { type GenerationProperty, type PackageableElement, type ExternalFormatDescription, CompilationError, ConfigurationProperty, ExternalFormatSchema as Schema, SchemaSet } from '@finos/legend-graph';
17
+ import { type GenerationProperty, type PackageableElement, type ExternalFormatDescription, type PureModel, CompilationError, ConfigurationProperty, ExternalFormatSchema as Schema, SchemaSet } from '@finos/legend-graph';
18
+ import type { Entity } from '@finos/legend-storage';
18
19
  import type { EditorStore } from '../../../EditorStore.js';
19
20
  import { ElementEditorState } from '../ElementEditorState.js';
20
21
  export declare enum SCHEMA_SET_TAB_TYPE {
21
- GENERAL = "GENERAL",
22
- MODEL_GENERATION = "MODEL_GENERATION"
22
+ SCHEMAS = "SCHEMAS",
23
+ GENERATE_MODEL = "GENERATE_MODEL"
23
24
  }
24
25
  export declare class SchemaSetModelGenerationState {
25
- isGenerating: boolean;
26
- isImportingGeneratedElements: boolean;
27
- schemaSetEditorState: SchemaSetEditorState;
26
+ readonly editorStore: EditorStore;
27
+ readonly schemaSet: SchemaSet;
28
+ generatingModelsState: ActionState;
29
+ importGeneratedElementsState: ActionState;
28
30
  configurationProperties: ConfigurationProperty[];
29
31
  generationValue: string;
30
- constructor(schemaSetEditorState: SchemaSetEditorState);
32
+ targetBinding: string;
33
+ isolatedGraph: PureModel | undefined;
34
+ constructor(schemaSet: SchemaSet, editorStore: EditorStore, graph?: PureModel | undefined);
31
35
  setConfigurationProperty(val: ConfigurationProperty[]): void;
32
- get description(): ExternalFormatDescription;
36
+ get description(): ExternalFormatDescription | undefined;
33
37
  get modelGenerationProperties(): GenerationProperty[];
38
+ get canGenerate(): boolean;
39
+ setTargetBindingPath(val: string): void;
34
40
  getConfigValue(name: string): unknown | undefined;
35
41
  getConfig(name: string): ConfigurationProperty | undefined;
36
42
  setGenerationValue(val: string): void;
43
+ handleTargetBindingPathChange(): void;
37
44
  updateGenerationParameters(generationProperty: GenerationProperty, newValue: unknown): void;
38
- generateModel(): GeneratorFn<void>;
39
- importGrammar(): GeneratorFn<void>;
45
+ generateModel(): GeneratorFn<boolean>;
46
+ importGeneratedModelsIntoGraph(): GeneratorFn<void>;
47
+ getImportEntities(): GeneratorFn<Entity[]>;
40
48
  }
41
49
  export declare class ImportSchemaContentState {
42
50
  editorStore: EditorStore;
43
- schemaSetEditorState: SchemaSetEditorState;
51
+ schemaSetEditorState: InnerSchemaSetEditorState | SchemaSetEditorState;
44
52
  loadingSchemaContentState: ActionState;
45
53
  files: File[] | undefined;
46
54
  importSchemaModal: boolean;
47
- constructor(schemaSetEditorState: SchemaSetEditorState, editorStore: EditorStore);
55
+ constructor(schemaSetEditorState: InnerSchemaSetEditorState | SchemaSetEditorState, editorStore: EditorStore);
48
56
  setImportSchemaModal(val: boolean): void;
49
57
  setFiles(files: File[] | undefined): void;
50
58
  removeFile(file: File): void;
51
59
  closeModal(): void;
52
60
  importSchemas(files: File[]): GeneratorFn<void>;
53
61
  }
62
+ export declare class InnerSchemaSetEditorState {
63
+ readonly editorStore: EditorStore;
64
+ isReadOnly: boolean;
65
+ schemaSet: SchemaSet;
66
+ currentSchema?: Schema | undefined;
67
+ selectedTab: SCHEMA_SET_TAB_TYPE;
68
+ schemaValidationError?: CompilationError;
69
+ importSchemaContentState: ImportSchemaContentState;
70
+ schemaSetModelGenerationState: SchemaSetModelGenerationState;
71
+ constructor(isReadOnly: boolean, schemaSet: SchemaSet, editorStore: EditorStore, graph: PureModel);
72
+ reset(): void;
73
+ setCurrentSchema(value: Schema | undefined): void;
74
+ setSelectedTab(tab: SCHEMA_SET_TAB_TYPE): void;
75
+ setSchemaValidationerror(error: CompilationError): void;
76
+ }
54
77
  export declare class SchemaSetEditorState extends ElementEditorState {
55
78
  currentSchema?: Schema | undefined;
56
79
  selectedTab: SCHEMA_SET_TAB_TYPE;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaSetEditorState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/editor-state/element-editor-state/external-format/SchemaSetEditor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C;IAC3C,yBAAyB,cAAwB;IACjD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,iBAAiB,UAAS;gBAExB,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,WAAW;IAgB1B,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIxC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,GAAG,IAAI;IAIzC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAM5B,UAAU,IAAI,IAAI;IAKjB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC;CA6BjD;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,sBAA+B;IAC1C,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IACzC,wBAAwB,EAAE,wBAAwB,CAAC;IAEnD,6BAA6B,EAAE,6BAA6B,CAAC;gBACjD,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;IA4BjE,IAAI,SAAS,IAAI,SAAS,CAMzB;IAED,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAIjD,cAAc,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI;IAI9C,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAIvD,SAAS,CACP,UAAU,EAAE,kBAAkB,EAC9B,WAAW,EAAE,WAAW,GACvB,kBAAkB;IAQpB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;CAwB1D"}
1
+ {"version":3,"file":"SchemaSetEditorState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/editor-state/element-editor-state/external-format/SchemaSetEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,EACL,KAAK,WAAW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