@finos/legend-application 3.0.3 → 4.0.2

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 (176) 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/LegendApplicationPluginManager.d.ts +3 -3
  6. package/lib/application/LegendApplicationPluginManager.d.ts.map +1 -1
  7. package/lib/components/ActionAlert.d.ts +1 -0
  8. package/lib/components/ActionAlert.d.ts.map +1 -1
  9. package/lib/components/ActionAlert.js +2 -2
  10. package/lib/components/ActionAlert.js.map +1 -1
  11. package/lib/components/ApplicationStoreProvider.d.ts +3 -3
  12. package/lib/components/ApplicationStoreProvider.d.ts.map +1 -1
  13. package/lib/components/ApplicationStoreProvider.js +2 -2
  14. package/lib/components/ApplicationStoreProvider.js.map +1 -1
  15. package/lib/components/ApplicationStoreProviderTestUtils.d.ts +5 -5
  16. package/lib/components/ApplicationStoreProviderTestUtils.d.ts.map +1 -1
  17. package/lib/components/ApplicationStoreProviderTestUtils.js +5 -4
  18. package/lib/components/ApplicationStoreProviderTestUtils.js.map +1 -1
  19. package/lib/components/ApplicationTestID.js +1 -1
  20. package/lib/components/ApplicationTestID.js.map +1 -1
  21. package/lib/components/BasicValueSpecificationEditor.d.ts +44 -0
  22. package/lib/components/BasicValueSpecificationEditor.d.ts.map +1 -0
  23. package/lib/components/BasicValueSpecificationEditor.js +276 -0
  24. package/lib/components/BasicValueSpecificationEditor.js.map +1 -0
  25. package/lib/components/BlockingAlert.d.ts +1 -0
  26. package/lib/components/BlockingAlert.d.ts.map +1 -1
  27. package/lib/components/BlockingAlert.js +1 -1
  28. package/lib/components/BlockingAlert.js.map +1 -1
  29. package/lib/components/CustomDatePicker.d.ts +38 -0
  30. package/lib/components/CustomDatePicker.d.ts.map +1 -0
  31. package/lib/components/CustomDatePicker.js +592 -0
  32. package/lib/components/CustomDatePicker.js.map +1 -0
  33. package/lib/components/DocumentationLink.d.ts +1 -1
  34. package/lib/components/DocumentationLink.js +2 -2
  35. package/lib/components/DocumentationLink.js.map +1 -1
  36. package/lib/components/LambdaEditor.d.ts +2 -1
  37. package/lib/components/LambdaEditor.d.ts.map +1 -1
  38. package/lib/components/LambdaEditor.js +3 -3
  39. package/lib/components/LambdaEditor.js.map +1 -1
  40. package/lib/components/LambdaParameterValuesEditor.d.ts +25 -0
  41. package/lib/components/LambdaParameterValuesEditor.d.ts.map +1 -0
  42. package/lib/components/LambdaParameterValuesEditor.js +52 -0
  43. package/lib/components/LambdaParameterValuesEditor.js.map +1 -0
  44. package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts +1 -1
  45. package/lib/components/LegendApplicationComponentFrameworkProvider.js +3 -3
  46. package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +1 -1
  47. package/lib/components/LegendApplicationNavigationContextServiceUtils.d.ts +32 -0
  48. package/lib/components/LegendApplicationNavigationContextServiceUtils.d.ts.map +1 -0
  49. package/lib/components/LegendApplicationNavigationContextServiceUtils.js +57 -0
  50. package/lib/components/LegendApplicationNavigationContextServiceUtils.js.map +1 -0
  51. package/lib/components/NotificationManager.d.ts +1 -0
  52. package/lib/components/NotificationManager.d.ts.map +1 -1
  53. package/lib/components/NotificationManager.js +2 -2
  54. package/lib/components/NotificationManager.js.map +1 -1
  55. package/lib/components/TextInputEditor.d.ts +2 -2
  56. package/lib/components/TextInputEditor.d.ts.map +1 -1
  57. package/lib/components/TextInputEditor.js +2 -2
  58. package/lib/components/TextInputEditor.js.map +1 -1
  59. package/lib/components/{AppHeader.d.ts → VirtualAssistant.d.ts} +5 -5
  60. package/lib/components/VirtualAssistant.d.ts.map +1 -0
  61. package/lib/components/VirtualAssistant.js +171 -0
  62. package/lib/components/VirtualAssistant.js.map +1 -0
  63. package/lib/components/WebApplicationNavigatorProvider.d.ts +2 -2
  64. package/lib/components/WebApplicationNavigatorProvider.d.ts.map +1 -1
  65. package/lib/components/WebApplicationNavigatorProvider.js +1 -1
  66. package/lib/components/WebApplicationNavigatorProvider.js.map +1 -1
  67. package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts +2 -2
  68. package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts.map +1 -1
  69. package/lib/components/WebApplicationNavigatorProviderTestUtils.js +3 -2
  70. package/lib/components/WebApplicationNavigatorProviderTestUtils.js.map +1 -1
  71. package/lib/const.js +2 -2
  72. package/lib/const.js.map +1 -1
  73. package/lib/index.css +2 -2
  74. package/lib/index.css.map +1 -1
  75. package/lib/index.d.ts +30 -22
  76. package/lib/index.d.ts.map +1 -1
  77. package/lib/index.js +32 -22
  78. package/lib/index.js.map +1 -1
  79. package/lib/stores/ApplicationEvent.d.ts +9 -7
  80. package/lib/stores/ApplicationEvent.d.ts.map +1 -1
  81. package/lib/stores/ApplicationEvent.js +10 -8
  82. package/lib/stores/ApplicationEvent.js.map +1 -1
  83. package/lib/stores/ApplicationStore.d.ts +15 -9
  84. package/lib/stores/ApplicationStore.d.ts.map +1 -1
  85. package/lib/stores/ApplicationStore.js +26 -21
  86. package/lib/stores/ApplicationStore.js.map +1 -1
  87. package/lib/stores/ApplicationStoreTestUtils.d.ts +3 -3
  88. package/lib/stores/ApplicationStoreTestUtils.d.ts.map +1 -1
  89. package/lib/stores/ApplicationStoreTestUtils.js +2 -2
  90. package/lib/stores/ApplicationStoreTestUtils.js.map +1 -1
  91. package/lib/stores/ApplicationTelemetry.d.ts +1 -1
  92. package/lib/stores/ApplicationTelemetry.d.ts.map +1 -1
  93. package/lib/stores/ApplicationTelemetry.js +2 -2
  94. package/lib/stores/ApplicationTelemetry.js.map +1 -1
  95. package/lib/stores/CJS__Fuse.cjs +35 -0
  96. package/lib/stores/CJS__Fuse.cjs.map +1 -0
  97. package/lib/stores/CJS__Fuse.d.cts +28 -0
  98. package/lib/stores/CJS__Fuse.d.cts.map +1 -0
  99. package/lib/stores/LambdaParameterState.d.ts +59 -0
  100. package/lib/stores/LambdaParameterState.d.ts.map +1 -0
  101. package/lib/stores/LambdaParameterState.js +184 -0
  102. package/lib/stores/LambdaParameterState.js.map +1 -0
  103. package/lib/stores/LegendApplicationAssistantService.d.ts +63 -0
  104. package/lib/stores/LegendApplicationAssistantService.d.ts.map +1 -0
  105. package/lib/stores/LegendApplicationAssistantService.js +167 -0
  106. package/lib/stores/LegendApplicationAssistantService.js.map +1 -0
  107. package/lib/stores/LegendApplicationConfig.d.ts +5 -4
  108. package/lib/stores/LegendApplicationConfig.d.ts.map +1 -1
  109. package/lib/stores/LegendApplicationConfig.js +8 -3
  110. package/lib/stores/LegendApplicationConfig.js.map +1 -1
  111. package/lib/stores/LegendApplicationDocumentationService.d.ts +70 -0
  112. package/lib/stores/LegendApplicationDocumentationService.d.ts.map +1 -0
  113. package/lib/stores/LegendApplicationDocumentationService.js +152 -0
  114. package/lib/stores/LegendApplicationDocumentationService.js.map +1 -0
  115. package/lib/stores/LegendApplicationEventService.d.ts +22 -0
  116. package/lib/stores/LegendApplicationEventService.d.ts.map +1 -0
  117. package/lib/stores/LegendApplicationEventService.js +25 -0
  118. package/lib/stores/LegendApplicationEventService.js.map +1 -0
  119. package/lib/stores/LegendApplicationNavigationContextService.d.ts +74 -0
  120. package/lib/stores/LegendApplicationNavigationContextService.d.ts.map +1 -0
  121. package/lib/stores/LegendApplicationNavigationContextService.js +118 -0
  122. package/lib/stores/LegendApplicationNavigationContextService.js.map +1 -0
  123. package/lib/stores/LegendApplicationPlugin.d.ts +6 -2
  124. package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
  125. package/lib/stores/LegendApplicationPlugin.js.map +1 -1
  126. package/lib/stores/PureLanguageSupport.d.ts.map +1 -1
  127. package/lib/stores/PureLanguageSupport.js +8 -2
  128. package/lib/stores/PureLanguageSupport.js.map +1 -1
  129. package/lib/stores/ValueSpecificationModifierHelper.d.ts +27 -0
  130. package/lib/stores/ValueSpecificationModifierHelper.d.ts.map +1 -0
  131. package/lib/stores/ValueSpecificationModifierHelper.js +49 -0
  132. package/lib/stores/ValueSpecificationModifierHelper.js.map +1 -0
  133. package/package.json +24 -18
  134. package/src/application/LegendApplication.tsx +6 -6
  135. package/src/application/LegendApplicationPluginManager.tsx +3 -3
  136. package/src/components/ActionAlert.tsx +2 -2
  137. package/src/components/ApplicationStoreProvider.tsx +4 -4
  138. package/src/components/ApplicationStoreProviderTestUtils.tsx +7 -6
  139. package/src/components/BasicValueSpecificationEditor.tsx +703 -0
  140. package/src/components/BlockingAlert.tsx +1 -1
  141. package/src/components/CustomDatePicker.tsx +1235 -0
  142. package/src/components/DocumentationLink.tsx +2 -2
  143. package/src/components/LambdaEditor.tsx +4 -4
  144. package/src/components/LambdaParameterValuesEditor.tsx +114 -0
  145. package/src/components/LegendApplicationComponentFrameworkProvider.tsx +3 -3
  146. package/src/components/LegendApplicationNavigationContextServiceUtils.tsx +63 -0
  147. package/src/components/NotificationManager.tsx +2 -2
  148. package/src/components/TextInputEditor.tsx +2 -2
  149. package/src/components/VirtualAssistant.tsx +600 -0
  150. package/src/components/WebApplicationNavigatorProvider.tsx +1 -1
  151. package/src/components/WebApplicationNavigatorProviderTestUtils.tsx +3 -2
  152. package/src/index.ts +39 -28
  153. package/src/stores/ApplicationEvent.ts +11 -7
  154. package/src/stores/ApplicationStore.ts +29 -27
  155. package/src/stores/ApplicationStoreTestUtils.ts +4 -4
  156. package/src/stores/ApplicationTelemetry.ts +2 -2
  157. package/src/stores/CJS__Fuse.cts +28 -0
  158. package/src/stores/LambdaParameterState.ts +314 -0
  159. package/src/stores/LegendApplicationAssistantService.ts +218 -0
  160. package/src/stores/LegendApplicationConfig.ts +20 -6
  161. package/src/stores/LegendApplicationDocumentationService.ts +276 -0
  162. package/src/stores/LegendApplicationEventService.ts +32 -0
  163. package/src/stores/LegendApplicationNavigationContextService.ts +131 -0
  164. package/src/stores/LegendApplicationPlugin.ts +10 -2
  165. package/src/stores/PureLanguageSupport.ts +8 -2
  166. package/src/stores/ValueSpecificationModifierHelper.ts +104 -0
  167. package/tsconfig.json +18 -12
  168. package/lib/components/AppHeader.d.ts.map +0 -1
  169. package/lib/components/AppHeader.js +0 -26
  170. package/lib/components/AppHeader.js.map +0 -1
  171. package/lib/stores/LegendApplicationDocumentationRegistry.d.ts +0 -36
  172. package/lib/stores/LegendApplicationDocumentationRegistry.d.ts.map +0 -1
  173. package/lib/stores/LegendApplicationDocumentationRegistry.js +0 -47
  174. package/lib/stores/LegendApplicationDocumentationRegistry.js.map +0 -1
  175. package/src/components/AppHeader.tsx +0 -49
  176. package/src/stores/LegendApplicationDocumentationRegistry.ts +0 -81
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { CollectionInstanceValue, Enumeration, EnumValueExplicitReference, EnumValueInstanceValue, GenericType, GenericTypeExplicitReference, getEnumValue, observe_ValueSpecification, observe_VariableExpression, PrimitiveInstanceValue, PrimitiveType, PRIMITIVE_TYPE, VariableExpression, LambdaFunction, TYPICAL_MULTIPLICITY_TYPE, CORE_PURE_PATH, FunctionType, SimpleFunctionExpression, SUPPORTED_FUNCTIONS, extractElementNameFromPath, } from '@finos/legend-graph';
17
+ import { addUniqueEntry, deleteEntry, IllegalStateError, isNonNullable, Randomizer, uuid, } from '@finos/legend-shared';
18
+ import { makeObservable, observable, action } from 'mobx';
19
+ import { genericType_setRawType, multiplicity_setLowerBound, multiplicity_setUpperBound, } from './ValueSpecificationModifierHelper.js';
20
+ import { format, addDays } from 'date-fns';
21
+ import { DATE_FORMAT, DATE_TIME_FORMAT } from '../const.js';
22
+ export var PARAMETER_SUBMIT_ACTION;
23
+ (function (PARAMETER_SUBMIT_ACTION) {
24
+ PARAMETER_SUBMIT_ACTION["EXECUTE"] = "EXECUTE";
25
+ PARAMETER_SUBMIT_ACTION["EXPORT"] = "EXPORT";
26
+ })(PARAMETER_SUBMIT_ACTION = PARAMETER_SUBMIT_ACTION || (PARAMETER_SUBMIT_ACTION = {}));
27
+ export const createMockEnumerationProperty = (enumeration) => new Randomizer().getRandomItemInCollection(enumeration.values)?.name ?? '';
28
+ const createMockPrimitiveProperty = (primitiveType, propertyName) => {
29
+ const randomizer = new Randomizer();
30
+ switch (primitiveType.name) {
31
+ case PRIMITIVE_TYPE.BOOLEAN:
32
+ return randomizer.getRandomItemInCollection([true, false]) ?? true;
33
+ case PRIMITIVE_TYPE.FLOAT:
34
+ return randomizer.getRandomFloat();
35
+ case PRIMITIVE_TYPE.DECIMAL:
36
+ return randomizer.getRandomDouble();
37
+ case PRIMITIVE_TYPE.NUMBER:
38
+ case PRIMITIVE_TYPE.INTEGER:
39
+ return randomizer.getRandomWholeNumber(100);
40
+ // NOTE that `Date` is the umbrella type that comprises `StrictDate` and `DateTime`, but for simplicity, we will generate `Date` as `StrictDate`
41
+ case PRIMITIVE_TYPE.DATE:
42
+ case PRIMITIVE_TYPE.STRICTDATE:
43
+ return format(randomizer.getRandomDate(new Date(Date.now()), addDays(Date.now(), 100)), DATE_FORMAT);
44
+ case PRIMITIVE_TYPE.DATETIME:
45
+ return format(randomizer.getRandomDate(new Date(Date.now()), addDays(Date.now(), 100)), DATE_TIME_FORMAT);
46
+ case PRIMITIVE_TYPE.STRING:
47
+ default:
48
+ return `${propertyName} ${randomizer.getRandomWholeNumber(100)}`;
49
+ }
50
+ };
51
+ export const buildParametersLetLambdaFunc = (graph, lambdaParametersStates) => {
52
+ const multiplicityOne = graph.getTypicalMultiplicity(TYPICAL_MULTIPLICITY_TYPE.ONE);
53
+ const typeString = graph.getPrimitiveType(PRIMITIVE_TYPE.STRING);
54
+ const typeAny = graph.getType(CORE_PURE_PATH.ANY);
55
+ const letlambdaFunction = new LambdaFunction(new FunctionType(typeAny, multiplicityOne));
56
+ letlambdaFunction.expressionSequence = lambdaParametersStates
57
+ .map((queryParamState) => {
58
+ if (queryParamState.value) {
59
+ const letFunc = new SimpleFunctionExpression(extractElementNameFromPath(SUPPORTED_FUNCTIONS.LET), multiplicityOne);
60
+ const letVar = new PrimitiveInstanceValue(GenericTypeExplicitReference.create(new GenericType(typeString)), multiplicityOne);
61
+ letVar.values = [queryParamState.variableName];
62
+ letFunc.parametersValues.push(letVar);
63
+ letFunc.parametersValues.push(queryParamState.value);
64
+ return letFunc;
65
+ }
66
+ return undefined;
67
+ })
68
+ .filter(isNonNullable);
69
+ return letlambdaFunction;
70
+ };
71
+ export class LambdaParameterState {
72
+ uuid = uuid();
73
+ parameter;
74
+ observableContext;
75
+ value;
76
+ constructor(variableExpression, observableContext) {
77
+ makeObservable(this, {
78
+ value: observable,
79
+ setValue: action,
80
+ mockParameterValue: action,
81
+ });
82
+ this.observableContext = observableContext;
83
+ this.parameter = observe_VariableExpression(variableExpression);
84
+ }
85
+ mockParameterValue() {
86
+ this.setValue(this.generateMockValues(this.parameter.genericType?.value.rawType, this.parameter.multiplicity));
87
+ }
88
+ generateMockValues(varType, multiplicity) {
89
+ if ((!multiplicity.upperBound || multiplicity.upperBound > 1) && varType) {
90
+ return new CollectionInstanceValue(multiplicity, GenericTypeExplicitReference.create(new GenericType(varType)));
91
+ }
92
+ if (varType instanceof PrimitiveType) {
93
+ const primitiveInst = new PrimitiveInstanceValue(GenericTypeExplicitReference.create(new GenericType(varType)), multiplicity);
94
+ primitiveInst.values = [
95
+ createMockPrimitiveProperty(varType, this.parameter.name === '' ? 'myVar' : this.parameter.name),
96
+ ];
97
+ return primitiveInst;
98
+ }
99
+ else if (varType instanceof Enumeration) {
100
+ const enumValueInstance = new EnumValueInstanceValue(GenericTypeExplicitReference.create(new GenericType(varType)), multiplicity);
101
+ const mock = createMockEnumerationProperty(varType);
102
+ if (mock !== '') {
103
+ enumValueInstance.values = [
104
+ EnumValueExplicitReference.create(getEnumValue(varType, mock)),
105
+ ];
106
+ }
107
+ return enumValueInstance;
108
+ }
109
+ return undefined;
110
+ }
111
+ setValue(value) {
112
+ if (value instanceof VariableExpression) {
113
+ throw new IllegalStateError('Can not assign a parameter to another parameter');
114
+ }
115
+ this.value = value
116
+ ? observe_ValueSpecification(value, this.observableContext)
117
+ : undefined;
118
+ }
119
+ changeVariableType(type) {
120
+ if (type !== this.variableType) {
121
+ const genricType = this.parameter.genericType?.value;
122
+ if (genricType) {
123
+ genericType_setRawType(genricType, type);
124
+ }
125
+ this.mockParameterValue();
126
+ }
127
+ }
128
+ changeMultiplicity(lowerBound, uppderBound) {
129
+ const current = this.parameter.multiplicity;
130
+ if (current.lowerBound !== lowerBound ||
131
+ current.upperBound !== uppderBound) {
132
+ multiplicity_setLowerBound(current, lowerBound);
133
+ multiplicity_setUpperBound(current, uppderBound);
134
+ this.mockParameterValue();
135
+ }
136
+ }
137
+ get variableName() {
138
+ return this.parameter.name;
139
+ }
140
+ get variableType() {
141
+ return this.parameter.genericType?.value.rawType;
142
+ }
143
+ }
144
+ export class ParameterInstanceValuesEditorState {
145
+ showModal = false;
146
+ submitAction;
147
+ constructor() {
148
+ makeObservable(this, {
149
+ showModal: observable,
150
+ submitAction: observable,
151
+ setShowModal: action,
152
+ open: action,
153
+ setSubmitAction: action,
154
+ });
155
+ }
156
+ setShowModal(val) {
157
+ this.showModal = val;
158
+ }
159
+ setSubmitAction(val) {
160
+ this.submitAction = val;
161
+ }
162
+ open(handler, label) {
163
+ this.setSubmitAction({ handler, label });
164
+ this.setShowModal(true);
165
+ }
166
+ close() {
167
+ this.setSubmitAction(undefined);
168
+ this.setShowModal(false);
169
+ }
170
+ }
171
+ export class LambdaParametersState {
172
+ parameterStates = [];
173
+ parameterValuesEditorState = new ParameterInstanceValuesEditorState();
174
+ addParameter(val) {
175
+ addUniqueEntry(this.parameterStates, val);
176
+ }
177
+ removeParameter(val) {
178
+ deleteEntry(this.parameterStates, val);
179
+ }
180
+ setParameters(val) {
181
+ this.parameterStates = val;
182
+ }
183
+ }
184
+ //# sourceMappingURL=LambdaParameterState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaParameterState.js","sourceRoot":"","sources":["../../src/stores/LambdaParameterState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,4BAA4B,EAC5B,YAAY,EACZ,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,4CAAiB,CAAA;AACnB,CAAC,EAHW,uBAAuB,GAAvB,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED,MAAM,C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AC5C,CAAC;IAED,eAAe,CAAC,GAAyB;QACvC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,aAAa,CAAC,GAA2B;QACvC,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { LegendApplicationContextualDocumentationEntry, LegendApplicationDocumentationEntry } from './LegendApplicationDocumentationService.js';
17
+ import type { LegendApplicationConfig } from './LegendApplicationConfig.js';
18
+ import type { ApplicationStore } from './ApplicationStore.js';
19
+ import { type MarkdownText, ActionState } from '@finos/legend-shared';
20
+ export declare enum VIRTUAL_ASSISTANT_TAB {
21
+ SEARCH = "SEARCH",
22
+ CONTEXTUAL_SUPPORT = "CONTEXTUAL_SUPPORT"
23
+ }
24
+ export declare class VirtualAssistantDocumentationEntry {
25
+ uuid: string;
26
+ documentationKey: string;
27
+ title: string;
28
+ content?: string | MarkdownText | undefined;
29
+ url?: string | undefined;
30
+ isOpen: boolean;
31
+ constructor(docEntry: LegendApplicationDocumentationEntry);
32
+ setIsOpen(val: boolean): void;
33
+ }
34
+ export declare class VirtualAssistantContextualDocumentationEntry {
35
+ uuid: string;
36
+ context: string;
37
+ title?: string | undefined;
38
+ content?: string | MarkdownText | undefined;
39
+ url?: string | undefined;
40
+ related: VirtualAssistantDocumentationEntry[];
41
+ constructor(contextualDocEntry: LegendApplicationContextualDocumentationEntry, related: VirtualAssistantDocumentationEntry[]);
42
+ }
43
+ export declare class LegendApplicationAssistantService {
44
+ readonly applicationStore: ApplicationStore<LegendApplicationConfig>;
45
+ private readonly searchEngine;
46
+ isHidden: boolean;
47
+ isOpen: boolean;
48
+ selectedTab: VIRTUAL_ASSISTANT_TAB;
49
+ searchResults: VirtualAssistantDocumentationEntry[];
50
+ searchState: ActionState;
51
+ searchText: string;
52
+ constructor(applicationStore: ApplicationStore<LegendApplicationConfig>);
53
+ get currentContextualDocumentationEntry(): VirtualAssistantContextualDocumentationEntry | undefined;
54
+ setIsHidden(val: boolean): void;
55
+ hideAssistant(): void;
56
+ toggleAssistant(): void;
57
+ setIsOpen(val: boolean): void;
58
+ setSelectedTab(val: VIRTUAL_ASSISTANT_TAB): void;
59
+ setSearchText(val: string): void;
60
+ resetSearch(): void;
61
+ search(): void;
62
+ }
63
+ //# sourceMappingURL=LegendApplicationAssistantService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendApplicationAssistantService.d.ts","sourceRoot":"","sources":["../../src/stores/LegendApplicationAssistantService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,6CAA6C,EAC7C,mCAAmC,EACpC,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,KAAK,YAAY,EAIjB,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B,oBAAY,qBAAqB;IAC/B,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;CAC1C;AAED,qBAAa,kCAAkC;IAC7C,IAAI,SAAU;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAC5C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 *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { action, makeObservable, observable, computed } from 'mobx';
17
+ import { Fuse } from './CJS__Fuse.cjs';
18
+ import { guaranteeNonEmptyString, uuid, isNonNullable, ActionState, } from '@finos/legend-shared';
19
+ export var VIRTUAL_ASSISTANT_TAB;
20
+ (function (VIRTUAL_ASSISTANT_TAB) {
21
+ VIRTUAL_ASSISTANT_TAB["SEARCH"] = "SEARCH";
22
+ VIRTUAL_ASSISTANT_TAB["CONTEXTUAL_SUPPORT"] = "CONTEXTUAL_SUPPORT";
23
+ })(VIRTUAL_ASSISTANT_TAB = VIRTUAL_ASSISTANT_TAB || (VIRTUAL_ASSISTANT_TAB = {}));
24
+ export class VirtualAssistantDocumentationEntry {
25
+ uuid = uuid();
26
+ documentationKey;
27
+ title;
28
+ content;
29
+ url;
30
+ isOpen = false;
31
+ constructor(docEntry) {
32
+ makeObservable(this, {
33
+ isOpen: observable,
34
+ setIsOpen: action,
35
+ });
36
+ this.documentationKey = docEntry._documentationKey;
37
+ this.title = guaranteeNonEmptyString(docEntry.title);
38
+ this.content = docEntry.markdownText ?? docEntry.text;
39
+ this.url = docEntry.url;
40
+ }
41
+ setIsOpen(val) {
42
+ this.isOpen = val;
43
+ }
44
+ }
45
+ export class VirtualAssistantContextualDocumentationEntry {
46
+ uuid = uuid();
47
+ context;
48
+ title;
49
+ content;
50
+ url;
51
+ related;
52
+ constructor(contextualDocEntry, related) {
53
+ this.context = contextualDocEntry._context;
54
+ this.title = contextualDocEntry.title;
55
+ this.content = contextualDocEntry.markdownText ?? contextualDocEntry.text;
56
+ this.url = contextualDocEntry.url;
57
+ this.related = related;
58
+ }
59
+ }
60
+ export class LegendApplicationAssistantService {
61
+ applicationStore;
62
+ searchEngine;
63
+ isHidden = false;
64
+ isOpen = false;
65
+ selectedTab = VIRTUAL_ASSISTANT_TAB.SEARCH;
66
+ searchResults = [];
67
+ searchState = ActionState.create().pass();
68
+ searchText = '';
69
+ constructor(applicationStore) {
70
+ makeObservable(this, {
71
+ isHidden: observable,
72
+ isOpen: observable,
73
+ selectedTab: observable,
74
+ searchText: observable,
75
+ searchResults: observable,
76
+ currentContextualDocumentationEntry: computed,
77
+ setIsHidden: action,
78
+ setIsOpen: action,
79
+ setSelectedTab: action,
80
+ setSearchText: action,
81
+ resetSearch: action,
82
+ search: action,
83
+ });
84
+ this.applicationStore = applicationStore;
85
+ this.searchEngine = new Fuse(this.applicationStore.documentationService.getAllDocEntries().filter((entry) =>
86
+ // NOTE: since we're searching for user-friendly docs, we will discard anything that
87
+ // doesn't come with a title, or does not have any content/url
88
+ entry.title && (entry.url ?? entry.text ?? entry.markdownText)), {
89
+ includeScore: true,
90
+ shouldSort: true,
91
+ // Ignore location when computing the search score
92
+ // See https://fusejs.io/concepts/scoring-theory.html
93
+ ignoreLocation: true,
94
+ // This specifies the point the search gives up
95
+ // `0.0` means exact match where `1.0` would match anything
96
+ // We set a relatively low threshold to filter out irrelevant results
97
+ threshold: 0.2,
98
+ keys: [
99
+ {
100
+ // NOTE: for now, we would weight title the most
101
+ name: 'title',
102
+ weight: 4,
103
+ },
104
+ {
105
+ name: 'text',
106
+ weight: 1,
107
+ },
108
+ {
109
+ name: 'markdownText.value',
110
+ weight: 1,
111
+ },
112
+ ],
113
+ });
114
+ }
115
+ get currentContextualDocumentationEntry() {
116
+ const currentContextualDocumentationEntry = this.applicationStore
117
+ .navigationContextService.currentContext
118
+ ? this.applicationStore.documentationService.getContextualDocEntry(this.applicationStore.navigationContextService.currentContext.value)
119
+ : undefined;
120
+ return currentContextualDocumentationEntry
121
+ ? new VirtualAssistantContextualDocumentationEntry(currentContextualDocumentationEntry, currentContextualDocumentationEntry.related
122
+ .map((entry) => this.applicationStore.documentationService.getDocEntry(entry))
123
+ .filter(isNonNullable)
124
+ .filter((entry) =>
125
+ // NOTE: since we're searching for user-friendly docs, we will discard anything that
126
+ // doesn't come with a title, or does not have any content/url
127
+ entry.title && (entry.url ?? entry.text ?? entry.markdownText))
128
+ .map((entry) => new VirtualAssistantDocumentationEntry(entry)))
129
+ : undefined;
130
+ }
131
+ setIsHidden(val) {
132
+ this.isHidden = val;
133
+ }
134
+ hideAssistant() {
135
+ this.setIsHidden(true);
136
+ this.setIsOpen(false);
137
+ }
138
+ toggleAssistant() {
139
+ const newVal = !this.isHidden;
140
+ if (newVal) {
141
+ this.hideAssistant();
142
+ }
143
+ else {
144
+ this.setIsHidden(false);
145
+ }
146
+ }
147
+ setIsOpen(val) {
148
+ this.isOpen = val;
149
+ }
150
+ setSelectedTab(val) {
151
+ this.selectedTab = val;
152
+ }
153
+ setSearchText(val) {
154
+ this.searchText = val;
155
+ }
156
+ resetSearch() {
157
+ this.searchText = '';
158
+ this.searchResults = [];
159
+ this.searchState.complete();
160
+ }
161
+ search() {
162
+ this.searchState.inProgress();
163
+ this.searchResults = Array.from(this.searchEngine.search(this.searchText).values()).map((result) => new VirtualAssistantDocumentationEntry(result.item));
164
+ this.searchState.complete();
165
+ }
166
+ }
167
+ //# sourceMappingURL=LegendApplicationAssistantService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendApplicationAssistantService.js","sourceRoot":"","sources":["../../src/stores/LegendApplicationAssistantService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAOpE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAEL,uBAAuB,EACvB,IAAI,EACJ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IAED,aAAa;QACX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,eAAe;QACb,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,aAAa,EAAE,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACzB;IACH,CAAC;IAED,SAAS,CAAC,GAAY;QACpB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAED,cAAc,CAAC,GAA0B;QACvC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,aAAa,CAAC,GAAW;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,WAAW;QACT,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QAC9B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAC7B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CACnD,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACF"}
@@ -13,8 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { type PlainObject } from '@finos/legend-shared';
17
- import { type LegendApplicationKeyedDocumentationEntry, type LegendApplicationDocumentationEntry } from './LegendApplicationDocumentationRegistry';
16
+ import { type LegendApplicationKeyedDocumentationEntry, type LegendApplicationDocumentationEntryConfig, type LegendApplicationKeyedContextualDocumentationEntry, type LegendApplicationContextualDocumentationEntryConfig } from './LegendApplicationDocumentationService.js';
18
17
  export interface LegendApplicationVersionData {
19
18
  buildTime: string;
20
19
  version: string;
@@ -25,7 +24,8 @@ export interface LegendApplicationConfigurationData {
25
24
  env: string;
26
25
  documentation?: {
27
26
  url: string;
28
- entries?: Record<string, PlainObject<LegendApplicationDocumentationEntry>>;
27
+ entries?: Record<string, LegendApplicationDocumentationEntryConfig>;
28
+ contextualEntries?: Record<string, LegendApplicationContextualDocumentationEntryConfig>;
29
29
  };
30
30
  extensions?: Record<PropertyKey, unknown>;
31
31
  }
@@ -34,7 +34,8 @@ export declare abstract class LegendApplicationConfig {
34
34
  readonly baseUrl: string;
35
35
  readonly env: string;
36
36
  readonly documentationUrl: string | undefined;
37
- readonly documentationKeyedEntries: LegendApplicationKeyedDocumentationEntry[];
37
+ readonly keyedDocumentationEntries: LegendApplicationKeyedDocumentationEntry[];
38
+ readonly keyedContextualDocumentationEntries: LegendApplicationKeyedContextualDocumentationEntry[];
38
39
  readonly appVersion: string;
39
40
  readonly appVersionBuildTime: string;
40
41
  readonly appVersionCommitId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"LegendApplicationConfig.d.ts","sourceRoot":"","sources":["../../src/stores/LegendApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,EAEzC,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kCAAkC;IACjD,OAA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,CAAC,EAAE;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yCAAyC,CAAC,CAAC;QACpE,iBAAiB,CAAC,EAAE,MAAM,CACxB,MAAM,EACN,mDAAmD,CACpD,CAAC;KACH,CAAC;IAIF,UAAU,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,8BAAsB,uBAAuB;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAGrB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,yBAAyB,EAAE,wCAAwC,EAAE,CACzE;IACL,QAAQ,CAAC,mCAAmC,EAAE,kDAAkD,EAAE,CAC7F;IAGL,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;gBAGlC,UAAU,EAAE,kCAAkC,EAC9C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,MAAM;CAoClB"}
@@ -14,13 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { guaranteeNonEmptyString, guaranteeNonNullable, } from '@finos/legend-shared';
17
- import { collectKeyedDocumnetationEntriesFromConfig, } from './LegendApplicationDocumentationRegistry';
17
+ import { collectKeyedDocumnetationEntriesFromConfig, collectKeyedContextualDocumentationEntriesFromConfig, } from './LegendApplicationDocumentationService.js';
18
18
  export class LegendApplicationConfig {
19
19
  appName;
20
20
  baseUrl;
21
21
  env;
22
+ // documentation
22
23
  documentationUrl;
23
- documentationKeyedEntries = [];
24
+ keyedDocumentationEntries = [];
25
+ keyedContextualDocumentationEntries = [];
26
+ // version
24
27
  appVersion;
25
28
  appVersionBuildTime;
26
29
  appVersionCommitId;
@@ -30,7 +33,9 @@ export class LegendApplicationConfig {
30
33
  this.env = guaranteeNonEmptyString(configData.env, `Can't configure application: 'env' field is missing or empty`);
31
34
  // Documentation
32
35
  this.documentationUrl = configData.documentation?.url;
33
- this.documentationKeyedEntries = collectKeyedDocumnetationEntriesFromConfig(configData.documentation?.entries ?? {});
36
+ this.keyedDocumentationEntries = collectKeyedDocumnetationEntriesFromConfig(configData.documentation?.entries ?? {});
37
+ this.keyedContextualDocumentationEntries =
38
+ collectKeyedContextualDocumentationEntriesFromConfig(configData.documentation?.contextualEntries ?? {});
34
39
  // Version
35
40
  this.appVersion = guaranteeNonNullable(versionData.version, `Can't collect application version: 'version' field is missing`);
36
41
  this.appVersionBuildTime = guaranteeNonNullable(versionData.buildTime, `Can't collect application version: 'buildTime' field is missing`);
@@ -1 +1 @@
1
- {"version":3,"file":"LegendApplicationConfig.js","sourceRoot":"","sources":["../../src/stores/LegendApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,0CAA0C,GAC3C,MAAM,0CAA0C,CAAC;AAqBlD,MAAM,OAAgB,uBAAuB;IAClC,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,GAAG,CAAS;IAEZ,gBAAgB,CAAqB;IACrC,yBAAyB,GAChC,EAAE,CAAC;IAEI,UAAU,CAAS;IACnB,mBAAmB,CAAS;IAC5B,kBAAkB,CAAS;IAEpC,YACE,UAA8C,EAC9C,WAAyC,EACzC,OAAe;QAEf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,uBAAuB,CACpC,UAAU,CAAC,OAAO,EAClB,kEAAkE,CACnE,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAChC,UAAU,CAAC,GAAG,EACd,8DAA8D,CAC/D,CAAC;QAEF,gBAAgB;QAChB,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;QACtD,IAAI,CAAC,yBAAyB,GAAG,0CAA0C,CACzE,UAAU,CAAC,aAAa,EAAE,OAAO,IAAI,EAAE,CACxC,CAAC;QAEF,UAAU;QACV,IAAI,CAAC,UAAU,GAAG,oBAAoB,CACpC,WAAW,CAAC,OAAO,EACnB,+DAA+D,CAChE,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,oBAAoB,CAC7C,WAAW,CAAC,SAAS,EACrB,iEAAiE,CAClE,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,CAC5C,WAAW,CAAC,SAAS,EACrB,iEAAiE,CAClE,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"LegendApplicationConfig.js","sourceRoot":"","sources":["../../src/stores/LegendApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,0CAA0C,EAC1C,oDAAoD,GACrD,MAAM,4CAA4C,CAAC;AAyBpD,MAAM,OAAgB,uBAAuB;IAClC,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,GAAG,CAAS;IAErB,gBAAgB;IACP,gBAAgB,CAAqB;IACrC,yBAAyB,GAChC,EAAE,CAAC;IACI,mCAAmC,GAC1C,EAAE,CAAC;IAEL,UAAU;IACD,UAAU,CAAS;IACnB,mBAAmB,CAAS;IAC5B,kBAAkB,CAAS;IAEpC,YACE,UAA8C,EAC9C,WAAyC,EACzC,OAAe;QAEf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,uBAAuB,CACpC,UAAU,CAAC,OAAO,EAClB,kEAAkE,CACnE,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAChC,UAAU,CAAC,GAAG,EACd,8DAA8D,CAC/D,CAAC;QAEF,gBAAgB;QAChB,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;QACtD,IAAI,CAAC,yBAAyB,GAAG,0CAA0C,CACzE,UAAU,CAAC,aAAa,EAAE,OAAO,IAAI,EAAE,CACxC,CAAC;QACF,IAAI,CAAC,mCAAmC;YACtC,oDAAoD,CAClD,UAAU,CAAC,aAAa,EAAE,iBAAiB,IAAI,EAAE,CAClD,CAAC;QAEJ,UAAU;QACV,IAAI,CAAC,UAAU,GAAG,oBAAoB,CACpC,WAAW,CAAC,OAAO,EACnB,+DAA+D,CAChE,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,oBAAoB,CAC7C,WAAW,CAAC,SAAS,EACrB,iEAAiE,CAClE,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,CAC5C,WAAW,CAAC,SAAS,EACrB,iEAAiE,CAClE,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { type MarkdownText, type PlainObject, SerializationFactory } from '@finos/legend-shared';
17
+ import type { ApplicationStore } from './ApplicationStore.js';
18
+ import type { LegendApplicationConfig } from './LegendApplicationConfig.js';
19
+ export declare type LegendApplicationDocumentationEntryConfig = {
20
+ markdownText?: MarkdownText | undefined;
21
+ title?: string | undefined;
22
+ text?: string | undefined;
23
+ url?: string | undefined;
24
+ };
25
+ export declare class LegendApplicationDocumentationEntry {
26
+ readonly _documentationKey: string;
27
+ markdownText?: MarkdownText | undefined;
28
+ title?: string | undefined;
29
+ text?: string | undefined;
30
+ url?: string | undefined;
31
+ static readonly serialization: SerializationFactory<LegendApplicationDocumentationEntry>;
32
+ static create(json: PlainObject<LegendApplicationDocumentationEntry>, documentationKey: string): LegendApplicationDocumentationEntry;
33
+ }
34
+ export declare type LegendApplicationContextualDocumentationEntryConfig = LegendApplicationDocumentationEntryConfig & {
35
+ related?: string[];
36
+ };
37
+ export declare class LegendApplicationContextualDocumentationEntry {
38
+ readonly _context: string;
39
+ markdownText?: MarkdownText | undefined;
40
+ title?: string | undefined;
41
+ text?: string | undefined;
42
+ url?: string | undefined;
43
+ related: string[];
44
+ static readonly serialization: SerializationFactory<LegendApplicationContextualDocumentationEntry>;
45
+ static create(json: PlainObject<LegendApplicationContextualDocumentationEntry>, context: string): LegendApplicationContextualDocumentationEntry;
46
+ }
47
+ export interface LegendApplicationKeyedContextualDocumentationEntry {
48
+ key: string;
49
+ content: LegendApplicationContextualDocumentationEntry;
50
+ }
51
+ export declare const collectKeyedContextualDocumentationEntriesFromConfig: (rawEntries: Record<string, LegendApplicationContextualDocumentationEntryConfig>) => LegendApplicationKeyedContextualDocumentationEntry[];
52
+ export interface LegendApplicationKeyedDocumentationEntry {
53
+ key: string;
54
+ content: LegendApplicationDocumentationEntry;
55
+ }
56
+ export declare const collectKeyedDocumnetationEntriesFromConfig: (rawEntries: Record<string, LegendApplicationDocumentationEntryConfig>) => LegendApplicationKeyedDocumentationEntry[];
57
+ export declare class LegendApplicationDocumentationService {
58
+ url?: string | undefined;
59
+ private docRegistry;
60
+ private contextualDocRegistry;
61
+ constructor(applicationStore: ApplicationStore<LegendApplicationConfig>);
62
+ getDocEntry(key: string): LegendApplicationDocumentationEntry | undefined;
63
+ hasDocEntry(key: string): boolean;
64
+ getContextualDocEntry(key: string): LegendApplicationContextualDocumentationEntry | undefined;
65
+ hasContextualDocEntry(key: string): boolean;
66
+ getAllDocEntries(): LegendApplicationDocumentationEntry[];
67
+ publishDocRegistry(): Record<string, LegendApplicationDocumentationEntryConfig>;
68
+ publishContextualDocRegistry(): object;
69
+ }
70
+ //# sourceMappingURL=LegendApplicationDocumentationService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendApplicationDocumentationService.d.ts","sourceRoot":"","sources":["../../src/stores/LegendApplicationDocumentationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,oBAAoB,EAIrB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5E,oBAAY,yCAAyC,GAAG;IACtD,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,qBAAa,mCAAmC;IAC9C,QAAQ,CAAC,iBAAiB,EAAG,MAAM,CAAC;IAEpC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzB,MAAM,CAAC,QAAQ,CAAC,aAAa,4DAU3B;IAEF,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,WAAW,CAAC,mCAAmC,CAAC,EACtD,gBAAgB,EAAE,MAAM,GACvB,mCAAmC;CAOvC;AAED,oBAAY,mDAAmD,GAC7D,yCAAyC,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