@finos/legend-application 4.0.2 → 5.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 (139) hide show
  1. package/lib/application/LegendApplication.d.ts +9 -1
  2. package/lib/application/LegendApplication.d.ts.map +1 -1
  3. package/lib/application/LegendApplication.js +54 -1
  4. package/lib/application/LegendApplication.js.map +1 -1
  5. package/lib/components/VirtualAssistant.js +3 -3
  6. package/lib/components/VirtualAssistant.js.map +1 -1
  7. package/lib/components/{BasicValueSpecificationEditor.d.ts → shared/BasicValueSpecificationEditor.d.ts} +0 -0
  8. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -0
  9. package/lib/components/{BasicValueSpecificationEditor.js → shared/BasicValueSpecificationEditor.js} +1 -1
  10. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -0
  11. package/lib/components/{CustomDatePicker.d.ts → shared/CustomDatePicker.d.ts} +0 -0
  12. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -0
  13. package/lib/components/{CustomDatePicker.js → shared/CustomDatePicker.js} +1 -1
  14. package/lib/components/shared/CustomDatePicker.js.map +1 -0
  15. package/lib/components/{DocumentationLink.d.ts → shared/DocumentationLink.d.ts} +0 -0
  16. package/lib/components/shared/DocumentationLink.d.ts.map +1 -0
  17. package/lib/components/{DocumentationLink.js → shared/DocumentationLink.js} +1 -1
  18. package/lib/components/shared/DocumentationLink.js.map +1 -0
  19. package/lib/components/{LambdaEditor.d.ts → shared/LambdaEditor.d.ts} +1 -1
  20. package/lib/components/shared/LambdaEditor.d.ts.map +1 -0
  21. package/lib/components/{LambdaEditor.js → shared/LambdaEditor.js} +3 -3
  22. package/lib/components/shared/LambdaEditor.js.map +1 -0
  23. package/lib/components/{LambdaParameterValuesEditor.d.ts → shared/LambdaParameterValuesEditor.d.ts} +1 -1
  24. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -0
  25. package/lib/components/{LambdaParameterValuesEditor.js → shared/LambdaParameterValuesEditor.js} +1 -1
  26. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -0
  27. package/lib/components/shared/PackageableElementOptionRenderer.d.ts +21 -0
  28. package/lib/components/shared/PackageableElementOptionRenderer.d.ts.map +1 -0
  29. package/lib/components/shared/PackageableElementOptionRenderer.js +8 -0
  30. package/lib/components/shared/PackageableElementOptionRenderer.js.map +1 -0
  31. package/lib/components/{TextInputEditor.d.ts → shared/TextInputEditor.d.ts} +1 -1
  32. package/lib/components/shared/TextInputEditor.d.ts.map +1 -0
  33. package/lib/components/{TextInputEditor.js → shared/TextInputEditor.js} +2 -2
  34. package/lib/components/shared/TextInputEditor.js.map +1 -0
  35. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.d.ts +28 -0
  36. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.d.ts.map +1 -0
  37. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.js +182 -0
  38. package/lib/components/shared/execution-plan-viewer/ExecutionPlanViewer.js.map +1 -0
  39. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.d.ts +31 -0
  40. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.d.ts.map +1 -0
  41. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.js +32 -0
  42. package/lib/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.js.map +1 -0
  43. package/lib/index.css +2 -2
  44. package/lib/index.css.map +1 -1
  45. package/lib/index.d.ts +12 -9
  46. package/lib/index.d.ts.map +1 -1
  47. package/lib/index.js +13 -9
  48. package/lib/index.js.map +1 -1
  49. package/lib/stores/ApplicationEvent.d.ts +4 -2
  50. package/lib/stores/ApplicationEvent.d.ts.map +1 -1
  51. package/lib/stores/ApplicationEvent.js +4 -2
  52. package/lib/stores/ApplicationEvent.js.map +1 -1
  53. package/lib/stores/ApplicationStore.d.ts.map +1 -1
  54. package/lib/stores/ApplicationStore.js +2 -1
  55. package/lib/stores/ApplicationStore.js.map +1 -1
  56. package/lib/stores/LegendApplicationAssistantService.d.ts +2 -2
  57. package/lib/stores/LegendApplicationAssistantService.d.ts.map +1 -1
  58. package/lib/stores/LegendApplicationAssistantService.js +13 -10
  59. package/lib/stores/LegendApplicationAssistantService.js.map +1 -1
  60. package/lib/stores/LegendApplicationConfig.d.ts +8 -5
  61. package/lib/stores/LegendApplicationConfig.d.ts.map +1 -1
  62. package/lib/stores/LegendApplicationConfig.js +15 -13
  63. package/lib/stores/LegendApplicationConfig.js.map +1 -1
  64. package/lib/stores/LegendApplicationDocumentationService.d.ts +34 -24
  65. package/lib/stores/LegendApplicationDocumentationService.d.ts.map +1 -1
  66. package/lib/stores/LegendApplicationDocumentationService.js +64 -60
  67. package/lib/stores/LegendApplicationDocumentationService.js.map +1 -1
  68. package/lib/stores/LegendApplicationPlugin.d.ts +14 -3
  69. package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
  70. package/lib/stores/LegendApplicationPlugin.js.map +1 -1
  71. package/lib/stores/PureLanguageSupport.d.ts.map +1 -1
  72. package/lib/stores/PureLanguageSupport.js +8 -3
  73. package/lib/stores/PureLanguageSupport.js.map +1 -1
  74. package/lib/stores/shared/ExecutionPlanState.d.ts +62 -0
  75. package/lib/stores/shared/ExecutionPlanState.d.ts.map +1 -0
  76. package/lib/stores/shared/ExecutionPlanState.js +118 -0
  77. package/lib/stores/shared/ExecutionPlanState.js.map +1 -0
  78. package/lib/stores/{LambdaEditorState.d.ts → shared/LambdaEditorState.d.ts} +0 -0
  79. package/lib/stores/shared/LambdaEditorState.d.ts.map +1 -0
  80. package/lib/stores/{LambdaEditorState.js → shared/LambdaEditorState.js} +0 -0
  81. package/lib/stores/shared/LambdaEditorState.js.map +1 -0
  82. package/lib/stores/{LambdaParameterState.d.ts → shared/LambdaParameterState.d.ts} +0 -0
  83. package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -0
  84. package/lib/stores/{LambdaParameterState.js → shared/LambdaParameterState.js} +1 -1
  85. package/lib/stores/shared/LambdaParameterState.js.map +1 -0
  86. package/lib/stores/{PackageableElementOption.d.ts → shared/PackageableElementOption.d.ts} +0 -0
  87. package/lib/stores/shared/PackageableElementOption.d.ts.map +1 -0
  88. package/lib/stores/{PackageableElementOption.js → shared/PackageableElementOption.js} +0 -0
  89. package/lib/stores/shared/PackageableElementOption.js.map +1 -0
  90. package/lib/stores/{ValueSpecificationModifierHelper.d.ts → shared/ValueSpecificationModifierHelper.d.ts} +0 -0
  91. package/lib/stores/shared/ValueSpecificationModifierHelper.d.ts.map +1 -0
  92. package/lib/stores/{ValueSpecificationModifierHelper.js → shared/ValueSpecificationModifierHelper.js} +0 -0
  93. package/lib/stores/shared/ValueSpecificationModifierHelper.js.map +1 -0
  94. package/package.json +11 -10
  95. package/src/application/LegendApplication.tsx +100 -4
  96. package/src/components/VirtualAssistant.tsx +4 -4
  97. package/src/components/{BasicValueSpecificationEditor.tsx → shared/BasicValueSpecificationEditor.tsx} +1 -1
  98. package/src/components/{CustomDatePicker.tsx → shared/CustomDatePicker.tsx} +1 -1
  99. package/src/components/{DocumentationLink.tsx → shared/DocumentationLink.tsx} +1 -1
  100. package/src/components/{LambdaEditor.tsx → shared/LambdaEditor.tsx} +4 -4
  101. package/src/components/{LambdaParameterValuesEditor.tsx → shared/LambdaParameterValuesEditor.tsx} +2 -2
  102. package/src/components/shared/PackageableElementOptionRenderer.tsx +40 -0
  103. package/src/components/{TextInputEditor.tsx → shared/TextInputEditor.tsx} +2 -2
  104. package/src/components/shared/execution-plan-viewer/ExecutionPlanViewer.tsx +550 -0
  105. package/src/components/shared/execution-plan-viewer/SQLExecutionNodeViewer.tsx +46 -0
  106. package/src/index.ts +16 -13
  107. package/src/stores/ApplicationEvent.ts +4 -2
  108. package/src/stores/ApplicationStore.ts +3 -1
  109. package/src/stores/LegendApplicationAssistantService.ts +20 -16
  110. package/src/stores/LegendApplicationConfig.ts +28 -27
  111. package/src/stores/LegendApplicationDocumentationService.ts +128 -124
  112. package/src/stores/LegendApplicationPlugin.ts +17 -3
  113. package/src/stores/PureLanguageSupport.ts +8 -3
  114. package/src/stores/shared/ExecutionPlanState.ts +154 -0
  115. package/src/stores/{LambdaEditorState.ts → shared/LambdaEditorState.ts} +0 -0
  116. package/src/stores/{LambdaParameterState.ts → shared/LambdaParameterState.ts} +1 -1
  117. package/src/stores/{PackageableElementOption.ts → shared/PackageableElementOption.ts} +0 -0
  118. package/src/stores/{ValueSpecificationModifierHelper.ts → shared/ValueSpecificationModifierHelper.ts} +0 -0
  119. package/tsconfig.json +14 -10
  120. package/lib/components/BasicValueSpecificationEditor.d.ts.map +0 -1
  121. package/lib/components/BasicValueSpecificationEditor.js.map +0 -1
  122. package/lib/components/CustomDatePicker.d.ts.map +0 -1
  123. package/lib/components/CustomDatePicker.js.map +0 -1
  124. package/lib/components/DocumentationLink.d.ts.map +0 -1
  125. package/lib/components/DocumentationLink.js.map +0 -1
  126. package/lib/components/LambdaEditor.d.ts.map +0 -1
  127. package/lib/components/LambdaEditor.js.map +0 -1
  128. package/lib/components/LambdaParameterValuesEditor.d.ts.map +0 -1
  129. package/lib/components/LambdaParameterValuesEditor.js.map +0 -1
  130. package/lib/components/TextInputEditor.d.ts.map +0 -1
  131. package/lib/components/TextInputEditor.js.map +0 -1
  132. package/lib/stores/LambdaEditorState.d.ts.map +0 -1
  133. package/lib/stores/LambdaEditorState.js.map +0 -1
  134. package/lib/stores/LambdaParameterState.d.ts.map +0 -1
  135. package/lib/stores/LambdaParameterState.js.map +0 -1
  136. package/lib/stores/PackageableElementOption.d.ts.map +0 -1
  137. package/lib/stores/PackageableElementOption.js.map +0 -1
  138. package/lib/stores/ValueSpecificationModifierHelper.d.ts.map +0 -1
  139. package/lib/stores/ValueSpecificationModifierHelper.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application",
3
- "version": "4.0.2",
3
+ "version": "5.0.1",
4
4
  "description": "Legend application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -43,9 +43,9 @@
43
43
  "test:watch": "jest --watch"
44
44
  },
45
45
  "dependencies": {
46
- "@finos/legend-art": "2.0.2",
47
- "@finos/legend-graph": "8.0.2",
48
- "@finos/legend-shared": "3.0.2",
46
+ "@finos/legend-art": "2.0.4",
47
+ "@finos/legend-graph": "9.0.1",
48
+ "@finos/legend-shared": "4.0.1",
49
49
  "@types/css-font-loading-module": "0.0.7",
50
50
  "@types/papaparse": "5.3.2",
51
51
  "@types/react": "18.0.14",
@@ -54,7 +54,7 @@
54
54
  "date-fns": "2.28.0",
55
55
  "fuse.js": "6.6.2",
56
56
  "history": "5.3.0",
57
- "mobx": "6.6.0",
57
+ "mobx": "6.6.1",
58
58
  "mobx-react-lite": "3.4.0",
59
59
  "monaco-editor": "0.33.0",
60
60
  "papaparse": "5.3.2",
@@ -64,17 +64,18 @@
64
64
  "react-resize-detector": "7.1.2",
65
65
  "react-router": "5.3.3",
66
66
  "react-router-dom": "5.3.3",
67
- "serializr": "2.0.5"
67
+ "serializr": "2.0.5",
68
+ "sql-formatter": "7.0.2"
68
69
  },
69
70
  "devDependencies": {
70
- "@finos/legend-dev-utils": "2.0.1",
71
- "@jest/globals": "28.1.1",
71
+ "@finos/legend-dev-utils": "2.0.3",
72
+ "@jest/globals": "28.1.2",
72
73
  "cross-env": "7.0.3",
73
74
  "eslint": "8.18.0",
74
- "jest": "28.1.1",
75
+ "jest": "28.1.2",
75
76
  "npm-run-all": "4.1.5",
76
77
  "rimraf": "3.0.2",
77
- "sass": "1.52.3",
78
+ "sass": "1.53.0",
78
79
  "typescript": "4.7.4"
79
80
  },
80
81
  "peerDependencies": {
@@ -30,12 +30,19 @@ import {
30
30
  guaranteeNonEmptyString,
31
31
  assertNonNullable,
32
32
  NetworkClient,
33
+ type Writable,
33
34
  } from '@finos/legend-shared';
34
35
  import { APPLICATION_EVENT } from '../stores/ApplicationEvent.js';
35
36
  import { configureComponents } from '@finos/legend-art';
36
37
  import type { GraphPluginManager } from '@finos/legend-graph';
37
38
  import type { LegendApplicationPluginManager } from './LegendApplicationPluginManager.js';
38
39
  import { setupPureLanguageService } from '../stores/PureLanguageSupport.js';
40
+ import {
41
+ collectKeyedDocumnetationEntriesFromConfig,
42
+ type LegendApplicationDocumentationConfigEntry,
43
+ type LegendApplicationDocumentationRegistryData,
44
+ type LegendApplicationDocumentationRegistryEntry,
45
+ } from '../stores/LegendApplicationDocumentationService.js';
39
46
 
40
47
  export abstract class LegendApplicationLogger {
41
48
  abstract debug(event: LogEvent, ...data: unknown[]): void;
@@ -126,6 +133,15 @@ export const setupLegendApplicationUILibrary = async (
126
133
  configureComponents();
127
134
  };
128
135
 
136
+ export interface LegendApplicationConfigurationInput<
137
+ T extends LegendApplicationConfigurationData,
138
+ > {
139
+ baseUrl: string;
140
+ configData: T;
141
+ versionData: LegendApplicationVersionData;
142
+ docEntries?: Record<string, LegendApplicationDocumentationConfigEntry>;
143
+ }
144
+
129
145
  export abstract class LegendApplication {
130
146
  protected config!: LegendApplicationConfig;
131
147
  protected logger!: LegendApplicationLogger;
@@ -193,6 +209,8 @@ export abstract class LegendApplication {
193
209
  baseUrl: string,
194
210
  ): Promise<[LegendApplicationConfig, Record<PropertyKey, object>]> {
195
211
  const client = new NetworkClient();
212
+
213
+ // app config
196
214
  let configData: LegendApplicationConfigurationData | undefined;
197
215
  try {
198
216
  configData = await client.get<LegendApplicationConfigurationData>(
@@ -209,6 +227,8 @@ export abstract class LegendApplication {
209
227
  configData,
210
228
  `Can't fetch Legend application configuration`,
211
229
  );
230
+
231
+ // app version
212
232
  let versionData;
213
233
  try {
214
234
  versionData = await client.get<LegendApplicationVersionData>(
@@ -222,16 +242,86 @@ export abstract class LegendApplication {
222
242
  );
223
243
  }
224
244
  assertNonNullable(versionData, `Can't fetch Legend application version`);
245
+
225
246
  return [
226
- await this.configureApplication(configData, versionData, baseUrl),
247
+ await this.configureApplication({
248
+ configData,
249
+ versionData,
250
+ baseUrl,
251
+ }),
227
252
  (configData.extensions ?? {}) as Record<PropertyKey, object>,
228
253
  ];
229
254
  }
230
255
 
256
+ async loadDocumentationRegistryData(
257
+ config: LegendApplicationConfig,
258
+ ): Promise<void> {
259
+ const entries: Record<string, LegendApplicationDocumentationConfigEntry> =
260
+ {};
261
+
262
+ await Promise.all(
263
+ [
264
+ ...config.documentationRegistryEntries,
265
+ ...this.pluginManager
266
+ .getApplicationPlugins()
267
+ .flatMap(
268
+ (plugin) => plugin.getExtraDocumentationRegistryEntries?.() ?? [],
269
+ ),
270
+ ].map(async (entry: LegendApplicationDocumentationRegistryEntry) => {
271
+ try {
272
+ const client = new NetworkClient(
273
+ entry.simple
274
+ ? {
275
+ /**
276
+ * NOTE: see the documentation for `simple` flag {@link LegendApplicationDocumentationRegistryEntry}
277
+ * here, basically, we expect to fetch just the JSON from an endpoint where `Access-Control-Allow-Origin", "*"` is set
278
+ * as such, we must not include the credential in our request
279
+ * See https://stackoverflow.com/questions/19743396/cors-cannot-use-wildcard-in-access-control-allow-origin-when-credentials-flag-i
280
+ */
281
+ options: {
282
+ credentials: 'omit',
283
+ },
284
+ }
285
+ : {},
286
+ );
287
+ const docData =
288
+ await client.get<LegendApplicationDocumentationRegistryData>(
289
+ guaranteeNonEmptyString(
290
+ entry.url,
291
+ `Can't load documentation registry: 'url' field is missing or empty`,
292
+ ),
293
+ );
294
+ assertNonNullable(
295
+ docData.entries,
296
+ `Can't load documentation registry data: 'entries' field is missing`,
297
+ );
298
+ Object.entries(docData.entries).forEach(([key, docEntry]) => {
299
+ // NOTE: entries will NOT override
300
+ if (!entries[key]) {
301
+ entries[key] = docEntry;
302
+ }
303
+ });
304
+ } catch (error) {
305
+ assertErrorThrown(error);
306
+ this.logger.warn(
307
+ LogEvent.create(
308
+ APPLICATION_EVENT.APPLICATION_DOCUMENTATION_FETCH_FAILURE,
309
+ ),
310
+ error,
311
+ );
312
+ }
313
+ }),
314
+ );
315
+
316
+ // NOTE: config entries will override
317
+ (config as Writable<LegendApplicationConfig>).keyedDocumentationEntries = [
318
+ ...collectKeyedDocumnetationEntriesFromConfig(entries),
319
+ ...config.keyedDocumentationEntries,
320
+ ];
321
+ }
322
+
231
323
  protected abstract configureApplication(
232
- configData: LegendApplicationConfigurationData,
233
- versionData: LegendApplicationVersionData,
234
- baseUrl: string,
324
+ input: LegendApplicationConfigurationInput<LegendApplicationConfigurationData>,
235
325
  ): Promise<LegendApplicationConfig>;
236
326
 
237
327
  protected abstract loadApplication(): Promise<void>;
@@ -252,6 +342,12 @@ export abstract class LegendApplication {
252
342
  this.pluginManager.configure(extensionConfigData);
253
343
  this.pluginManager.install();
254
344
 
345
+ // Other setups
346
+ await Promise.all(
347
+ // NOTE: to be done in parallel to save time
348
+ [this.loadDocumentationRegistryData(config)],
349
+ );
350
+
255
351
  await this.loadApplication();
256
352
 
257
353
  this.logger.info(
@@ -271,14 +271,14 @@ const VirtualAssistantSearchPanel = observer(() => {
271
271
  ContentType.APPLICATION_JSON,
272
272
  );
273
273
  };
274
- const downloadContextualDocRegistry = (): void => {
274
+ const downloadContextualDocMap = (): void => {
275
275
  downloadFileUsingDataURI(
276
276
  `documentation-registry_${format(
277
277
  new Date(Date.now()),
278
278
  DATE_TIME_FORMAT,
279
279
  )}.json`,
280
280
  JSON.stringify(
281
- applicationStore.documentationService.publishContextualDocRegistry(),
281
+ applicationStore.documentationService.publishContextualDocMap(),
282
282
  undefined,
283
283
  TAB_SIZE,
284
284
  ),
@@ -363,8 +363,8 @@ const VirtualAssistantSearchPanel = observer(() => {
363
363
  <MenuContentItem onClick={downloadDocRegistry}>
364
364
  Download documentation registry
365
365
  </MenuContentItem>
366
- <MenuContentItem onClick={downloadContextualDocRegistry}>
367
- Download contextual documentation registry
366
+ <MenuContentItem onClick={downloadContextualDocMap}>
367
+ Download contextual documentation mapping
368
368
  </MenuContentItem>
369
369
  </MenuContent>
370
370
  }
@@ -60,7 +60,7 @@ import { useEffect, useRef, useState } from 'react';
60
60
  import {
61
61
  instanceValue_changeValue,
62
62
  instanceValue_changeValues,
63
- } from '../stores/ValueSpecificationModifierHelper.js';
63
+ } from '../../stores/shared/ValueSpecificationModifierHelper.js';
64
64
  import { CustomDatePicker } from './CustomDatePicker.js';
65
65
 
66
66
  type TypeCheckOption = {
@@ -47,7 +47,7 @@ import { useEffect, useState } from 'react';
47
47
  import {
48
48
  genericType_setRawType,
49
49
  instanceValue_changeValue,
50
- } from '../stores/ValueSpecificationModifierHelper.js';
50
+ } from '../../stores/shared/ValueSpecificationModifierHelper.js';
51
51
 
52
52
  enum CUSTOM_DATE_PICKER_OPTION {
53
53
  ABSOLUTE_DATE = 'Absolute Date',
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { clsx, QuestionCircleIcon } from '@finos/legend-art';
18
- import { useApplicationStore } from './ApplicationStoreProvider.js';
18
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
19
19
 
20
20
  export const DocumentationLink: React.FC<{
21
21
  documentationKey: string;
@@ -35,7 +35,7 @@ import {
35
35
  LongArrowAltUpIcon,
36
36
  Dialog,
37
37
  } from '@finos/legend-art';
38
- import type { LambdaEditorState } from '../stores/LambdaEditorState.js';
38
+ import type { LambdaEditorState } from '../../stores/shared/LambdaEditorState.js';
39
39
  import {
40
40
  debounce,
41
41
  noop,
@@ -44,9 +44,9 @@ import {
44
44
  } from '@finos/legend-shared';
45
45
  import { flowResult } from 'mobx';
46
46
  import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
47
- import { APPLICATION_TEST_ID } from './ApplicationTestID.js';
48
- import { useApplicationStore } from './ApplicationStoreProvider.js';
49
- import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const.js';
47
+ import { APPLICATION_TEST_ID } from '../ApplicationTestID.js';
48
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
49
+ import { EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../../const.js';
50
50
 
51
51
  export type LambdaEditorOnKeyDownEventHandler = {
52
52
  matcher: (event: IKeyboardEvent) => boolean;
@@ -22,8 +22,8 @@ import {
22
22
  } from '@finos/legend-graph';
23
23
  import { prettyCONSTName } from '@finos/legend-shared';
24
24
  import { observer } from 'mobx-react-lite';
25
- import type { LambdaParametersState } from '../stores/LambdaParameterState.js';
26
- import { useApplicationStore } from './ApplicationStoreProvider.js';
25
+ import type { LambdaParametersState } from '../../stores/shared/LambdaParameterState.js';
26
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
27
27
  import { BasicValueSpecificationEditor } from './BasicValueSpecificationEditor.js';
28
28
 
29
29
  // TODO we may want to further componentize this by removing the dialog wrapper
@@ -0,0 +1,40 @@
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
+
17
+ import type { PackageableElement } from '@finos/legend-graph';
18
+ import type { PackageableElementOption } from '../../index.js';
19
+
20
+ export const getPackageableElementOptionalFormatter = (props?: {
21
+ darkMode?: boolean;
22
+ }): ((
23
+ option: PackageableElementOption<PackageableElement>,
24
+ ) => React.ReactNode) =>
25
+ function PackageableElementOptionLabel(
26
+ option: PackageableElementOption<PackageableElement>,
27
+ ): React.ReactNode {
28
+ const className = props?.darkMode
29
+ ? 'packageable-element-format-option-label--dark'
30
+ : 'packageable-element-format-option-label';
31
+
32
+ return (
33
+ <div className={className}>
34
+ <div className={`${className}__name`}>{option.label}</div>
35
+ {option.value.package && (
36
+ <div className={`${className}__tag`}>{option.value.path}</div>
37
+ )}
38
+ </div>
39
+ );
40
+ };
@@ -29,8 +29,8 @@ import {
29
29
  getEditorValue,
30
30
  normalizeLineEnding,
31
31
  } from '@finos/legend-art';
32
- import { type EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../const.js';
33
- import { useApplicationStore } from './ApplicationStoreProvider.js';
32
+ import { type EDITOR_LANGUAGE, EDITOR_THEME, TAB_SIZE } from '../../const.js';
33
+ import { useApplicationStore } from '../ApplicationStoreProvider.js';
34
34
 
35
35
  export type TextInputEditorOnKeyDownEventHandler = {
36
36
  matcher: (event: IKeyboardEvent) => boolean;