@finos/legend-application 12.0.1 → 13.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 +2 -2
  2. package/lib/application/LegendApplication.d.ts.map +1 -1
  3. package/lib/application/LegendApplication.js +4 -4
  4. package/lib/application/LegendApplication.js.map +1 -1
  5. package/lib/application/LegendApplicationConfig.d.ts +2 -2
  6. package/lib/application/LegendApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendApplicationConfig.js +3 -3
  8. package/lib/application/LegendApplicationDocumentation.d.ts.map +1 -0
  9. package/lib/application/LegendApplicationDocumentation.js.map +1 -0
  10. package/lib/{stores/ApplicationEvent.d.ts → application/LegendApplicationEvent.d.ts} +16 -13
  11. package/lib/application/LegendApplicationEvent.d.ts.map +1 -0
  12. package/lib/{stores/ApplicationEvent.js → application/LegendApplicationEvent.js} +15 -12
  13. package/lib/application/LegendApplicationEvent.js.map +1 -0
  14. package/lib/application/LegendApplicationPluginManager.d.ts.map +1 -1
  15. package/lib/application/LegendApplicationPluginManager.js.map +1 -1
  16. package/lib/application/LegendApplicationSetting.d.ts +25 -0
  17. package/lib/application/LegendApplicationSetting.d.ts.map +1 -0
  18. package/lib/application/LegendApplicationSetting.js +26 -0
  19. package/lib/application/LegendApplicationSetting.js.map +1 -0
  20. package/lib/{stores/ApplicationTelemetry.d.ts → application/LegendApplicationTelemetry.d.ts} +4 -4
  21. package/lib/application/LegendApplicationTelemetry.d.ts.map +1 -0
  22. package/lib/{stores/ApplicationTelemetry.js → application/LegendApplicationTelemetry.js} +3 -3
  23. package/lib/application/LegendApplicationTelemetry.js.map +1 -0
  24. package/lib/application/LegendApplicationTheme.d.ts +25 -0
  25. package/lib/application/LegendApplicationTheme.d.ts.map +1 -0
  26. package/lib/application/LegendApplicationTheme.js +37 -0
  27. package/lib/application/LegendApplicationTheme.js.map +1 -0
  28. package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts +3 -2
  29. package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts.map +1 -1
  30. package/lib/components/LegendApplicationComponentFrameworkProvider.js +14 -17
  31. package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +1 -1
  32. package/lib/components/NotificationManager.d.ts.map +1 -1
  33. package/lib/components/NotificationManager.js +1 -1
  34. package/lib/components/NotificationManager.js.map +1 -1
  35. package/lib/components/VirtualAssistant.js +3 -3
  36. package/lib/components/VirtualAssistant.js.map +1 -1
  37. package/lib/components/shared/TextInputEditor.d.ts.map +1 -1
  38. package/lib/components/shared/TextInputEditor.js +2 -1
  39. package/lib/components/shared/TextInputEditor.js.map +1 -1
  40. package/lib/components/shared/TextSearchAdvancedConfigMenu.js +1 -1
  41. package/lib/components/shared/TextSearchAdvancedConfigMenu.js.map +1 -1
  42. package/lib/index.css +1 -1
  43. package/lib/index.d.ts +19 -14
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +19 -14
  46. package/lib/index.js.map +1 -1
  47. package/lib/package.json +6 -5
  48. package/lib/stores/ApplicationNavigationContextService.js +2 -2
  49. package/lib/stores/ApplicationNavigationContextService.js.map +1 -1
  50. package/lib/stores/ApplicationStore.d.ts +7 -5
  51. package/lib/stores/ApplicationStore.d.ts.map +1 -1
  52. package/lib/stores/ApplicationStore.js +12 -9
  53. package/lib/stores/ApplicationStore.js.map +1 -1
  54. package/lib/stores/AssistantService.d.ts.map +1 -1
  55. package/lib/stores/AssistantService.js +2 -2
  56. package/lib/stores/AssistantService.js.map +1 -1
  57. package/lib/stores/CommandService.d.ts.map +1 -1
  58. package/lib/stores/CommandService.js +2 -2
  59. package/lib/stores/CommandService.js.map +1 -1
  60. package/lib/stores/Core_LegendApplicationPlugin.d.ts +27 -0
  61. package/lib/stores/Core_LegendApplicationPlugin.d.ts.map +1 -0
  62. package/lib/stores/Core_LegendApplicationPlugin.js +37 -0
  63. package/lib/stores/Core_LegendApplicationPlugin.js.map +1 -0
  64. package/lib/stores/DocumentationService.d.ts +7 -7
  65. package/lib/stores/DocumentationService.d.ts.map +1 -1
  66. package/lib/stores/DocumentationService.js +8 -7
  67. package/lib/stores/DocumentationService.js.map +1 -1
  68. package/lib/stores/IdentityService.d.ts +1 -0
  69. package/lib/stores/IdentityService.d.ts.map +1 -1
  70. package/lib/stores/IdentityService.js +3 -0
  71. package/lib/stores/IdentityService.js.map +1 -1
  72. package/lib/stores/LayoutService.d.ts +26 -7
  73. package/lib/stores/LayoutService.d.ts.map +1 -1
  74. package/lib/stores/LayoutService.js +61 -15
  75. package/lib/stores/LayoutService.js.map +1 -1
  76. package/lib/stores/LegendApplicationPlugin.d.ts +10 -0
  77. package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
  78. package/lib/stores/LegendApplicationPlugin.js.map +1 -1
  79. package/lib/stores/SettingService.d.ts +39 -0
  80. package/lib/stores/SettingService.d.ts.map +1 -0
  81. package/lib/stores/SettingService.js +85 -0
  82. package/lib/stores/SettingService.js.map +1 -0
  83. package/lib/stores/navigation/NavigationService.d.ts +4 -0
  84. package/lib/stores/navigation/NavigationService.d.ts.map +1 -1
  85. package/lib/stores/navigation/NavigationService.js.map +1 -1
  86. package/lib/stores/navigation/WebApplicationNavigator.d.ts +3 -1
  87. package/lib/stores/navigation/WebApplicationNavigator.d.ts.map +1 -1
  88. package/lib/stores/navigation/WebApplicationNavigator.js +12 -1
  89. package/lib/stores/navigation/WebApplicationNavigator.js.map +1 -1
  90. package/lib/stores/storage/ApplicationStorage.d.ts +0 -3
  91. package/lib/stores/storage/ApplicationStorage.d.ts.map +1 -1
  92. package/lib/stores/storage/ApplicationStorage.js +0 -4
  93. package/lib/stores/storage/ApplicationStorage.js.map +1 -1
  94. package/lib/stores/storage/StorageService.d.ts +8 -8
  95. package/lib/stores/storage/StorageService.d.ts.map +1 -1
  96. package/lib/stores/storage/StorageService.js +26 -17
  97. package/lib/stores/storage/StorageService.js.map +1 -1
  98. package/lib/stores/terminal/XTerm.js +3 -3
  99. package/lib/stores/terminal/XTerm.js.map +1 -1
  100. package/package.json +10 -9
  101. package/src/application/LegendApplication.tsx +7 -9
  102. package/src/application/LegendApplicationConfig.ts +6 -6
  103. package/src/{stores/ApplicationEvent.ts → application/LegendApplicationEvent.ts} +17 -12
  104. package/src/application/LegendApplicationSetting.ts +27 -0
  105. package/src/{stores/ApplicationTelemetry.ts → application/LegendApplicationTelemetry.ts} +4 -4
  106. package/src/application/LegendApplicationTheme.ts +41 -0
  107. package/src/components/LegendApplicationComponentFrameworkProvider.tsx +29 -18
  108. package/src/components/NotificationManager.tsx +0 -1
  109. package/src/components/VirtualAssistant.tsx +3 -3
  110. package/src/components/shared/TextInputEditor.tsx +2 -1
  111. package/src/components/shared/TextSearchAdvancedConfigMenu.tsx +1 -1
  112. package/src/index.ts +22 -16
  113. package/src/stores/ApplicationNavigationContextService.ts +2 -2
  114. package/src/stores/ApplicationStore.ts +13 -9
  115. package/src/stores/AssistantService.ts +3 -3
  116. package/src/stores/CommandService.ts +7 -4
  117. package/src/stores/Core_LegendApplicationPlugin.ts +53 -0
  118. package/src/stores/DocumentationService.ts +13 -15
  119. package/src/stores/IdentityService.ts +4 -0
  120. package/src/stores/LayoutService.ts +104 -18
  121. package/src/stores/LegendApplicationPlugin.ts +12 -0
  122. package/src/stores/SettingService.ts +147 -0
  123. package/src/stores/navigation/NavigationService.ts +8 -0
  124. package/src/stores/navigation/WebApplicationNavigator.ts +25 -1
  125. package/src/stores/storage/ApplicationStorage.ts +0 -4
  126. package/src/stores/storage/StorageService.ts +26 -20
  127. package/src/stores/terminal/XTerm.ts +3 -3
  128. package/tsconfig.json +9 -6
  129. package/tsconfig.package.json +1 -2
  130. package/lib/stores/ApplicationEvent.d.ts.map +0 -1
  131. package/lib/stores/ApplicationEvent.js.map +0 -1
  132. package/lib/stores/ApplicationTelemetry.d.ts.map +0 -1
  133. package/lib/stores/ApplicationTelemetry.js.map +0 -1
  134. package/lib/stores/LegendApplicationDocumentation.d.ts.map +0 -1
  135. package/lib/stores/LegendApplicationDocumentation.js.map +0 -1
  136. /package/lib/{stores → application}/LegendApplicationDocumentation.d.ts +0 -0
  137. /package/lib/{stores → application}/LegendApplicationDocumentation.js +0 -0
  138. /package/src/{stores → application}/LegendApplicationDocumentation.ts +0 -0
  139. /package/src/application/{LegendApplicationPluginManager.tsx → LegendApplicationPluginManager.ts} +0 -0
@@ -21,10 +21,10 @@ import {
21
21
  } from '@finos/legend-shared';
22
22
  import type { LegendApplicationConfigurationInput } from './LegendApplication.js';
23
23
  import {
24
- collectKeyedDocumnetationEntriesFromConfig,
25
- collectContextualDocumnetationEntries,
24
+ collectKeyedDocumentationEntriesFromConfig,
25
+ collectContextualDocumentationEntries,
26
26
  type KeyedDocumentationEntry,
27
- type DocumentationConfigEntry,
27
+ type DocumentationEntryData,
28
28
  type ContextualDocumentationConfig,
29
29
  type ContextualDocumentationEntry,
30
30
  type DocumentationRegistryEntry,
@@ -42,7 +42,7 @@ export interface LegendApplicationConfigurationData {
42
42
  documentation?: {
43
43
  url: string;
44
44
  registry?: DocumentationRegistryEntry[];
45
- entries?: Record<string, DocumentationConfigEntry>;
45
+ entries?: Record<string, DocumentationEntryData>;
46
46
  contextualEntries?: ContextualDocumentationConfig;
47
47
  };
48
48
  // TODO: when we support vault-like settings, we could support `settingOverrides`
@@ -84,10 +84,10 @@ export abstract class LegendApplicationConfig {
84
84
  this.documentationUrl = input.configData.documentation?.url;
85
85
  this.documentationRegistryEntries =
86
86
  input.configData.documentation?.registry ?? [];
87
- this.keyedDocumentationEntries = collectKeyedDocumnetationEntriesFromConfig(
87
+ this.keyedDocumentationEntries = collectKeyedDocumentationEntriesFromConfig(
88
88
  input.configData.documentation?.entries ?? {},
89
89
  );
90
- this.contextualDocEntries = collectContextualDocumnetationEntries(
90
+ this.contextualDocEntries = collectContextualDocumentationEntries(
91
91
  input.configData.documentation?.contextualEntries ?? {},
92
92
  );
93
93
 
@@ -15,30 +15,35 @@
15
15
  */
16
16
 
17
17
  export enum APPLICATION_EVENT {
18
- LOAD_TEXT_EDITOR_FONT__SUCCESS = 'application.load.font.success',
19
18
  APPLICATION_SETUP__FAILURE = 'application.setup.failure',
19
+ APPLICATION_LOAD__SUCCESS = 'application.load.success',
20
+ APPLICATION_LOAD__FAILURE = 'application.load.failure',
20
21
 
21
22
  ILLEGAL_APPLICATION_STATE_OCCURRED = 'application.error.illegal-state',
22
23
  APPLICATION_CONFIGURATION__FAILURE = 'application.configuration.failure',
23
24
 
24
- APPLICATION_IDENTITY_AUTO_FETCH__FAILURE = 'application.identity.auto-fetch.failure',
25
+ IDENTITY_AUTO_FETCH__FAILURE = 'application.identity.auto-fetch.failure',
25
26
 
26
- APPLICATION_DOCUMENTATION_FETCH__FAILURE = 'application.fetch.documentation.failure',
27
- APPLICATION_DOCUMENTATION_LOAD__SKIP = 'application.load.documentation.skip',
28
- APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK__FAILURE = 'application.load.documentation.requirement-check.failure',
29
- APPLICATION_TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE = 'application.load.terminal-command.configuration-check.failure',
30
- APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD__SKIP = 'application.load.contextual-documentation.skip',
27
+ DOCUMENTATION_FETCH__FAILURE = 'application.documentation.fetch.failure',
28
+ DOCUMENTATION_LOAD__SKIP = 'application.documentation.load.skip',
29
+ DOCUMENTATION_REQUIREMENT_CHECK__FAILURE = 'application.documentation.requirement-check.failure',
31
30
 
32
- APPLICATION_COMMAND_CENTER_REGISTRATION__FAILURE = 'application.command-center.registration.failure',
31
+ CONTEXTUAL_DOCUMENTATION_LOAD__SKIP = 'application.virtual-assistant.contextual-documentation-load.skip',
32
+ VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS = 'application.virtual-assistant.documentation-entry.access',
33
33
 
34
- APPLICATION_LOAD__SUCCESS = 'application.load.success',
35
- APPLICATION_LOAD__FAILURE = 'application.load.failure',
34
+ TERMINAL_COMMAND_CONFIGURATION_CHECK__FAILURE = 'application.load.terminal-command.configuration-check.failure',
35
+
36
+ COLOR_THEME_CONFIGURATION_CHECK__FAILURE = 'application.layout.color-theme.configuration-check.failure',
37
+ LOAD_TEXT_EDITOR_FONT__SUCCESS = 'application.load.font.success',
38
+
39
+ SETTING_CONFIGURATION_CHECK__FAILURE = 'application.setting.configuration-check.failure',
40
+ SETTING_RETRIVE_FAILURE = 'application.setting.retrieve.failure',
41
+
42
+ COMMAND_CENTER_REGISTRATION__FAILURE = 'application.command.registration.failure',
36
43
 
37
44
  DEVELOPMENT_ISSUE = 'development.issue',
38
45
 
39
46
  APPLICATION_CONTEXT__ACCESS = 'application.context.access',
40
47
 
41
48
  APPLICATION_USAGE__INTERRUPT = 'application.usage.interrupt',
42
-
43
- VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY__ACCESS = 'application.virtual-assistant.documentation-entry.access',
44
49
  }
@@ -0,0 +1,27 @@
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 { LEGEND_APPLICATION_COLOR_THEME } from './LegendApplicationTheme.js';
18
+
19
+ export enum LEGEND_APPLICATION_SETTING_KEY {
20
+ COLOR_THEME = 'application.layout.colorTheme',
21
+ }
22
+
23
+ export const LEGEND_APPLICATION_SETTING_CONFIG = {
24
+ [LEGEND_APPLICATION_SETTING_KEY.COLOR_THEME]: {
25
+ defaultValue: LEGEND_APPLICATION_COLOR_THEME.DEFAULT_DARK,
26
+ },
27
+ };
@@ -19,9 +19,9 @@ import {
19
19
  GRAPH_MANAGER_EVENT,
20
20
  } from '@finos/legend-graph';
21
21
  import type { TimingsRecord } from '@finos/legend-shared';
22
- import { APPLICATION_EVENT } from './ApplicationEvent.js';
23
- import type { GenericLegendApplicationStore } from './ApplicationStore.js';
24
- import type { TelemetryService } from './TelemetryService.js';
22
+ import { APPLICATION_EVENT } from './LegendApplicationEvent.js';
23
+ import type { GenericLegendApplicationStore } from '../stores/ApplicationStore.js';
24
+ import type { TelemetryService } from '../stores/TelemetryService.js';
25
25
 
26
26
  type ApplicationContextAccessed_TelemetryData = {
27
27
  key: string;
@@ -40,7 +40,7 @@ type GraphInitialized_TelemetryData = {
40
40
  generationCount?: number;
41
41
  };
42
42
 
43
- export class ApplicationTelemetry {
43
+ export class LegendApplicationTelemetryHelper {
44
44
  static logEvent_ApplicationInitializationSucceeded(
45
45
  telemetryService: TelemetryService,
46
46
  applicationStore: GenericLegendApplicationStore,
@@ -0,0 +1,41 @@
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 { ColorTheme } from '../stores/LayoutService.js';
18
+
19
+ export enum LEGEND_APPLICATION_COLOR_THEME {
20
+ DEFAULT_DARK = 'default-dark',
21
+ LEGACY_LIGHT = 'legacy-light',
22
+ HIGH_CONTRAST_LIGHT = 'hc-light',
23
+ }
24
+
25
+ export const DEFAULT_DARK_COLOR_THEME: ColorTheme = {
26
+ name: 'Default Dark (default)',
27
+ key: LEGEND_APPLICATION_COLOR_THEME.DEFAULT_DARK,
28
+ TEMPORARY__globalCSSClassName: 'theme__default-dark',
29
+ };
30
+
31
+ export const LEGACY_LIGHT_COLOR_THEME: ColorTheme = {
32
+ name: 'Legacy Light',
33
+ key: LEGEND_APPLICATION_COLOR_THEME.LEGACY_LIGHT,
34
+ TEMPORARY__globalCSSClassName: 'theme__legacy-light',
35
+ };
36
+
37
+ export const HIGH_CONTRAST_LIGHT_COLOR_THEME: ColorTheme = {
38
+ name: 'High-Contrast Light',
39
+ key: LEGEND_APPLICATION_COLOR_THEME.HIGH_CONTRAST_LIGHT,
40
+ TEMPORARY__globalCSSClassName: 'theme__hc-light',
41
+ };
@@ -28,10 +28,13 @@ import {
28
28
  type KeyBindingConfig,
29
29
  } from '@finos/legend-shared';
30
30
  import { VirtualAssistant } from './VirtualAssistant.js';
31
- import { ApplicationTelemetry } from '../stores/ApplicationTelemetry.js';
31
+ import { LegendApplicationTelemetryHelper } from '../application/LegendApplicationTelemetry.js';
32
+ import type { GenericLegendApplicationStore } from '../stores/ApplicationStore.js';
32
33
 
33
- const APP_CONTAINER_ID = 'app.container';
34
- const APP_BACKDROP_CONTAINER_ID = 'app.backdrop-container';
34
+ enum APPLICATION_COMPONENT_ELEMENT_ID {
35
+ TOP_LEVEL_CONTAINER = 'application.top-level-container',
36
+ BACKDROP_CONTAINER = 'application.backdrop-container',
37
+ }
35
38
 
36
39
  const PLATFORM_NATIVE_KEYBOARD_SHORTCUTS = [
37
40
  'Meta+KeyP', // Print
@@ -92,9 +95,12 @@ const buildHotkeysConfiguration = (
92
95
  * method forces those event to surface to the top of the app and being handled
93
96
  * by keybinding service
94
97
  */
95
- export const forceDispatchKeyboardEvent = (event: KeyboardEvent): void => {
96
- document
97
- .getElementById(APP_CONTAINER_ID)
98
+ export const forceDispatchKeyboardEvent = (
99
+ event: KeyboardEvent,
100
+ applicationStore: GenericLegendApplicationStore,
101
+ ): void => {
102
+ applicationStore.layoutService
103
+ .getElementByID(APPLICATION_COMPONENT_ELEMENT_ID.TOP_LEVEL_CONTAINER)
98
104
  ?.dispatchEvent(new KeyboardEvent(event.type, event));
99
105
  };
100
106
 
@@ -104,8 +110,8 @@ export const forceDispatchKeyboardEvent = (event: KeyboardEvent): void => {
104
110
  * NOTE: we usually want the backdrop container to be the first child of its immediate parent
105
111
  * so that it properly lies under the content that we pick to show on top of the backdrop
106
112
  */
107
- export const BackdropContainer: React.FC<{ elementID: string }> = (props) => (
108
- <div className="backdrop__container" id={props.elementID} />
113
+ export const BackdropContainer: React.FC<{ elementId: string }> = (props) => (
114
+ <div className="backdrop__container" data-elementid={props.elementId} />
109
115
  );
110
116
 
111
117
  export const LegendApplicationComponentFrameworkProvider = observer(
@@ -116,12 +122,6 @@ export const LegendApplicationComponentFrameworkProvider = observer(
116
122
  event.stopPropagation();
117
123
  event.preventDefault();
118
124
  };
119
- const backdropContainer = applicationStore.layoutService
120
- .backdropContainerElementID
121
- ? document.getElementById(
122
- applicationStore.layoutService.backdropContainerElementID,
123
- ) ?? document.getElementById(APP_BACKDROP_CONTAINER_ID)
124
- : document.getElementById(APP_BACKDROP_CONTAINER_ID);
125
125
 
126
126
  const keyBindingMap = buildHotkeysConfiguration(
127
127
  applicationStore.keyboardShortcutsService.commandKeyMap,
@@ -157,7 +157,7 @@ export const LegendApplicationComponentFrameworkProvider = observer(
157
157
  useEffect(() => {
158
158
  const onVisibilityChange = (): void => {
159
159
  if (document.hidden) {
160
- ApplicationTelemetry.logEvent_ApplicationUsageInterrupted(
160
+ LegendApplicationTelemetryHelper.logEvent_ApplicationUsageInterrupted(
161
161
  applicationStore.telemetryService,
162
162
  );
163
163
  applicationStore.timeService.recordUsageInterruption();
@@ -181,7 +181,14 @@ export const LegendApplicationComponentFrameworkProvider = observer(
181
181
  // For example, the default location of the backdrop works fine for most cases
182
182
  // but if we want to use the backdrop for elements within modal dialogs, we would
183
183
  // need to mount the backdrop at a different location
184
- <Portal container={backdropContainer}>
184
+ <Portal
185
+ container={
186
+ applicationStore.layoutService.getElementByID(
187
+ applicationStore.layoutService.backdropContainerElementID ??
188
+ APPLICATION_COMPONENT_ELEMENT_ID.BACKDROP_CONTAINER,
189
+ ) ?? null
190
+ }
191
+ >
185
192
  <Backdrop
186
193
  className="backdrop"
187
194
  open={applicationStore.layoutService.showBackdrop}
@@ -193,11 +200,15 @@ export const LegendApplicationComponentFrameworkProvider = observer(
193
200
  className="app__container"
194
201
  // NOTE: this `id` is used to quickly identify this DOM node so we could manually
195
202
  // dispatch keyboard event here in order to be captured by our global hotkeys matchers
196
- id={APP_CONTAINER_ID}
203
+ data-elementid={
204
+ APPLICATION_COMPONENT_ELEMENT_ID.TOP_LEVEL_CONTAINER
205
+ }
197
206
  // Disable global context menu so that only places in the app that supports context-menu will be effective
198
207
  onContextMenu={disableContextMenu}
199
208
  >
200
- <BackdropContainer elementID={APP_BACKDROP_CONTAINER_ID} />
209
+ <BackdropContainer
210
+ elementId={APPLICATION_COMPONENT_ELEMENT_ID.BACKDROP_CONTAINER}
211
+ />
201
212
  <VirtualAssistant />
202
213
  {children}
203
214
  </div>
@@ -151,7 +151,6 @@ export const NotificationManager = observer(() => {
151
151
  action={[
152
152
  <button
153
153
  className="notification__action"
154
- id="expand_button"
155
154
  key="expand"
156
155
  onClick={toggleExpansion}
157
156
  tabIndex={-1}
@@ -56,7 +56,7 @@ import {
56
56
  import { useApplicationStore } from './ApplicationStoreProvider.js';
57
57
  import Draggable from 'react-draggable';
58
58
  import { DATE_TIME_FORMAT } from '@finos/legend-graph';
59
- import { ApplicationTelemetry } from '../stores/ApplicationTelemetry.js';
59
+ import { LegendApplicationTelemetryHelper } from '../application/LegendApplicationTelemetry.js';
60
60
  import { TextSearchAdvancedConfigMenu } from './shared/TextSearchAdvancedConfigMenu.js';
61
61
 
62
62
  const WIZARD_GREETING = `Bonjour, It's Pierre!`;
@@ -67,7 +67,7 @@ const VirtualAssistantDocumentationEntryViewer = observer(
67
67
  const applicationStore = useApplicationStore();
68
68
  const toggleExpand = (): void => {
69
69
  if (!entry.isOpen) {
70
- ApplicationTelemetry.logEvent_VirtualAssistantDocumentationEntryAccessed(
70
+ LegendApplicationTelemetryHelper.logEvent_VirtualAssistantDocumentationEntryAccessed(
71
71
  applicationStore.telemetryService,
72
72
  {
73
73
  key: entry.documentationKey,
@@ -77,7 +77,7 @@ const VirtualAssistantDocumentationEntryViewer = observer(
77
77
  entry.setIsOpen(!entry.isOpen);
78
78
  };
79
79
  const onDocumentationLinkClick = (): void => {
80
- ApplicationTelemetry.logEvent_VirtualAssistantDocumentationEntryAccessed(
80
+ LegendApplicationTelemetryHelper.logEvent_VirtualAssistantDocumentationEntryAccessed(
81
81
  applicationStore.telemetryService,
82
82
  {
83
83
  key: entry.documentationKey,
@@ -78,7 +78,8 @@ export const TextInputEditor: React.FC<{
78
78
  const element = textInputRef.current;
79
79
  const _editor = monacoEditorAPI.create(element, {
80
80
  ...getBaseTextEditorOptions(),
81
- theme: applicationStore.layoutService.TEMPORARY__isLightThemeEnabled
81
+ theme: applicationStore.layoutService
82
+ .TEMPORARY__isLightColorThemeEnabled
82
83
  ? EDITOR_THEME.TEMPORARY__VSCODE_LIGHT
83
84
  : EDITOR_THEME.LEGEND,
84
85
  formatOnType: true,
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { BaseRadioGroup, InfoCircleIcon } from '@finos/legend-art';
18
18
  import { observer } from 'mobx-react-lite';
19
- import { LEGEND_APPLICATION_DOCUMENTATION_KEY } from '../../stores/LegendApplicationDocumentation.js';
19
+ import { LEGEND_APPLICATION_DOCUMENTATION_KEY } from '../../application/LegendApplicationDocumentation.js';
20
20
  import {
21
21
  ADVANCED_TEXT_SEARCH_MODE,
22
22
  type TextSearchAdvancedConfigState,
package/src/index.ts CHANGED
@@ -16,8 +16,15 @@
16
16
 
17
17
  export * from './const.js';
18
18
 
19
- export * from './application/LegendApplicationPluginManager.js';
20
19
  export * from './application/LegendApplication.js';
20
+ export * from './application/LegendApplicationConfig.js';
21
+ export * from './application/LegendApplicationPluginManager.js';
22
+ export * from './application/LegendApplicationEvent.js';
23
+ export * from './application/LegendApplicationDocumentation.js';
24
+ export * from './application/LegendApplicationTelemetry.js';
25
+ export * from './application/LegendApplicationSetting.js';
26
+ export { LEGEND_APPLICATION_COLOR_THEME } from './application/LegendApplicationTheme.js';
27
+
21
28
  export * from './components/ApplicationStoreProvider.js';
22
29
  export * from './components/WebApplicationNavigatorProvider.js';
23
30
  export * from './components/LegendApplicationComponentFrameworkProvider.js';
@@ -27,13 +34,11 @@ export * from './components/ApplicationStoreProviderTestUtils.js';
27
34
  export * from './components/WebApplicationNavigatorProviderTestUtils.js';
28
35
 
29
36
  export * from './stores/ApplicationStore.js';
30
- export * from './stores/ApplicationTelemetry.js';
31
- export * from './stores/ApplicationEvent.js';
32
- export * from './application/LegendApplicationConfig.js';
33
37
  export { WebApplicationNavigator } from './stores/navigation/WebApplicationNavigator.js';
34
38
  export { NavigationService } from './stores/navigation/NavigationService.js';
35
39
  export * from './stores/storage/ApplicationStorage.js';
36
40
  export * from './stores/storage/StorageService.js';
41
+ export * from './stores/SettingService.js';
37
42
  export * from './stores/DocumentationService.js';
38
43
  export * from './stores/CommandService.js';
39
44
  export * from './stores/event/EventService.js';
@@ -44,29 +49,30 @@ export * from './stores/AlertService.js';
44
49
  export * from './stores/AssistantService.js';
45
50
  export * from './stores/ApplicationNavigationContextService.js';
46
51
  export * from './stores/LegendApplicationPlugin.js';
47
-
48
- export * from './components/shared/TextSearchAdvancedConfigMenu.js';
49
- export * from './stores/shared/TextSearchAdvancedConfigState.js';
50
- export * from './stores/LegendApplicationDocumentation.js';
52
+ export * from './stores/Core_LegendApplicationPlugin.js';
51
53
 
52
54
  export * from './stores/ApplicationStoreTestUtils.js';
53
55
  export * from './stores/navigation/WebApplicationRouter.js';
54
- export { PURE_GRAMMAR_TOKEN } from './stores/pure-language/PureLanguageSupport.js';
55
- export * from './stores/pure-language/PureLanguageTextEditorSupport.js';
56
56
  export { DISPLAY_ANSI_ESCAPE } from './stores/terminal/Terminal.js';
57
57
 
58
58
  // ------------------------------------------- Shared components -------------------------------------------
59
59
 
60
60
  export * from './components/shared/DocumentationLink.js';
61
- export * from './components/shared/TextInputEditor.js';
62
- export * from './components/shared/PackageableElementOptionLabel.js';
63
- export * from './components/shared/TabManager.js';
64
-
65
- export * from './stores/shared/PackageableElementOption.js';
66
- export * from './stores/shared/TabManagerState.js';
67
61
 
68
62
  /**
63
+ * To be moved to other packages
69
64
  * @modularize
70
65
  */
71
66
  export * from './components/execution-plan-viewer/ExecutionPlanViewer.js';
72
67
  export * from './stores/ExecutionPlanState.js';
68
+
69
+ export * from './components/shared/TextInputEditor.js';
70
+ export * from './components/shared/PackageableElementOptionLabel.js';
71
+ export { PURE_GRAMMAR_TOKEN } from './stores/pure-language/PureLanguageSupport.js';
72
+ export * from './stores/pure-language/PureLanguageTextEditorSupport.js';
73
+ export * from './stores/shared/PackageableElementOption.js';
74
+
75
+ export * from './components/shared/TabManager.js';
76
+ export * from './components/shared/TextSearchAdvancedConfigMenu.js';
77
+ export * from './stores/shared/TabManagerState.js';
78
+ export * from './stores/shared/TextSearchAdvancedConfigState.js';
@@ -17,7 +17,7 @@
17
17
  import { IllegalStateError } from '@finos/legend-shared';
18
18
  import { action, computed, makeObservable, observable } from 'mobx';
19
19
  import type { GenericLegendApplicationStore } from './ApplicationStore.js';
20
- import { ApplicationTelemetry } from './ApplicationTelemetry.js';
20
+ import { LegendApplicationTelemetryHelper } from '../application/LegendApplicationTelemetry.js';
21
21
 
22
22
  /**
23
23
  * Context data refers to the area of the application that the user is
@@ -114,7 +114,7 @@ export class ApplicationNavigationContextService {
114
114
  )
115
115
  .includes(context.key)
116
116
  ) {
117
- ApplicationTelemetry.logEvent_ApplicationContextAccessed(
117
+ LegendApplicationTelemetryHelper.logEvent_ApplicationContextAccessed(
118
118
  this.applicationStore.telemetryService,
119
119
  {
120
120
  key: context.key,
@@ -20,7 +20,7 @@ import {
20
20
  LogEvent,
21
21
  uuid,
22
22
  } from '@finos/legend-shared';
23
- import { APPLICATION_EVENT } from './ApplicationEvent.js';
23
+ import { APPLICATION_EVENT } from '../application/LegendApplicationEvent.js';
24
24
  import type { LegendApplicationConfig } from '../application/LegendApplicationConfig.js';
25
25
  import type { WebApplicationNavigator } from './navigation/WebApplicationNavigator.js';
26
26
  import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager.js';
@@ -41,6 +41,7 @@ import { TimeService } from './TimeService.js';
41
41
  import { LayoutService } from './LayoutService.js';
42
42
  import { ClipboardService } from './ClipboardService.js';
43
43
  import { NavigationService } from './navigation/NavigationService.js';
44
+ import { SettingService } from './SettingService.js';
44
45
 
45
46
  export type GenericLegendApplicationStore = ApplicationStore<
46
47
  LegendApplicationConfig,
@@ -57,15 +58,19 @@ export class ApplicationStore<
57
58
  readonly pluginManager: V;
58
59
 
59
60
  // core
60
- readonly identityService: IdentityService;
61
+ readonly timeService: TimeService;
62
+ readonly logService: LogService;
61
63
  readonly storageService: StorageService;
62
- readonly timeService = new TimeService();
64
+ readonly settingService: SettingService;
65
+ readonly alertService: AlertService;
66
+ readonly notificationService: NotificationService;
67
+
68
+ readonly identityService: IdentityService;
63
69
  readonly commandService: CommandService;
64
70
  readonly keyboardShortcutsService: KeyboardShortcutsService;
65
71
  readonly layoutService: LayoutService;
66
72
  readonly clipboardService: ClipboardService;
67
73
  readonly terminalService: TerminalService;
68
- readonly logService = new LogService();
69
74
  readonly navigationService: NavigationService;
70
75
  readonly navigationContextService: ApplicationNavigationContextService;
71
76
 
@@ -74,8 +79,6 @@ export class ApplicationStore<
74
79
  readonly assistantService: AssistantService;
75
80
 
76
81
  // event
77
- readonly alertService: AlertService;
78
- readonly notificationService: NotificationService;
79
82
  readonly eventService: EventService;
80
83
  readonly telemetryService: TelemetryService;
81
84
  readonly tracerService: TracerService;
@@ -96,9 +99,12 @@ export class ApplicationStore<
96
99
  // NOTE: set the logger first so other loading could use the configured logger
97
100
  this.logService = new LogService();
98
101
  this.logService.registerPlugins(pluginManager.getLoggerPlugins());
102
+ this.storageService = new StorageService(this);
103
+ this.settingService = new SettingService(this);
104
+ this.alertService = new AlertService(this);
105
+ this.notificationService = new NotificationService();
99
106
 
100
107
  this.identityService = new IdentityService(this);
101
- this.storageService = new StorageService(this);
102
108
  this.layoutService = new LayoutService(this);
103
109
  this.clipboardService = new ClipboardService(this);
104
110
  this.terminalService = new TerminalService(this);
@@ -113,8 +119,6 @@ export class ApplicationStore<
113
119
  this.documentationService = new DocumentationService(this);
114
120
  this.assistantService = new AssistantService(this);
115
121
 
116
- this.alertService = new AlertService(this);
117
- this.notificationService = new NotificationService();
118
122
  this.eventService = new EventService();
119
123
  this.eventService.registerEventNotifierPlugins(
120
124
  pluginManager.getEventNotifierPlugins(),
@@ -17,7 +17,7 @@
17
17
  import { action, makeObservable, observable, computed } from 'mobx';
18
18
  import type { DocumentationEntry } from './DocumentationService.js';
19
19
  import type { GenericLegendApplicationStore } from './ApplicationStore.js';
20
- import { Fuse } from '@finos/legend-art';
20
+ import { FuzzySearchEngine } from '@finos/legend-art';
21
21
  import {
22
22
  type MarkdownText,
23
23
  guaranteeNonEmptyString,
@@ -112,7 +112,7 @@ export class AssistantService {
112
112
  currentDocumentationEntry: VirtualAssistantDocumentationEntry | undefined;
113
113
 
114
114
  // search text
115
- private readonly searchEngine: Fuse<DocumentationEntry>;
115
+ private readonly searchEngine: FuzzySearchEngine<DocumentationEntry>;
116
116
  searchConfigurationState: TextSearchAdvancedConfigState;
117
117
  searchState = ActionState.create();
118
118
  searchText = '';
@@ -144,7 +144,7 @@ export class AssistantService {
144
144
  });
145
145
 
146
146
  this.applicationStore = applicationStore;
147
- this.searchEngine = new Fuse(
147
+ this.searchEngine = new FuzzySearchEngine(
148
148
  this.applicationStore.documentationService
149
149
  .getAllDocEntries()
150
150
  .filter(isValidVirtualAssistantDocumentationEntry),
@@ -16,13 +16,14 @@
16
16
 
17
17
  import { LogEvent } from '@finos/legend-shared';
18
18
  import { action, makeObservable, observable } from 'mobx';
19
- import { APPLICATION_EVENT } from './ApplicationEvent.js';
19
+ import { APPLICATION_EVENT } from '../application/LegendApplicationEvent.js';
20
20
  import type { GenericLegendApplicationStore } from './ApplicationStore.js';
21
21
 
22
22
  export interface CommandRegistrar {
23
23
  registerCommands(): void;
24
24
  deregisterCommands(): void;
25
25
  }
26
+
26
27
  export type CommandConfigEntry = {
27
28
  title?: string;
28
29
  /**
@@ -34,10 +35,12 @@ export type CommandConfigEntry = {
34
35
  additionalKeyboardShortcuts?: string[];
35
36
  when?: string;
36
37
  };
38
+
37
39
  export type KeyedCommandConfigEntry = {
38
40
  key: string;
39
41
  content: CommandConfigEntry;
40
42
  };
43
+
41
44
  export type CommandConfigData = Record<string, CommandConfigEntry>;
42
45
  export const collectKeyedCommandConfigEntriesFromConfig = (
43
46
  rawEntries: Record<string, CommandConfigEntry>,
@@ -46,9 +49,11 @@ export const collectKeyedCommandConfigEntriesFromConfig = (
46
49
  key: entry[0],
47
50
  content: entry[1],
48
51
  }));
52
+
49
53
  export type CommandArguments = {
50
54
  event?: Event;
51
55
  };
56
+
52
57
  export type Command = {
53
58
  key: string;
54
59
  trigger?: () => boolean;
@@ -73,9 +78,7 @@ export class CommandService {
73
78
  const commandKey = command.key;
74
79
  if (this.commandRegistry.has(commandKey)) {
75
80
  this.applicationStore.logService.warn(
76
- LogEvent.create(
77
- APPLICATION_EVENT.APPLICATION_COMMAND_CENTER_REGISTRATION__FAILURE,
78
- ),
81
+ LogEvent.create(APPLICATION_EVENT.COMMAND_CENTER_REGISTRATION__FAILURE),
79
82
  `Can't register command: command is already registered`,
80
83
  );
81
84
  return;
@@ -0,0 +1,53 @@
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 packageJson from '../../package.json';
18
+ import type { LegendApplicationPluginManager } from '../application/LegendApplicationPluginManager.js';
19
+ import { LEGEND_APPLICATION_SETTING_CONFIG } from '../application/LegendApplicationSetting.js';
20
+ import {
21
+ HIGH_CONTRAST_LIGHT_COLOR_THEME,
22
+ LEGACY_LIGHT_COLOR_THEME,
23
+ } from '../application/LegendApplicationTheme.js';
24
+ import type { ColorTheme } from './LayoutService.js';
25
+ import { LegendApplicationPlugin } from './LegendApplicationPlugin.js';
26
+ import {
27
+ collectSettingConfigurationEntriesFromConfig,
28
+ type SettingConfigurationEntry,
29
+ } from './SettingService.js';
30
+
31
+ export class Core_LegendApplicationPlugin extends LegendApplicationPlugin {
32
+ static NAME = packageJson.extensions.applicationPlugin;
33
+
34
+ constructor() {
35
+ super(Core_LegendApplicationPlugin.NAME, packageJson.version);
36
+ }
37
+
38
+ install(
39
+ pluginManager: LegendApplicationPluginManager<LegendApplicationPlugin>,
40
+ ): void {
41
+ pluginManager.registerApplicationPlugin(this);
42
+ }
43
+
44
+ override getExtraColorThemes(): ColorTheme[] {
45
+ return [LEGACY_LIGHT_COLOR_THEME, HIGH_CONTRAST_LIGHT_COLOR_THEME];
46
+ }
47
+
48
+ override getExtraSettingConfigurationEntries(): SettingConfigurationEntry[] {
49
+ return collectSettingConfigurationEntriesFromConfig(
50
+ LEGEND_APPLICATION_SETTING_CONFIG,
51
+ );
52
+ }
53
+ }