@finos/legend-extension-dsl-data-space 10.0.11 → 10.0.12

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 (126) hide show
  1. package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.d.ts +28 -0
  2. package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.d.ts.map +1 -0
  3. package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.js +70 -0
  4. package/lib/__lib__/DSL_DataSpace_LegendApplicationCommand.js.map +1 -0
  5. package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.d.ts +20 -0
  6. package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.d.ts.map +1 -0
  7. package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.js +21 -0
  8. package/lib/__lib__/DSL_DataSpace_LegendApplicationNavigation.js.map +1 -0
  9. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +3 -1
  10. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
  11. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +13 -1
  12. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
  13. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
  14. package/lib/components/DataSpaceDataAccess.js +5 -76
  15. package/lib/components/DataSpaceDataAccess.js.map +1 -1
  16. package/lib/components/DataSpaceDescription.d.ts.map +1 -1
  17. package/lib/components/DataSpaceDescription.js +2 -1
  18. package/lib/components/DataSpaceDescription.js.map +1 -1
  19. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
  20. package/lib/components/DataSpaceDiagramViewer.js +110 -39
  21. package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
  22. package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -1
  23. package/lib/components/DataSpaceExecutionContextViewer.js +3 -3
  24. package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -1
  25. package/lib/components/DataSpaceInfoPanel.d.ts.map +1 -1
  26. package/lib/components/DataSpaceInfoPanel.js +6 -6
  27. package/lib/components/DataSpaceInfoPanel.js.map +1 -1
  28. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
  29. package/lib/components/DataSpaceModelsDocumentation.js +18 -8
  30. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
  31. package/lib/components/DataSpacePlaceholder.d.ts +4 -0
  32. package/lib/components/DataSpacePlaceholder.d.ts.map +1 -1
  33. package/lib/components/DataSpacePlaceholder.js +6 -1
  34. package/lib/components/DataSpacePlaceholder.js.map +1 -1
  35. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
  36. package/lib/components/DataSpaceQuickStart.js +24 -11
  37. package/lib/components/DataSpaceQuickStart.js.map +1 -1
  38. package/lib/components/DataSpaceSupportPanel.d.ts.map +1 -1
  39. package/lib/components/DataSpaceSupportPanel.js +17 -8
  40. package/lib/components/DataSpaceSupportPanel.js.map +1 -1
  41. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  42. package/lib/components/DataSpaceViewer.js +34 -13
  43. package/lib/components/DataSpaceViewer.js.map +1 -1
  44. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  45. package/lib/components/DataSpaceViewerActivityBar.js +15 -12
  46. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  47. package/lib/components/index.d.ts +1 -0
  48. package/lib/components/index.d.ts.map +1 -1
  49. package/lib/components/index.js +1 -0
  50. package/lib/components/index.js.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +1 -1
  52. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  53. package/lib/index.css +2 -2
  54. package/lib/index.css.map +1 -1
  55. package/lib/package.json +1 -1
  56. package/lib/stores/DataSpaceLayoutState.d.ts +46 -0
  57. package/lib/stores/DataSpaceLayoutState.d.ts.map +1 -1
  58. package/lib/stores/DataSpaceLayoutState.js +184 -1
  59. package/lib/stores/DataSpaceLayoutState.js.map +1 -1
  60. package/lib/stores/DataSpaceModelsDocumentationState.d.ts +11 -2
  61. package/lib/stores/DataSpaceModelsDocumentationState.d.ts.map +1 -1
  62. package/lib/stores/DataSpaceModelsDocumentationState.js +41 -0
  63. package/lib/stores/DataSpaceModelsDocumentationState.js.map +1 -1
  64. package/lib/stores/DataSpaceQuickStartState.d.ts +24 -0
  65. package/lib/stores/DataSpaceQuickStartState.d.ts.map +1 -0
  66. package/lib/stores/DataSpaceQuickStartState.js +48 -0
  67. package/lib/stores/DataSpaceQuickStartState.js.map +1 -0
  68. package/lib/stores/DataSpaceViewerDiagramViewerState.d.ts +44 -0
  69. package/lib/stores/DataSpaceViewerDiagramViewerState.d.ts.map +1 -0
  70. package/lib/stores/DataSpaceViewerDiagramViewerState.js +194 -0
  71. package/lib/stores/DataSpaceViewerDiagramViewerState.js.map +1 -0
  72. package/lib/stores/DataSpaceViewerNavigation.d.ts +36 -0
  73. package/lib/stores/DataSpaceViewerNavigation.d.ts.map +1 -0
  74. package/lib/stores/DataSpaceViewerNavigation.js +47 -0
  75. package/lib/stores/DataSpaceViewerNavigation.js.map +1 -0
  76. package/lib/stores/DataSpaceViewerState.d.ts +22 -74
  77. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  78. package/lib/stores/DataSpaceViewerState.js +34 -259
  79. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  80. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
  81. package/lib/stores/query/DataSpaceAdvancedSearchState.js +8 -5
  82. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  83. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts +8 -8
  84. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -1
  85. package/lib/stores/query/DataSpaceQueryCreatorStore.js +1 -1
  86. package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
  87. package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +1 -1
  88. package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
  89. package/lib/stores/query/DataSpaceQuerySetupStore.js +1 -1
  90. package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
  91. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
  92. package/lib/stores/studio/DataSpacePreviewState.js +15 -3
  93. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
  94. package/package.json +13 -13
  95. package/src/__lib__/DSL_DataSpace_LegendApplicationCommand.ts +74 -0
  96. package/src/__lib__/DSL_DataSpace_LegendApplicationNavigation.ts +33 -0
  97. package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +20 -1
  98. package/src/components/DataSpaceDataAccess.tsx +9 -122
  99. package/src/components/DataSpaceDescription.tsx +5 -5
  100. package/src/components/DataSpaceDiagramViewer.tsx +449 -69
  101. package/src/components/DataSpaceExecutionContextViewer.tsx +47 -40
  102. package/src/components/DataSpaceInfoPanel.tsx +107 -117
  103. package/src/components/DataSpaceModelsDocumentation.tsx +31 -12
  104. package/src/components/DataSpacePlaceholder.tsx +22 -0
  105. package/src/components/DataSpaceQuickStart.tsx +95 -15
  106. package/src/components/DataSpaceSupportPanel.tsx +146 -14
  107. package/src/components/DataSpaceViewer.tsx +153 -23
  108. package/src/components/DataSpaceViewerActivityBar.tsx +40 -20
  109. package/src/components/index.ts +1 -0
  110. package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +1 -1
  111. package/src/stores/DataSpaceLayoutState.ts +272 -0
  112. package/src/stores/DataSpaceModelsDocumentationState.ts +61 -2
  113. package/src/stores/DataSpaceQuickStartState.ts +91 -0
  114. package/src/stores/DataSpaceViewerDiagramViewerState.ts +245 -0
  115. package/src/stores/DataSpaceViewerNavigation.ts +64 -0
  116. package/src/stores/DataSpaceViewerState.ts +88 -401
  117. package/src/stores/query/DataSpaceAdvancedSearchState.ts +30 -6
  118. package/src/stores/query/DataSpaceQueryCreatorStore.ts +8 -8
  119. package/src/stores/query/DataSpaceQuerySetupStore.ts +1 -1
  120. package/src/stores/studio/DataSpacePreviewState.ts +27 -5
  121. package/tsconfig.json +5 -1
  122. package/lib/stores/DataSpaceViewerDataAccessState.d.ts +0 -35
  123. package/lib/stores/DataSpaceViewerDataAccessState.d.ts.map +0 -1
  124. package/lib/stores/DataSpaceViewerDataAccessState.js +0 -98
  125. package/lib/stores/DataSpaceViewerDataAccessState.js.map +0 -1
  126. package/src/stores/DataSpaceViewerDataAccessState.ts +0 -143
@@ -0,0 +1,245 @@
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 {
18
+ getNullableFirstEntry,
19
+ guaranteeNonNullable,
20
+ } from '@finos/legend-shared';
21
+ import { action, computed, makeObservable, observable } from 'mobx';
22
+ import { type DataSpaceViewerState } from './DataSpaceViewerState.js';
23
+ import type { ClassView } from '@finos/legend-extension-dsl-diagram/graph';
24
+ import type { DataSpaceDiagramAnalysisResult } from '../graph-manager/index.js';
25
+ import {
26
+ DIAGRAM_INTERACTION_MODE,
27
+ type DiagramRenderer,
28
+ } from '@finos/legend-extension-dsl-diagram/application';
29
+ import type { CommandRegistrar } from '@finos/legend-application';
30
+ import { DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY } from '../__lib__/DSL_DataSpace_LegendApplicationCommand.js';
31
+ import { DATA_SPACE_VIEWER_ACTIVITY_MODE } from './DataSpaceViewerNavigation.js';
32
+
33
+ export class DataSpaceViewerDiagramViewerState implements CommandRegistrar {
34
+ readonly dataSpaceViewerState: DataSpaceViewerState;
35
+
36
+ _renderer?: DiagramRenderer | undefined;
37
+ currentDiagram?: DataSpaceDiagramAnalysisResult | undefined;
38
+ contextMenuClassView?: ClassView | undefined;
39
+ showDescription = true;
40
+ expandDescription = false;
41
+
42
+ constructor(dataSpaceViewerState: DataSpaceViewerState) {
43
+ makeObservable(this, {
44
+ _renderer: observable,
45
+ currentDiagram: observable,
46
+ contextMenuClassView: observable,
47
+ showDescription: observable,
48
+ expandDescription: observable,
49
+ previousDiagram: computed,
50
+ nextDiagram: computed,
51
+ currentDiagramIndex: computed,
52
+ diagramRenderer: computed,
53
+ setDiagramRenderer: action,
54
+ setCurrentDiagram: action,
55
+ setContextMenuClassView: action,
56
+ setShowDescription: action,
57
+ setExpandDescription: action,
58
+ });
59
+
60
+ this.dataSpaceViewerState = dataSpaceViewerState;
61
+ this.currentDiagram = getNullableFirstEntry(
62
+ this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams,
63
+ );
64
+ }
65
+
66
+ get diagramRenderer(): DiagramRenderer {
67
+ return guaranteeNonNullable(
68
+ this._renderer,
69
+ `Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)`,
70
+ );
71
+ }
72
+
73
+ get isDiagramRendererInitialized(): boolean {
74
+ return Boolean(this._renderer);
75
+ }
76
+
77
+ // NOTE: we have tried to use React to control the cursor and
78
+ // could not overcome the jank/lag problem, so we settle with CSS-based approach
79
+ // See https://css-tricks.com/using-css-cursors/
80
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
81
+ get diagramCursorClass(): string {
82
+ if (!this.isDiagramRendererInitialized) {
83
+ return '';
84
+ }
85
+ switch (this.diagramRenderer.interactionMode) {
86
+ case DIAGRAM_INTERACTION_MODE.PAN: {
87
+ return this.diagramRenderer.leftClick
88
+ ? 'data-space__viewer__diagram-viewer__cursor--grabbing'
89
+ : 'data-space__viewer__diagram-viewer__cursor--grab';
90
+ }
91
+ case DIAGRAM_INTERACTION_MODE.ZOOM_IN: {
92
+ return 'data-space__viewer__diagram-viewer__cursor--zoom-in';
93
+ }
94
+ case DIAGRAM_INTERACTION_MODE.ZOOM_OUT: {
95
+ return 'data-space__viewer__diagram-viewer__cursor--zoom-out';
96
+ }
97
+ case DIAGRAM_INTERACTION_MODE.LAYOUT: {
98
+ if (this.diagramRenderer.mouseOverClassView) {
99
+ return 'data-space__viewer__diagram-viewer__cursor--pointer';
100
+ }
101
+ return '';
102
+ }
103
+ default:
104
+ return '';
105
+ }
106
+ }
107
+
108
+ get previousDiagram(): DataSpaceDiagramAnalysisResult | undefined {
109
+ if (!this.currentDiagram) {
110
+ return undefined;
111
+ }
112
+ const idx =
113
+ this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.indexOf(
114
+ this.currentDiagram,
115
+ );
116
+ if (idx === 0 || idx === -1) {
117
+ return undefined;
118
+ }
119
+ return this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams[idx - 1];
120
+ }
121
+
122
+ get nextDiagram(): DataSpaceDiagramAnalysisResult | undefined {
123
+ if (!this.currentDiagram) {
124
+ return undefined;
125
+ }
126
+ const idx =
127
+ this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.indexOf(
128
+ this.currentDiagram,
129
+ );
130
+ if (
131
+ idx ===
132
+ this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.length - 1 ||
133
+ idx === -1
134
+ ) {
135
+ return undefined;
136
+ }
137
+ return this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams[idx + 1];
138
+ }
139
+
140
+ get currentDiagramIndex(): number {
141
+ return this.currentDiagram
142
+ ? this.dataSpaceViewerState.dataSpaceAnalysisResult.diagrams.indexOf(
143
+ this.currentDiagram,
144
+ ) + 1
145
+ : 0;
146
+ }
147
+
148
+ setDiagramRenderer(val: DiagramRenderer): void {
149
+ this._renderer = val;
150
+ }
151
+
152
+ setCurrentDiagram(val: DataSpaceDiagramAnalysisResult): void {
153
+ this.currentDiagram = val;
154
+ }
155
+
156
+ setContextMenuClassView(val: ClassView | undefined): void {
157
+ this.contextMenuClassView = val;
158
+ }
159
+
160
+ setupDiagramRenderer(): void {
161
+ this.diagramRenderer.setIsReadOnly(true);
162
+ this.diagramRenderer.setEnableLayoutAutoAdjustment(true);
163
+ this.diagramRenderer.onClassViewDoubleClick = (
164
+ classView: ClassView,
165
+ ): void => this.dataSpaceViewerState.queryClass(classView.class.value);
166
+ this.diagramRenderer.onClassViewRightClick = (
167
+ classView: ClassView,
168
+ ): void => {
169
+ this.setContextMenuClassView(classView);
170
+ };
171
+ }
172
+
173
+ setShowDescription(val: boolean): void {
174
+ this.showDescription = val;
175
+ this.setExpandDescription(false);
176
+ }
177
+
178
+ setExpandDescription(val: boolean): void {
179
+ this.expandDescription = val;
180
+ }
181
+
182
+ registerCommands(): void {
183
+ const DEFAULT_TRIGGER = (): boolean =>
184
+ this.dataSpaceViewerState.currentActivity ===
185
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER;
186
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
187
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.RECENTER_DIAGRAM,
188
+ trigger: DEFAULT_TRIGGER,
189
+ action: () => this.diagramRenderer.recenter(),
190
+ });
191
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
192
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_ZOOM_TOOL,
193
+ trigger: DEFAULT_TRIGGER,
194
+ action: () => this.diagramRenderer.switchToZoomMode(),
195
+ });
196
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
197
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_VIEW_TOOL,
198
+ trigger: DEFAULT_TRIGGER,
199
+ action: () => this.diagramRenderer.switchToViewMode(),
200
+ });
201
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
202
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_PAN_TOOL,
203
+ trigger: DEFAULT_TRIGGER,
204
+ action: () => this.diagramRenderer.switchToPanMode(),
205
+ });
206
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
207
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.GO_TO_NEXT_DIAGRAM,
208
+ trigger: DEFAULT_TRIGGER,
209
+ action: () => {
210
+ if (this.nextDiagram) {
211
+ this.setCurrentDiagram(this.nextDiagram);
212
+ }
213
+ },
214
+ });
215
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
216
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.GO_TO_PREVIOUS_DIAGRAM,
217
+ trigger: DEFAULT_TRIGGER,
218
+ action: () => {
219
+ if (this.previousDiagram) {
220
+ this.setCurrentDiagram(this.previousDiagram);
221
+ }
222
+ },
223
+ });
224
+ this.dataSpaceViewerState.applicationStore.commandService.registerCommand({
225
+ key: DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.TOGGLE_DIAGRAM_DESCRIPTION,
226
+ trigger: DEFAULT_TRIGGER,
227
+ action: () => this.setShowDescription(!this.showDescription),
228
+ });
229
+ }
230
+
231
+ deregisterCommands(): void {
232
+ [
233
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.RECENTER_DIAGRAM,
234
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_ZOOM_TOOL,
235
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_VIEW_TOOL,
236
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.USE_PAN_TOOL,
237
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.GO_TO_NEXT_DIAGRAM,
238
+ DSL_DATA_SPACE_LEGEND_APPLICATION_COMMAND_KEY.GO_TO_PREVIOUS_DIAGRAM,
239
+ ].forEach((commandKey) =>
240
+ this.dataSpaceViewerState.applicationStore.commandService.deregisterCommand(
241
+ commandKey,
242
+ ),
243
+ );
244
+ }
245
+ }
@@ -0,0 +1,64 @@
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 { NAVIGATION_ZONE_SEPARATOR } from '@finos/legend-application';
18
+ import type {
19
+ DataSpaceDiagramAnalysisResult,
20
+ DataSpaceExecutableAnalysisResult,
21
+ } from '../graph-manager/action/analytics/DataSpaceAnalysis.js';
22
+
23
+ export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
24
+ DESCRIPTION = 'description',
25
+ DIAGRAM_VIEWER = 'diagram-viewer',
26
+ MODELS_DOCUMENTATION = 'models-documentation',
27
+ QUICK_START = 'quick-start',
28
+ EXECUTION_CONTEXT = 'execution-context',
29
+ DATA_ACCESS = 'data-access',
30
+
31
+ DATA_STORES = 'data-stores', // TODO: with test-data, also let user call TDS query on top of these
32
+ DATA_AVAILABILITY = 'data-availability',
33
+ DATA_READINESS = 'data-readiness',
34
+ DATA_COST = 'data-cost',
35
+ DATA_GOVERNANCE = 'data-governance',
36
+ INFO = 'info', // TODO: test coverage? (or maybe this should be done in elements/diagrams/data-quality section)
37
+ SUPPORT = 'support',
38
+ }
39
+
40
+ const generateAnchorChunk = (text: string): string =>
41
+ encodeURIComponent(
42
+ text
43
+ .trim()
44
+ .toLowerCase() // anchor is case-insensitive
45
+ .replace(/\s+/gu, '-'), // spaces will be replaced by hyphens
46
+ );
47
+ export const generateAnchorForActivity = (activity: string): string =>
48
+ generateAnchorChunk(activity);
49
+ export const extractActivityFromAnchor = (anchor: string): string =>
50
+ decodeURIComponent(anchor);
51
+ export const generateAnchorForQuickStart = (
52
+ quickStart: DataSpaceExecutableAnalysisResult,
53
+ ): string =>
54
+ [
55
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.QUICK_START,
56
+ generateAnchorChunk(quickStart.title),
57
+ ].join(NAVIGATION_ZONE_SEPARATOR);
58
+ export const generateAnchorForDiagram = (
59
+ diagram: DataSpaceDiagramAnalysisResult,
60
+ ): string =>
61
+ [
62
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
63
+ generateAnchorChunk(diagram.title),
64
+ ].join(NAVIGATION_ZONE_SEPARATOR);