@finos/legend-extension-dsl-data-space 10.0.3 → 10.0.5

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 (74) hide show
  1. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
  2. package/lib/components/DataSpaceDataAccess.js +11 -3
  3. package/lib/components/DataSpaceDataAccess.js.map +1 -1
  4. package/lib/components/DataSpaceDescription.d.ts +1 -1
  5. package/lib/components/DataSpaceDescription.d.ts.map +1 -1
  6. package/lib/components/DataSpaceDescription.js +8 -3
  7. package/lib/components/DataSpaceDescription.js.map +1 -1
  8. package/lib/components/DataSpaceDiagramViewer.d.ts +1 -1
  9. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
  10. package/lib/components/DataSpaceDiagramViewer.js +22 -6
  11. package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
  12. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
  13. package/lib/components/DataSpaceModelsDocumentation.js +11 -3
  14. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
  15. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
  16. package/lib/components/DataSpaceQuickStart.js +75 -61
  17. package/lib/components/DataSpaceQuickStart.js.map +1 -1
  18. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  19. package/lib/components/DataSpaceViewer.js +36 -14
  20. package/lib/components/DataSpaceViewer.js.map +1 -1
  21. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  22. package/lib/components/DataSpaceViewerActivityBar.js +6 -7
  23. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  24. package/lib/components/DataSpaceWiki.d.ts.map +1 -1
  25. package/lib/components/DataSpaceWiki.js +11 -0
  26. package/lib/components/DataSpaceWiki.js.map +1 -1
  27. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +3 -1
  28. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  29. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +3 -0
  30. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  31. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts +2 -2
  32. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.d.ts.map +1 -1
  33. package/lib/graph-manager/action/analytics/DataSpaceAnalysisHelper.js.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +7 -4
  36. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +4 -5
  38. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +64 -62
  40. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +1 -1
  44. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts +1 -0
  45. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  46. package/lib/stores/DataSpaceModelsDocumentationState.d.ts.map +1 -1
  47. package/lib/stores/DataSpaceModelsDocumentationState.js +1 -1
  48. package/lib/stores/DataSpaceModelsDocumentationState.js.map +1 -1
  49. package/lib/stores/DataSpaceViewerState.d.ts +38 -15
  50. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  51. package/lib/stores/DataSpaceViewerState.js +132 -62
  52. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  53. package/lib/stores/query/DataSpaceAdvancedSearchState.js +2 -2
  54. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  55. package/lib/stores/query/DataSpaceQueryBuilderState.js +2 -2
  56. package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
  57. package/package.json +13 -13
  58. package/src/components/DataSpaceDataAccess.tsx +27 -5
  59. package/src/components/DataSpaceDescription.tsx +22 -5
  60. package/src/components/DataSpaceDiagramViewer.tsx +49 -15
  61. package/src/components/DataSpaceModelsDocumentation.tsx +29 -5
  62. package/src/components/DataSpaceQuickStart.tsx +223 -211
  63. package/src/components/DataSpaceViewer.tsx +66 -12
  64. package/src/components/DataSpaceViewerActivityBar.tsx +6 -3
  65. package/src/components/DataSpaceWiki.tsx +14 -0
  66. package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +4 -0
  67. package/src/graph-manager/action/analytics/DataSpaceAnalysisHelper.ts +2 -2
  68. package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +15 -3
  69. package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +112 -89
  70. package/src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts +5 -0
  71. package/src/stores/DataSpaceModelsDocumentationState.ts +1 -1
  72. package/src/stores/DataSpaceViewerState.ts +193 -73
  73. package/src/stores/query/DataSpaceAdvancedSearchState.ts +3 -3
  74. package/src/stores/query/DataSpaceQueryBuilderState.ts +2 -2
@@ -15,7 +15,11 @@
15
15
  */
16
16
 
17
17
  import { AnchorLinkIcon } from '@finos/legend-art';
18
- import type { DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
18
+ import {
19
+ DATA_SPACE_VIEWER_ACTIVITY_MODE,
20
+ generateAnchorForActivity,
21
+ type DataSpaceViewerState,
22
+ } from '../stores/DataSpaceViewerState.js';
19
23
  import { observer } from 'mobx-react-lite';
20
24
  import { DataSpaceWikiPlaceholder } from './DataSpacePlaceholder.js';
21
25
  import { DataSpaceMarkdownTextViewer } from './DataSpaceMarkdownTextViewer.js';
@@ -26,19 +30,32 @@ export const DataSpaceDescription = observer(
26
30
  const { dataSpaceViewerState } = props;
27
31
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
28
32
  const sectionRef = useRef<HTMLDivElement>(null);
33
+ const anchor = generateAnchorForActivity(
34
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION,
35
+ );
29
36
 
30
37
  useEffect(() => {
31
- // do
32
- }, [dataSpaceViewerState]);
38
+ if (sectionRef.current) {
39
+ dataSpaceViewerState.layoutState.setWikiPageAnchor(
40
+ anchor,
41
+ sectionRef.current,
42
+ );
43
+ }
44
+ return () => dataSpaceViewerState.layoutState.unsetWikiPageAnchor(anchor);
45
+ }, [dataSpaceViewerState, anchor]);
33
46
 
34
47
  return (
35
48
  <div ref={sectionRef} className="data-space__viewer__wiki__section">
36
49
  <div className="data-space__viewer__wiki__section__header">
37
50
  <div className="data-space__viewer__wiki__section__header__label">
38
51
  Description
39
- <div className="data-space__viewer__wiki__section__header__anchor">
52
+ <button
53
+ className="data-space__viewer__wiki__section__header__anchor"
54
+ tabIndex={-1}
55
+ onClick={() => dataSpaceViewerState.changeZone(anchor, true)}
56
+ >
40
57
  <AnchorLinkIcon />
41
- </div>
58
+ </button>
42
59
  </div>
43
60
  </div>
44
61
  <div className="data-space__viewer__wiki__section__content">
@@ -22,14 +22,19 @@ import {
22
22
  clsx,
23
23
  useResizeDetector,
24
24
  } from '@finos/legend-art';
25
- import type { DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
25
+ import {
26
+ DATA_SPACE_VIEWER_ACTIVITY_MODE,
27
+ generateAnchorForActivity,
28
+ type DataSpaceViewerState,
29
+ generateAnchorForDiagram,
30
+ } from '../stores/DataSpaceViewerState.js';
26
31
  import { observer } from 'mobx-react-lite';
27
32
  import { forwardRef, useEffect, useRef } from 'react';
28
33
  import { type Diagram } from '@finos/legend-extension-dsl-diagram/graph';
29
34
  import { DiagramRenderer } from '@finos/legend-extension-dsl-diagram/application';
30
35
  import {
31
- getNullableFirstElement,
32
- getNullableLastElement,
36
+ getNullableFirstEntry,
37
+ getNullableLastEntry,
33
38
  guaranteeNonNullable,
34
39
  } from '@finos/legend-shared';
35
40
  import { DataSpaceWikiPlaceholder } from './DataSpacePlaceholder.js';
@@ -81,6 +86,20 @@ export const DataSpaceDiagramViewer = observer(
81
86
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
82
87
  const { dataSpaceViewerState } = props;
83
88
  const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
89
+ const sectionRef = useRef<HTMLDivElement>(null);
90
+ const anchor = generateAnchorForActivity(
91
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
92
+ );
93
+
94
+ useEffect(() => {
95
+ if (sectionRef.current) {
96
+ dataSpaceViewerState.layoutState.setWikiPageAnchor(
97
+ anchor,
98
+ sectionRef.current,
99
+ );
100
+ }
101
+ return () => dataSpaceViewerState.layoutState.unsetWikiPageAnchor(anchor);
102
+ }, [dataSpaceViewerState, anchor]);
84
103
 
85
104
  // diagram selector
86
105
  const diagramCanvasRef = useRef<HTMLDivElement>(null);
@@ -95,8 +114,12 @@ export const DataSpaceDiagramViewer = observer(
95
114
  if (idx === 0 || idx === -1) {
96
115
  return;
97
116
  }
98
- dataSpaceViewerState.setCurrentDiagram(
99
- guaranteeNonNullable(analysisResult.diagrams[idx - 1]),
117
+ const previousDiagram = guaranteeNonNullable(
118
+ analysisResult.diagrams[idx - 1],
119
+ );
120
+ dataSpaceViewerState.setCurrentDiagram(previousDiagram);
121
+ dataSpaceViewerState.syncZoneWithNavigation(
122
+ generateAnchorForDiagram(previousDiagram),
100
123
  );
101
124
  };
102
125
  const showNextDiagram = (): void => {
@@ -109,19 +132,27 @@ export const DataSpaceDiagramViewer = observer(
109
132
  if (idx === analysisResult.diagrams.length - 1 || idx === -1) {
110
133
  return;
111
134
  }
112
- dataSpaceViewerState.setCurrentDiagram(
113
- guaranteeNonNullable(analysisResult.diagrams[idx + 1]),
135
+ const nextDiagram = guaranteeNonNullable(
136
+ analysisResult.diagrams[idx + 1],
137
+ );
138
+ dataSpaceViewerState.setCurrentDiagram(nextDiagram);
139
+ dataSpaceViewerState.syncZoneWithNavigation(
140
+ generateAnchorForDiagram(nextDiagram),
114
141
  );
115
142
  };
116
143
 
117
144
  return (
118
- <div className="data-space__viewer__wiki__section">
145
+ <div ref={sectionRef} className="data-space__viewer__wiki__section">
119
146
  <div className="data-space__viewer__wiki__section__header">
120
147
  <div className="data-space__viewer__wiki__section__header__label">
121
148
  Diagrams
122
- <div className="data-space__viewer__wiki__section__header__anchor">
149
+ <button
150
+ className="data-space__viewer__wiki__section__header__anchor"
151
+ tabIndex={-1}
152
+ onClick={() => dataSpaceViewerState.changeZone(anchor, true)}
153
+ >
123
154
  <AnchorLinkIcon />
124
- </div>
155
+ </button>
125
156
  </div>
126
157
  </div>
127
158
  <div className="data-space__viewer__wiki__section__content">
@@ -143,7 +174,7 @@ export const DataSpaceDiagramViewer = observer(
143
174
  tabIndex={-1}
144
175
  title="Previous"
145
176
  disabled={
146
- getNullableFirstElement(analysisResult.diagrams) ===
177
+ getNullableFirstEntry(analysisResult.diagrams) ===
147
178
  dataSpaceViewerState.currentDiagram
148
179
  }
149
180
  onClick={showPreviousDiagram}
@@ -155,7 +186,7 @@ export const DataSpaceDiagramViewer = observer(
155
186
  tabIndex={-1}
156
187
  title="Next"
157
188
  disabled={
158
- getNullableLastElement(analysisResult.diagrams) ===
189
+ getNullableLastEntry(analysisResult.diagrams) ===
159
190
  dataSpaceViewerState.currentDiagram
160
191
  }
161
192
  onClick={showNextDiagram}
@@ -174,9 +205,12 @@ export const DataSpaceDiagramViewer = observer(
174
205
  dataSpaceViewerState.currentDiagram === diagram,
175
206
  },
176
207
  )}
177
- onClick={() =>
178
- dataSpaceViewerState.setCurrentDiagram(diagram)
179
- }
208
+ onClick={() => {
209
+ dataSpaceViewerState.setCurrentDiagram(diagram);
210
+ dataSpaceViewerState.syncZoneWithNavigation(
211
+ generateAnchorForDiagram(diagram),
212
+ );
213
+ }}
180
214
  >
181
215
  <CircleIcon />
182
216
  </button>
@@ -41,7 +41,11 @@ import {
41
41
  CaretRightIcon,
42
42
  CaretLeftIcon,
43
43
  } from '@finos/legend-art';
44
- import { type DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
44
+ import {
45
+ DATA_SPACE_VIEWER_ACTIVITY_MODE,
46
+ generateAnchorForActivity,
47
+ type DataSpaceViewerState,
48
+ } from '../stores/DataSpaceViewerState.js';
45
49
  import { DataSpaceWikiPlaceholder } from './DataSpacePlaceholder.js';
46
50
  import {
47
51
  DataSpaceAssociationDocumentationEntry,
@@ -61,7 +65,7 @@ import {
61
65
  PROPERTY_ACCESSOR,
62
66
  getMultiplicityDescription,
63
67
  } from '@finos/legend-graph';
64
- import { useMemo, useRef } from 'react';
68
+ import { useEffect, useMemo, useRef } from 'react';
65
69
  import {
66
70
  type ModelsDocumentationFilterTreeNodeData,
67
71
  type DataSpaceViewerModelsDocumentationState,
@@ -1031,22 +1035,42 @@ const DataSpaceModelsDocumentationSearchBar = observer(
1031
1035
  export const DataSpaceModelsDocumentation = observer(
1032
1036
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
1033
1037
  const { dataSpaceViewerState } = props;
1038
+ const sectionRef = useRef<HTMLDivElement>(null);
1039
+ const anchor = generateAnchorForActivity(
1040
+ DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_DOCUMENTATION,
1041
+ );
1042
+
1043
+ useEffect(() => {
1044
+ if (sectionRef.current) {
1045
+ dataSpaceViewerState.layoutState.setWikiPageAnchor(
1046
+ anchor,
1047
+ sectionRef.current,
1048
+ );
1049
+ }
1050
+ return () => dataSpaceViewerState.layoutState.unsetWikiPageAnchor(anchor);
1051
+ }, [dataSpaceViewerState, anchor]);
1052
+
1034
1053
  const documentationEntries =
1035
1054
  dataSpaceViewerState.dataSpaceAnalysisResult.elementDocs;
1036
1055
  const documentationState = dataSpaceViewerState.modelsDocumentationState;
1056
+
1037
1057
  const toggleFilterPanel = (): void =>
1038
1058
  documentationState.setShowFilterPanel(
1039
1059
  !documentationState.showFilterPanel,
1040
1060
  );
1041
1061
 
1042
1062
  return (
1043
- <div className="data-space__viewer__wiki__section">
1063
+ <div ref={sectionRef} className="data-space__viewer__wiki__section">
1044
1064
  <div className="data-space__viewer__wiki__section__header">
1045
1065
  <div className="data-space__viewer__wiki__section__header__label">
1046
1066
  Models Documentation
1047
- <div className="data-space__viewer__wiki__section__header__anchor">
1067
+ <button
1068
+ className="data-space__viewer__wiki__section__header__anchor"
1069
+ tabIndex={-1}
1070
+ onClick={() => dataSpaceViewerState.changeZone(anchor, true)}
1071
+ >
1048
1072
  <AnchorLinkIcon />
1049
- </div>
1073
+ </button>
1050
1074
  </div>
1051
1075
  </div>
1052
1076
  <div className="data-space__viewer__wiki__section__content">